5

I'm trying to get the hydrosys4 open source irrigation control software to work with my 16 channel relay board and raspberry pi zero w.

When the pi boots up the relay is triggered multiple times, rapidly ( this is not good, the relays will have AC loads in the final setup ).

Below shows my current wiring to the 16 channel relay board. Here's a link to a document I could find showing the relay board schematic. Sainsmart relay schematic

Wiring Diagram

Is there any hardware/wiring I can add to prevent the relays from triggering during the pi boot?

tlfong01
  • 4,847
  • 3
  • 12
  • 24
D A
  • 61
  • 4

1 Answers1

6

You could use an IO expander module (e.g. PCF8575 or MCP23017) between the Pi and the relay board: those modules don't change pin states unless they receive a valid I2C/SPI command, so they will not be affected by sporadic pin toggling at boot.

You'll have to enable the correspoding interface (I2C or SPI) on the Pi to be able to talk to the expander.

Another solution is to use an Arduino or a similar controller, which would receive commands from the Pi and in turn control the relay board. The advantage here is flexibility: you can program the Arduino exactly the way you want it to behave, implement whatever interface you like with the Pi (if I2C and SPI cannot be used, you could use a UART or even a GPIO pin which has to be toggled in a specific sequence to activate the relay). The Arduino could also implement safety features, e.g. turn off AC loads if the Pi was not sending any commands for a long time, probably due to a SW crash.

Dmitry Grigoryev
  • 28,277
  • 6
  • 54
  • 147