Running a Raspberry Pi off a LiPo battery

I wanted to take an IR photo at dawn. IR photos are easy enough these days, you can either butcher the camera you already have taking out the IR filter, or you can use a Raspberry Pi NoIR camera where they have taken the filter out/not fitted it at the factory.

The dawn part, however, is a problem. I am night owl 😉 I don’t do dawn, if I can help it, and since the target is static in my case, and the Raspberry Pi is the camera of choice, it seems a nice idea to get the Pi to do all the work of getting up early. Why keep a dog if you have to bark yourself?

There are no end of shims and gizmos that will up the 3.7 to 3.2V of a LiPo battery to 5V, for putting into the Pi. I’ve used a wide input shim to power Pi’s off a CCTV power supply rather than have one mains PSU per Pi.

In this case I favoured the piZero variant, and didn’t have aims to be connected to t’internet in the field. So I need a real-time clock, and all of a sudden a simple requirement has turned into dongle hell. This is where I wanted to be:

Pi running off a battery
Pi running off a battery

and at first considered a 5V LiPo plus RTC device like this only to discover it won’t start the Pi on a schedule. I then considered using a 16F628A PIC with one of the DS3231 dongles, a Chinese noname clone of this. It turns out the stock Raspberry Pi driver can support one single wakeup alarm on the DS3231 – the gory details are here. That will pull down Pin 3 on the alarm, although pin 3 isn’t brought out on the connector it’s easy enough to tack a wire onto that. Some Pis have a setting where you can pull a wire to ground to start the board; fortunately the DS3231 pin3 is open-drain so ti will work with that. The PiZero (not W, mine is a 1.3) draws about 30-40mA powered down, that’s much better than a real Pi but still a bit much for a battery. Continue reading “Running a Raspberry Pi off a LiPo battery”