-->
Page 1 of 2

Problem using ESP8266-12E with a Relay

PostPosted: Fri Jan 27, 2017 3:01 pm
by Rich Babylon
I’m attempting to use Blynk with an ESP8266-12E and a relay to switch my mains powered garden lights on/off. I am confident with mains lighting circuits but new to microcontrllers and the electronics knowledge required to use them.
I have successfully used Blynk to switch an LED on a breadboard.
I succesfully tested a 5v relay to switch a lamp on/off using an Arduino.
I then unsuccessfully tried to implement the circuit which is shown at http://imgur.com/JA62ybF
The switching didn’t work and I seem to have damaged the ESP8266 as I can no longer upload anything to it.
I am wondering if this is a problem with the capacitor. The friend helping me gave me a 1000uF capacitor but I read somewhere that Neil Kolban suggests a 10uF capacitor should be used for this purpose.

Can anyone offer any advice?

Re: Problem using ESP8266-12E with a Relay

PostPosted: Sat Jan 28, 2017 11:08 pm
by GinjaNinja
Richard,

I'm a novice in the electronics realm thus far, however where is the 3.3V going to? Based on a Relay switch I have here.. You can decide on powering the Relay from an external power souce, which you have through that Samsung Charger, or through the Micro Controller.

Since the NodeMCU(or whatever unit you're using) cannot supply the appropriate volts, what's the 3.3V going to?

Re: Problem using ESP8266-12E with a Relay

PostPosted: Sun Jan 29, 2017 5:41 am
by jeffas
You haven't labelled the pins on your circuit diagram, but you seem to be feeding 5v directly into the ESP. It is my understanding that you shouldn't exceed 3.3v (approx.) on any pin into an ESP. If I'm correct on that, it's probably the 5v that has fried it.

Re: Problem using ESP8266-12E with a Relay

PostPosted: Mon Jan 30, 2017 4:47 am
by g6ejd
You should determine if the relay is switching by disconnecting it from the ESP and putting the control input to +5v, does the relay switch?

Having disconnected the relay does the ESP respond, can you programme it?

When relays switch on they produce a relatively large (back-EMF) pulse on the +5v line, usually enough to damage connected devices like your ESP, this can be solved by placing a diode in-series with the relay supply pin (+5v on the relay), the diode then prevents the back-EMF (an ~ negative 5volt pulse) from affecting the rest of the circuit.

If the ESP cannot switch the relay then you will need an intermediate level changing circuit to change ESP outputs from 0/3.3 volts to the 0/5 needed for the relay or get a relay that can operate from a 3.3volts control input.