driving 1-Chanal Relais Module with ESP8266

Hello, i have the follwoing problem.
I am experimenting with a 1-Chanal Relais Module (Link). I connect on the module pin GND to ground and pin VCC to +5V. That moment i have 4.4V on pin IN (???).

If i connect a +5V line to IN nothing happens (i would expect that the relais closes). If i connect ground to pin IN the relais closes. (sounds like the relais is active on LOW state)

If i connect pin IN to one of my I/O-pins of the ESP8266 the relais closes, but no matter what i write to this I/O-pin (HIGH, LOW) the relais does not change its state. The same I/O-pin/program drives an optocoupler perfectly.

Any suggestions ?

Hi,
As you have found the relay module, like others, need the input pulled to gnd to activate the relay.

The ESP8266 is a 3.3V outout controller.
The relay module needs to see 5V to deactivate the relay, 3.3V from the ESP8266 is not high enough to release the relay.

Tom.... :slight_smile:

OK, on the back of your relay module, it says "Low level trigger".

I can't seem to find a circuit for this module on the 'net; the closest I can find is this one:

If you take this upside-down, with a PNP transistor instead of an NPN and all the diodes reversed, GND and VCC swapped, then you have your module. All resistors are 1k.

Now unlike those with an optocoupler and the green indicator LED in series with the optocoupler which means that you must apply at least 3.1 V for the LEDs to operate, this one requires only a little more than the 0.6 V emitter-base drop of the transistor to turn on. So since its VCC is 5 V, when you connect it to the ESP8266, the output pin of the ESP8266 can never go much higher than about 3.8 V, so there will be at least 1.2 V between that and the 5 V supply on the relay module, which may not be enough to actuate it to start with, but will be sufficient to hold it once pulled in.

How to fix it? Simply put a green LED in series with the input to the relay board - it will work perfectly. :grinning:


OK, I had to go and find the module in question and get it out of its little package to determine the circuit. I would have preferred to have the green LED in series with the transistor base, in the module itself like the opto-coupler version, which would save a tiny amount of current - and make things easier for the ESP8266 users. Oh well. :roll_eyes:

Just for fun, I ordered another module. (AUS)$1 plus GST.

THX folks. Now it works fine ...

I drive the module now via my optocoupler (instead of a transistor) bringing the IN pin to ground (relay engaged). And i have a pullup resistor from IN to +5V in case of the coupler "is open". This disengages the relay securely.

A green LED in series would do just as well.