Electrical – Will this circuit suffice for low battery detection for any microcontroller

batteriesbattery-chargingbattery-operatedvoltagevoltage-detector

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.

circuit

Best Answer

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.