How to connect an 8 channel relay to an external power supply

I finally ditched the plan of using a shift register after playing around with it i decided to get a NodeMCU board to switch the relays, for now i am using blynk library later ill use a local web server. I got everything working except the power, The NodeMCU only has a 3.3v pin so i cant run all the relay at the same time. Some of the guides i saw used the VIN pin but that didn't work for me so i was thinking of using an external power supply but don't know how to connect the relay to it.

loli_roller:
I finally ditched the plan of using a shift register after playing around with it i decided to get a NodeMCU board to switch the relays, for now i am using blynk library later ill use a local web server. I got everything working except the power, The NodeMCU only has a 3.3v pin so i cant run all the relay at the same time. Some of the guides i saw used the VIN pin but that didn't work for me so i was thinking of using an external power supply but don't know how to connect the relay to it.

What relays do you have and how do you want them to do?

You might consider using a 2N7000 MOSFET to drive the relays. The source is ground, the gate is the input from the NodeMCU board and the Power Supply + goes to the relay coil. Be sure the grounds are connected and you should be off and running. You can find lots of variations of this on the web including this web site. You should never connect a inductive component (relays) to one of the output pins of the NodeMCU. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

ieee488:
What relays do you have and how do you want them to do?

Thanks for the reply, I have jqc-3ff-s-z 8 channel relay module
I want to power the relay using the external power supply since 3.3v on the NodeMCU is not enough to run the relays, ill be switching the relays on/off using the blynk app for now.

You connect the external PSU to the Vcc and GND pins on the relay board. You must also have a common ground connection between the external PSU and the nodeMCU.

I don't think nodeMCU will have enough pins to drive your 8 relays, so I don't understand your comment about ditching the shift register. Did you start a new topic which was actually a continuation of another topic and just assumed we had all read the other topic? Be careful, that is considered "cross-posting" and can get you banned from the forum.

PaulRB:
You connect the external PSU to the Vcc and GND pins on the relay board. You must also have a common ground connection between the external PSU and the nodeMCU.

I don't think nodeMCU will have enough pins to drive your 8 relays, so I don't understand your comment about ditching the shift register. Did you start a new topic which was actually a continuation of another topic and just assumed we had all read the other topic? Be careful, that is considered "cross-posting" and can get you banned from the forum.

It was a continuation to my previous post i had esp8266 esp-01 was thinking of using that in my project but the module died, so now i decided to get a NodeMCU to make things easier, The ESP8266 -12E NodeMCU Does have D0-8 pins to power 8 relays. feel free to correct if i am wrong, this is my first project so mistakes are normal :)'.

So i should leave the jumper between vcc and jd-vcc on ?. Cause from the guides i have seen they connect the wires by removing the jumper but i cant get it to work.

Can you post a picture or link to the specific relay module that you have? jqc-3ff-s-z is the part number for the relay itself, what we need to know is what type board the relays are mounted on.

david_2018:
Can you post a picture or link to the specific relay module that you have? jqc-3ff-s-z is the part number for the relay itself, what we need to know is what type board the relays are mounted on.

Sure, i have attached the image. Except its a 5VDC

Remove the VCC to JD-VCC jumper. The power supply is connected to GND and JD-VCC. DO NOT connect the ground from the NodeMCU, connect 3.3V from the NodeMCU to VCC on the relay board, as well as the data lines to drive the relays. The data line inputs to the relay board are active LOW, which means to turn a relay ON, you output a LOW, to turn it OFF, you output a HIGH.

Note - for anyone who insists that a ground connection to the NodeMCU is needed, the relay board is opto-coupled. All the NodeMCU is driving is an LED inside the opto-coupler, and the LED is connected to VCC through a resistor. It no more needs a ground than a discrete LED that you are using as an indicator light.

Might have to connect VCC of the relay board to 5volt (4.6volt) of the NodeMCU.
3.3volt is not enough to overcome the thresholds of two LEDs (opto and indicator) on the relay module.
This won't damage the 3.3volt output pin of the NodeMCU, because of the combined thresholds of the LEDs.

But, you don't have enough I/O for eight channels, so you need a port expander.
Leo..

david_2018:
Remove the VCC to JD-VCC jumper. The power supply is connected to GND and JD-VCC. DO NOT connect the ground from the NodeMCU, connect 3.3V from the NodeMCU to VCC on the relay board, as well as the data lines to drive the relays. The data line inputs to the relay board are active LOW, which means to turn a relay ON, you output a LOW, to turn it OFF, you output a HIGH.

Note - for anyone who insists that a ground connection to the NodeMCU is needed, the relay board is opto-coupled. All the NodeMCU is driving is an LED inside the opto-coupler, and the LED is connected to VCC through a resistor. It no more needs a ground than a discrete LED that you are using as an indicator light.

Which VCC pin on relay board should i connect to the NodeMCU 3.3v pin ? the one next to the data lines or the one thats between GND and JD-VCC

loli_roller:
Which VCC pin on relay board should i connect to the NodeMCU 3.3v pin ? the one next to the data lines or the one thats between GND and JD-VCC

Should not make any difference which VCC pin you use, I usually use the one next to the data lines so all the arduino wiring is together.

david_2018:
Should not make any difference which VCC pin you use, I usually use the one next to the data lines so all the arduino wiring is together.

Awesome,Thank you! :).

Ill try powering the relay tomorrow. lets hope it works :D.

david_2018:
Should not make any difference which VCC pin you use, I usually use the one next to the data lines so all the arduino wiring is together.

Thank you so much man it works, :), I have gone one step further towards completing my first project :D.

It works but there’s one issue when i power it on all the switches starts clicking and the red led on the power supply flickers.

Just for the information i have all the switches on by default, which ill fix it later after i finish up powering the switches properly.