Hi
I've got a project which ultimately will sit in a box connected a WiFi network, but not near a power outlet, pushing temperature and other sensor data to a website for graphing. To avoid gaps in the data logging I was hoping to be able to have it alert me by an email (sent either from a mail server on the same LAN, or via a PHP on a web server) when it detects the battery is failing so I can swap it out.
The web, email and sensors side of this I've found enough info on to start but google-fu has failed me on the battery monitoring...but is there a reliable way to have an Arduino self-diagnose the power being supplied to it?
Thanks in advance, Geoff
1 Like
There is always a way. However if you could be more specific with how you are going to power the arduino it would be helpful. What type battery chemistry and what nominal battery voltage are you planning on using and how will it be wired to the arduino board?
Hi retrolefty and thanks for your reply
At this stage I have kept that vague because it's so early in the project I can make it whatever it needs be to work best. The project will include bluetooth and WiFi but which shields or xbees provide that functionality is still to be determined.
Still vague I know, but does that help? If there's a type of battery that responds in a way that's more predictable to measure I'm happy to take the advice on board and make that the chemistry/voltage of choice.
Thanks, Geoff
Well then to keep it pretty generic, lets assume you are going to use a small lead acid gel cell 12vdc battery wired to the arduino external DC power connector. The standard way to measure the battery voltage is to wire the battery positive voltage termianl to a two series wired resistor voltage divider, say +12v to 10k ohm resistor to 5k ohm resistor then to battery ground. You could also use the Vin pin as the battery positive sample voltage point. The voltage at the junction of the two resistors will always be 1/3 of the batteries terminal voltage and this is safe (within the 0 to +5vdc voltage limits for a analog input pin) to wire directly to an arduino analog input pin. Then in your sketch you can just read the value at some convenient time period and test if it's above or below your action threshold value to do something to warn the system when the battery voltage is low.
That make sense?
1 Like
That make sense?
Thanks so much! Not only does it make sense, it's actually simpler than I'd anticipated.
Cheers !
Geoff