New: the AI firewall watches the whole platform and explains each incident in plain words. See how it works

Reply To: Relay briefly pulls in when the Pi boots, irrigation valve opens. What state are the GPIOs in at boot?

Translated from Türkçe by AI ·

I don’t think it’s power, it’s exactly the situation you described. At startup the Pi initialises GPIO0-8 with the internal pull-up (HIGH) and GPIO9-27 with pull-down (LOW). Your pins are all in the 9-27 range, so until the script runs they are LOW. The board is active-low, so LOW = relay energised = valve open. We had the same thing happen on the test rig in our lab.
There are two fixes, doing both together is the most robust:
1. Add a line to /boot/firmware/config.txt that sets the pins as outputs driven HIGH early in boot, without waiting for the script:

gpio=22-25=op,dh

This is applied at firmware stage, but a very short LOW may still occur at the very first moment of power-up. So:
2. Put a 10k pull-up resistor from each relay input to 3V3. That way the input stays HIGH even when the Pi is not driving it at all.
Also, on the Hermetry side, have the script send the valve states as telemetry such as valve1_open: 0, so after an outage you see the real state on the dashboard.

Accepted solution♥ 1