My ESP32 is controlling a relay which I switch on for 500ms (controlled through the internet).
Do I need a diode to protect my ESP32 from voltage spikes when the magnetic flux collapses?
I'm using an ESP-WROOM-32, and the relay specs are (taken from here):
Small and light weight.Specifications:- Contact form: SPST normally open- Coil Resistance: 1050ohms- Nom Volts: 12 - Pickup Voltage: 8.4V DC- Rated Current: 11.4mA - Allowable Voltage: 160%- Dropout Voltage: 1.2V DC - Carry Current = 500mA.- Power Consumption (W): 0.1 - Contact Rating: 1A- 12 VOLT
I've been using it without any problems for quite a few days, but I'm wondering if there's a chance it could be damaged randomly, or if there's something in the ESP32 pins that protects it from things like this.
Here's a circuit diagram of my setup: