Close
0%
0%

LiFePO4wered/Pi

LiFePO4 battery / UPS / power manager for Raspberry Pi

Similar projects worth following
- Ever wished you could unplug your Raspberry Pi and move it elsewhere when you were in the middle of something and didn't want to turn it off?
- Ever wanted to have your Pi run on battery power for a couple of hours?
- Ever wanted to have your Pi sleep most of the time, but wake up to do a short task at regular intervals, all while battery powered?
- Ever wanted your Pi to have a power button that would do a clean shutdown instead of just pulling power, even when you were using it headless?
- Ever had a high-availability application where you wanted your Pi to run through short power outages, and cleanly shut down and come back online when power returned?

If you answered "yes" to any of these questions, the LiFePO4wered/Pi or LiFePO4wered/Pi3 are for you! :)

The LiFePO4wered/Pi and LiFePO4wered/Pi3 can now be bought on Tindie:
https://www.tindie.com/stores/xorbit/

The project is built on top of a LiFePO4wered/USB or #LiFePO4wered/18650 module. A small board is added with an MSP430G2231 microcontroller that takes care of monitoring input and output voltage, monitoring a PCB touch button, driving a power indicator LED and switching the load (the Raspberry Pi power). The microcontroller is also connected to the Pi's I2C bus and monitors the Pi's running state. The small board connects to 8 of the Pi's GPIO pins but leaves the rest free to allow prototyping using fly leads.

