Microntroller or dedicated chip for low battery indicator?

Go To Last Post
17 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear Freaks,

I have been a lurker here for several months (6) and can't thank you all enough for what you (and Smiley's book) have taught me about electronics and microcontrollers. Going from having no idea what exactly a microcontroller (or transistor for that matter) does, to actually being able to put a few circuits run by an avr controller has been great.

I was wondering if anyone could answer this general question? If you made a microcontroller device powered by a 9 volt battery, is it 'better' to have a low battery indicator with a dedicated chip (say ltc1440), or use an available microcontroller input to read a divided voltage and signal on another pin that the battery is low?

Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You have to get rid of that generic "what is better" notation in engineering. Engineering is a string of compromises, guided by requirements (including budget) and available technology.

So, for your particular application, can you afford the extra components? Does it allow you to fulfill a requirement you couldn't fulfill otherwise with a (cheaper, simpler, more flexible, etc.) solution?

Stealing Proteus doesn't make you an engineer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There have been a few threads on here on how to use an ADC input for low-battery detection, especially what to do if the AVR is always on.

Resistive dividers always consume power, it's better only to switch this divider on when actually measuring the battery voltage.

A search will likely turn up a few interesting threads.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Power consumption will probably be a BIG issue in any scheme to monitor 9V battery levels. I am actually not very sure HOW I would do it (other than the fact that I probably would NOT use a 9V battery).

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you all for the replies. Arnold, your point is well taken. My desire is not a commercial device, so I am not thinking about savings over thousands of units. Just a couple.

JayJay, interesting about a divider that should be switched on and off. I hadn't thought of that or seen it yet. That makes good sense to me. You don't really need to measure the battery voltage continuously, only one in a while. Maybe at every start-up. Brilliant!

Mr. Wagner, it seems the switched resistive divider would help alleviate some power consumption issues. Can you possibly elaborate on why a 9 volt supply is not a good choice? I have been lining up AAA and AA batteries 4 at a time and it just seemed like a 9 volt would have a better footprint - i.e. take up less space. You need 4 smaller voltage batteries to get enough voltage for most chips, no? Energy would certainly be wasted by the voltage regulator in the 9 volt scenario, when bringing the voltage down to a more friendly AVR level.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A 9V battery has a very low energy content. Understand, first, that the ratings I am about to quote will depend on how far you can discharge the battery.

9V battery, with a steady load current of 10ma and a low votage limit of 6V will give about 60 hours of operation. Figuring an AVERAGE voltage of 7.5V, that is 600mA hours at 7.5V or 4.5W-Hr.

4 AAA batteries connected in series will deliver about 120 hours at 10ma with a cutoff voltage of 1.2V per cell (4.8V total). That is 1200mA hours with an average voltage of 4*1.35V = 5.4V for 6.5W-Hr.

So, those 4 AAA cells hold about 50% more energy than the 9V battery.

But, maybe even more telling, is how you actually use the battery. If your circuit requires 5V and you use a linear regulator, you only use 5V/7.5V = 67% of the energy usefully; the other 33% goes up in heat. If you use a switch-mode supply, you might improve that to 8-10% loss.

With a 6V battery and an LDO (type of linear regulator), you will effectively use 5V/5.5V = 90% of the energy. You might gain a little with a switch-mode supply.

If you use other supply voltages, such as 3.3V, the numbers get worse for both (and 9V gets much worse) with a linear regulator.

IF you can use the battery voltage without regulation, you get even better life. But, few circuits will operate directly on 9V.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When I wrote "afford" I not only mean "afford extra cost", but also the PCB space for the components, the risk of the additional components failing, etc.

Or the other way around, is the result worth the extra effort?

Regarding the selection of an LDO:

If you only need to limit the maximum operating voltage to, let's say 5V, but can tolerate that the circuit runs on lower voltage, then look for LDOs that

- drop out of regulation when Vin gets to low,

- and then go into a linear mode where Vout = Vin - Vdrop, with a more or less constant low Vdrop.

- and do that without significantly increasing their quiescent current

That way you can get more millage out of the battery.

Stealing Proteus doesn't make you an engineer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Mr Wagner and Arnold. Great information on batteries and picking a voltage regulator. If only I could do the Vulcan mind meld with you guys...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When I measure battery voltage I use two series resistors with a MOSFET transistor pulling them to ground. That works well enough for my applications. The leakage trough a MOSFET is about the same as the internal leakage in a Li-Poly battery. And Li-Poly batteries has very low internal leakage compared to other common battery types.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you do put a resistive divider from 9V to GND and measure the middle pin with ADC, you are facing several problems.

One is current consumption, but if you use two 1Mohm resistors, it will use 4.5microamperes. That is 1000 times less what your AVR plus other circuitry propably consumes. Even a normal 7805 type regulator can consume 4mA even if it is not doing anything.
1Mohm resistors however provide too much source impedance for AVR ADC, so you must either use smaller resistors (not recommended) or put a 10nF-100nF capacitor there. Of course you can use larger resistor values like 2Mohms to further reduce the current to 2.25 µA (about the same as your LTC chip). Plus the LTC chip still needs divider resistors too.

If you make the resistor divider switchable, then you can use smaller resistor values, but you are facing problems which end to switch. Some people switch the GND side of the divider somehow, like with a transistor or IO pin, it does not matter, but it still requires an IO pin. But what matters is that when the divider is turned off, you are feeding current from 9V via measurement resistor to AVR ADC IO pin, which is clipped by a internal protection diode to supply voltage. This current must be kept small (propably max 1mA) or the AVR will suffer. While this enables you to use smaller resistor values (down to 10k or so) so you don't need the capacitor, this still consumes more current even when the measurement resistor is turned off.

