I have 8 relays controlled by esp8266 through a shift register. 4 relays on the left are under 220v load and 4 on the right are under 12v.
220v on the input splits between the left relay board load and 12v power supply. 12v then splits between right relay board load and a buck converter. Buck converter outputs 5v for esp, relay boards and shift register.
When there is no load connected, corresponding relays turn on/off according to the code. But as soon as I connect one or more loads (220 or 12v, doesn't matter), relay boards go completely bananza and start randomly turning ports on and off whenever I change state on any output.
Twisting load wires has the same effect. Is it some kind of interference? But loads and inputs of a relay board are optocoupled, so how can it be? 🤔
Previous version of the device had all 8 relay pins connected directly to esp and worked fine both with and without load.
So the question is — what causes the problem and how can I solve it?
(Don't mind the mess, it is version 0.1 🌚)