An Open Source software package is provided on the Raspberry Pi to interact with the LiFePO4wered/Pi. It contains a library that can be used in your own applications, a CLI interface to read and write device registers over the I2C bus and a tiny daemon that continually tracks the power state, and can initiate a clean shutdown when the battery is empty or the user wants to turn the Pi off using the touch button. Touch button parameters, voltage thresholds, auto boot settings, wake timer and auto shutdown timer (#LiFePO4wered/18650 version only) can be customized by the user and saved to flash.

The touch button requires press-and-hold to turn the Pi on and off to prevent accidental activation. The power LED indicates several power states: off (LED off), busy with boot or shutdown (LED breathing), on (LED solid on). The LED also provides touch button feedback: fade on during the press-and-hold delay, fast flashes when the LiFePO4wered/Pi cannot comply with the user input, either because the input voltage is too low or the Pi is busy booting or shutting down.

Normally the LiFePO4wered/Pi will wait for the user to press the button before it will boot the Raspberry Pi. Auto boot values can be set over the I2C bus so the Pi will automatically boot whenever there is enough battery charge, or when the USB voltage is present (#LiFePO4wered/18650 version only). There is also a wake up timer that can be set so the Pi can shut down, and automatically be started again after the wake timer expires. There are separate, customizable thresholds voltage levels for when the Pi is allowed to boot and when it will be instructed to shut down, or even forcefully turned off in case the daemon isn't active or fails to shut down the Pi. This ensures stable operation and over-discharge protection for the battery.

Based on testing with different Raspberry Pi's, a Model A+ and Pi Zero are able to run from the battery for over 2 hours. The B+, B2 and B3 take more power, but should be able to run for at least an hour. Run time will of course depend on system load as well. For UPS use, the #LiFePO4wered/USB based version is limited to low load conditions with the Pi Zero or Model A+, the #LiFePO4wered/18650 based version is recommended for UPS use in higher load conditions.

LiFePO4wered-Pi-5V.pdf

LiFePO4wered/Pi 5V version schematic

force-download - 19.90 kB - 03/14/2016 at 15:06

Preview

LiFePO4wered-Pi.pdf

LiFePO4wered/Pi 3.2V version schematic

force-download - 18.15 kB - 03/14/2016 at 15:06

Preview

  • 1 × LiFePO4wered/USB (MCP73123-22JI version - LiFePO4wered/Pi) USB chargeable LiFePO4 power module
  • 1 × LiFePO4wered/18650 (LiFePO4wered/Pi3) High power USB chargeable LiFePO4 power module
  • 1 × MSP430G2231 Ultra low power microcontroller, 2K flash
  • 1 × MIC2876 (5V version) Boost regulator with bidirectional load switch
  • 1 × AP22802 (3.2V version) Bidirectional load switch

  • Hardware, firmware, software update

    Patrick Van Oosterwijck01/07/2018 at 19:32 1 comment

    I've been very busy with the development of of the #LiFePO4wered/Pi+ lately, so updates here have been sparse, my excuses for that.  That doesn't mean that nothing has been happening though!  In fact, much of the development going on for the /Pi+ also benefits this project directly, since there is a large shared code base that has been extensively tested on both devices.

    Let's go over what's new:

    Hardware

    The new layout with the improved footprint for the MIC2876 boost converter has been working very well, I have had much less assembly issues with this new batch.  Lesson learned: don't just pick a footprint from the library that looks right, instead make sure it's as close to the manufacturers recommendations as possible or make your own!

    The new layout also has a new design for the touch button:

    How do you guys like it?  And what it means?

    I've been a little remiss on making true on the meaning of that logo, sorry about that.  But very soon now, the source Eagle files for the LiFePO4wered/Pi and #LiFePO4wered/18650 (which is the charging base for the LiFePO4wered/Pi3) will be put up on GitHub! Yay! :)

    Firmware

    Much work has been done on firmware in the last couple of months.  The LiFePO4wered/Pi and #LiFePO4wered/Pi+ share a code base, so improvements made for the one directly benefit the other as well.  Here is a summary of the improvements that have spilled over to the LiFePO4wered/Pi:

    • I2C write shadow buffer.  This ensures multi-byte register values are always written atomically to prevent race conditions.  The I2C peripheral on the MSP430G2231 is a pain because it requires so much babysitting in software, and the Raspberry Pi's I2C peripheral is a pain because it doesn't support clock stretching.  Initially I had a shadow buffer for both read and write, but because the bytes coming out of the LiFePO4wered/Pi could never be 100% trusted (the first bit might be wrong because the software couldn't get to it in time), ensuring consistency for reads has been shifted to the Raspberry Pi code, and only the I2C write shadow buffer is left.
    • I2C write unlock code.  To prevent erroneous register writes when multiple processes are trying to access the LiFePO4wered/Pi, a write now needs to be preceded with an unlock code.  Look at the host software source or the updated product brief for details.
    • Timeouts for boot and shutdown states.  Before, the LiFePO4wered/Pi would stay in these states until the right host event occurred.  But if a Pi became unresponsive, these events wouldn't happen and the LiFePO4wered/Pi would just keep waiting.  Now the timeouts ensure the power is turned off eventually if things are unresponsive.  The timeouts can also be adjusted by the user.
    • It is now possible to force the power output off by pressing and holding the touch button for 10 seconds.  Nice for when you have started the LiFePO4wered/Pi without a Pi attached or if you have forgotten to insert an SD card.
    • If the user wants to connect a hardware button, this was already possible by connecting a button in series with a 100pF capacitor between the T and G pads.  Since support for mechanical buttons was added for the #LiFePO4wered/Pi+, this is now also available on the LiFePO4wered/Pi.  Just set TOUCH_CAP_CYCLES to zero and connect a button between the T and G pads, no capacitor needed in that case.
    • ADC values now have more precision.  I already was doing a running average on the ADC readings, but now instead of scaling this back to 10-bit every time, I keep the 13-bit value.  The result is better filtering, and less code.
    • Added a host application watchdog function.  When using this feature, your application needs to regularly reload the watchdog timer so it doesn't run out.  If it fails to do so, the watchdog timer will expire.  When it does, either the LED will start flashing an error pattern to let you know, or the system will be shut down. ...
    Read more »

  • Some you win, some you lose

    Patrick Van Oosterwijck10/18/2017 at 15:41 0 comments

    In this case I lose.  Twice actually, since this is the second time I'm posting this!  Not sure what happened to the first attempt...

    So I finally got around to building prototypes of the new boost converter design with the RT4812.  At first they didn't work.  But after I swapped the 1.2uH inductors I had stuffed (my current production parts) with 1.5uH inductors (as specified in the datasheet), they immediately came to life.  I didn't think such a small change would make much of a difference, but I guess this chip it picky!

    Here is a prototype in action:

    At first glance everything is working just fine.  I didn't really test this thoroughly, but I had the feeling the circuit stayed cooler at high loads as well, which makes sense since the chip has lower RdsON MOSFET switches than the MIC2876.

    At some point during my testing I turned the Pi off and connected power to the Raspberry Pi's own power input.  To my great surprise, the boost converter started to become hot!  What in the world?

    A little background information may be useful here.  When I search for a boost converter for the LiFePO4wered/Pi, I always look for parts that have a bidirectional load switch.  The reason is that although there is no point to it, you can guarantee someone will plug power into the Pi at some point.  The bidirectional load switch makes sure that in such a case, no parasitic current flows from the Pi's 5V into the battery, while firmware makes sure the LiFePO4wered/Pi refuses to turn the boost converter on.

    My current production MIC2876 is such a part.  In the datasheet it specifies it has a "Bi-Directional True Load Disconnect".  So when searching for a potential replacement, I look for the same thing.  The RT4812 datasheet states it features a "True Load Disconnect".  I assumed that was their marketing term for the functionality I was looking for.  And I was wrong.  When powering the Pi from another source, the RT4812 apparently allows current to flow back into the battery.  Very disappointing, since it seems a nice part otherwise.

    At this point I can't help but wonder what "True Load Disconnect" is supposed to mean.  If it only works one way, isn't that just regular on/off functionality?  It doesn't seem necessary to even mention it, let alone call it by a fancy name.

    On the upside, the RT4812 gets warm but does seem to survive the condition just fine.  What's worse is that I measured 4.4V across the battery, 5V minus the diode drop of the MOSFET's body diode.  That's unacceptable, the maximum voltage across a LiFePO4 cell is only supposed to be 3.6V.

    So, back to the drawing board.  Since I'm running out of stock I decided to do another run with the current design, but using a slightly adjusted layout.  The new layout has a different footprint for the MIC2876.  When I first designed the board, I had used a footprint I had found somewhere in the Eagle library, and it turns out it doesn't really match what is specified in the datasheet very well.  I custom made the new footprint according to the spec and also ordered a new stencil to go along with it.  I'm hoping that this will solve some of the assembly problems I've experienced with the chip.

  • New boost converter evaluation

    Patrick Van Oosterwijck09/21/2017 at 16:52 0 comments

    Even though I'm focusing most of my new development effort on the next gen #LiFePO4wered/Pi+, that doesn't mean the LiFePO4wered/Pi shouldn't get any love!

    One thing that I've started to notice now I've sold over 750 of these things is that the part that gives me the most trouble is the MIC2876 boost converter.  It's the only part that gives any trouble really.  The tiny little DFN package seems to not always be mounted correctly on the boards I get from the CM, so I need to rework some of them and that's a pain.  Worse, I've even had some field returns where units that were working fine before shipping, would not work when they arrived at the customer, and it's always this part that's been the problem on the returns I've analysed.

    So I've been looking for a more robust replacement and I think I've found a good candidate to try: the Richtek RT4812.  It has a nice small leaded package, so assembly problems should go away, and with power MOSFETs that have 1/2 to 1/4 the RdsON as those in the MIC2876, it also should heat up less under heavy load, possibly extending the load current range.

    So I've made a prototype layout to evaluate this change:

    The RT4812 runs at a lower switching frequency than the MIC2876 and specifies a larger output capacitance, plus it doesn't have a fixed output voltage version, so between the extra capacitors and resistive divider the layout has become even more dense.  But it all fits and that's what counts. :)  The design has been sent to OSH Park, I can't wait to see how it performs!

  • LiFePO4wered host software on LibreElec

    Patrick Van Oosterwijck03/30/2017 at 17:33 0 comments

    One of my customers, Raman Sarin, spent some time trying to make the host software work on LibreElec, a small Kodi distro that doesn't come with all the bells and whistles expected for compilation.

    I have not tested this myself, but here are his instructions verbatim in case someone else wants to give this a go:

    1. Get another SD Card and install Raspbian
    2. Go through the steps in the documentation to get the GIT depot onto your Raspbian install
    3. Edit the lifepo4wered-daemon.c file and change the shutdown function to this:
    
    void shutdown(void) {
      syslog(LOG_INFO, "LiFePO4wered/Pi triggered shutdown");
      char *params[6] = {"shutdown", "-h", "-t", "60", "now", NULL}; // shutdown halt in 10 seconds
      execv("/sbin/shutdown", params);
    }
    
    4. Build the files
    5. Copy the BUILD directory to a USB stick
    6. Shutdown the pi and swap to the LibreElec SD Card
    7. Boot the pi
    8. SSH into LibreElec 
    9. Copy the files from the usb to sbin directory 
    	a.  cp /media/ESD-USB/LiFePo4wered-Pi/build/DAEMON/lifepo4wered-daemon /usr/sbin/
    	b.  cp /media/ESD-USB/LiFePo4wered-Pi/build/CLI/lifepo4wered-cli /usr/sbin
    10. Make the files executable chmod u+x filenames
    11. Make sure I2c is enabled by editing config.txt file
    nano /flash/config.txt (at the end)
    
    ################################################################################
    # Adding information to turn on i2c1 for later rpis
    dtparam=i2c1=on
    dtparam=i2s=on
    
    12. nano /storage/.config/autostart.sh
    	
    	(
    	        ~/LiFePO4wered-Pi/build/DAEMON/lifepo4wered-daemon
    	)&
    	
    13. Now manually start the daemon so you can configure it
    14. Now configure it, I'm using the following, this makes sure the Pi starts up when plugged in and shutsdown cleanly when power is removed. However it also means you can't power it off in software it'll just reboot again.
    	a. lifepo4wered-cli set AUTO_SHDN_TIME 2
    	b. lifepo4wered-cli set AUTO_BOOT 3
    	c. lifepo4wered-cli set CFG_WRITE 0x46 
    15. Now reboot the Pi and start testing.

  • LiFePO4wered/Pi+ prototype

    Patrick Van Oosterwijck03/29/2017 at 22:41 0 comments

    Prototype PCBs for the higher power LiFePO4wered/Pi+ arrived from OSH Park, so I built up a prototype:

    I also hacked a #LiFePO4wered/18650 to charge at up to 3A instead of 1.3A as a base for this. This proved to be a bit of a challenge. The charger uses an asynchronous buck converter topology, and the little Schottky diode kept getting too hot and burning out. So I had to hack in a diode in a big SOD-128 package to make it work. It's still getting too hot but it's surviving so I can do the testing with this power manager. This is a basic problem with asynchronous converters: you can never get rid of the voltage drop over the Schottky diode, and at high currents, it becomes a power dissipation problem.

    The thermal image below shows the charger getting "too hot" when charging at 3A:

    The new TPS61235P boost converter is pretty amazing though. With the Raspberry Pi3 running with 4 cores at 100%, the CPU at > 100C, the boost converter is hardly breaking a sweat:

    Very nice! So time to put it on the electronic load and see how high it can go:

    And here is a thermal shot at this load current:

    I have to admit that eventually, the chip did a thermal shutdown at 1.8A. I lowered the load to 1.6A and it's been running for several days now (while charging, which provides a ton of heat on its own).

    Overall I'm very happy with this result. It's capable of providing twice the power of the current LiFePO4wered/Pi before going into thermal shutdown. The components were chosen to provide up to 3A, but I think I have to face the reality that in this form-factor, that is not going to happen. The PCB is just too small to provide any substantial heat sinking. If I want to get to 3A, I will have to change the design and go to a larger PCB.

    The #LiFePO4wered/18650 charger may actually be more of a limiting factor to get to 3A though. It's doing it in this prototype, but not at a healthy, mass producible temperature. I may need to look into a synchronous switching solution to get rid of the inherent voltage drop of the diode, which would always result in ~1.5W of power dissipation at 3A.

    In the meantime, this still provides a path to an improved LiFePO4wered/Pi3. 1.7A is a huge improvement over 0.85A. And even though 3A charge current seems to be out of reach for the #LiFePO4wered/18650, 1.8A may be a whole lot more manageable.

  • Power ping-pong

    Patrick Van Oosterwijck03/22/2017 at 20:22 0 comments

    It's funny how this project has evolved over time. It started with the #LiFePO4wered/USB, which I once connected to a Raspberry Pi as a demo for a Mini Maker Faire. It seemed to work well, and out of that the LiFePO4wered/Pi was born.

    Then people wanted to use the LiFePO4wered/Pi as a UPS for the Pi 3, which drew more power than the #LiFePO4wered/USB charger could support, so I created the #LiFePO4wered/18650 as a more powerful charger and the LiFePO4were/Pi3 was born.

    Now people are trying to power complete systems including hard drives and LCD screens from the LiFePO4wered/Pi3 and turns out it still isn't powerful enough. It seems the power craved by makers is insatiable. :)

    I have received reports of customers powering Pi 3s with LCD screens successfully, and others reported that this failed. The worst thing was that according to the reports the LiFePO4wered/Pi3 did not do a clean shutdown first but power just went away, indicating the boost converter went into thermal overload and switched off. I decided that instead of calibrating this with "it can power a Pi3 at 100% CPU", I needed to come up with some real numbers. So I got a nice electronic load from AliExpress and did some testing:

    Testing indicates that the maximum continuous load that doesn't cause the boost converter to go into thermal shutdown, at room temperature and with no extra cooling, is around 0.9A. The system had been designed with components rated for 2A, but on the tiny PCB it seems the boost converter just can't dump enough heat. Keep in mind that this is a thermal effect, so it takes time for the temperature to build up, meaning peak currents of 2A may be fine but are not sustainable over time.

    The LiFePO4wered/Pi was originally designed for a Pi Zero or Model A+ or B+ load, for which it works fine. Then the "ping" of making the charger more powerful made the LiFePO4wered/Pi3 possible, still using the same boost converter. But now people want to power all kinds of peripherals as well, and a "pong" to bump up the current capability of the boost converter may be in order.

    Luckily new and improved components arrive on the market all the time, allowing more powerful circuits in even smaller dimensions. One such component is the TI TPC61235P, which is a significant step-up to the MIC2876 I currently use. So I made a new layout based on this component and have prototype boards on order from OSH Park:

    Tight, but it all fit. Can't wait to test performance of these prototypes!

  • LiFePO4wered/Pi3 released!

    Patrick Van Oosterwijck12/20/2016 at 20:47 9 comments

    Kind of late I know, people following me on Twitter or looking on Tindie already knew. I had forgotten that I hadn't mentioned it here yet, sorry. :)

    So you can now buy a close-to-perfect power manager for the Raspberry Pi on Tindie! I wouldn't have dared to make such a claim about the LiFePO4wered/Pi, there were too many people who wanted to use it with the Pi 3 and who wanted input voltage monitoring and the behavior associated with that. But now that both these cases are supported with the LiFePO4wered/Pi3, we're getting there! :)

    A couple of things are still missing:

    • Adding RTC functionality would be great.
    • Some people don't need a big battery for long run times. They just want a small battery to shut down safely, but be able to run indefinitely at high load when plugged in. While the LiFePO4wered/Pi3 can be used for this, its battery is overkill. So... I have some ideas. :)

    If you like this and want to support my continuing development, please had over to Tindie and buy one!

  • Load tests LiFePO4wered/Pi3

    Patrick Van Oosterwijck12/13/2016 at 23:24 0 comments

    I did a couple more load tests with the LiFePO4wered/Pi3, the variant that uses the #LiFePO4wered/18650 as a charging base (and should be for sale very soon now). A lot of people seem to have applications where they want to use a Pi 3, use the LiFePO4wered/Pi as UPS, and also plug in a USB flash drive. Since flash drives are power hogs, I decided I should test some scenarios with a flash drive plugged in. So here are a couple of tests I did, with the LiFePO4wered/Pi3 charging from a 2A USB charger:

    • Pi 3, 4 cores @ 100%, ssh connection with a WiFi USB dongle (the built-in WiFi on my Pi 3 died), USB flash drive plugged in: slowly discharges (the system consumes more than the 1.33 A charge current).
    • Pi 3, 3 cores @ 100%, ssh connection with a WiFi USB dongle, USB flash drive plugged in: charges!
    • Pi 3, 4 cores @ 100%, ssh connection over Ethernet, USB flash drive plugged in: charges! :)

    I'm quite happy with these results. Systems running at 100% CPU continuously are very unusual. Using a WiFi USB dongle on a Pi 3 is very unlikely as well (unless breaking that silly flip chip without any protective packaging is common, which wouldn't be too surprising). I'm certain the on-board WiFi uses less power than a WiFi USB dongle, so I'm pretty confident that scenario with the CPU @ 100% will work as well. I really should get myself another Pi 3 some time so I can test it.

  • Firmware work

    Patrick Van Oosterwijck12/02/2016 at 21:14 0 comments

    I've been doing a lot of work on the LiFePO4wered/Pi firmware this week. Much of that was related to new functionality made possible by the ability to measure the input (USB) voltage with the new #LiFePO4wered/18650 base, but the quality time I spent with the code also resulted in some good improvements across the board, including for the standard LiFePO4wered/Pi. Here's a summary:

    • Auto boot when plugged in. Aside of the old "always boot when there's enough battery voltage" auto boot, being able to measure the USB input voltage enables the addition of an "always boot when there's enough input voltage and the USB power is present" function that so many people want.
    • Smart auto boot. It's fine and dandy to automatically boot when power returns, but it's kind of annoying if this prevents you from shutting the Pi down on purpose. Based on a suggestion from a user, I added smarts so that the auto boot only occurs if the system was shut down due to a low voltage condition, not when the user did a shutdown either with the touch button or from a program on the Pi. This is now an option for both the battery voltage based auto boot and the USB voltage based auto boot if it's available.
    • Auto shut down with timer. Many people want the Pi to cleanly shut down when external power goes away and boot up again when power comes back. This is now possible by combining the auto boot and auto shut down features (only with the new #LiFePO4wered/18650 base). The auto shut down will shut down the Pi if external power has been gone for a settable number of minutes. It is actually always active, but by default it's set to 65535 minutes and the battery won't last that long, so the feature is effectively disabled. :) If you want the Pi to immediately shut down when power goes away, set the auto shutdown time to 0. If you want the Pi to keep running across power outages up to 20 minutes, set it to 20. If the outage is longer than 20 minutes the Pi will be shut down with plenty of battery power left.
    • Improved wake timer accuracy. While implementing the auto shutdown timer, I implemented a new minute timer subsystem that's much better than the one I had for the wake timer. So now the wake timer also uses this new minute timer and benefits from much more accurate timing. It still uses the micro's internal RC oscillator, but it's much less dependent on variation due to other stuff going on in the code. As an example, I just ran a test of the auto shut down feature with the time set to 30 minutes, and it triggered a shutdown at 29:59. Nice! :)

    The improvements that are dependent on measuring the USB input voltage will be available when the version with #LiFePO4wered/18650 base goes on sale, the other improvements will be in every LiFePO4wered/Pi unit going forward!

  • Pi 3 testing with 18650 battery

    Patrick Van Oosterwijck11/24/2016 at 00:57 0 comments

    I'm making good progress on the new #LiFePO4wered/18650 base for Pi 3 versions of the LiFePO4wered/Pi, see this project log.

    Meanwhile I've been doing some stress testing on my first prototypes. I've been running a Pi 3 at 100% CPU for 5 days straight, powered from the prototype (plugged in of course), covered with a box to contain as much heat as possible, and it's been rock solid. Yay! :)

    So now that I have a new prototype that is pretty much identical to what I intend to run in production, I'm going to do the same test with it:

    First I'm having the battery run out, then I'll let the system charge while under high load for a week or so and see if everything behaves well. If it does, I'll go ahead and order production panels.

View all 48 project logs

Enjoy this project?

Share

Discussions

Adnan Kurt wrote 09/02/2016 at 12:17 point

Nice project. Thanks for sharing. Is your MSP430 code open? Or should we buy the unit?

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 09/02/2016 at 14:49 point

It isn't open yet, but I fully intend to open source it once I have achieved some return on my investment by selling units.  I have to figure out how many units I should sell before that happens.  You can speed that up by buying one, the release sale is still going on! :)

  Are you sure? yes | no

Adnan Kurt wrote 09/02/2016 at 15:12 point

Now I've noticed the sales link. Thanks for reminding. Keep up with nice work! :)

  Are you sure? yes | no

Renos wrote 08/29/2016 at 05:50 point

Excellent work. Can't wait for it to be available for purchase :)

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 09/02/2016 at 14:45 point

Thanks Renos.  You can now buy it on Tindie:

https://www.tindie.com/products/xorbit/lifepo4weredpi/

The release sale is still going on, so hurry if you want it cheap!

  Are you sure? yes | no

Renos wrote 09/02/2016 at 14:47 point

Already ordered 2. Saw the news on twitter and ordered immediately :)

  Are you sure? yes | no

