# Arduino Battery Over-Discharge Protection (O-DP)

I am getting an Arduino Uno soon, and am planning to run off a 8-cell NiMH battery pack (through the power jack). Assuming a .9V cut-off per cell, that'll mean a 7.2 cut-off voltage. How would I wire it to detect the <7.2V voltage and turn off?

Would this Schematic work?

#pseudo-code
if A0 < 3.65v then BUZZ
#buzz makes a square wave w/ PWM to PWM0


• I think you'll need additional circuitry (besides the Arduino Uno) to be able to turn it off. By itself the Uno cannot control its power supply. – Ricardo Jun 30 '14 at 1:04
• "(through the power jack)" This is not what you want. – Ignacio Vazquez-Abrams Jun 30 '14 at 1:04
• You can sense the input voltage with the ATmega ADC (using a resistor voltage divider to bring the voltage into ATmega's ADC 0-5V range) and give the user feedback to turn the thing off (sound a buzzer, show some alarm on an LCD). But that's not as cool... – Ricardo Jun 30 '14 at 1:11
• @Ricardo I was meaning to have it auto-power-down – user46377 Jun 30 '14 at 1:12
• Turning on the buzzer only adds MORE load to the battery, which isn't what you want to do when it's already at minimum voltage. If human intervention fails to appear, you make destroying the battery by overdischarge happen sooner. As Russell suggests, such a warning should be set for a higher voltage. Then at "empty" you want the load to be removed completely from the battery and not get enabled again until the battery has been at least somewhat charged. – Matt B. Jun 30 '14 at 4:20

Your solution will work in principle.

The following will work for any generic uC (microcontroller).
You could automate it by providing a high side switch (MOSFET or bipolar) that was turned on with a momentary action push button, held on by the uC, and turned off by the uC when desired. There is then no prospect of hunting or hysteresis as the battery voltage rises when deloaded as when it's off it stays off until the user turns it on.

Size R2 to suit output current.
MOSFETS can be used for Q1 or Q2 with minor changes.
Switch Go! has to be held low until the uC takes over hold-on control.
Adding a capacitor across SW1 will allow circuit to remain on for a small period until the Arduino takes over.

simulate this circuit – Schematic created using CircuitLab

For extra points have a warning buzzer at a slightly higher voltage so you get a chance to take action before auto shutoff (hat tip to 46464).

The divider resistors should be as high as the ADC spec allows to minimise wasted current (only about 0.5 mA here but it all helps).

0.9V is well down the NimH discharge curve - especially if current is <= C/5, as is usually the case in this sort of application. I'd use closer to 1.0V/cell. Higher cutoff voltages will give substantially better cell cycle life with only a small decrease in available battery capacity.

• How to prevent brownout if V_battery is lower than minimum required Vout and I hold Go! button pressed? – Martin Ždila Feb 25 '15 at 15:02
• @Martin I do similar to the above in a commercial product but use a TLV431 shunt regulator as the turn on detector. If Vbat is too low then pressing GO! fails to trigger the TLV431. The same IC is also used to latch the circuit on and to cause it to auto turn off when Vbattery is too low. [TLV431 is about 2 cents in China which helps the design decision :-). ][TLV431 is a 1.25 V version of the usual 2.5V TL431 - they have far lower minimum regulation current] – Russell McMahon Feb 25 '15 at 15:52