What I want to do is use a 2-transistor circuit on the left to let the microcontroller determine if the battery is supplying sufficient voltages to the LCD. Ok, the LCD isn't wired well, but the important thing to note is that everything but the transistors is powered through an LM2940 voltage regulator. Yes I deliberately forgot to include the coupling capacitors to make things simple, because my problem is on the left side and I already made the PCB but I don't know the optimal values to use for resistors and zener diodes.
The LCD is an HD44780 compatible LCD with a backlight always on but I usually feed the backlight power through a 10 ohm resistor to try to extend battery life. The transistors I thought of using were PN2222 but I could also use 2N3904 if thats better.
I did use 10K resistors from each NPN base to ground and I'm tempted to make the other resistors 2K.
Somehow I think the formula for the perfect diode is this:
Battery voltage (7.2V on full charge) minus zener voltage minus transistor emitter-base voltage >= 0 to turn GPIO line off.
I didn't use resistors at the NPN collector because I'm relying on the internal resistors installed in the AT89S52 micro. As of last measurement on the multimeter, they came to about 82K.
Did I get the formula right? and do I need different resistor values from what I mentioned?
The LCD is an HD44780 compatible LCD with a backlight always on but I usually feed the backlight power through a 10 ohm resistor to try to extend battery life. The transistors I thought of using were PN2222 but I could also use 2N3904 if thats better.
I did use 10K resistors from each NPN base to ground and I'm tempted to make the other resistors 2K.
Somehow I think the formula for the perfect diode is this:
Battery voltage (7.2V on full charge) minus zener voltage minus transistor emitter-base voltage >= 0 to turn GPIO line off.
I didn't use resistors at the NPN collector because I'm relying on the internal resistors installed in the AT89S52 micro. As of last measurement on the multimeter, they came to about 82K.
Did I get the formula right? and do I need different resistor values from what I mentioned?