CaptMcAllister wrote 08/11/2016 at 21:04 point

This is a very cool project.  I used to get questions on whether my AA voltage booster could power a raspberry pi, and I always had to say definitely not.  Even two in parallel couldn't.  I'd refer people to this project as the "right" way to do it.

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 08/11/2016 at 21:31 point

Thank you for your kind words.  It takes comments and encouragement like this to get projects from prototype to production.  I appreciate it! :)

  Are you sure? yes | no

CaptMcAllister wrote 08/11/2016 at 21:38 point

You're welcome.  I think you'll achieve some very nice sales with this.  If you have any questions about crowdfunding, feel free to contact me.  My modest campaign was successful and I learned so much.  I'd love to share the lessons I learned the hard way!

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 08/11/2016 at 22:19 point

Thanks!  I considered doing a crowdfunding campaign, it's definitely nice to be able to have a known set of customers before you start building product.  But it seemed like it would cause a lot of extra stress that I could do without.  Then I received the $1000 grand for being a Hackaday Prize finalist and that made it possible to do the build without crowd funding.

Of course, if you're right and I do get a lot of sales, things may turn out to be just as hectic. :)

  Are you sure? yes | no

atlrob wrote 07/08/2016 at 21:12 point

Have you considered making one layout using the adjustable version of the MIC2876 rather than maintaining separate layouts for 3.2v and 5v?  (Position the voltage divider resistor pads to make hand SMD soldering/tinkering possible.)

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 07/09/2016 at 04:14 point

