V_USB and V_BATT pins on ESP32 Thing Plus C

For an external circuit attached to the ESP32 Thing Plus C I need a 3.5V source and thus the 3.3V source isn’t going to work. I thought I would replicate the circuit used by the Thing Plus C to create VIN for the system regulator and hook it to the available VUSB and VBAT pins.

Basically a diode and a MOSFET. This is preferred over two diodes (which was my first thought) as it completely turns off drawing from the battery if there is a constant source to draw from. But then I discovered it didn’t work…

Through investigation I found that the VUSB and VBAT pins do not work as I would expect from the schematic. From there I would expect VUSB to be near 0V (~280mV due to reverse leakage) if only VBAT was plugged in and VBAT to be near 0V whenever the USB was plugged in. But this wasn’t so - both always have significant voltage (this is with nothing else attached to the board):

USB Battery VUSB VBAT
X 5.2V 4.1V
X 2.9V 3.9V
X X 2.2V-2.7V* 3.9V

* fluctuates over about a half second

I would like to understand why this happens from the circuit (because my understanding of the MOSFET + diode is apparently wrong).

Additionally, I would like to know if it would be safe/reasonable to just use two diodes to get the max of the to voltages?

Hi @coderforlife ,

The reverse leakage current though D4 can cause issues. It varies from part to part. And with temperature. It is difficult to find a (Schottky) diode with high forward current, low forward voltage drop and (very) low reverse leakage current. The FET will leak a little too.

We’ve started using the LM66200 dual ideal diode, to replace the diode and FET. It’s a very nice part. Very low on resistance; 2.5A capability; ON enable pin; very low quiescent current; and a ST status pin which identifies which VIN is in use.

I hope this helps,
Paul

1 Like

In the diode + FET circuit, the FET is a P-Channel but is connected ‘upside down’. The Source and Drain would normally be connected the other way round (Source towards the battery).

When only V_BATT is connected:
R7 is pulling the Gate low.
Because the FET is upside down, current flows through the FET’s internal diode.
Then because the Source is higher than the Gate, the FET turns on, shorting out the internal diode and avoiding the voltage drop.

When V_USB is high (5V), it holds the FET Gate higher than the Source and turns it off.
Power is delivered through D4 - with a drop of 280mV.

The LM66200 avoids all of this…!

1 Like