I'm lost.
I thought I picked the perfect diodes. When I picked them up at the store, one was labelled 3.3V and one 4.3V so I figured by using them I'd get two ground outputs at the NPN collectors if the battery voltage is > 5 (4.3V + 0.7V) and I figured one of the two NPN collector outputs is ground if battery voltage is > 4 (3.3V + 0.7V). I got the 0.7V as the estimated voltage required to turn the NPN on.
I take out the voltmeter and run some tests and my theory seems a bit flawed. On a battery that's half-dying one NPN collector output reads about 3.2V and the other NPN collector output reads about 4V. On a good almost new battery, both NPN collectors read about the same voltage at 4V. I measured these voltages inverted style (+ve lead of meter to VCC and -ve lead of meter to NPN collector).
Now if I subtract the two from 5 to get the real, the experiment went wrong because all voltage values are under 2 which to the micro can mean logic low in every case.
I mean I could change the resistor but I don't want to go too low or I will blow up the diodes. I do think I need to change the diodes but I don't want to use too low of voltage or I might blow up the microcontroller since the battery I'm using is 7.2V which is what the resistor is connected to.
The microcontroller is connected to 5V supplied by a voltage regulator (LM2940) the 7.2V battery also feeds.
I want to detect when the voltage from the battery drops just below 5.5V (since LM2940 needs 0.5V for its own processing) and I also want to detect when the voltage drops just below about 4.5V since the microcontroller needs 4V minimum to run.
How do I go about calculating the optimal diode reverse voltage value or optimal resistor value? or better yet, which diode model numbers would best suit my application?
Here's my circuit for reference.
And I'm not concerned about battery detection speed, as long as I can get an accurate reading at least once a minute.
I thought I picked the perfect diodes. When I picked them up at the store, one was labelled 3.3V and one 4.3V so I figured by using them I'd get two ground outputs at the NPN collectors if the battery voltage is > 5 (4.3V + 0.7V) and I figured one of the two NPN collector outputs is ground if battery voltage is > 4 (3.3V + 0.7V). I got the 0.7V as the estimated voltage required to turn the NPN on.
I take out the voltmeter and run some tests and my theory seems a bit flawed. On a battery that's half-dying one NPN collector output reads about 3.2V and the other NPN collector output reads about 4V. On a good almost new battery, both NPN collectors read about the same voltage at 4V. I measured these voltages inverted style (+ve lead of meter to VCC and -ve lead of meter to NPN collector).
Now if I subtract the two from 5 to get the real, the experiment went wrong because all voltage values are under 2 which to the micro can mean logic low in every case.
I mean I could change the resistor but I don't want to go too low or I will blow up the diodes. I do think I need to change the diodes but I don't want to use too low of voltage or I might blow up the microcontroller since the battery I'm using is 7.2V which is what the resistor is connected to.
The microcontroller is connected to 5V supplied by a voltage regulator (LM2940) the 7.2V battery also feeds.
I want to detect when the voltage from the battery drops just below 5.5V (since LM2940 needs 0.5V for its own processing) and I also want to detect when the voltage drops just below about 4.5V since the microcontroller needs 4V minimum to run.
How do I go about calculating the optimal diode reverse voltage value or optimal resistor value? or better yet, which diode model numbers would best suit my application?
Here's my circuit for reference.
And I'm not concerned about battery detection speed, as long as I can get an accurate reading at least once a minute.