There are two reasons not to do this.  First of all, the layout is really tight and I don't have room for external voltage divider resistors.  More important though, the only good excuse to power the Pi with an out-of-spec voltage of 3.2V is the increased efficiency of directly feeding the battery voltage to the Pi, without using a boost converter.

  Are you sure? yes | no

hyperzap wrote 05/16/2016 at 01:53 point

In the 3V version, are you just feeding 3.2V-4.2V into the 5V pin of the Pi and so far it has no worries? Can I do that? (I want to power my Pi with a LiPo without a boost converter, just wondering if this approach has any issues in a setup without any USB devices but using ethernet).

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 05/16/2016 at 16:01 point

Yes, the 3.2V version just feeds the battery voltage into the 5V line and it works beautifully, I've had no issues whatsoever.  The reason is that the Pi, and most USB devices actually just convert the 5V to a lower voltage anyway to power the chips.

I've decided that since I want to sell this as a product, I'm going to produce the 5V version first to avoid any complaints about powering the Pi with an out-of-spec voltage.

But sure, for your own hacks go ahead and power the Pi directly from the battery, it will work fine for the Pi and should be OK for most USB peripherals such as Bluetooth and WiFi dongles.

  Are you sure? yes | no

hyperzap wrote 05/16/2016 at 22:47 point

