Author Topic: Battery Monitor - Proper Way  (Read 10986 times)

0 Members and 2 Guests are viewing this topic.

Offline MLXXXp

  • Frequent Contributor
  • **
  • Posts: 327
  • Country: ca
Re: Battery Monitor - Proper Way
« Reply #25 on: July 23, 2015, 08:26:22 pm »
you assume the ADC isn't used for other things meanwhile though...
Unless by meanwhile you mean during the battery sample time, you can use the ADC for other things between battery readings. However, when you want to read the battery you would have to select the battery's ADC input pin and then delay at least long enough for a sufficient RC settling period, based on the resistor you chose, before starting the conversion.
Quote
I don't understand why you'd wan't to add more source resistance than necessary for protection (500 ohm), seems like it will only make life more complicated?
The current flowing through the series protection resistor will drain the battery until you disconnect it. The higher the resistor, the slower the battery will drain. This may be important in a low current battery powered situation.

If you're only reading the battery occasionally and not using the ADC for anything else, then there probably wouldn't be any additional complication. Otherwise the only complication is adding a small delay.
 

Offline apis

  • Super Contributor
  • ***
  • Posts: 1667
  • Country: se
  • Hobbyist
Re: Battery Monitor - Proper Way
« Reply #26 on: July 23, 2015, 08:53:50 pm »
The current flowing through the series protection resistor will drain the battery until you disconnect it. The higher the resistor, the slower the battery will drain. This may be important in a low current battery powered situation.
Yes, but if you also ensure the battery isn't connected when you turn it off there isn't any drain at all.

Otherwise the only complication is adding a small delay.
It also becomes more susceptible to noise.
 

Offline MLXXXp

  • Frequent Contributor
  • **
  • Posts: 327
  • Country: ca
Re: Battery Monitor - Proper Way
« Reply #27 on: July 23, 2015, 09:03:49 pm »
An alternative would be to use the internal comparator, might be simpler if you just want an alarm. Then you need a voltage divider and set it so that battery min voltage == internal v ref voltage.
Assuming an ATmega328P, with this method you would have to be able to individually trim the voltage divider for each unit and re-trim it if the processor chip is changed. This is because, according to the datasheet, the internal reference can vary between 1.0V and 1.2V (about +/-9%) from chip to chip. This reference tolerance isn't good enough to allow accurately detecting a low battery condition, using a voltage divider with a single fixed ratio.
« Last Edit: July 23, 2015, 09:20:56 pm by MLXXXp »
 

Offline MLXXXp

  • Frequent Contributor
  • **
  • Posts: 327
  • Country: ca
Re: Battery Monitor - Proper Way
« Reply #28 on: July 23, 2015, 09:10:58 pm »
Yes, but if you also ensure the battery isn't connected when you turn it off there isn't any drain at all.
If you can ensure that the battery isn't connected when you turn it off, then you don't need a protection resistor at all.
Quote
It also becomes more susceptible to noise.
Since the battery voltage changes very slowly, you can add a capacitor between the input pin and ground to dampen any noise.
 

Offline apis

  • Super Contributor
  • ***
  • Posts: 1667
  • Country: se
  • Hobbyist
Re: Battery Monitor - Proper Way
« Reply #29 on: July 23, 2015, 09:39:55 pm »
An alternative would be to use the internal comparator, might be simpler if you just want an alarm. Then you need a voltage divider and set it so that battery min voltage == internal v ref voltage.
Assuming an ATmega328P, with this method you would have to be able to individually trim the voltage divider for each unit and re-trim it if the processor chip is changed. This is because, according to the datasheet, the internal reference can vary between 1.0V and 1.2V (about +/-9%) from chip to chip. This reference tolerance isn't good enough to allow accurately detecting a low battery condition, using a voltage divider with a single fixed ratio.
Then it's not good enough to measure the voltage with the ADC either... which means OP will either have to trim it for each unit or add an external reference in either case.

Yes, but if you also ensure the battery isn't connected when you turn it off there isn't any drain at all.
If you can ensure that the battery isn't connected when you turn it off, then you don't need a protection resistor at all.
precisely :)
 

Offline MLXXXp

  • Frequent Contributor
  • **
  • Posts: 327
  • Country: ca
Re: Battery Monitor - Proper Way
« Reply #30 on: July 23, 2015, 09:49:58 pm »
Then it's not good enough to measure the voltage with the ADC either... which means OP will either have to trim it for each unit or add an external reference in either case.
The comparator only gives you a go/no-go indication. Being able to read any value of battery voltage via the ADC gives you the option of calibrating, to compensate for reference variation, in software using values saved in EEPROM, instead of requiring a hardware trim. (But hardware trim would still be possible as well.)

Depending on the design, it's also possible that Vcc would have the required tolerance, which could be used as the reference.
« Last Edit: July 23, 2015, 09:55:29 pm by MLXXXp »
 

Offline apis

  • Super Contributor
  • ***
  • Posts: 1667
  • Country: se
  • Hobbyist
Re: Battery Monitor - Proper Way
« Reply #31 on: July 23, 2015, 10:59:09 pm »
Looks like the regulator the latest arduino (uno rev. 3) is using is trimmed to ±1.0% accuracy at least, so yes would be better to rely on that if you cant trim/calibrate it.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf