NodeMCU vin pin(5v) is not working I'm a newbie on Arduino and NodeMCU so now I'm trying to run  my relay module trough the NodeMCU v3  and so far I have wired them all respectively as the instruction below:




NodeMCU
5v Relay




D2
+


Gnd
-


VIN
S




but somehow it doesn't work when I try vin pin but the led of  Relay module just turns automatically on when I connected to 3v pin  works on vin3 without me doing anything through the app (Blynk).
I wonder if I'm missing something here?
Thanks very much for your help in advance.
Sani
You’ve probably switched some wires.
Relay Connection with Arduino, usually takes 3 Pins:

VCC / In (5v)
Signal (Data) - [D2] Pin On your sketch.
Ground

It is that simple.
Some recommendations apart from your question:

Make sure to know how your relay starts.
That is: Starts Always On or Always Off.

On your sketch (relay initialisation); set the initial relay state before defining its function as OUTPUT.


...
digitalWrite(relayPin; LOW);
PinMode(relayPin, OUTPUT);

...

Ensure the wires are properly connected to avoid wasting time understanding why the relay doesn’t work.
Special attention to Ground Wiring.

Note: Depending on your schematic; You may require to bridge your Grounds.