I’ve a grow hat and want to run it off battery power, but all the power management hats I’ve found use GPIO 4 to indicate the Pi has started up to the hat. GPIO 4 is already in use on the Grow hat mini to control one of the buttons.
I can change the grow hat software to listen on another pin but that’d mean changing some physical wiring on the header, which I’ve not done before and I don’t want a rats nest of jumper wires for something I intend to put outside ( protected from rain but still exposed ).
What’s the usual way of getting around this? I’ve looked for other hats to provide power management/charging, should I get a breadboard? Is there something I can buy that makes this easier/neater? I’m running a Pi zero W
Can you shortly describe your use-case regarding power-management, especially what kind of on/off intervals you are thinking about. Also it would be useful to know if you have basic soldering skills. With this information, I might be able to give you some qualified advice.
I’ve a little soldering experience but not much and I haven’t tried with particularly tiny components, I don’t have a heat-gun/microscope. Most of what I’ve learnt is from watching people repair Macbooks on youtube
As for on/off intervals I was mainly going for turn off in the evening and back on in the morning ( plant watering ), one of the big hopes was that I could attach a Li battery and some sort of solar source.
I did see this and wondered if I could have a partial header bridge minus the GPIO 4 pin and another, then attach 2 short wires to re-route the hats, I think I could manage soldering a header wire on. Or would that to turn into a lego style nightmare of rickety adapters?
Thanks for the details. Now some thoughts…
Soldering is really something that improves with experience, so don’t worry. And you don’t need a heat-gun or a microscope. I have a good magnifying glass, and that is enough.
In my measurements, the Zero W uses about 100mA in idle mode. But I assume that your Zero is actually doing some work, so that might be more. So even if you use an industry cell 18650 with 3000mAh, you LiPo won’t last more than about three days (with morning-evening 8h). Adding a solar panel is a good idea, but you definitely need a specialized solar charger (you will find one from Adafruit in the Pimoroni shop).
As far as I understood the grow-hat, it monitors moisture and activates an alarm if watering is necessary. Maybe you can think of a different on/off scheme, eg. waking up once an hour, checking, and shutting down again. That would greatly reduce current consumption.
If this is a viable option, I would suggest using a breakout based on the TPL5110 (there is one from Sparkfun and one from Adafruit). This breakout has a timer that turns on power and a DONE pin that cuts power again. The idea is to use a free GPIO on the Pi to signal “power-off” to this breakout. The TPL5110 has a maximal interval of 2h. The Pi has an overlay called gpio-poweroff, that can probably be used directly for this purpose (it triggers very late during shutdown).
Of course you would also need a DC-DC converter that changes the LiPo voltage to the 5V of the Zero.
Regarding physical rerouting: this is tricky, but might work. Giving it a try does not cost much.
But maybe all of this isn’t necessary at all. I had a look at the schematic of the grow hat mini and it does not use GPIO4 for a button, but as “Breakout-Garden” interrupt pin. Which is connected to the light sensor but not used as far as I can see. So maybe you don’t have the GPIO-problem after all.
ah that’s good news on the GPIO pin, though I was looking at:
But you’re right the schematic lists BG_INT for that pin 😁
I was originally recommended this hat for power management/charging: Witty Pi 4 L3V7: Realtime Clock and Power Management for Raspberry Pi | UUGear
Then started looking at other hats once i noticed the overlap. They both use SDA/SCL pins, is that an issue? I think it’s time I got the hat and experimented
The moisture-sensors can be optionally be setup to use the GPIO4 for interrupts. But I think this is not necessary. The same holds true for the light-sensor (I have one of these and I don’t use the interrupt).
Also have a look at the Witty Pi Mini. It has a better form factor for the Zero. I am using one of the earlier generations of this board since years for my PVR. Once the setup is done, it just works. These are very nice boards from UUGear.
Regarding SDA/SCL: you just have to see if they share an I2C address. You can have up to 127 devices an a single bus (theoretically), as long as they all have different addresses.