Close

Some bad and some good

A project log for LiFePO4wered/Pi400

Simplified low cost UPS and battery power for the Raspberry Pi 400

patrick-van-oosterwijckPatrick Van Oosterwijck 12/02/2020 at 23:261 Comment

Having established that when the Pi 400 is on, the load switch can conduct both ways, it was time to check whether the UPS can keep the Pi running when external power goes away.  I connected the prototype to the Pi 400 and the debug probe.  I had some init code to set the pins correctly, after which I paused execution and used the IDE to manually enable the boost converter.

Then the magic smoke came out. :(  What the heck?

Yep, the boost converter burned out.

I am very confused.  I had already checked that the boost converter did the right thing when external power was applied in the very first project log I thought?  The only difference is that I checked it with a lab supply instead of a Raspberry Pi (and its supply).  Could this make a difference?  Does anyone have an explanation as to why this would work when the external voltage is applied by a lab supply versus a wall wart?

I guess I'm happy it blew up so early in the project versus much later, after doing a bunch more work.  The worst case would have been if it all seemed to work while I was prototyping and developing the whole thing with one particular supply, and then blew up when someone used another supply.  My only loss now is the layout work and three prototype PCBs.

So, where to go from here?  Well I don't feel like giving up just yet.  It's not because a specific part fails that the whole concept is trash.  So I decided to test the concept with a really simple setup.  I connected a test circuit with two tiny 100 mAh LTO (Lithium Titanate) cells in series to the 5V GPIO.  The nominal voltage of LTO cells is 2.4V, so two of them in series is close enough to 5V.  LTO cells have low internal resistance, so even small cells have high enough current capability to power a Pi.  For a short time at least.

Plugged in, time to pull the power cord:

Excuse the mess on my desk, but you can see the Pi 400, with power cord pulled, still running from the two little purple LTO cells!

How long can it run?  Well I did some testing with even smaller 60 mAh LTO cells.  Running the "stress" test utility, it lasted about 10 seconds.  Playing a video in the browser, about 22 seconds.  Just idle at the desktop, I stopped the test after a minute but it was still going.  I think the limit is not so much the capacity of the cell, but the voltage loss due to the cells' internal resistance and the loss across the Pi 400's GPIO 5V load switch.  When the battery voltage gets down to about 4V, the Pi turns off.

So if shutdown is immediately triggered when loss of power is detected (terminating high load processes with it), this may be a workable design!  I may not even need to add a power switch on the UPS, I could actually take advantage of the load switch in the Pi 400 which drops leakage current into the 5V pin to less than 1μA!  But I probably will, because of the 40-pin header pass-through design I'm going for.  The key to making it work will be to accurately detect whether current is flowing into the battery or out of the battery to the system, and immediately signal a shutdown to the Pi when power is provided by the battery.  I may be able to salvage the current sense amplifier circuit from the failed design for this purpose.

Discussions

Dustin wrote 11/17/2021 at 17:12 point

Fantastic project and progress. I just finished reading all 4 of your current logs. I'm trying out the Pi 400 as an every day computer, and would love a UPS for it. I hope to see more progress on this and other Pi 400 projects. I'm currently working on making game and software cartridges for the Pi 400 as well. A UPS cart would be awesome. Hope you're well.

  Are you sure? yes | no