LiFePO4 battery technology, made easy for makers - a bigger version

Similar projects worth following
High power and capacity version of my LiFePO4wered/USB project.

Provides a convenient module for makers to use LiFePO4 technology in their projects, with all the advantages of safety, cycle life into the thousands of cycles, high power density and 2.9 - 3.6 V voltage range that allows you to power 3 V circuits without a regulator. Very nice for use with modules such as the ESP8266 and ESP32 and other WiFi modules that require a power supply that can handle high peak currents without drooping. At the same time, the charging circuit is disconnected when not powered for minimal leakage when not in use, allowing long standby times.

This project came out of the need for the #LiFePO4wered/Pi to have a high power / high capacity version that works well with the newer, more power hungry versions of the Raspberry Pi such as the Pi 2 and Pi 3.

While the original #LiFePO4wered/USB baseboard works when the #LiFePO4wered/Pi is used as a battery power source for the Pi 2 or Pi 3, it fails to provide enough charge current to use it as a UPS for these Raspberry Pi versions. This is both related to the charge circuit (a linear charger, becoming thermally limited at high currents) and the cell used (a AA or 14500 size cell with a maximum charge current of ~500 mA). The Pi 2 and 3 take out more current than the charger can put into the cell, and eventually the cell charge runs out even if the system is plugged in.

This project aims to provide a power source for the #LiFePO4wered/Pi that will be able to provide continuous UPS functionality, even for a Pi 3 @ 100% CPU use. To do so, it uses a larger cell that allows charge currents up to 1.5 A and a switch mode charger that is much more efficient and hence produces less heat.


Schematic rev 2

