Hackaday Prize Entry: Powering A Pi From A Battery

Knocking a microcontroller into sleep mode and waking it up on demand or in intervals is common practice in many low power applications, enabling devices to stay in operation for years on a single coin cell battery. Since there are tons of applications where you might want to do similar things with a Raspberry Pi, [Patrick Van Oosterwijck] created the LiFePO4wered/Pi. The module that snaps on to eight GPIO pins of a Pi, extending it by a long life LiFePO4 battery, a charging regulator, and a proper power management. Obviously, it also makes a great UPS.

lifepo_pcbs[Patrick] realized this project by expanding his already available and equally useful LiFePO4wered/USB charging regulator module by a low power MSP430G2131 microcontroller and a load switch. A daemon on the Raspberry Pi speaks to the module over I2C, allowing you to schedule a wake-up timer, let your Pi autoboot after a power outage or just read out the current battery voltage through a command line tool. Once the Pi is safely shut down, the microcontroller will also go to sleep, resulting in a standby current of 8 uA for the whole system. Together with the 500 mAh LiFePo4 cell, that’s theoretically low enough to send your Pi-ncess into a seven-year-long sleep.

LiFePO4wered/Pi is not only good for sleeping, though. [Patrick’s] runtime tests show, that the 500 mAh cell will power a Raspberry Pi Zero and a WiFi dongle for about two hours. Because the Raspberry Pi and many USB peripherals won’t complain when only 3.2 V are present on the VBUS, [Patrick] was able to squeeze out even more runtime by dismissing the boost converter from the design and driving the Pi directly from the battery voltage. If that worries you, you can either read a detailed explanation on why that works so well or just have a look at the more compliant 5 V version.

lifepo_time_laps_cameraEventually, [Patrick] used his module to create a Raspberry Pi time-lapse camera. A little script lets the Pi take a picture on boot up, set a wake-up timer and go back to sleep again. Safely enclosed in a waterproof electric box and deployed into the wild, the camera took 120 pictures on a single charge.

We’re sure the module will find it’s way into many cool projects and we’re counting the hours until we can get one in [Patrick’s] tindie store. Until then, enjoy the time-lapse video:

The HackadayPrize2016 is Sponsored by:


