I wanted to know if it is possible to monitor a battery that is driving the Arduino and check its voltage. When the voltage drops below a certain level (i.E below 3.0V) it should shutdown and disconnect itself from the battery by using a relay or something. When the battery is full enough again it should power up again. Is that possible without any external sensors just by using the Arduino's inputs?

  • After it has "disconnected itself from the battery", how would it know that the battery is full enough again? Commented Jul 9, 2015 at 18:18
  • I don't really know, that's why I'm asking here. Maybe use a programmable attiny45 which controls the voltage and the relay? If that is not possible just shutting down is enough for me
    – qwertz
    Commented Jul 9, 2015 at 18:24

3 Answers 3


It is not entirely beyond possible, in fact quite possible in theory.

I think the saying 'in theory, theory and reality are the same, but in reality they are not' is appropriate here.

So to monitor voltage, a simple voltage divider circuit can be used, and the Arduino can monitor that, and release a relay controlling the power line. The same relay could be wired to also reconnect when voltage reaches a threshold. I think the circuit actually requires 2 (or more) relays, and technically is it a kind of sensor, but since you indicated a relay was ok, it could work. So given those requirements, do you really need someone to draw it out, or were you just curious?

enter image description here

Simple battery monitoring from http://arduinotronics.blogspot.com/2012/04/voltage-monitor.html

  • I think I understood how the voltage detection works on the arduino. Yeah I would kinda need someone to show me how to do it as I'm really not advanced in this territory.
    – qwertz
    Commented Jul 9, 2015 at 20:27
  • google.com/search?q=latching+relay&tbm=isch
    – user6569
    Commented Jul 9, 2015 at 20:30
  • That looks quite complicated, but I'll try to figure it out :)
    – qwertz
    Commented Jul 9, 2015 at 20:33
  • I think that was my point, good luck :)
    – user6569
    Commented Jul 9, 2015 at 20:36

Have a look here http://wp.josh.com/2014/11/06/battery-fuel-guage-with-zero-parts-and-zero-pins-on-avr/ It is for bare metal Atmel chip, but applicable to Arduino as well probably. Step one in getting longer battery life is to move to a bare metal Atmel chip, choose ATMEGA or ATTINY depending on how many pins you need. Also see my answer here What are (or how do I use) the power saving options of the Arduino to extend battery life?

  • You also probably do not need a relay to disconnect the chip. Assuming you have the chip connected directly to the power supply with no regulator (which you do if you are running off battery), then you can just have your software put the chip into sleep mode which uses a negligible amount of power (micro amps). You can even set things up so that the chip will wake itself when the battery is reconnected to a charger. He is an example circuit and software using an ATTINY that does just that... github.com/bigjosh/Vibe-V2
    – bigjosh
    Commented Jul 12, 2015 at 15:36

I'm assuming Arduino is powered directly by the battery, and not via a voltage regulator. In that case you van measure VCC by first measuring the internal 1.1v voltage reference (in relation to Vcc). Since the internal 1.1v is constant and VCC will lower over time, the reading (0-1023) will increase.

See this article: http://jeelabs.org/2012/05/04/measuring-vcc-via-the-bandgap/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.