Read low battery voltage?

Hi all

does any one know how do read and send me an alert for low battery voltage. say when it hits 9V or something (12v battery)

Im using a remote device with a sim 900 shield. it runs on a 12v battery and a solar panel that charges it.

at the moment if the battery goes flat then the arduino uno restarts when it later gets charge I will know about it because it sends me a SMS (power on) as part of the set up sketch.

But i want to know at the time when my device it about to go dead!

Does anyone know how to implement this?

does any one know how do read and send me an alert for low battery voltage. say when it hits 9V or something (12v battery)

Yes. It’s very simple. What part(s) are you having problems with?

all of it! lol

stuwilson:
all of it! lol

Perhaps you could at least make a list of the steps you feel are necessary.

My list would start with reading the analog pin that the battery is connected to.
Next, I'd compare that reading with the value that corresponds (for whatever definition of corresponds that you come up with) to "low voltage".

If the reading does mean low voltage, I'd call the SendSMS() function.

Of course, that means actually writing a SendSMS() function, but if you are already sending SMSs, then you probably have one that is close.

Use two resistors as a voltage divider to get your 12V below the 5V maximum and then use an analog input. Pick a threshold and send an alert when voltage goes below the threshold. Threshold should be a bit above the voltage at which the hardware fails.

NOTE: If the power input goes below about 7.5V then the "5V" rail will droop and your voltage readings will be off. I would just set the threshold to about 8V to avoid that problem.

Are you using a lead-acid battery? They have very little capacity left when they get down to 11V so that would be a good alarm point.

I would use a voltage divider like this and set analog reference to INTERNAL (1.1V):
vDiv.png

Great thanks everyone.

Yes its a lead acid battery. a 7A sealed one. That circuit looks great so I just need the one input pin?

The only other thing I need to check is that my solar charge controller wouldn't conflict, its got separate charge, battery and load contacts in there. But the chances are when its going flat would be at nightime etc. when theres no charge going in anyway