connecting Node MCU FPS32 or FPS8266 to relay

Hello,

I'm a beginner, and I started a new project (for personal use). I want to control a lamp through my phone using wifi.
After researching I have a plan of how I want to build the system and which parts I need for this purpose. In almost all of the guides I've read, they connect Arduino\Raspberry Pi\Node MCU wifi board directly to the relay.
In my project I want to use Node MCU FPS32 or FPS8266 (not sure yet, FPS8266 is more easy to find but I want to buy few pieces of Node MCU FPS32 anyway for next projects) and this type of relay. I've read in a forum that it is dangerous to connect the board directly to the relay.

Is it really problematic to connect the board directly to the relay? if it is, how should I connect them?

Thank you for your time and attention :slight_smile:

There are matching single-relay boards for a WeMos D1 mini.
Note that many, if not all, relay boards are not safe to use with mains power.
Unless you encapsulate the whole project in a plastic case.
Leo..

OK, the point is that not only should you not connect a relay directly to the Arduino/ ESP, you can not connect it directly for the simple reason that it will not work!

So what you cite here is not a relay, it is a relay module. The actual relay is the blue cubical part. But the module contains a transistor which switches the actual relay as well as the "kickback" protection diode and an indicator to show when it is actuated. Does that resolve the various apparently contradictory things you have read about using a relay?

And yes, we do have some doubts about whether the design of these modules is adequate in terms of safely connecting to mains electricity, however it must be said that the same relays are as best we know, used in many commercial appliances. :grinning:

Google esp8266 relay.

There is a relay modele that lets an ESP8266 plug directly in to it.

Google smart socket
There is a plug in device that is sealed
Gets power from the wall
has an ESP8266 in it.
You cannot hack it so it is an appliance not a hobby module.
But it is safe

dave-in-nj:
has an ESP8266 in it.
You cannot hack it so it is an appliance not a hobby module.

I venture to suggest that if contains an ESP8266 it is indeed "hackable". :grinning:

Like the Sonoff.