tl;dr: I'm having a problem with 8-relay module boards that control sprinkler solenoid valves. When 24VAC is present, sometimes turning a relay off causes other relays to randomly turn on.
My configuration is as follows:
- I'm using an ESP32 Pico kit microcontroller.
- Three of the 3.3V ESP32 pins are connected are connected to a 3.3V to 5V bi-directional logic level shifter (one level shifter per pin, three total).
- The 5V logic level shifter outputs are connected to the RCLK, SRCLK, and SER pins of a SN74HC595 8-bit shift register.
- Three shift registers are daisy-chained together, providing 24 outputs total.
- Each of the 24 shift register outputs are connected to an input of one of three 8-module relay boards.
- The 8-module relay boards are powered by a standalone 5V supply (in other words, not the 5V linear regulator on the Pico board). The 5V supply is a 1.5A supply, large enough to turn on several relays at once.
When there are no connections to the relay outputs (NC, COM, NO) on the 8-module boards, the relays can be turned on and off in any order or combination, so I believe the shift registers, connections to the relay boards, and software are correct.
I then connect 24VAC sprinkler solenoid valves to the relays like so:
Notice in particular that one leg of the 24VAC transformer is connected to the COM port of multiple relays in the 8-module relay boards.
When I enable just one relay it looks like this:
If 24VAC power is not enabled, I can turn on and off the relay just fine. When I plug in the 24VAC transformer and then enable the relay, again, everything works ok. The sprinkler solenoid energizes and all is well.
Most of the time, say 4 out of 5 times, when I turn off the relay the solenoid shuts off and everything is good. However, 1 out of 5 times, when I turn off the relay, numerous other relays just randomly turn on. When that happens it looks like this:
I'm wondering if anyone can help me diagnose what might be happening and/or give me some troubleshooting tips. I've disconnected things down to just one solenoid in the system and it still happens.
Random notes on my setup:
The leftmost relay of the bottom, horizontally oriented 8-module board is where the COM cable comes in from the 24VAC transformer. It then connects to the COM of the relay to its right, then that COM connects to the COM of the bottom-most relay of the left 8-module relay board, runs up through each COM of the left board, then runs across the top to the COM of the upper right 8-module board, down through each of its 8 relays, and terminates there.
The rightmost 6 relays of the bottom horizontal board do not share the COM channel. I am using those as dry contactors to operate different (non-sprinkler solenoid) devices.