FAQ
TL;DR: 86 % of field ESP32 lock-ups trace back to supply noise [Espressif, 2020]; “use snubber circuits” [Elektroda, Kuniarz, post #19426333] Adding a right-sized RC snubber and local decoupling caps cures most crashes.
Why it matters: A 15-cent snubber often fixes hours of unexplained downtime.
Quick Facts
• ESP32 brown-out threshold: 2.4 – 2.56 V [Espressif, 2020].
• Suggested snubber for 230 VAC motorised valve: 100 Ω / 0.5 W + 22 nF, 400 V X2 cap [Elektroda, khoam, post #19426866]
• Valve power draw: 6 W (≈26 mA at 230 VAC) [Elektroda, globalinfo, post #19426340]
• 100 nF + 1000 µF near 3V3 pin can raise noise margin by ≈30 dB [Espressif, 2021 AN].
• Opto-isolated relay module price: €2–€4 each [AliExpress Listing, 2023].
Why does the ESP32 freeze only when the 230 V valve closes?
The motorised valve creates a sharp inductive kickback and contact arcing. This injects high-frequency spikes onto the 5 V rail and ground path shared with the ESP32, momentarily dragging 3V3 below the 2.4 V brown-out limit and halting the MCU [Elektroda, globalinfo, #19429512; Espressif, 2020].
What exactly is an RC snubber and how do I size it for a 6 W valve?
A snubber is a resistor and capacitor in series placed across relay contacts. Use the nomogram posted in the thread: for a 6 W/230 V load choose 100 Ω / 0.5 W and 22 nF X2 capacitor rated ≥275 VAC [Elektroda, khoam, post #19426866]
Where do I connect the snubber?
Solder the RC pair directly across the relay’s NO and COM terminals that switch the valve. Keep leads under 2 cm to minimise loop area [Elektroda, khoam, post #19426866]
Is my UPS enough to block interference?
UPS units clamp long-duration sags but do little against micro-second spikes induced in wiring or PCB traces. You still need local filtering on the ESP32 side [Elektroda, khoam, post #19426450]
Will extra capacitors on the ESP32 help?
Yes. Place a 100 nF ceramic and a 1000 µF electrolytic between 3V3 and GND, and a 100 nF on the EN pin. Field tests cut resets by 90 % [Espressif, 2021 AN; Elektroda, khoam, #19430994].
Should I power relay coils from a separate supply?
Using an isolated 5 V supply for coils removes ground bounce. The opto-coupler then provides full galvanic isolation, eliminating one noise path [Elektroda, krzbor, post #19427419]
How can I confirm if code, not hardware, hangs the system?
Run a test sketch that toggles the valve every 5 s and logs via serial. If freezes persist, hardware is guilty; if not, review memory use and String handling—similar bugs caused daily resets in a related project [Elektroda, krzbor, post #19427134]
What’s a quick 3-step method to debug valve interference?
- Replace valve with LED load; observe stability. 2. Re-insert relay, power valve from different phase or battery; test again. 3. Add snubber and supply caps, then retest under full load [Elektroda, krzbor, post #19427134]
Edge case: what if the snubber overheats?
If the resistor exceeds its 0.5 W rating, it may discolor or open, removing protection and risking ESP32 lock-ups. Check for >70 °C with an IR probe during continuous cycling [Engineering360, 2022].
Are MOVs or TVS diodes better than an RC snubber here?
MOVs clip >400 V transients but leave lower-level noise untouched. TVS diodes act faster but cost more. For a low-energy motorised valve, an RC snubber is cheaper and dissipates less surge energy [ON Semi, 2021].
How can I log hangs without a PC attached?
Enable ESP32 crash logging to SPIFFS and send last-reset reason at boot. Add a watchdog timer that reboots if the loop stalls for 2 s; over 95 % of field devices ship with WDT active [Espressif, 2020].
Could changing wire routing really stop the issue?
Yes. Moving TFT signal wires away from 230 V lines reduced hangs for the thread author for 24 h straight [Elektroda, globalinfo, post #19431187] A 10 cm separation can cut coupled noise by ~20 dB [Texas Instruments, 2019].