measuring uC supply voltage

J

Jamie Morken

Guest
Hi all,

I am trying to figure out the best way to measure the 5V supply voltage
for an AVR microcontroller. The uC has a 10bit ADC built in, and I am
using the 5V supply as the ADC reference voltage. The problem I am
seeing is when the 5V supply droops, the reference voltage will also
droop. For other sensors I need to use the 5V reference voltage. Any
ideas on how to solve this?

cheers,
Jamie Morken
 
On Sat, 23 Oct 2004 01:59:09 GMT, the renowned Jamie Morken
<jmorken@shaw.ca> wrote:

Hi all,

I am trying to figure out the best way to measure the 5V supply voltage
for an AVR microcontroller. The uC has a 10bit ADC built in, and I am
using the 5V supply as the ADC reference voltage. The problem I am
seeing is when the 5V supply droops, the reference voltage will also
droop. For other sensors I need to use the 5V reference voltage. Any
ideas on how to solve this?

cheers,
Jamie Morken
How about you measure a known (say) 2.5V reference, and calculate the
5V supply from that- if you have an N-bit ADC:

Vsupply = (2^N * Vref) / reading
 
Jamie Morken wrote:
Hi all,

I am trying to figure out the best way to measure the 5V supply voltage
for an AVR microcontroller. The uC has a 10bit ADC built in, and I am
using the 5V supply as the ADC reference voltage. The problem I am
seeing is when the 5V supply droops, the reference voltage will also
droop. For other sensors I need to use the 5V reference voltage. Any
ideas on how to solve this?

cheers,
Jamie Morken
Many AVR chips have an inbuilt analog reference voltage generator. Use
this for the reference, if available.

Alternately separate the load causing the droop from the analog
reference supply.


--
Regards,

Adrian Jansen adrianjansen at internode dot on dot net
Design Engineer J & K Micro Systems
Microcomputer solutions for industrial control
Note reply address is invalid, convert address above to machine form.
 
Adrian Jansen wrote:
Jamie Morken wrote:

Hi all,

I am trying to figure out the best way to measure the 5V supply
voltage for an AVR microcontroller. The uC has a 10bit ADC built in,
and I am using the 5V supply as the ADC reference voltage. The
problem I am seeing is when the 5V supply droops, the reference
voltage will also droop. For other sensors I need to use the 5V
reference voltage. Any ideas on how to solve this?

cheers,
Jamie Morken


Many AVR chips have an inbuilt analog reference voltage generator. Use
this for the reference, if available.
Is it possible to use this internal reference while the external
reference is at 5V?

cheers,
Jamie


Alternately separate the load causing the droop from the analog
reference supply.
 
Spehro Pefhany wrote:
On Sat, 23 Oct 2004 01:59:09 GMT, the renowned Jamie Morken
jmorken@shaw.ca> wrote:


Hi all,

I am trying to figure out the best way to measure the 5V supply voltage
for an AVR microcontroller. The uC has a 10bit ADC built in, and I am
using the 5V supply as the ADC reference voltage. The problem I am
seeing is when the 5V supply droops, the reference voltage will also
droop. For other sensors I need to use the 5V reference voltage. Any
ideas on how to solve this?

cheers,
Jamie Morken


How about you measure a known (say) 2.5V reference, and calculate the
5V supply from that- if you have an N-bit ADC:

Vsupply = (2^N * Vref) / reading
Only problem is that all 8 analog inputs are tied up already! :) I
think the internal 2.5V reference may work if I switch to that while
checking the divided down 5V supply.

cheers,
Jamie



 
On Sat, 23 Oct 2004 04:20:00 GMT, the renowned Jamie Morken
<jmorken@shaw.ca> wrote:

Spehro Pefhany wrote:
On Sat, 23 Oct 2004 01:59:09 GMT, the renowned Jamie Morken
jmorken@shaw.ca> wrote:


Hi all,

I am trying to figure out the best way to measure the 5V supply voltage
for an AVR microcontroller. The uC has a 10bit ADC built in, and I am
using the 5V supply as the ADC reference voltage. The problem I am
seeing is when the 5V supply droops, the reference voltage will also
droop. For other sensors I need to use the 5V reference voltage. Any
ideas on how to solve this?

cheers,
Jamie Morken


How about you measure a known (say) 2.5V reference, and calculate the
5V supply from that- if you have an N-bit ADC:

Vsupply = (2^N * Vref) / reading

Only problem is that all 8 analog inputs are tied up already! :) I
think the internal 2.5V reference may work if I switch to that while
checking the divided down 5V supply.

cheers,
Jamie
I don't see how that saves any inputs compared to my suggestion, but
if you can use the internal reference, all the better, and more
palatable calculations.
 
On Sat, 23 Oct 2004 01:59:09 GMT, Jamie Morken <jmorken@shaw.ca>
wrote:

Hi all,

I am trying to figure out the best way to measure the 5V supply voltage
for an AVR microcontroller. The uC has a 10bit ADC built in, and I am
using the 5V supply as the ADC reference voltage. The problem I am
seeing is when the 5V supply droops, the reference voltage will also
droop. For other sensors I need to use the 5V reference voltage. Any
ideas on how to solve this?
---
If the ADC is ratiometric, then you have a non-problem in that if the
input of the ADC is connected to the supply the output of the ADC will
always be 03ffH whatever the supply voltage is if the supply voltage
is also the reference.

This also applies to your sensors if they're powered by the same
supply as the ADC. For example, if the supply voltage to the ADC and
the sensors is 5.000V and you have a sensor out there with an output
of 5.000V connected to the input of the ADC, the ADC's output will be
full-scale at 03ffH, and if the sensor's output falls to 2.500V the
ADC's outout will go to half-scale; 01ffH.

Now, if your supply voltage (which is also the sensors' excitation
voltage and your reference voltage) should go to 4.000V, and if your
sensor's output is at 100%, its output will go to 4.000V. That will
drive the ADC's output to full scale; 03ffH. Then, if the sensor's
output goes to 2.000V (50%) the ADC's output will go to 01ffH; half
scale.

If your ADC isn't ratiometric and/or you're using different supplies
for the ADC and the sensors, then you'll need to supply the ADC with a
reference voltage low enough that any perturbations of its supply
voltage will leave its output unaffected, and you'll need to keep
track of the supply/reference voltage for the sensors as well as their
outputs in order to calculate out variations in their outputs caused
by supply/reference variations.

--
John Fields
 

Welcome to EDABoard.com

Sponsor

Back
Top