Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Using the ADC to measure the battery supply?

2007-06-20 by Ralph Hilton

On Mon, 18 Jun 2007 23:00:54 -0600 you wrote:

We are talking about a battery voltage indicator needing 3 bits resolution max.

Lets get a bit more real here.

Keep it simple.

The original requirement was:

"I'm using the ATmega48V in a project and I need to monitor the battery
level (2 AAA cells) every so often and when low give an indication to
the user that it's time to change them."

Some of the points mentioned are possibly relevant for much higher resolution
and accuracy but the requirement is a simple indicator to tell the user to
change the battery !!!

>If the cap is across it then the ADC might not get the correct voltage 
>either.  The ADC relies upon charging a cap inside the module.  That 
>relies upon a certain target RC charge rate, that charge rate also must 
>not exceed the current capacity of the pin.  You are playing a finicky 
>game by using a cap to boost the inrush current to offset the RC time 
>constant.  It might work under some circumstances but since the ADC 
>modules specifically states that you should only be using slowly 
>changing signals on the circuit with low-pass filters that would tend to 
>contra indicate using a bypass cap I think.  Have you used such a 
>circuit successfully before?
>
>curious,
>DLC
>
>
>
>Ralph Hilton wrote:
>> On Mon, 18 Jun 2007 15:44:07 -0600 (MDT) you wrote:
>> 
>> 
>>>Most microcontroller's ADC will not like a 10M load, the charge time will
>>>be very high and not very accurate.  I have used a low power OpAmp to run
>>>very high Z dividers into and the output of the OpAmp is nicely low Z for
>>>that ADC to be happy with.  Its a few more pins and passive parts than the
>>>FET but the readings tend to be more repeatable.
>>>
>>>DLC
>> 
>> 
>> It isn't 10M if a cap is across it! 
>> 
>> 
>>>>On Mon, 18 Jun 2007 13:02:17 -0400 you wrote:
>>>>
>>>>
>>>>>I think you need to disconnect the voltage divider using an fet. The
>>>>>voltage divider will draw more juice than the avr in sleep mode! I assume
>>>>>you read the datasheet about the half dozen or so best ways to cut down
>>>>>on power consumption? (turn off a/d, turn off pullups, which sleep mode
>>>>>to use, etc)
>>>>>
>>>>
>>>>Forget the FET. 10M resistors are cheaper if the consumption is that
>>>>critical.
>>>>The only buffer needed is a 0.1uF cap.
>>>>

--
Ralph Hilton
http://www.ralphhilton.org
C-Meter: http://www.cmeter.org
FZAOINT http://www.fzaoint.net

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.