3
\$\begingroup\$

I have designed a simple battery voltage monitoring circuit to monitor a 3.7V Li-Po battery. My microcontroller (ESP32) uses a 3.3V supply.

schematic

simulate this circuit – Schematic created using CircuitLab

The MOSFET M1 is an attempt to save power when I'm not measuring the battery level.

Is this circuit suitable to measure voltage across the ADC pin of my MCU? Please review the circuit and provide me with inputs if I'm doing something wrong, or if it could improved in any way.

Thanks.

\$\endgroup\$
8
  • 3
    \$\begingroup\$ What's the purpose of the MOSFET? All you need is a voltage divider to ensure you are below the ADC ref, and perhaps a current-limiting resistor. \$\endgroup\$
    – Lundin
    Commented Feb 27, 2019 at 9:39
  • \$\begingroup\$ It is not entirely clear what the purpose of this circuit is. It looks like R2, R3 are a voltage divider and you want to use M1 to connect/disconnect this voltage divider to save battery while not monitoring. M1 is an NMOS that means that in order to fully close M1 the voltage at MCU_DOUT needs to be higher than the battery voltage. When MCU_DOUT = Vbat then this will behave as a source follower meaning you will get Vbat - Vgs(M1) at the resistor divider. Consider using a PMOS instead! You should do more research and see what is generally done as you're not the first to want this. \$\endgroup\$ Commented Feb 27, 2019 at 9:41
  • 2
    \$\begingroup\$ I think the OP has the mosfet in an attempt to stop R2 and R3 draining the battery when the measurement isn't being made. \$\endgroup\$
    – james
    Commented Feb 27, 2019 at 9:52
  • 1
    \$\begingroup\$ So... you picked some ebay wifi module with a 160MHz CPU and then you are concerned about 330uA continuous current...? Meanwhile the wifi radio spits out what, 100mW power? \$\endgroup\$
    – Lundin
    Commented Feb 27, 2019 at 10:18
  • 1
    \$\begingroup\$ @Lundin Yes, because my MCU sleeps for about 23.5 hours a day(not continuously though) \$\endgroup\$ Commented Feb 27, 2019 at 10:22

2 Answers 2

2
\$\begingroup\$

The problem on your circuit is using a N channel mos, since the source is floating, it's difficult to predict when it gonna switch.

The design below, using a p channel mos solves this issue. Note the Mos has a low Vgsth that allows to switch with low voltages.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
5
  • \$\begingroup\$ Can you tell me what is the purpose of Q2 in your circuit? \$\endgroup\$ Commented Feb 27, 2019 at 11:18
  • \$\begingroup\$ Tie the gate down so M1 become conductive, you could do it directly from the MCU if it supports open drain pin and can handle the voltage. \$\endgroup\$
    – Damien
    Commented Feb 27, 2019 at 11:26
  • \$\begingroup\$ Thanks for replying! It can handle the voltage but I dont know what you mean by "supports open drain pin". \$\endgroup\$ Commented Feb 27, 2019 at 11:31
  • \$\begingroup\$ Means it can either pull the pin down to GND or leave it floating. Google -> microcontrollertips.com/what-is-an-open-drain-faq \$\endgroup\$
    – Damien
    Commented Feb 27, 2019 at 11:33
  • \$\begingroup\$ Would it be possible to move the N-channel MOSFET to the midpoint of the divider and add a weak pull-down? Similar to what is described in this blog: jeelabs.org/2013/05/17/zero-powe-battery-measurement \$\endgroup\$
    – Septatrix
    Commented Jan 26, 2022 at 14:27
1
\$\begingroup\$

As the comments have mentioned, the purpose of the MOSFET is not clear. I can only assume you want to turn it on and off each time you want to measure the battery voltage. First of all, you want to use a PMOSFET for this, rather than NMOSFET.

But, after saying that, it is not even needed. All you need is the battery voltage and a divider. You can still take the battery measurements at whatever intervals you want in your code, you don't need a MOSFET to do this. If you make sure your resistor values are quite high, then you can minimise current.

You may also consider using a buffer as well to feed the microcontroller pin to give a more stable reading to the MCU AIN pin:

schematic

simulate this circuit – Schematic created using CircuitLab

Using a buffer will stabilise your reading, so it won't get loaded down by anything, and change the reading. This will allow you to use higher value resistors in the divider, to further save power.

\$\endgroup\$
15
  • \$\begingroup\$ can you tell me why the buffer is needed? \$\endgroup\$ Commented Feb 27, 2019 at 10:06
  • \$\begingroup\$ I have added it in to the answer. It is not needed, but it will be useful to have \$\endgroup\$
    – MCG
    Commented Feb 27, 2019 at 10:10
  • 2
    \$\begingroup\$ If the buffer is needed depends on the ADC input of the MCU. Some ADCs do not have a high impedance input but an input impedance of for example 10 kohm. Then the buffer is needed. If the ADC has a high input impedance, significantly higher than the impedance of the voltage divider, then the buffer is not needed. To improve EMI: add a capacitor in parallel with R2, a 100 nF capacitor will do the job. \$\endgroup\$ Commented Feb 27, 2019 at 10:20
  • 1
    \$\begingroup\$ As a rule of thumb you don't use 1M resistors in radio applications. All of the board will soak up not only your own radiated power but external radio too. All wires, such as those to a battery, will act as antennas to some degree. A 100mW 2.4GHz signal leaking energy into the battery plane will cause that OP to dance. \$\endgroup\$
    – Lundin
    Commented Feb 27, 2019 at 10:23
  • 1
    \$\begingroup\$ I would dispute the argument of not using 1MOhm resistors in radio applications. I have used up to 10MOhm resistors in multiple BT projects without any negative impact. In fact Nordic Semiconductors have a blog article on battery measurement, and they recommend high value resistors. devzone.nordicsemi.com/b/blog/posts/… \$\endgroup\$
    – Elmesito
    Commented Feb 27, 2019 at 10:30

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.