Adding A Power Source

Obviously we want to make this camera portable, so we're going to need a battery. I like to use "emergency cell phone chargers" because they can last for a while, they can be recharged, and a lot of them even have a built in USB cable that can plug directly into the Pi! However, you are still welcome to buy a Lithium Polymer battery and a charging board if you don't want to go that route. You can find the parts to do that listed in the "what you will need" section.

The only thing one of these battery banks doesn't have is an an/off switch. There are a couple ways to go about this: You could either solder a switch onto the battery bank yourself, or you could buy a premade micro-usb on/off switch, which is a much safer way to go than soldering near a lithium polymer battery.

This will take care of turning the power on and off, but it's generally not a good idea to cut the power to a Pi while it's running software. This can corrupt the software and/or the Pi itself. You eagle eyed code monkeys may have noticed that the code in the previous step generates a touch screen "Power" button that can shut down the Raspberry Pi OS.

So you can switch the USB cable "on" to power on the Pi, and then touch the "Power" touchscreen button to turn off the Raspberry Pi OS before switching the USB cable to "off".

This guide was first published on Sep 15, 2017. It was last updated on Sep 15, 2017. This page (Adding A Power Source) was last updated on May 26, 2019.