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

User avatar
By joefly888
#18956 Hello, I am basically combining two examples to monitor and post to thingspeak my front door status of motion and temperature.. And then I am using another example to turn on a relay momentarily for 1.5sec for a 12VAC solenoid door lock.

Example 1: posting status to thingspeak
http://captain-slow.dk/2015/04/16/posti ... d-nodemcu/
Example 2: to web enable LED but altered for relay instead of LED
http://randomnerdtutorials.com/esp8266-web-server/

Everything runs fine, without load attached to the relay..ie the load of the door lock is not connected. Even when I turn on/off the relay.

However, when I connect the load onto the relay, the ESP-12 seems to reboot when I turn on the relay. It seems to mostly happen after posting to thingspeak then I engage the relay. But not always....

I checked the heap, it hovers around 10/11000

any suggestions as what the problems is and how I would go about debugging it. There is no message before crashing/rebooting.. it just restarts normally.

Any electrical engineers out there, is there a possibility of the load on the relay 12VAC is causing some oscillating noise that is causing the ESP to restart? The relay basically sits next to the ESP

Any help would be much appreciated...
User avatar
By byrosis
#19151 I would double check that the hardware is correct. What type of relay are you using? The circuit to control the coil of a relay is different to the circuit for a LED. Generally you should use a small transistor. Secondly, you would need to connect a diode in parallel to the coil to prevent induced currents and voltages. (search for free-wheeling diode circuit)