Hi, I'm familiar with these setup and use relays with external supply before with arduino. My project uses PIC Microcontroller running at 3.3V and 4 channel relay. I connect with external power supply JD-VCC to external source and Ground to external ground. I Connected the VCC to 3.3V of the PIC microcontroller. However, the relay(input 4) sometimes runs strange like not enough voltage is drawn, turning off and on quickly. My question is that the gpio from raspi going to input of relay is 3.3V? and Does running 3.3V on VCC ok? Because power seems low.
nice! was it due to the relays requirments. its been such a long time since i touched this stuff i forgot a lot about it I should really start doing more projects like this again. Good luck on your project!
since this was like 3 years ago i forgot most of it, but if i remember correctly you still need to activate the relays with some power i honesly cant rememeber im sorry
Hey Techplant, it was a informative video. I dont have a ground right next to the JD-Vcc pin, can I connect the ground of the 5V power source to the other ground pin which is along with IN1, IN2 pins? Kindly clarify. Thanks
how much power is needed per relay, and how many relays do you want activated at the same time. I forget what these use but if its 500mw and you wanna power 8 at once you are looking at 4W which could be too much for the RPI. again these arent accurate numbers but the concept is the same
what if i have to use a 15-0-15 V at 300mA rating transformer connected to a IC L7805CV Voltage Regulator operating at 5V DC output?! i did this but it resulted in a humming sound when the relay was turned ON, and heating of the IC circuit.
?????? Why connect a seperate wire to VCC as that is connected to the I/O header (at least on mine.) the jumper is only their to connect Jc-VCC to Vcc to power the relays from the IO header. Ah, you didn't use the VCC and GND on the I/O header.
Thanks for the great video! Can you please tell me the purpose of the jumper wire? I know in the video you said it powers the internal relay switches, but don't the relays require 5V? Instead, you're using the jumper to connect to a 3V pin on the RPi (I'm sure I'm the one confused). Also, I am trying to use a 12V external power supply due to the small 12V dosing pumps I'm wanting to use for pH control in a hydroponic system. Can I substitute a 12V external power supply as used in your example? TIA for any help.
The PSU is an external 5v, which powers the actual relays (via JDVCC pin). By removing the jumper block, it allows us to use a 3.3v signal to switch the relays and protect the pi from the 5v circuit.
Im moving into a new place soon, right now ive been limited by my bedroom, and my channel name barely makes sense. But once i have a new house. The entire basement is getting automated using these, lights, water pumps, fans. its gunna be pretty crazy. But this is all going to be like 6 months out. so if you are willing to wait some really cool automation stuff will be comming
Just seeing this today, 3 years after you posted it 😄 I have a question: is the trigger a low signal for this kind of boards? Thank you, very nice and clear video.
no need to supply relay board if you are using 5v 3A power supply you can use power relay from pi gpio. relay operation drop current around 600ma so if you are using 5v 2a power supply for your pi then you need external power supply. I hope you understand
i have a 8 channel board which don't have a JD-VCC pins it has only 10 pins . this board dont have another 3 pins how do i give power supply to all 8 channel .
@@TechplantChannel brother this module don't have the right and same picture online, i bought it from amazon but i can send its pic on your email or whatsapp if you wish .
Technically you don't need to when you use the same power supply for both the RPI and the supply for the relays as the grounding in your building will be more or less the same. However, it is good practice to make sure the grounding, or zero level, of your signals are the same to avoid ground loops
Can you specify if you mean it's better to connect the GND of the RBP with the GND next to IN1 or the GND next to VCC and JD-VCC of the external power?
I get my wall warts/power supplies from thrift stores because they are dirt cheap there. Just look on the label at the output and make sure it says 5v, and has at least .7A rating. If you cant find one, amazon.com offers them for 6-10USD.
I am your student and following your tutorials and i also edit your code. But now i am facing the problem can you please help me. I am using the above configration to turn on and turn off the load as you did in the video. i want to read or sense the pins if they or low every 5 seconds and to print the output in .txt or .csv file. for one pin i have attached the code and it working fine but how i can expand to all 8 channels. please help me python code: import time from time import sleep # Allows us to call the sleep function to slow down our loop import RPi.GPIO as GPIO # Allows us to call our GPIO pins and names it just GPIO GPIO.setmode(GPIO.BCM) # Set's GPIO pins to BCM GPIO numbering INPUT_PIN = 26 # Write GPIO pin number. GPIO.setup(INPUT_PIN, GPIO.IN) # Set our input pin to be an input # Start a loop that never ends while True: if (GPIO.input(INPUT_PIN) == True): # load is turned off. print (time.strftime ("%Y/%m/%d , %H:%M:%S"),"0") else: #now 20 watt load is turned ON!. print(time.strftime ("%Y/%m/%d , %H:%M:%S"),"20") sleep(10); # Sleep for 10 seconds. and i want to save all the data in a .csv or .txt file with time stamp at the start and other 8 columns for pins status that are connected with relay. my output should look like 06/01/2018,18:54:00,1,0,1,1,1,0,0,0 06/01/2018,18:54:05,1,0,1,1,1,0,0,0 06/01/2018,18:54:10,1,0,1,1,1,0,0,0 06/01/2018,18:54:15,1,0,1,1,1,0,0,0 06/01/2018,18:54:20,0,0,0,0,0,0,0,0 please help me
Dear friend ,thank you for your youtube. I already did it but i have some problem for quit. how can I turn off project. when I run project on terminal , i try to close by using ctrl z. The result is stop but when I close terminal window , the project run again. please advise. many thanks in advance
Also, on the relay, there is 3 connectors for each relay. Plus, minus, but the third? And which one is plus and which one is minus and so forth. Thanks
1. When considering a power supply, the most important thing to consider is that it can supply *at least* enough current for any load. So, for example, if you have a device that draws 1 ampere, the power supply should be rated for at least 1 ampere. You can also use a power supply rated for 100 amperes, because a load will only draw what it needs. (Search "ohm's law" and you'll notice voltage and resistance is what dictates current draw) 2. Relay has 3 terminals: The center terminal will connect to one of the outside terminals depending on if its on or off. So, for example, if a relay's left-and-middle terminal are connected when its off, the right-and-middle will be connected when you turn it on. Refer to this picture for more info: www.learningaboutelectronics.com/images/SPDT-relay-diagram.png As you can see, the "COM" pin is normally connected to "NC" but if you power the coil, COM will instead connect to "NO." Hope that helps.
What happen to the relay board when is connected to the raspi and then you turn the raspi on? Does the relays switching during the boot time? Would like to know because that is a very very important point to be able to make meaningful projects.
why use a raspberry pi when you can install the app on the mobile phone ?? the pi is not as stable either as i have been using it..... hangs a lot ....
I see. then what is the purpose of the adapter? I see two power sources going into the relay board. one from raspberry pi, one from the wall. Shouldn't one of them power devices connect to a relay?
it takes about .7 amps to power all 8 relays at a time, so the adapter takes the brunt of the load away from the rpi. otherwise your rpi will struggle to run well during high load.
That makes sense. Any video you could provide me with to power the actual relays? I will essentially connect my relay to the wall outlet and power stuff with it.
The .7amp 5v is in fact what powers the actual relays. The relays are essentially a switch that will provide or cut power to what ever is hooked up to them. Think of it as a light switch! Hope this helped
Im not really sure, here is the data sheet for the relays on this board - pub.ucpros.com/download/27115-Songle-Relay-Datasheet.pdf?osCsid=tqkrkpgfau5ki5j03e5lmk89b5
Hi, I'm familiar with these setup and use relays with external supply before with arduino. My project uses PIC Microcontroller running at 3.3V and 4 channel relay. I connect with external power supply JD-VCC to external source and Ground to external ground. I Connected the VCC to 3.3V of the PIC microcontroller. However, the relay(input 4) sometimes runs strange like not enough voltage is drawn, turning off and on quickly. My question is that the gpio from raspi going to input of relay is 3.3V? and Does running 3.3V on VCC ok? Because power seems low.
Great video! I tried many things but this one got me in the right direction. very cool!
Cn you tell me will this relay work on raspberry pi 3 model b
This is one very clear and very well made video
Thanks!
Short but very useful video, thanks
vielen lieben Dank gut erklärt, sehr gut und sehr sehr interessant !
I've had to watch this more than I'd like to admit.
No worries. I watch tutorials a ton too!
Techplant I’m a post grad at RUclips University by now.
Great video, worked perfectly, except that I needed to connect the VCC pin to the 5V on the Raspberry pi B instead of the 3.3V.
nice! was it due to the relays requirments. its been such a long time since i touched this stuff i forgot a lot about it I should really start doing more projects like this again. Good luck on your project!
why was the single cable plugged into the 3V supply pin of RPI?
since this was like 3 years ago i forgot most of it, but if i remember correctly you still need to activate the relays with some power i honesly cant rememeber im sorry
Hey Techplant, it was a informative video. I dont have a ground right next to the JD-Vcc pin, can I connect the ground of the 5V power source to the other ground pin which is along with IN1, IN2 pins? Kindly clarify. Thanks
Yes. No problem with that.
What conditions decide, whether the power supply of the Raspberry is sufficient or a external power source has to be added?
how much power is needed per relay, and how many relays do you want activated at the same time. I forget what these use but if its 500mw and you wanna power 8 at once you are looking at 4W which could be too much for the RPI. again these arent accurate numbers but the concept is the same
Okay, got it. I also found a document saying one relay needs 450 mW. Thanks!
what if i have to use a 15-0-15 V at 300mA rating transformer connected to a IC L7805CV Voltage Regulator operating at 5V DC output?!
i did this but it resulted in a humming sound when the relay was turned ON, and heating of the IC circuit.
im not really sure to be honest sorry!
Thanks
Does the pi support all kinds of relays ?
220v / 12v ...etc
??????
Why connect a seperate wire to VCC as that is connected to the I/O header (at least on mine.) the jumper is only their to connect Jc-VCC to Vcc to power the relays from the IO header.
Ah, you didn't use the VCC and GND on the I/O header.
Thanks for the great video! Can you please tell me the purpose of the jumper wire? I know in the video you said it powers the internal relay switches, but don't the relays require 5V? Instead, you're using the jumper to connect to a 3V pin on the RPi (I'm sure I'm the one confused). Also, I am trying to use a 12V external power supply due to the small 12V dosing pumps I'm wanting to use for pH control in a hydroponic system. Can I substitute a 12V external power supply as used in your example? TIA for any help.
The PSU is an external 5v, which powers the actual relays (via JDVCC pin). By removing the jumper block, it allows us to use a 3.3v signal to switch the relays and protect the pi from the 5v circuit.
Does the py still need amperage for switching the relay with the external power supply?
Yes it still uses a tiny bit to activate the relay but the relay is using thr psu
Are you powering the pi through the relay board instead of powering the relay board through the pi, or are you using two power supplies?
No they each have a separate psu
@@TechplantChannel Thank you
Very interesting, a really good followup video would be, if you showed how to make a touch screen GUI to activate each relay
Im moving into a new place soon, right now ive been limited by my bedroom, and my channel name barely makes sense. But once i have a new house. The entire basement is getting automated using these, lights, water pumps, fans. its gunna be pretty crazy. But this is all going to be like 6 months out. so if you are willing to wait some really cool automation stuff will be comming
@@TechplantChannel thats awesome! Congratulations!, you must be very excited, no worries I'll wait.
Just seeing this today, 3 years after you posted it 😄
I have a question: is the trigger a low signal for this kind of boards?
Thank you, very nice and clear video.
I dont have a JD-VCC on my board, where can I connect the power supply?
Contrary to some, I actually enjoyed the music. What is the song?
Oh yeah, and this helped a lot. Thank you
At this point i have no idea. but it is one of the free songs youtube lets us use. sorry!
Thanks for this video, helped me a lot! I have a 5V 3A power supply, can i use this single source for the RPi and the relay board as well?
im not an expert on this question, but i bet you could split the psu off into two separate power plugs. and attach one to the pi and one to the relay.
no need to supply relay board if you are using 5v 3A power supply you can use power relay from pi gpio. relay operation drop current around 600ma so if you are using 5v 2a power supply for your pi then you need external power supply. I hope you understand
i have a 8 channel board which don't have a JD-VCC pins it has only 10 pins . this board dont have another 3 pins how do i give power supply to all 8 channel .
can you link me the model, im not an expert so id have to see and do some research
@@TechplantChannel brother this module don't have the right and same picture online, i bought it from amazon but i can send its pic on your email or whatsapp if you wish .
upload it to imgur and link it here!
@@TechplantChannel i make a Google Drive Link here it is - drive.google.com/file/d/17BC80SY1wBHM-3qSKZnWlmc1kXxSOUR_/view?usp=drivesdk
Hi, how did you make that power supply? Can I use one of the ribbon cables with a charger to make one myself?
Your solution may work, what doesn't mean it's perfect: you forgot to connect the ground(s) between the Pi and the relay board.
Do you need too?
Technically you don't need to when you use the same power supply for both the RPI and the supply for the relays as the grounding in your building will be more or less the same. However, it is good practice to make sure the grounding, or zero level, of your signals are the same to avoid ground loops
Can you specify if you mean it's better to connect the GND of the RBP with the GND next to IN1 or the GND next to VCC and JD-VCC of the external power?
Can the 8 relay script be used with Venus os?
Great video my dude
It's hard to hear the narrator with all of the noise in the background.
sorry, this was one of my first videos ive ever made so i made some rookie mistakes
Good video. The music is VERY distracting and makes it super hard to hear.
Sorry about that this was one of my first videos when i just started so i was a rookie!
could you make video explain wiring relay 8 ch in Raspbery 3 B+
Can i use 12volt relay board with 12volts external supply on raspberry
Which software should I use for the 8 channel relay????
That depends what you want to do with the relay board.
How's the Pi getting ground???
Its in a box now doing nothing. but im moving soon and im gunna make some elaborate plant setups that will use this!
@@TechplantChannel I'm working on a industrial bottle filling machine with raspberry pi 3 b+
Where can I buy an external power supply like that one? And/or how can I build it?
I get my wall warts/power supplies from thrift stores because they are dirt cheap there. Just look on the label at the output and make sure it says 5v, and has at least .7A rating. If you cant find one, amazon.com offers them for 6-10USD.
I am your student and following your tutorials and i also edit your code.
But now i am facing the problem can you please help me.
I am using the above configration to turn on and turn off the load as you did in the video. i want to read or sense the pins if they or low every 5 seconds and to print the output in .txt or .csv file. for one pin i have attached the code and it working fine but how i can expand to all 8 channels. please help me
python code:
import time
from time import sleep # Allows us to call the sleep function to slow down our loop
import RPi.GPIO as GPIO # Allows us to call our GPIO pins and names it just GPIO
GPIO.setmode(GPIO.BCM) # Set's GPIO pins to BCM GPIO numbering
INPUT_PIN = 26 # Write GPIO pin number.
GPIO.setup(INPUT_PIN, GPIO.IN) # Set our input pin to be an input
# Start a loop that never ends
while True:
if (GPIO.input(INPUT_PIN) == True):
# load is turned off.
print (time.strftime ("%Y/%m/%d , %H:%M:%S"),"0")
else:
#now 20 watt load is turned ON!.
print(time.strftime ("%Y/%m/%d , %H:%M:%S"),"20")
sleep(10); # Sleep for 10 seconds.
and i want to save all the data in a .csv or .txt file with time stamp at the start and other 8 columns for pins status that are connected with relay.
my output should look like
06/01/2018,18:54:00,1,0,1,1,1,0,0,0
06/01/2018,18:54:05,1,0,1,1,1,0,0,0
06/01/2018,18:54:10,1,0,1,1,1,0,0,0
06/01/2018,18:54:15,1,0,1,1,1,0,0,0
06/01/2018,18:54:20,0,0,0,0,0,0,0,0
please help me
Ill look into this soon!
Dear friend ,thank you for your youtube. I already did it but i have some problem for quit. how can I turn off project. when I run project on terminal , i try to close by using ctrl z. The result is stop but when I close terminal window , the project run again. please advise. many thanks in advance
Im not really sure why its doing that, how are you running the script? try CTRL C
Could one have a 5V 2A adapter? Or is 2A to much?
Also, on the relay, there is 3 connectors for each relay. Plus, minus, but the third? And which one is plus and which one is minus and so forth. Thanks
It should be fine as the relay will pull what it needs. The important number to not deviate from is the 5v.
I will try and get up a video explaining that
Thank! :)
1. When considering a power supply, the most important thing to consider is that it can supply *at least* enough current for any load. So, for example, if you have a device that draws 1 ampere, the power supply should be rated for at least 1 ampere. You can also use a power supply rated for 100 amperes, because a load will only draw what it needs. (Search "ohm's law" and you'll notice voltage and resistance is what dictates current draw)
2. Relay has 3 terminals: The center terminal will connect to one of the outside terminals depending on if its on or off. So, for example, if a relay's left-and-middle terminal are connected when its off, the right-and-middle will be connected when you turn it on. Refer to this picture for more info:
www.learningaboutelectronics.com/images/SPDT-relay-diagram.png
As you can see, the "COM" pin is normally connected to "NC" but if you power the coil, COM will instead connect to "NO." Hope that helps.
Great video; thanks! Can you point me to tutorial info that shows how to actually command those relays?
What happen to the relay board when is connected to the raspi and then you turn the raspi on? Does the relays switching during the boot time? Would like to know because that is a very very important point to be able to make meaningful projects.
why use a raspberry pi when you can install the app on the mobile phone ?? the pi is not as stable either as i have been using it..... hangs a lot ....
Is that adapter going to power all the relays?
It provides them power to turn on and off, but it will not power devices that are connected to each relay.
I see. then what is the purpose of the adapter? I see two power sources going into the relay board. one from raspberry pi, one from the wall. Shouldn't one of them power devices connect to a relay?
it takes about .7 amps to power all 8 relays at a time, so the adapter takes the brunt of the load away from the rpi. otherwise your rpi will struggle to run well during high load.
That makes sense. Any video you could provide me with to power the actual relays? I will essentially connect my relay to the wall outlet and power stuff with it.
The .7amp 5v is in fact what powers the actual relays. The relays are essentially a switch that will provide or cut power to what ever is hooked up to them. Think of it as a light switch! Hope this helped
are relays bistable or monostable?
Im not really sure, here is the data sheet for the relays on this board - pub.ucpros.com/download/27115-Songle-Relay-Datasheet.pdf?osCsid=tqkrkpgfau5ki5j03e5lmk89b5
can you use a 7.5 v power supply?
It depends on the 8 channel relay and if the voltage regulator can handle that large of a difference. What relay do you own?
do relays "remember" positions when ppowered off, or do they fall back into "default"?
they fall back into default.
Will he reply to a person commenting on a 3 year old video?
for sure i will
how about 7 years old?
how do i make the 5v 0.7A power supply. Please help my life is on the line
how soon do you need a video?
idk but the disease is catching up to me i dont have alot of time. plz make video or i die
Sentimental value ok I'll try tomorrow
Do we really need the music? ?
Robert D it's essential!
Not work
hi
hi
Would have been a great video but the music was too annoying. Could not watch the entire vid.