Adobe Portable Document Format - 21.74 kB - 07/16/2021 at 20:13


  • 1 × CN3801 Power Management ICs / Switching Regulators and Controllers
  • 1 × DMG2305UX Discrete Semiconductors / Power Transistors and MOSFETs

  • New panel, new stock!

    Patrick Van Oosterwijck07/14/2017 at 16:59 0 comments

    I had run out of my first PCB run of panels so I decided to do a quick improvement before ordering new ones. I had noticed that some of the surface mount USB connectors were mounted slightly crooked. Nothing major, but still something that nags on a perfectionist like me. ;) So I switched to a different USB connector that has alignment features going into the board to help keep it straight. I'm very happy with the results:

    No more crooked connectors! One side effect is that the alignment features are through hole, and the holes interfered with the original location of the VIN and GND connection pads on the bottom of the PCB. So I had to move them to work with the new layout:

    I think there is enough clearance between the VIN pad and the USB connector holes (that are ground) to not cause a problem, but just a heads up to those using the VIN pad to take care with their soldering. :)

    I have a couple of units of the old design left but all new stock after that will have these improved connectors!

  • In production!

    Patrick Van Oosterwijck12/20/2016 at 21:31 0 comments

    The LiFePO4wered/18650 is now in production! Here's a video of the panels being built at Colorado Tech Shop:

    Since I primarily designed it as a new base for the #LiFePO4wered/Pi, this combination is for sale now on Tindie as the LiFePO4wered/Pi3. It's not yet for sale as a LiFePO4 charge module on its own like the #LiFePO4wered/USB, but I plan to do so soon. The problem is mostly that the documentation is not yet done. :)

    In the mean time, you can get it touch with me directly if you want to buy some for your projects.

  • Solar power!

    Patrick Van Oosterwijck12/12/2016 at 19:25 1 comment

    One really neat feature of the LiFePO4wered/18650 that I haven't talked much about is the ability to power it from a 5-7V solar panel. I've only been able to test this just now because the component reel I was waiting for makes it possible to do this, since now the input cap is rated for 16V instead of 6.3V.

    The charge controller I used has MPPT functionality with a fixed voltage set point. This means that the charger will reduce charge current to prevent the input voltage from sagging below this voltage. On the LiFePO4wered/18650 I have set this set point to 4.66V, which is a pretty decent value (not optimal but usable) for small 5-6V solar panels.

    At the same time, this feature also makes it so the LiFePO4wered/18650 can dynamically adjust to the actual output capacity of a USB charger. Although reaching a maximum charge current of 1.33 A when connected to a powerful 2A USB charger, it will not overload a less capable power source such as a computer USB port. The charger will just limit the charge current when the voltage starts to droop. This is why the MPPT set point is at 4.66V: a USB power source's minimum voltage can be 4.75V so we need some headroom.

    The LiFePO4wered/18650 has convenient solder pads on the bottom where you can connect an input source other than micro USB:

    And here's the system out in the sun, charging from a 6W Voltaic Systems panel and powering a Pi 3 using the #LiFePO4wered/Pi power manager:

    Hard to see the LEDs in the bright Colorado sunlight, but everything is on and charging. :)

    I will have to do some more testing to determine what acceptable limits on the input voltage are. The ceramic input cap loses capacity when under higher bias voltage and the peak-to-peak ripple on the charge current will get worse as well, so it will likely be less than the 16V cap rating.

  • Ready for production

    Patrick Van Oosterwijck12/12/2016 at 18:44 0 comments

    The last reel of components I needed to start production (22uF / 16V caps) arrived from Digi-Key over the weekend, so I now have everything ready for production!

    Here's the box of stuff ready to go to Colorado Tech Shop:

    They will try to have my panels built by 12/14, so hopefully I can start selling by the end of the week!

  • Panels have arrived!

    Patrick Van Oosterwijck12/03/2016 at 00:29 0 comments

    Fifty panels and a framed stencil have arrived, and they look great! I have all parts in my possession, production is getting really close now. :)

  • Second prototype build

    Patrick Van Oosterwijck11/24/2016 at 00:45 3 comments

    Second prototype PCBs came in from OSH park, time for a new build! Only small changes, added a resistor, took away an optional cap to make room for the resistor, and changed the schottky diode to a smaller package.

    Here's before reflow:

    After reflow:

    And put together with my production battery holder and battery:

    Now it's time for some more testing! Putting it into a LiFePO4wered/Pi and will be running that with a Pi 3 @ 100% for some serious load testing!

    Since I'm assuming this prototype will work fine (I'm an optimist, or naive, or maybe both), I also went ahead and created a panel for production:

    When my testing has given me enough confidence, this panel will go to the fab!

  • First test results

    Patrick Van Oosterwijck11/10/2016 at 18:27 0 comments

    First test results are in, and they are largely positive!

    I did hit a small snag at first. The LiFePO4wered/18650 would power a #LiFePO4wered/Pi / Raspberry Pi 3 just fine, but when I plugged in the USB power, it would reset the #LiFePO4wered/Pi and kill the Raspberry Pi power. Not good for something that needs to be a UPS! :-/

    Taking a look with my 'scope, this is what I saw the battery voltage do when the USB power was plugged in:

    Yikes! No wonder the micro was reset--the voltage pretty much spikes down to zero.

    I traced the problem to my charger disconnect circuit. I use a MOSFET to disconnect the charger from the battery when USB power is removed, limiting battery leakage into the charging circuitry. The manufacturer indicates this leakage is about 30 uA, the MOSFET switch reduces this to 1 uA or so (take these numbers with a grain of salt, I haven't tested this thoroughly yet). What seemed to be happening is that when the USB was plugged in, the discharged 22 uF output cap of the charger would instantaneously suck the charge out of the little 4.7 uF input cap of the #LiFePO4wered/Pi. I solved the problem by adding a gate resistor to the MOSFET which, in combination with the gate capacitance, would delay turning on of the MOSFET enough for the output capacitor to get charged first. No more resets! :)

    I wanted to know if the new charger would keep up with the worst case scenario for the current #LiFePO4wered/Pi: charging a near-empty cell with high load on a Pi 3. The current charger can't do it, it's limited to 480 mA charge current and thermal limiting problems are the worst when the battery voltage is low. I threw the worst case at it: A Pi 3 with all 4 CPU cores at 100%, Ethernet connected, the Raspberry Pi CPU at >100 degrees C and battery nearly dead. Here's a thermal image of the torture setup:

    I'm very happy to say that the LiFePO4wered/18650 prototype passed with flying colors! :) The heat production stayed reasonable, the system was stable through the night and the battery was charged in less than 6.5 hours (didn't check often enough to see when it was actually done)!

    Very positive indeed. I've started work on the next prototype, hopefully the last one before making a production panel.

  • First prototype build

    Patrick Van Oosterwijck11/09/2016 at 18:10 0 comments

    Always a good day when you get a package from OSH Park. :)

    As you can see, I went fancy with the silkscreen this time. I have to say I like it a lot, looks much more "branded" now compared to the simple vector font.

    Cut a plastic film stencil on the Tinkermill lasercutter, this worked fine since there aren't any tiny pitch components. I placed the parts by hand, here's a picture of two proto's ready to be reflowed:

    And after reflow. Looking good!

    As you can see I used a different inductor on the two prototypes. I'm making some variations to see what works better.

    Here's a picture of the completely built-up unit with 18650 LiFePO4 cell:

    And a prototype used with the #LiFePO4wered/Pi:

    Now it's time for testing, first impression is good--as you can see, the Pi is running. :)

View all 8 project logs

Enjoy this project?



Dennis Fleming wrote 01/25/2020 at 03:16 point

