Relay type - not triggering


i’m trying to trigger this relay, but not way to make it work.


But getting an opto coupled relay, it works.

Nodemcu ESP32
5V0 to VIN and VCC of relay
GND to GND and GND of relay
GPIO21 to IN1 of relay

Directly feeding the relay (VC, GND and IN1) works.

Any idea of what could be going wrong?

Thx in advance.

Most likely the relay wants a 5v trigger and the ESP32 is only providing 3.3v indicating you should add a logic shifter.

Bing Videos

Relays like this often have a built in optocoupler that allows them to trigger from quite low voltages. What @SJ20035 says is probably the issue but it’s hard to tell without the relay specs and your yaml.

There is usually details on using the component from anywhere you buy it. Look for the Specifications or Documentation section for details and instructions. This is how you learn how to use things and it needs to be the first place you look, even before you buy something.