Hi,
I have been prototyping with a “powerpath controller” in the below configuration (datasheet is here; https://www.analog.com/media/en/technical-documentation/data-sheets/4412fb.pdf).
This is for use as a power supply switching circuit, when mains power fails.
How this configuration works is that when the wall adapter input is higher than the battery cells, the Auxiliary P-channel mosfet turns on, and the wall adapter powers the load. This mosfet is driven by the STAT pin, which is an open drain output (either ground or disconnected). The mosfet is pulled-up by the 470K resistor. The stat pin has a sink current of about 10 micro-amp max.
When the Wall adapter input is lost (i.e. battery voltage becomes higher than mains voltage), the primary P-channel mosfet turns on and the battery powers the load. This is driven with the gate pin.
This circuit works as expected, but what I now need is for there to be a signal sent to a microcontroller (3.3v ESP32), which indicates that the power source has changed from Wall adapter to Battery Cells (and vice versa).
The datasheet says a signal can be sent via the STAT pin to a microcontroller, but it doesn’t go into detail on how to do this when the STAT pin is also powering a mosfet.
I have attempted to achieve this with the following diagram, but it didn’t work. I had the STAT pin powering an additional P-channel mosfet (Q2), which acts as a high-side switch. This was supposed to send +3.3v to the ESP32 input pin, to switch the input HIGH when the wall adapter is connected. The input would pull to low (through 10K resistor) when the wall adapter is lost.
The gate of the mosfet (Q2) is pulled-up with the same 470k resistor.
I thought this would work, because the GATE of Q2 would switch from 12v (wall adapter voltage) to ground (0v) and the SOURCE pin would be receiving 3.3v, which would make VGS ≈ -3.3V, which is enough to turn on a logic-level mosfet, but I may be getting confused.
Can someone explain what I’m doing wrong and/or a proper approach to doing this?
I was also thinking maybe a level shifter circuit might work (using N-channel mosfets), with the voltage at the STAT pin connected to the high side (HV) and the voltage at the ESP-32 connected to the low side (LV). like this one https://www.sparkfun.com/products/12009. Could that work?
Thanks a lot!