I'm making a major digital circuit powered by two 3.6 volt cordless phone NiCD rechargeable batteries, and one thing I want to include is a low battery detector. To protect the rest of the circuit from overheating, I use a typical 7805 voltage regulator circuit to give all my circuit 5 volts.

What I want to do is detect if the source battery is too weak to power the rest of the circuit and allow a microcontroller to detect it via a GPIO pin's logic state.

Because digital circuits ideally run on 5VDC, I figured using a zener diode rated at 5.1V with a 10K resistor for R1 would be sufficient to detect the low voltage itself but I'm not sure if it would explode the GPIO pin even though its pulled up by 5V through R2 which I may also make as 10K.

Questions are:

Would this circuit have potential to work or would connecting fresh batteries equaling the same voltage explode a GPIO pin?

Also, is 10K an ok value for the resistors or should I choose something different?

The microcontroller in question is at89C2051.


  • 1
    \$\begingroup\$ What's the purpose? Are you planning to shut down most of the circuit when the battery appears "low?" Or do you want to save some data and shut down? How will you use this? Also, what exactly do you want to be considered "good" and "bad" regarding the stacked NiCd batteries? Peter's point about the LM7805 is pretty important, too. Have you considered an LDO? \$\endgroup\$
    – jonk
    Dec 1 '16 at 1:28
  • \$\begingroup\$ When the battery is low, I want the microcontroller to detect it using a GPIO pin and then display a message on an LCD indicating the battery is low. And what I want considered Bad is when the total voltage from the batteries is too low to power anything in my circuit (under roughly 5 volts). I haven't heard of LDO but I might consider a heat sink even though the battery voltage is less than 9. \$\endgroup\$
    – user116345
    Dec 1 '16 at 1:39
  • 1
    \$\begingroup\$ An LDO is a "Low drop-out" voltage regulator. An LDO will regulate with the input voltage as little as 0.5 volt or so (they vary) above the output. The need for a heatsink depends on the power dissipated in the regulator with the maximum expected input voltage. \$\endgroup\$ Dec 1 '16 at 4:15

This circuit won't work - the transistor will be saturated, and the GPIO pin held low, until the battery voltage drops to ~ 0.7 volts.

Also, your thought of using an LM7805 to regulate your 7.2 volt battery down to 5 volts will only work with fully-charged batteries, as the 7805 need a minimum of 2 volts across it to maintain regulation.

  • \$\begingroup\$ If I made slight modifications to my circuit such as maybe adding a pull-down component or swapping components, would I get it to work? and I did manage to make a 7805CT regulator output 5V from a 6VDC wall adapter. I have to admit such circuit is not easy to find on the internet because their voltage detectors use the same voltage for input and output. \$\endgroup\$
    – user116345
    Dec 1 '16 at 1:16
  • \$\begingroup\$ It might work with a 5 volt Zener in series, between R1 and the transistor base, and a pull-down resistor of 10K or so between base and ground - then the transistor would turn off when the battery voltage drops below ~ 5.7 volts. \$\endgroup\$ Dec 1 '16 at 4:19
  • \$\begingroup\$ So I take it a zener still in reverse (cathode to R1 and anode to base)? \$\endgroup\$
    – user116345
    Dec 1 '16 at 4:45
  • \$\begingroup\$ So your series idea does work. I used 6VDC for main supply, and I put a voltmeter and resistor in series for output to test, and when I stuck a 9V battery between zener anode and ground, the voltmeter measured 5.90V. If I instead connected the zener anode to vcc then I get a reading of 5.96V. It makes me think that the transistor is sucking up power sometimes? I don't know. \$\endgroup\$
    – user116345
    Dec 1 '16 at 5:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy