0
\$\begingroup\$

I'm trying to read the voltage of the battery so I can simply calculate the battery status.

I'm using a 8.4V battery (recharcable PP3) that I've meassured now to 5.57V. The circuit will die long before but of the max 8.4V its now at 66%.

My MPU is a is the ESP32, that is a 3.3V device. In order to lower the voltage I've put two resistors in series; 4.7k Ohm and 1k Ohm. I should get a Vout of 0.977V @ 5.57V from the battery. But I'm getting 0.476V.

Now, in order to not drain the battery I have a 2n2222 NPN transistor between the battery og the first resistor. 0.476V is about halv of the expected 0.977V. Is that whats expected? Or am I using the wrong NPN here? Can I just double the Vout so I get the expected value?

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Please post a schematic or wiring diagram so we can see what you are asking about. \$\endgroup\$
    – AnalogKid
    Commented Jun 24, 2020 at 18:48
  • \$\begingroup\$ This has been done many, many times before. Not only with an ESP but other micros as well including Arduino style modules. Go find projects that also monitor the battery voltage and learn from them how it is done. As you didn't educate yourself first you are doubting everything. And include a schematic, yes that's already mentioned but it is so important that it needs to be mentioned again. \$\endgroup\$ Commented Jun 24, 2020 at 18:54

1 Answer 1

1
\$\begingroup\$

This is what you have:

schematic

simulate this circuit – Schematic created using CircuitLab

The circuit on the right will work.

The problem with your circuit is that the NPN transistor will only output the control voltage minus Vbe, which is about 0.6 or 0.7V. So it won't be related to the battery voltage at all.

The circuit on the right is a high side switch that controls the PNP transistor via the NPN transistor.

\$\endgroup\$
2
  • \$\begingroup\$ Did you use the npn to fully turn on the pnp so that there is minimal voltage drop across the pnp? \$\endgroup\$
    – Amigo54
    Commented Jun 24, 2020 at 19:20
  • 1
    \$\begingroup\$ Yes, that is correct. \$\endgroup\$ Commented Jun 24, 2020 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.