Hello
I'm testing my relay SRD-05VDC-SL-C, wich was bought in Az-Delivery, with a simple Blink program, and the relay doesn't change his state. I'm using an ESP8266 microcontroller, conecting "IN" input to a digital pin, VCC to a 5V output and GND to GND of the pcb. Whith this conection, it's always on close state.
Nevertheless, if I disconnect the digital pin and "IN" input of the relay, it changes his state (it changes to open).
I don´t have anything conected to the output of the relay.
I don´t understand why it doesn´t work, it´s a very simple testing program.
Could you please read the forum instructions, post your code in "code" tags according to the instructions, and give us a Web link to the actual relay module you are using?
Also which ESP8266 module you are using and to which pin you are connecting the module?
Just guessing but it sounds like the output pin was not defined as an output or has a 1 written to it not a zero. Use your VOM to see if the pin changes state and that all grounds are connected. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil
He said "IN" - the relay datasheet does not refer to "IN"!
He said ESP8266!
Not a bad idea to read the question.
Yep, you're right. Shame on me. Still, the sketch's only output is, presumably, to the relay, to cycle it on and off. The *8266 *datasheet says 12ma max. for I/O pins. Isn't this going to be a problem? Could the output already be blown?
The reference to "IN", 5 V to "VCC" and "GND" indicates it is a relay module containing the specified relay, in which case overloading the ESP8266 is not going to happen.
If the OP ever re-surfaced, we might know answers to my questions and even, just perhaps, be able to figure out his problem.
jonasnic:
Speculation: maybe the OP is using 3.3v ESP and that is not read as high enough for it to de energize the relay.
roberto1698:
I'm using an ESP8266 microcontroller, connecting "IN" input to a digital pin, VCC to a 5V output and GND to GND of the PCB.
So he is indeed using an ESP8266, all of which use 3.3 V.
Now when you refer to active-low relay modules, the ones with opto-couplers mostly use this circuit:
which actually requires the "VCC" to connect to 5 V in order for the ESP to pull down sufficient voltage to turn on the optocoupler and series green LED - about 3.5 V in total, so no trouble switching off at 3.3 V.