I’m using the PRT-26993 to act as a power switch for my LiPo powered project. The board I’m powering has a LiPo charger built in, and appears to successfully charge the LiPo battery through the Sparkfun Soft Power Switch board.
I’m looking to implement an auto-power-down on my device when powered solely from LiPo, but don’t have a reasonable way in software to detect when the mcu board is powered over USB or LiPo. Is it safe to drive the OFF pin HIGH (which normally cuts LiPo power) while charging? Will this still allow charging of the connected battery?
Sorry if this is an obvious answer, I’m not terribly well versed in MOSFETs and power circuits in general. The schematic is here: https://docs.sparkfun.com/SparkFun_Soft_Power_Switch_Mk2/assets/board_files/Soft_Power_Switch_JST_2mm_Schematic_V10.pdf
My very basic understanding of the MOSFET circuit (“High Side Switch” in the schematic) is that Current is always allowed to flow from VOUT to VIN via the embedded Schottky diode (which should only happen if VOUT, i.e. the target, is charging). If the OFF pin is driven HIGH, that will disallow current from flowing from VIN to VOUT, which shouldn’t matter in a charging scenario.
Is that right? Just trying to make sure I understand this all.
Hi @gatesphere ,
Yes, that’s right. Correct, the charge path is through the diode embedded in the FET. The power switch being off will have no effect on the charge path.
You could use another FET or open-drain output to drive BTN, to turn the power switch back on again. I don’t know if this would help with your application?
Prepare to shut down your code (close any open microSD files etc.)
Turn power switch OFF
Wait say 500ms
If the code is still running, the code knows power is coming from USB
Turn power switch back on again via BTN - to maintain power if USB is disconnected
Repeat
I hope this helps,
Paul