Pico LiPo Power Switch

Looking at the schematic for the Pico LiPo, it looks like it might solve a problem I’m having with a project on Adafruit Feather Rp2040. I want to be able to switch the power on with a momentary action push button and off again with a GPIO. The use case is a zero power switch for my desktop computer. The button would power the micro from a LiPo, this would then actuate a relay to turn the computer on resulting in power on the USB taking over from, and charging the battery. At power down the computer would signal over USB to set a timer in the micro which would open the relay after sufficient time for the computer to shut down.
Unfortunately the schematic does not identify the chip used for the flip-flop in the power on-off circuit, or even give it a component reference. If I could check the truth table for this component I am sure I could modify the circuit to do what I want. Can you tell me what the chip is and maybe comment on the feasibility of this?

Replying to my own question!

I just got delivery of a couple of these (amazing delivery, crew, I ordered late Sunday and it was delivered to my home in rural Cornwall first thing Tuesday morning!).

There is only one 8-pin chip labelled V74 Google reveals it to be 74LVC1G74 (probably). Sadly, while the chip supports exactly what I want, the board layout and the tiny size of the chip makes modification hard to contemplate! The Set pin is accessible with a pull up resistor and large ‘TP’ pad, although this is covered with resist it could probably be scraped off fairly easily. Sadly the Reset pin is pulled straight to VDD and has no pad. I am fairly confident if I could only pull this pin low with a GPIO I could reset the flipflop and switch the power off.

If you ever revise the PCB layout, please could you consider doing the same with the Reset pin as you have done with the Set pin to facilitate this sort of mod?

I seem to be talking to myself here, but just for closure, I did solve this one myself.

First, I scraped the resist off TP1 and placed a push-button between that and VSYS&VBAT. That provides a non-toggling ‘switch on’ function (i.e. it cannot switch the power off).

Then it occurred to me (not before time) that it did not matter that the GPIO ‘off’ function was a toggle because the very fact that the GPIO can pull high means the power must be on. So we only have to connect to the pads of the existing Power switch, which is quite feasible. But we need to shift levels between the 3.3V of the GPIO and anywhere between 3.5V to 5.5V VSYS&VBAT. I used a 74LV1T86, which is a level-shifting exclusive OR, with one input grounded so it acts as a non-inverting buffer. The other input goes to GP10, although any GPIO should do. A 10K resistor to ground is also fitted to pull the input to ground once the power is off, and I also fitted a 10uF capacitor to ground to stretch the power off pulse a little.

I tested this by a simple program which waits 10 seconds and then raises GP10. The toggle Power switch still works as before, the new switch switches on, but not off, and the unit switches itself off 10 seconds after it is switched on. Works on USB power or battery. Perfect!

Small correction to the above: The non-toggling ‘on’ switch needs to be between TP1 and GND, not VSYS&VBAT. I also found the switch needed some extra capacitance from TP1 to GND in order to power up reliably ‘on’. A 10uF was fine. I also added a level shifter to VSYS&VBAT to drive a neopixel chain (sometimes these are OK at 3V3, but they are supposed to be 5V, so VSYS&VBAT is safer, but may still not work when the battery is very low and USB power not available. Also this avoids unnecessary load on the 3V3 regulator.

Here is the modified schematic:

Hi John,
I had a similar use case with a pico and an e-ink display, push a button to turn on, perform a test, display result and power off. Instead of a level shifter I just used a 1n4148 diode between GP0 and the power button and this works a treat.
Would be nice if they could consider it if there was ever a shim revision
CD

The D-flip flops are so cheap and also available as DIP, so no problem to build this yourself on a breadboard or perfboard.

A different ready to use solution is a TPL511x from Adafruit, not integrated with the LiPo powering though.

As a side note:

To be honest, I did not really understand the original use-case. Desktops can shutdown completely, and even in wake-on-usb state they don’t consume any substantial amount of power. Probably far less than is needed to build all that stuff. But even then, there are smart plugs that allow the same thing.

I agree with your comment regarding the OP use-case, what I was searching for was an easy solution that provided USB rechargeable battery power with built-in charging and a software controlled power-off function in lieu of having to roll my own and the LiPo Shim was the only one that ticked all but one of those the boxes.

The one mistake I made was to try and desolder the pushbutton for easier access to the pads but accidentally lifted the pad. Thankfully the support team were very helpful with a solution and my prototype works perfectly and will give me 6-12 months operation on a single charge

I was just surprised that, given how creative the Pimoroni team are with their range of pico add ons, this lacked a way to turn it off under software control given how easy it was to implement with the addition of 1 diode and potentially two pads with a cuttable trace so that if you don’t need the option then the pin could be used for something else

1 Like