I'm still very much playing with the board right now, but I'm having an issue that I assume is pilot error. I have the LiFePO4wered/Pi+ (14500 Battery) w/ Stackable Header connected to a Pi Zero.  Connected to the RPi are HDMI and a powered USB 2.0 Hub which has a keyboard, ethernet and WiFi.  The RPi boots up without a problem, but shuts down after a short period (1-2 minutes).  Any direction would be helpful.

  Are you sure? yes | no

Dennis Fleming wrote 01/29/2020 at 18:05 point

As expected, it is some sort of pilot error.  Things seem to be working well now.

  Are you sure? yes | no

bootdsc wrote 08/21/2019 at 16:40 point

I bought one of these off tindie years ago and have used it in many rpi projects its really the best possible way of making a portable rpi so thank you. Two questions, whats the max output current that can be supplied to 5v when unteathered and can a momentary switch be wired up in place of the capacitance switch? I use the board with two 26650 cells in parallel for longer run times.

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 08/22/2019 at 14:54 point

Hi, looks like this question is more related to the #LiFePO4wered/Pi, but I'll answer it here.

The LiFePO4wered/Pi3 (which uses this project as charge base) max continuous output current is 0.85A.  If you need more (for Pi 3B+ and Pi 4 you definitely do), there's the #LiFePO4wered/Pi+ which supports 2A continuous current.

If you want to use a momentary switch with the LiFePO4wered/Pi3, connect it in series with a 100pF cap between the T and G pads.  The #LiFePO4wered/Pi+ is more suitable for hacks like this and has 2 through-hole BTN pads where a momentary switch can be directly connected.

  Are you sure? yes | no

Clay Zuvich wrote 04/26/2019 at 17:05 point

Hi!  This battery charger is exactly what I've been looking for on my outdoor Adafruit Feather projects (LiPo's work but are very volatile).  Would it be possible to purchase some from you to try on my own projects?  I'm currently working on a prototype that I hope one day to take to market, and it'd be great to try these out!

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 08/22/2019 at 14:48 point

Hi Clay, sorry I didn't see this but we got this figured out over email.  How's the project going?

  Are you sure? yes | no

Clay Zuvich wrote 08/26/2019 at 13:31 point

It's going well!  I ended up going with the MCP73123 and so far the batteries seem to be doing great!  Thanks for all of the help.

  Are you sure? yes | no

Kenny MacDermid wrote 03/03/2017 at 17:06 point

Is this version required for an ESP8266 (or ESP32) setup? I see it mentioned in the description but there's also a comment on the /USB version saying that one worked fine for someone.

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 03/03/2017 at 19:48 point

Both will work fine to power an ESP8266 or ESP32, but of course you will get more run time with the bigger battery.

If you want to buy this, contact me on Tindie (the docs aren't done yet).

  Are you sure? yes | no

koalatron.9000 wrote 02/16/2017 at 08:20 point

Hey boss! I'm working on version 2 of a dead drop reader. The original was built out of a rpi 3 and was powered by a portable battery bank for charging phones. Tt created a wifi access point that i would then VNC through my phone and up/download contents. That way if someone electrified the dead drop, I'd be frying a $35 dollar board instead of my laptop or phone. The problem was it was too cumbersome. I was basically holding 2 walkmen in one hand and my phone in the other. So I thought to update it to a smaller form with a built in battery. I figured i'd use an 18650 since I have enough lying around. As i was figuring out the electrical side of things/the supply list, I came across your product! you took care of just about everything for me! which is great since I've never done anything hardware/electrical. I'm more of a code guy. The charger, The on/off switch (way cooler than my idea), and the safe shut down. Man, you killed it with this thing. Given my hardware noob-ness, I was wondering if I could just  place the Zero on the back of this and solder wires to the respective unpopulated GPIO pin holes? Thanks and expect  an order from SoCal on payday!

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 02/16/2017 at 21:24 point

Thanks! :)

This is more related to the #LiFePO4wered/Pi but yes, you can arrange things differently with extra wiring.  By default the LiFePO4wered/Pi/Pi3 sits next to the Pi, but you can use a ribbon cable or separate wires to arrange them like you describe.  Just make sure to keep the wires as short as possible and don't use very thin gauge.  The LiFePO4wered/Pi has a pretty small output capacitor and for stable operation the inductance between the power system and Pi should be kept as small as possible.

If it would make things easier I can ship you one without the female 8-pin header installed, in case it might simplify your wiring.  Just let me know when you place the order.

Looking forward to seeing what you build with it. :)

  Are you sure? yes | no

Eric Smith wrote 01/16/2017 at 03:57 point

