I'm working on a temperature controller circuit that uses an ESP32 to activate a relay based on temperature readings from sensors. This relay, in turn, controls a contactor.
I've encountered an issue where the ESP32 completely freezes when the contactor opens, probably due to the noise as shown in the oscilloscope (measuring the 5v power supply) screenshot attached. The noise generated during the contactor's operation seems to interfere with the ESP32. I've also attached the schematic of my PCB and the wiring diagram for the contactor. Additionally, I've included a video demonstrating the ESP freezing when I manually toggle the relay using a button.
Does anyone have experience with this kind of issue or suggestions for mitigating the noise? I’m considering solutions like snubber circuits, flyback diodes, or optoisolation, but I'd like to hear from others before proceeding.
Video showing it freezing (second 5 - couldn't find a way to upload here - it's got 4 contactor to speed up the freezing): https://youtube.com/shorts/SMRyH60qVf4?feature=share
EDIT 1:
I’ve now added the PCB layout photo to give more context about the design. Hopefully, this helps clarify things further.
From what I understand of my circuit, I’ve already included decoupling capacitors. However, I might be missing something in their placement or specifications. Could you advise on what I should double-check here? (the contactor acts in AC voltage, not DC)
Regarding the snubber, I’m not sure where exactly to place it. Since the idea is for this to be a commercial product, I won’t have control over the type of contactor used or the wiring setup (e.g., whether users will employ twisted pairs). Because of this, any solution has to be implemented directly on the PCB of the controller itself.
I don't think the problem in through radiation because I tested putting the contactor pretty far away from the board and still the uC froze...
EDIT 2:
Osciloscope image on the 3.3V (right on the uC pwr supply):

Any help would be greatly appreciated!



