Electronic – Circuit to tell Microcontroller when Voltage is Low

batteriescircuit-designvoltage

I would like to trip an input, similar to a button input to an microcontroller if the input voltage to the circuit/microcontroller is below a certain threshold. I have transistors and some zener diodes of different voltages but I am not sure how to connect them in order for the microcontroller to get an input when the voltage is below "x" volts.

Best Answer

If you don't care much about accuracy, you can use a circuit like the below:

schematic

simulate this circuit – Schematic created using CircuitLab

This circuit uses the Vbe of the transistor as a crude reference and thus has a threshold of around 4V. It's crude, has a mushy transfer function and will vary from unit-to-unit and with temperature.

If you replace R1 with a resistor + zener and pick the value of R2 to pass a properly selected current through the zener you'll get a more consistent threshold of about 0.7V + zener voltage, but zeners less than about 5V have very mushy knees, so it won't be as much of an improvement as you might expect. You could consider replacing the zener + resistor with a green LED + resistor, but it would require some experimentation. It's also possible to use a TL431 with a transistor and some resistors.

If you need something accurate that doesn't drift much with temperature, have a look at supply voltage supervisor chips which contain a reference and a comparator (and sometimes a timer).