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?