Dear All,
I am trying to built an ESP32 controlled PLC.
The connection is:
ESP32 —> 16 channels 74HC595 shift register —> opto isolated 5VDC relay modules —> 240 VAC load
Without the AC load, the switching performed as programmed. However when the AC load is connected to the relay output, even the slightest AC load such as electrical test pen, will cause occational glitches.
Please advise the cause and the solution.
Best regards,
Herman
Hi.
Can you be more specific? What kind of glitches?
What exactly happens?
Regards.
Sara
This sounds like an issue with the pcb layout or system wiring coupling noise into the cpu. Do you have an experienced EE available to dig into this?
I am 100% certain the problem is not software related.
Hi Herman,
Details on kick back diodes for DC and MOV’s for AC:
Today
Relays and kick back diodes 240 V. A.C.? detail kick back diodes
Relays are electromagnetic switches often used to control high-power circuits, and they can generate voltage spikes when the current through their coils is suddenly interrupted. These spikes, known as “inductive kickback,” can damage other components in the circuit.
For DC circuits, a flyback diode (also called a kickback diode) is commonly placed across the relay coil to suppress these spikes. The diode provides a path for the current to dissipate safely when the relay is turned off, protecting the circuit. However, in AC circuits like 240 V AC, the situation is different. Since the current alternates direction, a single diode isn’t effective. Instead, other methods like snubber circuits (a combination of resistors and capacitors) or MOVs (Metal Oxide Varistors) are used to suppress voltage spikes.
–from Microsoft’s Copilot
Regards,
William