user50053: I am using a bi-directional 3.3-5V logic converter to control 5V relay with 3.3V D5 pin of nodemcu. link of logic  converter is here
However, I expected to control the relay but it didn't work. I don't think there is a problem with electrical connection or code since that is simple.
3.3V sides of nodemcu is connected to LV and 5V side of Relay is connected to HV.
Code:-
void setup() {
  // put your setup code here, to run once:
pinMode(D5, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(D5, HIGH);
delay(2000);
digitalWrite(D5, LOW);
delay(2000);
}

My Observations:-
1) When relay is removed, multimeter shows 3.3V at the LV & HV side. (so logic converter is not working i guess)
2) When relay  is  connected, multimeter shows 2.5V on  both sides.
Everything is powered from nodemcu pins. Does  it means that i have to supply extenal power or something wrong with logic converter?[![enter image description here][2]][2]
What do you guys think?
PS  - I  soldered the pins another way around on logic converter. Does it change anything?
circuit image, nodemcu is powered by the laptop USB


user59408: To make that work you'd need to connect the HV connection to the Vin of the NodeMCU (as well as to the relay board) which should be the 5 V coming form the USB port. You'd also need to connect the GND on the HV side to the GND of the NodeMCU.

user68946: You must supply a steady, regulated voltage to both 3.3v and 5v pins at all time (see Voltage Inputs on https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide/all).
Logic level controller does NOT convert 3.3v to 5v for powering the relay, it just let you turn 3.3v signal to 5v so a relay can get activated. Relay's positive pin still needs to be supplied with a 5v from a PSU or other sources.

50053: <p>I am using a bi-directional 3.3-5V logic converter to control 5V relay with 3.3V D5 pin of nodemcu. link of logic  converter is <a href="https://i.stack.imgur.com/FUeVv.png" rel="nofollow noreferrer">here</a></p>

<p>However, I expected to control the relay but it didn't work. I don't think there is a problem with electrical connection or code since that is simple.</p>

<p>3.3V sides of nodemcu is connected to LV and 5V side of Relay is connected to HV.</p>

<p>Code:-</p>

<pre><code>void setup() {
  // put your setup code here, to run once:
pinMode(D5, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(D5, HIGH);
delay(2000);
digitalWrite(D5, LOW);
delay(2000);
}
</code></pre>

<p>My Observations:-
1) When relay is removed, multimeter shows 3.3V at the LV &amp; HV side. (so logic converter is not working i guess)
2) When relay  is  connected, multimeter shows 2.5V on  both sides.</p>

<p>Everything is powered from nodemcu pins. Does  it means that i have to supply extenal power or something wrong with logic converter?[![enter image description here][2]][2]</p>

<p>What do you guys think?</p>

<p>PS  - I  soldered the pins another way around on logic converter. Does it change anything?</p>

<p>circuit image, nodemcu is powered by the laptop USB</p>

<p><a href="https://i.stack.imgur.com/FUeVv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FUeVv.png" alt="circuit"></a></p>
 59408: <p>To make that work you'd need to connect the HV connection to the Vin of the NodeMCU (as well as to the relay board) which should be the 5 V coming form the USB port. You'd also need to connect the GND on the HV side to the GND of the NodeMCU.</p>
 68946: <p>You must supply a steady, regulated voltage to both 3.3v and 5v pins at all time (see Voltage Inputs on <a href="https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide/all" rel="nofollow noreferrer">https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide/all</a>).</p>
<p>Logic level controller does NOT convert 3.3v to 5v for powering the relay, it just let you turn 3.3v signal to 5v so a relay can get activated. Relay's positive pin still needs to be supplied with a 5v from a PSU or other sources.</p>
