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
I know this is an old post, but do you by any chance have any photos of where you soldered this mod? I would like to try this also.
Afraid I cannot find either a photo or the modified board to take one. As I remember it, I built the circuit on an Adafruit adapter board (ADA1211) stocked by Pimoroni. This converts the surface mount chip package to through hole pads and you can also solder the resistors and capacitors on this. The only connections to the Pico LiPo that are not through hole pads are the ‘on’ switch to TP1 and the ‘off’ wire to U5 pin 2 which can be soldered to the pad of the SW_PWR button. Then I just hot-glued the adapter board on top of the RP2040 chip on the Pico LiPo making a self-contained unit.
Thanks for responding after such a long time, and thanks for the extra info. I’ll order some of those Adafruit adapter boards for testing, but then probably make a small board to house the 74LV1T86, switch, caps, etc. If this works I have to solder quite a few of them, so I want to make it as easy for me as possible.
By the way, was there any specific reason for using a 74LV1T86, or was that just what you had available?
The 74LV1T86 was used because of its level shifting capability (i.e. it allows a 3.3V GPIO to drive logic at a higher voltage, up to 5V), and because it was available in a small package with just two circuits rather than the more common eight channel packages. But there are many different approaches to level switching. The one LadyAda uses in her circuits with a discrete MOSFET and a few resistors has its advantages, and as someone pointed out above, depending on the switching threshold of the higher voltage logic, you can often get away with a diode and a pull-up resistor. If I were making more than a handful, I would redesign the Pimoroni board and add the level shifting circuit rather than making a daughter board. Having to solder wires to non-through-hole nodes is always going to be a bodge! Also this approach lets you save costs by deleting anything else you do not need. Check out the Adafruit.com site. All LadyAda’s designs are fully open source including the PCB layouts and she knows what she is doing!
What you say makes perfect sense, however I’m not sure I have the time/experience to redesign my own Pico Lipo. There is a big difference between designing a small simple board with a few components that I can solder myself, to designing an RP2040 board with power circuit/charging, etc.
I would at first like to see just how much of a bodge the soldering is, before going down that route.
I will also check out the Ladyada MOSFET approach to level shifting.
Thank you again.