28 thoughts on “Hackaday Prize Entry: Powering A Pi From A Battery

    1. Yes, and at the time that was an entry for the Adafruit Pi Zero contest.

      We’re now running a contest with $300k in prizes (of which we’ve already given away >$20k to hackaday readers). This project was one of the entries that won $1000.

      It’s…. it’s almost like we’re trying to promote something here…

  1. been looking to beef up the battery system on my pi tablet. i got 2 li-ion cells on a ubec putting out 5v. but between the pi, the wifi dongle, and the display (offitial screen), i dont get more than an hour and a half out of the thing. there is also not a scrap of safety features on the thing. but the ubec starts to drop out before the cells get fully discharged and the pi starts getting unstable. so it has a modicum of protection from overdischarge. i have a physical switch that disconnects the pi from the battery pack and connect it to a charge connector, and i use my 2/3 cell li-poly balance charger to top it off.

    i kind of want to bump it up to 3 cells. i want a charge, protection and regulation system on a single board. something that will let me run the thing while charging, and draw wall power instead of battery power while its charging. cant seem to find a single board solution though. im not beyond building it myself but most of the tutorials i have been able to find have been for single cell systems. i really dont know what to do with the thing.

    1. Driving a screen costs power. The mentioned 3.3V hack works well but you loose 5V on USB so some USB peripherals might not work. Did the 3.3V hack to a Pi A model with a wide input pololu buck converter and run it off a car battery as a dash camera.

  2. I see one serious problem with this solution. It is close to impossible to buy Pi Zero after 6 months from announcement. Therefore this project is for most of us so useful like for example “DYI nuclear reactor monitoring system”. Can’t get crucial component.

    1. Buy the PI 2 and desolder the connectors if space is that important. The Pi 2 has a sleep consumption comparable with the Zero with HDMI, Lan and processor powered down.

      1. No. The only redeeming quality of the Raspberry Pi Zero is the $5 price tag. The forums are full of stealth marketers who just do this, pushing the Pi2 and other models (that cost 5x-20x more) as an “alternative”. It’s getting old. Best advice is to just stay away from anything Pi-“foundation” (aka broadcom), and their hipster club of ripoff resellers.

        1. where the hell do you buy a pi at 20x the price of a pi zero?
          And if you want a cheaper pi, there’s always the pi A+.

          As for the zero, the thing is that raspi foundation makes the zero themselves, as opposed to beeing manufactured for them by factories for the other models. I guess that otherwise, no one would be willing to craft something with so little profit to be made.
          Anyway, that means only 50K pi zeros a week.

          In all cases, the A+ can be bought for 20$, and that’s still cheap. The Pi3 is available for 35$, and that’s still cheap.
          I know few to no other single board computers with such low prices AND a large community, meaning that problems one encounters has likely been solved by someone else.

          I don’t get the hate on the pi, it seems to be trendy to be bitter, and hate it…
          I’d be glad to hear about the so many other boards, cheaper, well documented, largely available that you seem to know…

          Meanwhile, the various raspi will keep be a excellent tool for so many projetcs (i use those for robots, cameras, driving my 3D printer, meteo station, aquarium monitoring, etc).

          1. Where do you get a Raspberry Pi for 20x the price of a $5 pi zero? Adafruit, of course:
            Look Mom, no free shipping! They do throw in a breadboard, some led’s, and a box, however. Value.

            An then there’s:

            > As for the zero, the thing is that raspi foundation makes the zero themselves

            The raspi foundation make nothing themselves. They own no fabs. Broadcom (their parent company) is fabless has sites in the UK and Shanghai. Quote from Adafruit Pi Zero page:
            “Please note: Some boards are made in the UK, some in China. WE DO NOT KNOW IN ADVANCE WHICH ONES YOU MAY RECEIVE!”

            Pick a fruit, any fruit. There are several alternatives to the Raspberry Pi without the marketing overhead and ripoff resellers. Better specs and lower cost too.
            It’s $13.77 shipped.

            > In all cases, the A+ can be bought for 20$, and that’s still cheap. The Pi3 is available for 35$, and that’s still cheap.
            Did you factor in markup, shipping costs, and tax? Those cannot be obtained for the listed prices *anywhere* online. All resellers markup the price with varying levels of higher price+rip ship. Your out of pocket cost will be higher.
            It’s not “hate on the pi”* . It’s the “foundation”‘s shady marketing practices, false advertising, and fraud.

            If you want someone else to solve your problems and need a broadcom-sponsored “community”, the Raspberry Pi is maybe your thing. For everyone else who have reasonable levels of software and hardware understanding and some basic financial knowledge, avoid the foundations, marketers, hipsters, and ripoff resellers.

          2. The A+ appears to be out of stock everywhere. Also, if you can find one it’ll probably have a pitiful 256MB of RAM, half that of the Zero – there’s a new 512MB version of the A+ but I don’t think it’s shipping yet.

  3. If you use a RTC with 2 ALARMS and some circuitry around it you don’t have to program an external MCU to do this.
    Power wise you’re at least 10 times better then too and have an RTC on top of it.

    NXP PCF85263A
    0.4 uA
    set 1st alarm to wake the pi (enable power to pi)
    set 2nd alarm to remove power from the pi, then shut down pi (timer enables pi to shut down, before power is removed)

  4. If you are doing something that doesn’t take very long, then the boot time is the killer for battery life. How does one make a RPi or BeagleBone boot faster. Let’s say I want to do something that takes 1 sec, but the boot time is 30 sec, ~96% of my battery life is spent on booting…

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.