A UPS For Your Pi That’s A Little Different

There are many uninterruptible power supply (UPS) solutions for the Raspberry Pi that take the form of HATs with a battery on board, but they’re not suitable for every situation. Web3-Pi are using the Pi 5 as an Ethereum node, and found the need for a UPS that didn’t sit on top of the Pi. Their solution is the Web3 Pi UPS, a device that sits in the USB power chain.

It’s a box that takes three power inputs, USB-C PD, a barrel jack, or a hot-swappable Sony camera battery, and puts out the constant 5 V at 5 A the Pi requires. The USB output isn’t just for power, it can communicate with the Pi to deliver telemetry and ask the OS to shut itself down if power reserves are failing. Inside are a CH32 RISC-V microcontroller that handles the power circuitry, and an RP2040 that handles control and an OLED screen for a UI. The project’s web site also mentions provision for an LTE add-on for remote monitoring, however this doesn’t at the time of writing appear to be fully implemented in the GitHub repository.

While it’s probable that few of you are mining Ethereum on your PI, we can see that there are plenty of other situations that this project could find a home in. It’s not the first Pi UPS we’ve seen, though some of them are considerably less complex or capable.

24 thoughts on “A UPS For Your Pi That’s A Little Different”

  1. I’ve been looking at cordless tool batteries to power my projects but these Sony batteries seem to be more compact and available.

    1. These SONY batteries are in a very stable formfactor. Where the same model (or improved version with a compatible footprint) has been around for almost 30 years, I have yet to find a powertool battery that will remain the same for more than 5 years before it will be discontinued. As they are constantly “improving” the formfactor for a more “balanced design”, higher voltage for “more power” and each time the connectors change… the chargers are incompatible and you end up with various shapes and sizes of what could have been oh so practical, one battery that fit’s all your tools….

      1. Agreed. I like the form factor and usability. But like I mention below, it’s difficult to find a mating connector.

        I’d also like to find quality info on the infolithium protocol. Between the lousy libraries, poor documentation and spotty availability in the batteries, it’s essentially useless.

        1. Ryobi 18v batteries have had the same form factor for decades, even keeping it the same when they switched from NiCd to Lithium. The electrical contacts are available as replacement parts and a 3D printer easily makes the rest of the mating connector.

          1. Yeah, I do that with my Milwaukee packs, but the NP-F form factor is a significant level up from the tool battery aesthetic.

    2. Just get a A/AA/AAA battery box, hook up a charging controller and get the respective standardized and widely availlable cells of your choice chemistry.

  2. Nice job with that.
    The two perennial problems with NP-F batteries:
    1. What do you use for the terminals? Supplier, Part number/distributor, catalog number?
    2. What do you use to talk to the battery’s smart pin?

    1. Thanks! On the terminals: that connector is the real UNOBTAINIUM of the NP-F world.
      You can occasionally find it from resellers, but at prices that make no sense for a small product. So I tracked down the factory that actually makes it and ordered a big batch directly.
      I like sharing this kind of thing with other hackers, so here it is: BP3572-B from Guangdong Techeng Hardware Electronics Co., Ltd.

      1. Many thanks for the followup!
        1000 pc minimum order… Guess I’ll continue with my mini banana plug hacks and buying cheap integrated holders, though I do appreciate the locking version design you provided.

    1. @Andrew: a regular UPS works, but it’s AC → DC → battery → AC → DC just to feed a Pi, it’s the size of a shoebox, and many small ones won’t negotiate the 5 V / 5 A PD profile the Pi 5 wants. This one is DC end to end, Pi-sized, and the battery is a hot-swappable camera pack you can buy in any photo store.

    2. I dont know where you live or what you consider expensive but traditional UPS absolutely is expensive, has lead-acid battery unless you want to pay even many times more and is completely ineffective. If you take out its battery and use good DCDC then you make 1h battery life into >1day.

      1. There are thousands of lipo battery ‘ups’s on ali etc. Basically powerbanks that dont auto shut off and allow charging while in use. Very cheap, very handy

    3. i don’t know why but in my experience commercially-purchased lead-acid AC => AC UPSes are always broken. they don’t seem to ever last more than a couple years, and when they go they often take down whatever device you had attached to them. UPS-connected power in my life is less reliable than the wall plug.

      always figured there must be a good UPS out there somewhere but it just hasn’t been my experience.

      i don’t need this device but if i did, i wouldn’t use a UPS :)

      1. It’s all use case, budget and risk appetite appropriate. I’ve worked with big, medium, small and tiny UPSs over the last 20+ years.

        On the medium and large scale UPSs, they’re all under service contract because they power switch closets/servers or datacentre sized stuff and there’s a big risk involved if they don’t work. Realistically when you’re at that level, the UPS only works for a short time (1-3 hours) and a generator is supposed to kick in to power them. The 1-3 hours is for an engineer/electrician to pop out if the generator doesn’t kick in automatically. Most commercial UPSs are built for this purpose. There’s a very high reliability rate on all of these (when they’re set up correctly) that I’ve worked with (except one faulty external capacity unit which caused a lot of problems over a few months before it was properly diagnosed), but the battery life isn’t set up for anything more than a few hours at most.

        I’ve a small one at home that’s been running for 15 years, connected to a server, a router, a PoE injector constantly and keeps power on a laser/3d printer and router in case of power failure. I’ve replaced the batteries in it only once in that time (about 7 years ago so its probably coming close to that time again – 2 12v SLAs) and its been bulletproof aside from when the batteries get low but there’s plenty of warning, obviously depending on usage I can get a couple of hours out of it or a full day if I power down the server and PoE injector if there’s a longer power failure. The use case here is to power different items, all of which accept mains power. But I’ve used small ones for various raspberry PI projects and they’re powered by either 1 or 2 18650s. One of those still has the battery going after 3+ years (I must do some capacity checks on it to be fair and I don’t know if it keeps it at 100% or 80% charged) while another was designed to use the battery to power the device and charge the battery simultaneously so the batteries have been changed on that one twice in 5/6 years.

  3. Web3 Pi runs Ethereum nodes and validators, and a hard power cut can corrupt the node database, which means days of resync and missed attestations for stakers. That’s why the UPS talks to the OS over the same USB-C cable and asks for a clean shutdown before the battery dies.

    The LTE part is already implemented. An LTE-M modem (ESP32-S3 + SIM7080G) sits inside the unit with a pre-installed SIM, so you get outage alerts and remote monitoring even when your home internet is down. Firmware is in the same repo, the README is just behind.

    So it’s three MCUs: CH32X035 for the power path and USB-PD, RP2040 for the UI and the link to the Pi, ESP32-S3 for LTE. Hardware, firmware and protocol are all open.

  4. For the life of me, I cannot figure out how these UPS manufacturers are developing UPS options fornthe Pi and manage to ignore the FACT that Pi wants 5.1v or 5.2v to not throw undervolt errors everywhere. FFS, make the output 5.2v and do it right.

    1. The Web3 Pi UPS provides 5.1V/5A, exactly as the Raspberry Pi 5 expects, and properly negotiates Power Delivery with the Pi 5.

      There are no undervoltage warnings. We even compensate for the voltage drop across the USB-C cable, so the Pi actually receives the full 5.1V at its input.

      For USB Power Delivery handling, we use the WCH CH32X035.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.