If you make the 9V end of the measurement divider switchable from 5V IO pin, you must add a transistor, and maybe a second one so you can actually control the first. Too much components, so the single chip monitor chip may be better and more accurate too.

If you can supply the AVR with unregulated power from 3 AA cells (4 AA cells is too much while 4 NiMH cells might be ok), there is a trick you may be able to use to measure battery voltage. Some AVRs have internal reference voltage which you can measure with ADC. While the reference voltage stays stable, the ADC result will vary according to battery voltage. I used this on a Mega8L.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

http://www.imdb.com/title/tt0104... from "My Cousin Vinnie":

Quote:

D.A. Jim Trotter: Now, uh, Ms. Vito, being an expert on general automotive knowledge, can you tell me... what would the correct ignition timing be on a 1955 Bel Air Chevrolet, with a 327 cubic-inch engine and a four-barrel carburetor?
Mona Lisa Vito: It's a bullshit question.
D.A. Jim Trotter: Does that mean that you can't answer it?
Mona Lisa Vito: It's a bullshit question, it's impossible to answer.
D.A. Jim Trotter: Impossible because you don't know the answer!
Mona Lisa Vito: Nobody could answer that question!
D.A. Jim Trotter: Your Honor, I move to disqualify Ms. Vito as a "expert witness"!
Judge Chamberlain Haller: Can you answer the question?
Mona Lisa Vito: No, it is a trick question!
Judge Chamberlain Haller: Why is it a trick question?
Vinny Gambini: [to Bill] Watch this.
Mona Lisa Vito: 'Cause Chevy didn't make a 327 in '55, the 327 didn't come out till '62. And it wasn't offered in the Bel Air with a four-barrel carb till '64. However, in 1964, the correct ignition timing would be four degrees before top-dead-center.
D.A. Jim Trotter: Well... um... she's acceptable, Your Honor.

If one is apparently concerned with battery life:

-- Why use 9V with lower power density than other packages?
-- Why would one use a regulator and suffer the inefficiencies?

Yeah, yeah, maybe the raw 9V is used for some other device, or it is already made and there is no choice.

It is always a LOL about "low battery indication". What do you do when you detect it? Turn on and LED, and or beep--thus drawing much more power than your sleep current! (e.g., smoke detectors)

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
If you can supply the AVR with unregulated power from 3 AA cells (4 AA cells is too much while 4 NiMH cells might be ok), there is a trick you may be able to use to measure battery voltage. Some AVRs have internal reference voltage which you can measure with ADC. While the reference voltage stays stable, the ADC result will vary according to battery voltage. I used this on a Mega8L.

Doesn't the AVR give the reference voltage a 1024, no matter what it is? That would mean there is a reference voltage to look at the reference voltage. Brain cramp time.

Quote:
It is always a LOL about "low battery indication". What do you do when you detect it? Turn on and LED, and or beep--thus drawing much more power than your sleep current! (e.g., smoke detectors)

If you are concerned that low voltage will give spurious readings, then you are just telling yourself, change the battery, the data might start to get funny. The warning should come come at some point before the power is too low to give a warning.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Doesn't the AVR give the reference voltage a 1024, no matter what it is? That would mean there is a reference voltage to look at the reference voltage. Brain cramp time.


Well, 1023. But here is the idea. You haven't specified your AVR model, so let's assume a Mega88.

For this measurement: You set the reference voltage via ADMUX to be AVcc. With the unregulated power as mentioned, it might be between 3V and 4.5V. Let's say it is 4.4V with new batteries. [Side note: Do the low-battery measurement with typical load. If you do it with minimum load then even a weak battery's voltage may rise to near fresh level.] Then you do a few conversions on the internal 1.1V bandgap "channel". You get say 255 A/D counts.

Now the batteries are near critical, and your AVcc is 3.3V. When you do the conversions, you get 340 A/D counts.

You do the algebra. ;)

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rfb2000 wrote:

Doesn't the AVR give the reference voltage a 1024, no matter what it is? That would mean there is a reference voltage to look at the reference voltage. Brain cramp time.

Uh, yes.

Use AVCC as ADC reference voltage. Then measure internal bandgap voltage which is always something around 1.2V or 2.5V. You get the result of known bandgap voltage measured with reference to unknown VCC. Calculate VCC.

But as I said, this is not possible on all AVRs. What AVR you were planning to use?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

An AVR can run from 2 alkaline cells in series, or one lithium cell. Of course you may have other requirements for a higher voltage.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks gentlemen for the excellent advice and information. I managed to put together a working circuit using an atmega168, and no need for an extra chip.

By the way, the reason I wanted to use 9 volts was the footprint fits in the case I want to use. It seems I needed 3 or 4 double or triple A and they take up quite a bit of space.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For future reference, in case you want to monitor without the MCU and need a really low current setup.

Alkalines discharge at a few percent per year, say 2%, with a capacity of 450mAh for a 9V cell. So that's about 9mAh/year or 1.0uA current. Battery brand can tweak this around but I've used that based on measured data before.

The lowest current supply supervisor I've seen is 220nA, the TPS3838. It essentially uses a sampled measurement technique itself. Depending on the battery you might use a low battery voltage of around 6.5V. The highest Vit for that family is for a 3.3V supply so you'd have to divide down the supply, which adds current for the resistor divider and can cause the threshold to shift due to input current into the sense pin. The divider would have to be something like 12 MOhms to keep the overall current to the same level as the battery self discharge rate. There would be some accuracy degradation with that but maybe it would work. You'd have to check the tolerance stack-up.

It works better with really leaky battery types like Li+ since you don't care about current nearly as much.