Close
0%
0%

battery2pi

a battery operated Pi Zero using a minimum of parts

Similar projects worth following
Did you know the Pi Zero (and a few other models) will operate from a power supply voltage as low as 3.3 volts? That means you can power it directly from a single Lithium rechargeable cell. And with a little hacking on the battery protection module, you can use a single momentary switch to turn it on, and the Pi can turn it off.

(And before someone writes something in the comments section, I know that using one of those USB battery packs would be easier. But that wouldn't be a hack, would it?)

Anyway, what would this project be good for? How about making some cheap Pi Zero throwies? A bunch of used batteries, Pi Zeros, and WiFi adapters, and you can sprinkle access points all over the place. How much fun would that be? Or maybe FM transmitter throwies...

WARNING: ANY PROJECT THAT USES LITHIUM BATTERIES MAY RESULT IN FIRE OR OTHER BAD THINGS. USE THESE INSTRUCTIONS AT YOUR OWN RISK.

This is a minimal parts, minimal cost battery powered Pi Zero. All you need is a Pi Zero with SD card, a new or used LiIon or LiPo cell, a battery protection board (often part of the cell, or it can be salvaged), a 1K resistor, and some bits of wire. You can tart things up a bit by adding a power on push button, an on-board charger, and voltage monitoring.

All is not perfect, of course - the Pi Zero USB port won't provide 5 volts, just the raw battery voltage. Consequently, some USB devices won't work. But the ones that run on 3.3V internally will work just fine!

  • oops

    mincepi02/22/2017 at 05:05 0 comments

    I had mis-typed the project title: I forgot the trailing "i". I hope it doesn't cause anyone problems.

  • will it blend

    mincepi02/21/2017 at 17:20 0 comments

    soldered a wire to the resistor connected to the CS pin (boy, that resistor is tiny) and tested things out on a breadboard. It works!

    Next I needed to figure out how to allow the Pi to shut itself off. I came up with this circuit:

    The Pi turns itself off by setting GPIO4 to pull-down (it's normally pull-up). There is a major problem with this circuit: when the Pi power voltage drops below 3.3 volts it will reset the Pi but GPIO4 will not change to pull-down, so the Pi will not power off. It WILL eventually turn off when the battery drops below it's low voltage protect voltage, but that's too late: permanent battery damage may occur. Those Lithium batteries are pretty sensitive!

    To fix this I came up with this circuit. It requires removing the 1K resistor from the protection module, but in return it doesn't require a transistor:

    This circuit has a small problem: the on switch has to be held down until the Pi can set GPIO4 to a low output. The quickest this can be done is in about 4 seconds, using a device tree overlay, so you have to hold the on button down for 4 seconds. I think I can live with this.

    By the way, did you know that if you set a GPIO's pull state, it will survive a reboot? It only gets set back to the default state when the power is cycled. The GPIO's input/output state doesn't survive a shutdown or reset though: they all get set to inputs. So you have to use the input/output state change to power off the Pi if you want it to power off on a low-voltage reset or shutdown.

    I tested the final circuit, and it works great! I issue a shutdown command, and after the PI halts, the power turns off automatically. Just like a real computer. It's kind of cool after years of powering off Pis manually! Current draw when off is 55 microamps. This seemed like a lot until I calculated that an 18650 cell could provide this current for 4 years!

  • we don't need no power switch

    mincepi02/21/2017 at 17:15 0 comments

    Yo know what the problem is with power switches? They're bulky, especially thickness-wise. And all of the ones I have in my junk box are way too large. The best solution to this problem is an electronic power switch like this one. And you get the added capability of having the Pi shut it's own power off.

    While pondering this problem, I realised that the electronic switch is just a pass MOSFET, some electronics, and push-button switches. And the battery protection module is a pass MOSFET (actually back-to-back MOSFETs) and some electronics. Maybe I could add push-button switches and get the same functionality?

    I searched for images of battery protection modules on the Internet. It seems the DW01 chip is pretty common. So I took a look at it's data sheet: it disconnects the load if it's CS pin rises more than 150mV above ground and reconnects it if it's lower than 150mV. So, connecting CS and V+ with a switch will disconnect the load, and CS will stay at V+ once the switch is released. To connect the load, momentarily apply power to the load with a switch: this will lower the CS pin to ground potential and turn on the MOSFETs, and they will stay on once the switch is released. There, I just made an electronic power switch by adding two push-buttons to the battery protection module!

    Here is the unmodified protection module:

    Here is the protection module with added switches:

  • we don't need no boost converter

    mincepi02/21/2017 at 16:13 0 comments

    As I've detailed here, some models of Pi can be operated from a power supply as low as 3.3 volts. So, I've decided to build a minimum-cost battery operated Pi Zero.

    I'll need the battery of course, and it should have a protection module: I don't want any fires. And a power switch of some kind. I'll also need some way to charge the battery. And before you say anything, an all-in-one charging-protection-boost module is cheating!

    The downside of this setup (there's always one, isn't there) is that some USB devices won't work at 3.3 volts. But my WiFi adapter certainly will, so I plan to make a battery operated access point as a test case.

    Let the hack begin!

View all 4 project logs

Enjoy this project?

Share

Discussions

mincepi wrote 02/22/2017 at 04:59 point

Thanks for the kind words. I've added quite a bit since you viewed the project, and I've still got more to add. So check back later!

  Are you sure? yes | no

Arsenijs wrote 02/23/2017 at 11:12 point

Will do! Also, it's better if you reply to comments, instead of writing just another comment - then the person you're answering is going to get a notification =)

  Are you sure? yes | no

Arsenijs wrote 02/23/2017 at 11:12 point

Like this, press the "reply" button under the comment you want to answer, then one more textbox will appear.

  Are you sure? yes | no

Arsenijs wrote 02/21/2017 at 23:44 point

Hi! Great projects from you, as always :-)

  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