Awesome :) Out of curiousity, did you ever profile what the cutout voltage was (ie: the voltage it which the Pi was unreliable or reset)?

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 05/17/2016 at 15:34 point

In the LiFePO4wered/Pi, I instruct the Pi to shut down at 2.95V.  I think in my testing it started to become flaky at around 2.7V.

Of course this was just at room temperature and not across a statistically relevant sample of Pis.  Since I have no way to get such data, this uncertainty is another reason for me to choose the 5V version for production since it follows the Pi spec.

  Are you sure? yes | no

Mario Ray Mahardhika wrote 04/19/2016 at 17:05 point

I'll be waiting for production release, having a full smartphone size portable computer is fully achievable by that time :)

I wonder if you're willing to create more battery slot version as if I'm gonna use it with 5" LCD touchscreen + Pi 3 (instead of Pi Zero), it certainly will require big battery power.

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 04/19/2016 at 18:51 point

I have been wondering about that myself.  In principle, I can just add parallel cells to increase capacity.  The only problem is that the little charging chip would take quite a while to charge a larger capacity cell, since it has a 1A limit.  USB chargers have similar limits though.  I'm starting to look into USB Type C.

  Are you sure? yes | no

Steve wrote 03/19/2016 at 08:14 point

+1 for Kickstarter. What do you expect one would cost retail? I'm very interested in a few but the default 30$ for these devices is a little much for my taste.

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 03/21/2016 at 17:17 point

