A while ago, I asked about detecting whether a power jack is connected or not, in order to select power source from USB or DC jack.
You can see the question here: Power selection circuit for USB or DC Jack - both at 5V
I finally put together this circuit:
On the input I expect a 5V supply.
I use a voltage divider (VJACK/2 = VSENSE -> going to a 3.3V uC input) to know if there is voltage at the DC jack (V-SENSE goes to a uC pin), and if there is enough voltage, I want to enable the power switch (AP2501M8-13 active LOW) in order for it to deliver the power for the rest of the circuit. Also, I'd like to detect if there isn't power (the DC jack was disconnected, or no voltage in the power supply), and in this case, disable the power switch.
I need this, cause I have two power modes in my system, and the HIGH power mode needs the power supply to run.
The problem I am having is that after unplugging the DC jack, I still have 5V in VIN and VJACK, so I can't detect with the micro controller a disconnect.
After unplugging the DC JACK, with the microcontroller, I enable and disable the power switch (EXT_POWER_EN line), and I still have 5V at the input. I would think that after disabling it, the input of the switch would go to 0V, dischargin C10 through R7 and R8.
I don't know if it's the power switch, that is bi-directional, or that it is not meant to be used like this, or that the 5V are leaking from somewhere else to the input, but I can't find the root of the issue.
I removed the C10 capacitor, to check if the problem was that it got charged, and could not discharge, but the problem persists without C10.
EDIT: Also, after connecting and disconnecting the DC Jack, if I touch VIN with a jumper wire to GND, it stays on GND, it doesn't get back up to 5V.
Any help appreciated!