This question already has an answer here:

I'm facing a problem that is completely strange for me. This is simple, I build a small electronics device and in that one I just set up a voltage bridge divider to obtain battery voltage to be able to indicate what is the level of the battery.

Problem description

Behavior: It works quite fine, means that when battery voltage is decreasing, it decreases on the input ADC on the MCU. The main problem, is that it discharges the battery same when the circuit is turned off.

What we tried: OK, we have to find a system that permits to turn off the bridge divider when I turn off the circuit. That's why I simply added a transistor which is driven by the 3.3v regulator of the circuit:

  • When circuit is ON, 3.3v from the regulator drives a transistor BC547A (just for test) on the Base with a 10k resistor.
  • The transistor becomes "passing", and provide battery voltage to the bridge divider.
  • We read VBAT2 on the MCU, when system is powered

Strange behavior: But... this is not working, we observe that the transistor is acting like a regulator because it seems to be not "passing" enough to provide the voltage variation from the battery. This is the circuit that we are trying.


enter image description here

And when we measure variation at the input of the MCU, the transistor seems acting like a regulator O_o. It means that when battery voltage decreases slowly, voltage on the MCU input stay completely constant and stable.

Here are the measure that I've done:

enter image description here

The blue line is VBAT2 (the one that goes to the MCU), and the red one is the probe that is on the battery +.

The battery is a standard single cell lithium ion polymer, with battery voltage that move from 4.15 V (full charge) and 3.1 V (discharged).

Does someone can help me to solve this problem or explain to me why I observe this behavior?


marked as duplicate by Andy aka, PeterJ, JRE, uint128_t, Bimpelrekkie May 2 '16 at 14:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


You should use a P channel mosfet controlled from a low side BJT or N channel MOSFET. What you have at the moment is an emitter follower and that does indeed act like a regulator. Try something like this: -

enter image description here

Basically, when you want to measure the battery voltage, you use a spare IO line to activate the BJT. This then turns on the P channel MOSFET and delivers the battery terminal (through the on resistance of the MOSFET) to the potential divider.

See also this page which makes your question a duplicate.

  • \$\begingroup\$ Thank you very much andy, sorry for the duplication, I'm going to try this schematic \$\endgroup\$ – kevzzz May 1 '16 at 10:43
  • \$\begingroup\$ Hey it makes my answer a duplicate too. \$\endgroup\$ – Andy aka May 1 '16 at 10:58
  • \$\begingroup\$ :-), I don't have transistor equivalent to your scheme, but I have one N channel. Can I replace the MMBF2202 by 2N7002P? \$\endgroup\$ – kevzzz May 1 '16 at 10:59
  • \$\begingroup\$ Virtually any bjt would work. For the n ch fet just check the data sheet to ensure it will turn on with a 3 volt gate drive.... There are graphs that will help you else, just try it! \$\endgroup\$ – Andy aka May 1 '16 at 11:04
  • \$\begingroup\$ I made the test and... It works but in the wrong way :-). When I turn on the device (3.3v on the base of the current transistor) my voltage (VBATT_sense_ falls to 0.003V and I have 1.085 when everything is turned on. It may comes from the type of MOSFET transistor I have. \$\endgroup\$ – kevzzz May 1 '16 at 13:09

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