Sensing Battery Voltage and auto-shutdown?

I'm using a Lithium Polymer battery from an RC aircraft to power my Arduino project. This is a "dumb" battery - it has no internal protection circuit. To avoid over-drawing and damaging the battery, I need a way to shut down the Arduino when the voltage drops below a certain threshold.

Reading the battery voltage can be done on one of the analog input pins, with a resistor to drop the 11.1 volts down below the max 5V input (calibration will be needed to correlate sensed voltage in with actual voltage).

My biggest question is, can the Arduino power itself off in software, or will I need to rig up a relay that mechanically disconnects the battery?

crispy:
I'm using a Lithium Polymer battery from an RC aircraft to power my Arduino project. This is a "dumb" battery - it has no internal protection circuit. To avoid over-drawing and damaging the battery, I need a way to shut down the Arduino when the voltage drops below a certain threshold.

Reading the battery voltage can be done on one of the analog input pins, with a resistor to drop the 11.1 volts down below the max 5V input (calibration will be needed to correlate sensed voltage in with actual voltage).

My biggest question is, can the Arduino power itself off in software, or will I need to rig up a relay that mechanically disconnects the battery?

Well an arduino board cannot actually cut all power off, the AVR chip does have several power-saving modes. However the Arduino IDE does not provide any library files to utilize those power saving modes directly but there should be much examples posted in this forum if you search them out. Keep in mind that even if the AVR chip is put to sleep the board still consumes some current via the USB serial converter chip, +5vdc on board voltage regulator if using Vin to power the board, the power LED, and auto-voltage selector components. When I need to use a manual power on, auto software power down I use a 5vdc single coil latching relay circuit:
http://img25.imageshack.us/img25/563/08miq7.jpg

Lefty

Dear forum members,
this is my First post so I'm taking the chance to say hello.

i have a similar problem like crispy. I would like to shut down the power circuit depending on input voltage. The battery protection circuit that i have shuts down at 2.0 Volts per cell and I would like to shut the power at 2.5 V per cell (10 V total for a 4s battery). I would like to make a standalone battery power supply controlled by Arduino.

Can I use a voltage devider to sense the battery and a relay to shut down the entire circuit?

PB1 would be used to jump start the circuit until Arduino starts the program and turns on the relay so it holds the contact until the voltage drops below minimum alowabable treshold.

The same 4S LiFePo4 battery would be used to supply power to arduino nano over a 6V 3A UBEC (switching voltage regulator) and i would connect it to my further projects.

The First project where I would inplement this power supply is a RF 433 MHz controlled bulldouzer (4x24byj48 stepper motors on two A4988 drivers in parallel to lift and rotate the bucket and 4 x 6V geared motors (jellow) on L298N for wheels). It woild run on a seperate arduino Nano and the temperature sensors from the previous circuit would be mounted on the motors and battery so it shuts down if a motor gets jammed. It should all be Powered from the same circuit as possible.

So, my questions are the following:
Can i use this supply tu run two arduinos and 8 motors or is there going to be too mutch noise?
I can use seperate 9V batterys for the arduinos but this takes place in the chasis and costs more.

What size resistor should I use for the vlotage devider? should it be 1000, 10000 or 100000 ohm?
I get the relationshup between R1 and R2 to keep the voltage below 5V but I don't know how to choose R1.

The entire chasis of the bulldoazer is going to be made of metal. Should I ground the chasis?

Sorry for sloppy schematics and my bad English.

A relay is one solution - and its conceptually probably the easiest. Its a fairly regular question here,
and often people try to invent their own transistor or FET based power switch and get it wrong, because
with a transistor/FET switch the voltage is inverted (with a relay the input and output are isolated which
is simple).

How much current is the project needing in total? A small reed relay might be enough if its low, and
some of these are small enough to be driven from an Arduino pin (but don't forget the free-wheel
diode, essential for any relay driving circuit).

Thanks for the reply MarkT. Under normal load the project will use 2A at ~12 V. I have a standalone relay circuit for the Arduino that works up to 30 A. I will search for free wheel diode and implement it in the motor circuit. How about the noise from the motors? Can the Ubec filter that out? It has a ferrite ring on the output wire.