Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By Marcello1972
#60193 Hi ,first of all , excuse my poor english!
I faced the same issue of the random reset of my ESP12-E driving a onboard 5V relay 16A (RZ03-1A4-D005)
I reed many forum talking about poor power supply and how to solve it. i agree with them , this is the first point to be sure in the circuit but it's not the only problem,ESP has poor immunity to radiated emission.
This is what i did up to now:
I did a simple sketch that turns on and off continuously the onborad relay every 100mS and counting the second.(i got the elapsed seconds via serial port)
the best empirical solution was adding 15pf 0603 soldered between shield and reset pin and 47pf 0603 soldered between shield and +3V3 PIN directly on the module.
(my experience tells to me that 100nF capacitor are useless in case of High frequency due to parasitics inductance of nf cap multilayers technology)
moreover, i put all the unused pin to OUTPUT and HIGH state.
The above solution is still not perfect ,anyway the ESP works for 300 Second without reset.
I will update you soon
Marcello
User avatar
By Daniel V
#89521 The problem is that the esp-01 do not have shielding in the MCU chip and it is very close to the relay, the replay sends a small electromagnetic pulse when activated and if is very close to the esp-01 affects it by resetting it and sometimes damages
User avatar
By eriksl
#89587 No the problem is the interference (induction) on various signal lines. Relays are baaaaad in that way. Make sure both RST and CH_PD are properly decoupled from the Vcc, by using both a resistor AND a capacitor.

Then, make sure the coil of the relay is driven properly. I am not a fan of relays, so I am never using them, but treat the coil as a motor, as it is. This means after the current is dropped, a current in the reverse direction is generated. This maybe quite a big current. Make sure it's properly deflected using a diode that can handle the current. Don't rely on the parasitic diode in a MOSFET and certainly never connect an GPIO pin directly to a relay. At least insert a MOSFET (can be a small one), or, and that may be interesting, use MOSFET gate driver (and leave out the MOSFET). These can handle quite bit currents by themselves. Extra advantage is that they have schmitt-trigger input and can have a power supply independent from the microcontroller (mostly interesting for using higher voltages than 3V3).