My question is simple. I would like to be able to switch off power to the DC/DC converter (orange rectangle) according to the following conditions:
When the charging USB cable is plugged in (VUSB) I would like to cut off power to the DC/DC converter. I would like to prevent battery usage while charging for safety reasons so that the battery is charging with the power to the DC/DC converter and therefore the rest of the functional components on the pcb cut off.
When USB power is disconnected, the power supply to the pcb coming from the 3.3V output of the DC/DC converter is managed by a simple toggle switch preventing the DC/DC converter and therefore the rest of the circuit from powering on when you don’t intend to use it and unplug the USB cable.
This is the circuit:
How this circuit works via 4 functional groups on this layout:
Blue: TP4056 constant current/constant voltage battery charging IC
Green: FS312F One cell battery protection IC
Orange: TPS63001 DC/DC Buck-Boost converter 3.3V output
My question is about the Red section, the toggle switch is easy and does not require modification in my opinion. However as I am still quite new to electronics I realised my solution using a PNP transistor might not be optimal as depicted in the circuit above.
Problems I can think off with the current layout:
- I am not preventing electricity to flow back into the USB port from the battery.
- Voltage at he Base of this PNP transistor is not necessarily going to be higher (5V USB) than the voltage at the Emitter when switching off flow from emitter to base. So I could see that this PNP transistor might be permanently on.
I just immediately thought about transistors when thinking about switching something with electricity. The NPN transistor wouldn’t work here as I want the electricity to flow from Collector to Emitter when USB is unplugged (no power). This made me think this might be a use case for PNP?
I would be grateful for any suggestion on switching this part of the circuit!