Thanks Steve!

I'm adding a project log about the cost issue...

  Are you sure? yes | no

bagdala wrote 03/18/2016 at 07:59 point

I have this one:

https://pi.gate.ac.uk/pages/mopi.html

But I have to admit yours look much more appealing . I'm in line for one!

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 03/18/2016 at 17:03 point

Cool!  I'm not sure if it's too bad or a good thing I didn't know about it... If I had, I may not have bothered making mine! ;)

Very impressed you managed to do a successful Kickstarter.  I'm considering doing one for this project but I'm not sure if I can play the marketing game well enough to make it succeed.  Any tips you could share on what worked well and what didn't?

  Are you sure? yes | no

bagdala wrote 03/18/2016 at 17:09 point

Sorry if i misled you, I meant to say I purchased this one. I'm just a end user not involved in development of particular product in any way. 

That being said, go for Kickstarter you can't fail ! You definitely have market  for it. 

  Are you sure? yes | no

Vlad Conut wrote 03/08/2016 at 13:39 point

any chance you will make the hw opensource ? i am interested in making a backup battery for my raspberry pi which will preferably provide a clean shutdown in case of power lose. 

anyway great project and good luck in the pi zero contest :)

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 03/08/2016 at 17:12 point

Thanks! :)

I'm considering open sourcing the hardware.  There honestly isn't too much to it, the bulk of the functionality is in the firmware.