I'm working on a project that will use a low-power microcontroller for long battery life; the Raspberry Pi uses too much power. I'm considering using the Nordic nRF52 which also provides Bluetooth Low Energy.  I want to use LiFePO4 for the same reasons you've used it. I hadn't heard of the CN3801, so I was looking into the MCP73123, BQ24620, LTC4098, or LTC4156, but the CN3801 looks much easier to use and I suspect is probably less expensive. Is the charging portion of your circuit much different than the examples in the CN3801 datasheet?

Were you able to find a distributor for the CN3801, or are you buying direct from the vendor in China?

Do you have a reliable source for high-quality LiFePO4 18650 cells? My searches don't turn up anything that looks like a good source.

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 01/16/2017 at 17:01 point

Hello Eric,

The MCP73123 is what I use on the #LiFePO4wered/USB and original #LiFePO4wered/Pi, but it's a linear charger so while it's fine for low power charging it gets too hot when dealing with higher charge currents needed for the LiFePO4wered/Pi3 version.  The CN3801 has been a pleasure to use, it seems to be working very well and since it's a switcher there are much less heat problems.  My circuit is similar to the example in the datasheet but I added a MOSFET that disconnects the charger from the battery when there is no input power to reduce leakage current back into the charger.

I buy the part directly from China (from their branch in Hong Kong actually).  It's not convenient and you need to buy in volume.  They did send me some samples though.

As for sourcing the batteries, I'm using O'Cell.  I've had some bad ones among the AA size ones, but the good ones seem to stay good and I've tested that they actually last 2000+ cycles (the test is still ongoing).  I haven't found any bad 18650s yet.

  Are you sure? yes | no

phil.davis wrote 12/01/2016 at 11:04 point

Looks very useful. I have RPi3 with Temperature Sensor and want to put it outside. Of course the outdoor power socket is not on UPS, so I need something just like this to provide continuous power across power cuts of somewhat unknown duration - I am in Nepal! At the moment the cuts are only minutes, but could easily be hours. The 1500mAh is only going to last up to a couple of hours, but that is good 99% of the time.

  Are you sure? yes | no

Mikey wrote 11/28/2016 at 19:40 point

Are you planning on releasing it with the option for a JST battery connector? -- I'd like to use it with one of the bigger Adafruit 6600 mAh batteries to make a portable handheld game (RetroPI, etc.). -- 1500 mAh seems severely limited for that kind of usage... -- Also, is this compatible with 3.7v / 4.2v batteries, or only 3.6v / 4.1v?

  Are you sure? yes | no

Mikey wrote 11/28/2016 at 19:43 point

Or perhaps would there be an option to chain in multiple batteries (in parallel)? (i.e. 3000 aH seems like it would be a good fit...)

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 12/20/2016 at 21:26 point

Hello Mikey,

You can add multiple LiFePO4 cells in parallel to get more capacity, or use one bigger LiFePO4 cell of course.  This is only compatible with 3.2V / 3.6V max LiFePO4 cells, not standard LiPos.  Nothing planned for a JST connector option, I'm afraid too many people would connect it to a LiPo... :-/

  Are you sure? yes | no

Mika wrote 11/27/2016 at 18:20 point

Getting rpi3 powered by 18650 seems like a very good idea. Is there any information about the approximate cost when its completed ?  Also, will this device have Fcc / CE certification?

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 11/28/2016 at 00:08 point

Hello Mika,

The 18650 version will probably be an option that will add $4-5 to the LiFePO4wered/Pi currently on Tindie:

Unfortunately I don't have a budget for certification.  Also, it is a module that has no use on its own, it's only useful in combination with other circuitry such as the Raspberry Pi and would have to be certified in the final application.

  Are you sure? yes | no

David wrote 11/27/2016 at 10:42 point

what a bout a standard lithium ion version that could replace the expensive Powerboost 1000C ? 

  Are you sure? yes | no

Patrick Van Oosterwijck wrote 11/28/2016 at 00:19 point

There are a lot of options for standard lithium already, that's why I'm focusing on LiFePO4.

I also don't like standard lithium cells and am doing this as part of an effort to promote the use of LiFePO4.  Too many people are building stuff that is supposed to last and are using standard commercial lithiums that will die on them after a couple hundred cycles.  Higher capacity, sure, but only for the first 100 or so cycles.

Also, for UPS use, standard lithiums really don't like being held at a high voltage, which will make them die even faster.

  Are you sure? yes | no

Guzzi wrote 11/28/2016 at 09:47 point

Even the LiFePO4s are more expensive than questionable quality 18650s, I prefer them for some projects. Much more reliable and for micro controller projects with 3,3V supply voltage ideally suited. No voltage regulator needed and you don't have to fear that they eventually catch fire  if for whatever reason they are somehow abused.
I like Patricks idea of promoting LiFePO4s.

  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