I'm going to drive a bunch of 230VAC motorized ball valves from an ESP32.
I'll have several boards, each with 8 triacs driven by MOC3052 opto-triacs. This will be connected to another board with an ESP32 with short ribbon cables.
There isn't enough IO to drive all the MOC's, so I'll be using PCA9554B I2C IO expanders. I chose these because they have a 200mA maximum total sink current, which suits 8 optos driven at 10mA each.
I have two options available:
- I2C IO-Expander on ESP32 board, and route the outputs through the ribbon cable to the triac board.
This would be the most robust solution. Since the triacs will be on/off and not phase-cut dimming, I could add filter caps on the control lines.
- I2C IO-Expander on the triac board, and route I2C through the ribbon cable.
This would be more flexible, as I could add more triac boards along the I2C cable. However, I2C isn't famous for being robust against EMI, and this thing is going to sit in an enclosure with lots of mains wiring, and all the loads are inductive.
The motorized ball valves have limit switches which are quite bouncy, so they emit a burst of EMI when the switch opens. That caused problems with the first version of the board. I've added snubbers and that worked very well though.
I'm leaning towards option 1. Thoughts?