At the moment I'm trying to figure out where to take this.  I didn't get enough response to my 3V/5V question to choose a clear direction.  I'm also wondering if I can take on the cost of doing a build and hoping for enough sales to recover it, or if I need to do a Kickstarter or pre-sales to get the funds to do it.  If I do a Kickstarter, I'd want to keep the open sourcing of HW and FW as stretch goals.

So, no clear answer at the moment, sorry. :)  I'm pretty sure everything will be open sourced eventually, but I don't know when.

  Are you sure? yes | no

Vlad Conut wrote 03/09/2016 at 11:56 point

no problem :) i will still follow the project 

It really depends on what you want to do with it - i have learned that if you try to make it do a lot of features you will create something that wouldn't appeal to a lot of people.

My design goal is simple provide battery backup for just enough time to do a clean shutdown its not because i have valuable data on the device, but that ofcourse is something to consider, is that my time is more valuable doing something else that setting up the rpi once the sdcard goes bad

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 03/14/2016 at 15:15 point

I uploaded the schematics, they're available in the files section now! :)

  Are you sure? yes | no

James Newton wrote 02/09/2016 at 01:27 point

Consider adding charging / solar panel charging for remote applications? 

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 02/09/2016 at 21:04 point

Well, the base LiFePO4wered/USB module does provide USB charging, so if you have a regulated 5V output solar panel, you can use it.

