I'm planning to use 9V or so battery for my arduino uno and per the documentation the arduino shouldn't be powered with less than 7Vs. But as the battery discharges, its voltage will inevitably drop bellow 7V.
What is best to do in this case? I'm planning to use external electronics to make it so once that happens to turn off the power whatsoever and shut down the arduino. Is this a good aproach?
Yes, and you can also use a voltage divider and let the Arduino measure its own battery
+9V --- [100K]---AR---[100K]---GND
analogRead() at AR, should read about 4.5Volts ~ 900
your strategy could be like this:
900 => 4.5 V => battery 9.0 V => code green
800 => 4.0 V => battery 8.0 V => code yellow
750 => 3.75V => battery 7.5 V => code orange
700 => 3.5 V => battery 7.0 V => code red1, disable all non critical sensors
650 => 3.25V => battery 6.5 V => code red2, disable all sensors
600 => 3.0 V => battery 6.0 V => code red3, shut down.
robtillaart:
Yes, and you can also use a voltage divider and let the Arduino measure its own battery+9V --- [100K]---AR---[100K]---GND
analogRead() at AR, should read about 4.5Volts ~ 900
your strategy could be like this:
900 => 4.5 V => battery 9.0 V => code green
800 => 4.0 V => battery 8.0 V => code yellow
750 => 3.75V => battery 7.5 V => code orange
700 => 3.5 V => battery 7.0 V => code red1, disable all non critical sensors
650 => 3.25V => battery 6.5 V => code red2, disable all sensors
600 => 3.0 V => battery 6.0 V => code red3, shut down.
Thank you. There's one thing I don't understand - you say to shut it down at 6.0 V, but a quick search shows that that is impossible to do softwarely and rather it's possible only manually. From this I infer it's not fatal if it runs for a few seconds at 6.0V or even lower. Is this indeed the case?
Either way, I think I'll just shut it down earlier.
Edit: nvm, I figured out what you mean. I'll have one output towards a transistor immediately after the battery. I think that should work.
Place a push to make button over that transistor in parallel as well so you can still turn the arduino on in the first instance.
If you are thinking of using the small PP3 type of 9v battery you should probably think again. They can't provide enough current for more than a very short time. A pack of 6xAA cells would be a practical alternative.
...R