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:
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.Rooting about in the junkbox I discovered a WittyPi mini, presumably from when I last looked at this. The WittyPi is onto rev 4, so I had to regress to Buster to be able to install and run this, but that’s no desperate hardship on a standalone camera, I used the lite variant. The great thing about the WittyPi mini is that it will schedule start and stop the Pi. What appeared to be a downside was the WittyPi has no step-up. So I wondered if I might get away without one, keeping the whole rig small. After all, everything in a PiZero runs off the 3.3V rail
Running the Pi Zero directly off the battery voltage
Warning – only do this with a battery that has a BMS (a board in orange Kapton tape on the top, as in my pic. That will isolate the battery from the load when the battery voltage falls below 3.2V. If you don’t do that, and leave the load on the battery below about 3V then the battery is scrap1. Just like that – it’s not going to recharge. Ask me how I know this 😉 It’s happened to me too often 🙁
With that proviso, I was surprised to read this treatise on Hackaday that says the PiZero will work fine straight off a LiPo cell, the onboard regulator will still work down to 3.3V. The one provison is DO NOT CONNECT A POWERED DEVICE TO USB. You will be stuffing 5V bus power straight into your LiIon battery, result likely misery. Exercise caution and don’t do that. You’re in unknown territory as to whether anything plugged into the USB socket will work, a single LiIon cell won’t overvolt it, but the low end of the spec is 4.2V, 16% low, so at 3.3V you’re 33% down, and you’re taking the mickey something rotten. I got away with it with the peripherals I wanted!
Mine is the original steam-driven PiZero 1.3, no W. I bought a USB OTG hub and Ethernet port so I could see what I was doing. It’s nasty, but it works on the Zero, and plugging in a small WiFi nut to one of the ports gives me PiZero W functionality, without carrying the load in the field where I don’t need wireless. Much to my surprise all this lot worked off the battery too
You do pay for that with a shockingly increased power drain, up from 90mA to 330mA, but that’s not necessarily a problem. Indeed, I tested the power drain without by scheduling a powerdown in 10 minutes and pulling the OTG hub out. Obviously I was logged out with no WiFi, but the Pi kept running until the scheduled power off, which is how I got to measure to 90mA. Apparently you can do better, though you’re not left with much working.
Quiescent power drain (ie after a powerdown, so presumably the wittypi baseload) is about 5mA. That’s not micropower, but something like a 1200mAh battery can run for over a week – 240 hours, so in practice it is fine, it’ll probably get nicked if left out that long. If you are after a sensor or long duration rig you’re probably better with an Arducam SPI camera and a microcontroller board like an Arduino Pro Mini clone or an Adafruit Feather – I stuck with the Zero first because I had it, and secondly because if I do see IR dawn effects I have the hope of running video, and with the best will in the world you’re not running video on a microcontroller platform at the current state of the art.
It was an interesting exercise, and illuminating how well the PiZero worked with the battery connected straight to the 5V rails (via the wittyPi). The USB meter confirms that the wittyPi doesn’t boost the battery voltage.
- A google search will bring you enough results on reviving overdischarged lithium bateries – in the case of a BMS that has isolated the cell then it’s easy enough, but mine had no BMS. I tried the usual trick of trickling off a bench PSU via a resistor monitoring the cell voltage but it didn’t revive it. LiIon batteries scare me enough, I chalked this up to experience for buying anonymous Chinese rubbish on Ebay. ↩