For a full featured MPPT solar solution, I'm working on one.  It's going to be significantly bigger and more costly with a 10W panel and 10Ah battery to be able to run a Pi through 4-5 days of dark time.

  Are you sure? yes | no

James Newton wrote 02/09/2016 at 23:03 point

I'm interested in something that would fit on a hat... for this:

https://hackaday.io/project/9497-wearable-hud-hmd

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 02/09/2016 at 23:23 point

Hmm, I think you'd be hard pressed to run a Pi with a panel that fits on a hat I think.  The Pi takes about 0.6W, and solar panels are very inefficient.  A standard solar cell is ~15% efficient, the sun at zenith generates at most 0.1 W/cm2, so you'd need ~40 cm2 to run the Pi if you were in full zenith sun all the time, continuously.  In reality, you have conversion losses, significantly less solar power than the maximum zenith value, cloudy days and day/night cycle.  Also, you probably want flexible solar cells which are less efficient I think.  Assuming you have some sun time every day, I'd say you should start with at least 300 cm2.

  Are you sure? yes | no

James Newton wrote 02/10/2016 at 01:51 point

The Pi Zero is 160mA at 5v so 0.8W max... 0.6 W average is probably right. But there are a lot of other things running as well. I totally agree a hat sized solar panel isn't going to keep up. But... it would /extend/ the life of the unit over the course of a day outside. It's an interesting option, not a complete solution.

  Are you sure? yes | no

James Newton wrote 02/10/2016 at 01:51 point

The Pi Zero is 160mA at 5v so 0.8W max... 0.6 W average is probably right. But there are a lot of other things running as well. I totally agree a hat sized solar panel isn't going to keep up. But... it would /extend/ the life of the unit over the course of a day outside. It's an interesting option, not a complete solution.

  Are you sure? yes | no

eric wrote 03/22/2016 at 15:33 point

What if it can go to sleep the majority of the time. The area needed would be much smaller. And even the taking the penalty of not MPPT might be acceptable.

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 03/22/2016 at 16:04 point

Definitely, if you're asleep most of the time you can get away with a much smaller panel.  One of the reasons I added the wake up timer. :)

  Are you sure? yes | no

mark gunderson wrote 02/08/2016 at 16:12 point

This is exactly what my Pi needs. There's a similar product called Witty Pi I've come across. Are you familiar with it?

http://www.uugear.com/witty-pi-realtime-clock-power-management-for-raspberry-pi/

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 02/08/2016 at 19:37 point

Hey Mark,

Thanks for pointing out this product, I was not aware of it!  Looks neat, and costs less than I can likely produce the LiFePO4wered/Pi for.  :-/  There is definitely overlap in functionality (clean boot/shutdown), but there are differences as well.

The big plus of the Witty Pi is that it has a real RTC, so wakeup time is very accurate.  The LiFePO4wered/Pi doesn't use a crystal, so wakeup timer accuracy is not great.

On the other hand, the Witty Pi does not provide backup power for UPS or battery powered functionality.  And since it doesn't have backup power, it cannot do a clean shutdown when power is removed.  So there's still hope for this project. :-)

Other than that, it looks like LiFePO4wered/Pi leaves more GPIO available (actually all GPIOs are still available), and the Pi-side software is in C instead of Bash (that's just a matter of taste, not better one way or another).

Thanks for pointing this out!

  Are you sure? yes | no

mark gunderson wrote 02/08/2016 at 23:30 point

UPS and emergency shutdown would probably have saved more than one SD card of mine over the last couple years.

  Are you sure? yes | no

ajlitt wrote 02/03/2016 at 15:57 point

This is a well thought out project!  I've been toying with the idea of adding a LiPo charger/controller to my WiFi Pi board but keep getting stuck on the safety and usability.  I hadn't even considered LiFePO4 until now, and am going to pick up a 4pk of 14500 cells later today to play with.

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 02/03/2016 at 18:48 point

Thanks!  I actually have been toying with the idea of making a combined board that adds ESP8266 WiFi to the LiFePO4wered/Pi functionality. *lol*

Too many projects, so little time... :)

  Are you sure? yes | no

ajlitt wrote 02/03/2016 at 20:19 point

I was thinking about just adding a 5V out buck/boost to my board so that people could bring their own battery.  Your LiFePO4wered USB module would fit well with that...

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates