I thought I blow my boards up only to realize, they were high and needed to pull them down via negative. Now i can proceed with my project all thanks to your helpful video
didn't saw it before, it's just what want! I have some similar relays around, but I'm getting convinced to get a ready to go board like your's there. one of the thing I wanted to do if also get a IR receiver and map the tv's remote to say the gpios, similar to your motion sensors. anyway, thanks for the replays, make some more quick vid's on working thing, forces some inspiration to me:)
I got it from ebay. Check the about section and click show more to see the link to the 8 channel board. When you're buying a relay look for the optocoupler, as this will allow you to run it with your raspberry pi.
These are the one's I use here in New Zealand, as they are "off-the-shelf", and thus there's no bothering with extremely long - covoid shipping delays &/or high cost taxation/custom duty restrictions (on importing anything myself). www.jaycar.co.nz/arduino-compatible-8-channel-relay-board/p/XC4418
perhaps because he doesn't have the need for opto isolation. Then one would ask, why bother with a board that has opto isolation when the load is already isolated...
@@axa.axa. isn't the other for ground I heard you say the one on the right that's why I was asking. I have my own relays and im using a 2amp 5v supply to give power than im using a arduino
@@lightsonmatfield4031 The JD-VCC - VCC (jumper letters) is a shortened term for: This [LINK] JUMPS this -VCC onto THAT -VCC Being the 5vDC jumper - is JUMPED onto the relay's (supposedly 12vDC power) coil circuit feed Thereby voiding the opto-couplers job, by completely removing them from each relay coil input controls. This also has a tendency to remove isolation between all of the relay coil circuits - and could potentially screw your 5vDC device - if any of the 8 relays "fly-back" diodes fail. Thus - why purchase an opto-coupler relay board - if all you want to do - is jump out the opto-couplers and STILL risk your 5vDC device.? Risking any 12vDC signal source - to direct control the power to 12v relay coils - isn't such a bad thing . But to overstrain a small 5vDC device - by lumbering it with directly controlling EIGHT 12vDC coil circuits - that's insane.
Hey, Glad it got your interest! DON'T USE MAINS. Mains can kill and they're well beyond my skill set (that's why I stick to 12V lights). The relays say they can handle mains, and if you talk to an Electrical Engineer there's no reason you can't. But why die for a little project? Hope that helps, P
YES - skiwithpole Do use these for 230vAC MAINS circuit controllers - as these relays can handle 10A 230VAC Talk to an electrician first to show them you know what you want to achieve, and AFTER you cold-wire your 8-way relay boards, YOU MUST ALSO ensure that same Electrician - then both check's your board's entire wiring, (as well as to "final connect" any switched 230v terminal circuits) You though, can "cold-wire" the entire thing, and you can also extend the switched relay outputs (into terminal blocks) for the 230vAC Mains "switching functions". Thus when completed - all that requires checking by the Sparkie (Electrician) - is a visual check for both the 5vDC signal & 12vDC supply circuits, to the relays. They then MUST COMPLY with all regulations to both insulation test and continuity test the 230vAC Mains connected to the relay outputs, (to ensure the 230vAC circuits feed correctly into their correct terminal blocks) and finally the electrician is the ONLY ONE who can then connect them into whatever house wiring circuits - these control To say NO - you cannot use 230vAC Mains in your final circuits - (switched via these "230vAC 10A capable" relays) - is sheer nonsense To tell you NOT to use an electrician is also WRONG. You can cold-wire anything - just remember to never connect it yourself, if it is to be connected into 230vAC mains As that's why an Electrician spends 4 YEARS learning about all aspects of safety and correct wiring methods, before becoming qualified to connect. It isn't as easy a job as some think (to "safely" connect to mains circuits without the correct qualifications), but it's fairly easy to be cold-wiring something - for an Electrician to (later) thoroughly circuit test & final-connect - BEFORE IT IS LIVENED. Thinking that ONLY mains can kill is a false knowledge. 5vDC can kill you - if it "gets you" in the most susceptible places - such as directly across your heart . Something easily achieved if careless by leaning onto a bench (livened with 5vDC) and licking the end of a cable - to see if it's LIVE..? It may be - but YOU "won't be" - very rapidly. An unfused 5vDC supply can have enough milliamps of KILLING POWER - to stop your heart beating. I've had a few tickles in my years of Industrial Electrical work - such that I've been sent flying (rapidly sliding across a machine room floor) - by accidentally touching LIVE 400vAC 3phase mains bus bars. It didn't kill me but boy what a thumping headache I had for days afterwards (after head-first slamming into the far concrete wall), and even to this day - sharp pains in the nerves of my right arm and both legs - (why - it's because the current went directly from my Right arm and down both legs - BUT NOT via the heart. 220kva (& higher) "overhead transmission line voltages" will generally THROW YOU away from them (that is - if you accidentally get a shock connection between lines) - but at that voltage - you will normally survive.! That is because the current at that voltage travels across the skin itself, and NOT deep inside your thicker muscle tissues etc. and thus mostly doesn't travel through your veins which means it usually doesn't effect the heart - but simply burns your skin at the contact points, or along the skin where it took the shortest route. . Knowing how voltage plays a part in powering things, as to how much CURRENT your body can withstand - doesn't lead to the old concept of the lower the voltage the safer you are. Sometimes the lower the voltage - the higher the risk of deep vein burning - and a stopped heart beat
Thanks For the Video. I used that same sainsmart 8 channel relay board with my arduino Uno r3. I power the relay board from the arduino like you do with your pi. The arduino doesnt deliver enough power to the relay board to operate more than 2 or 3 relays at a time. How would I connect a 5v external Power source to the Sainsmart Relay board and retain a common gnd to the arduino? Thanks!!
is it possible to connect the GP10 direct to a mosfet like IRF840PBF ? or i need also relay like the one you showed to turn on and off the gate on the mosfet IRF840PBF ?
GPIO as in Input / Output. I would think yes, you could do that. But then the output would be limited to a maximum of 5V and only a very tiny amperage.
@@skiwithpete the mosfet will be used to turn on and off 220 volts 5amps I guess I will need to use the relays you used but how fast can they turn on and off what is the maximum frequency?
Hi Pete, this is an awesome vid, and I'm loving the neat circuit layout, its thing of beauty but it's left me with one question, why have you used 6 way connectors for the 'separate' connections on the right of the circuit (see 0.03 in video)? I get the two 8-ways used for splitting the initial positive and negative wires but why don't they they connect into eight 2-way connectors instead of eight 6-way connectors as shown? Is this essential if you're just running one device off each of the relays, are you connecting three devices into each of the 8 (if you are then you're a lot more hardcore than me ;) Cheers for any help on this
The 6 way connectors would each attach 3 lights. My thinking was 1) path, 2) area 3) highlight (like a tree or a flower). I lived in the woods and it was both dark and a winding path to get to the front door - it had a certain scariness when it was dark. Even when the path was lit. That's why that was the plan was to use multiple lights on each section. My light selection video will probably shed more... err... light on this. As the steps would have used LED strips, floods for the area, and spots for the highlights. Let me know if I can help any further. Cheers, P
Looks simple enough to me. Nice. How many channels can the Pi handle? I've got a project that's been itching in my head for some time that I'd love to do.
Hey, thanks for watching! In terms of the "live side" my relays are rated to 240V 10A. You should check the relays on your board, as they could be (and likely are) different. Truthfully, I don't understand your second question. You only split the live wire to the relay board. Ground and Return, do not connect to the relay directly (they're represented as the Black on my board). Talk to an electrician. It's not hard. They work at most colleges or are in the Yellow pages. Don't die, P
Actually - most electricians are way too busy doing their daily jobs - except for old retired sparkies, (such as myself), who love nothing better than to have a "yarn" to someone who needs help - understanding electrical circuits &/or control of extra low voltage circuits, using (oh yes) relays.
Hy i have a switch tah conected to 15 lamp. Am i able to use relay to switch 15 lamp in one channel. I don't know the specifications of lamps that im use.
Hi, just lurking around and wanted to ask a quick question since I myself em just in highschool and don't know what I'm doing much: Just what can I connect to the relay board? how much can it hold, say can I plug it to a 220v wall socket as a switch? standart light bulbs? a tv/monitor? where should it say how much it held's? Sorry, but I'm just hoping to clear out something before I start the fun.
Hey Kris, You're really testing my knowledge here. The static current would be 5v*XmA + (3.3v *2mA)*8=Y Unfortunately, I don't off the top of my head know the value of X, different spec sheets say it is in the 50-75mA range (for a single relay, depending on the manufacturer) - though I'm sure you can look it up for your board and the number of relays you intend to power. As for the Dynamic current, I'd have to measure at the mains - which I haven't. Let me know if there's any more info I can provide, or if you come to different numbers I'd be interested to hear. Cheers, P
skiwithpete I was wondering if a cheap USB phone charger could handle the power for both RPI and all , in my case 4 , relays. And be sure that in case of switching all relays simultaneous , nothing will burn. Which I think will happen since these cheap chargers are common 700 mA rated . .
Hi, i will connect the 8relay board to my rpi2, basically to control lights. Do you have any diagram showing the high voltage connections from the relays to the lights? thanks
heh, it's not such a deadly interest and a single 220v socket hasn't killed my yet(although shaken much, yes.) Not the first time I'm playing with high power, it's just that I'm really afraid to connect the pi to anything since they are hard to come by around where I am. Sorta getting paranoid. ever since I got it, it was running only webservers for my studies, but I did make an apache,php with mysql and a python script thing to control the gpios via the web. thanks for getting back!:)
Hi @funnybasterd - if you are still alive after 7 years of "playing around" the higher power - 220v sockets. NEVER assume that 220v sockets won't kill you - no matter how LUCKY you have been (in the past), as you won't know when the next one does kill you. There's no remembering past events - or the current event (excuse the pun - fully intended) - if the next "shock" kills you.
10 лет назад
can you control from a web page on a web server hosted by thepaspbeery pi?
hi i need some help i have a rapsberry pi B+ and i connected an 8 channel relay to it just like you did and i also have a jumper on VCC and JD-VCC when i power up my pi, all relay led lights up... except the last one is there anything wrong ? what should i do ?
really ? i can use a 2A power supply ? actually the 7 leds lights up as soon as i plug my power supply to the pi :/ and when i run a script the led would light brighter :/ its not like in you videos where the leds are off and lights up when a script is run ! ah thats cool awaiting this review ;)
That's a good idea - unfortunately, I've just moved from NZ to NYC and my stuff won't arrive for another couple of weeks. Hope you can hold on until then...
Great video! Can i do the same with AC (as in 230V 2A Alive Current) given i invite all my friends for a kamikaze funeral the day before i plug it in? A bit puzzled how your relays pretty much the same as the once i have on a board i bought ( sf-innovations.co.uk/custard-pi-6.html ) react to AC since both feeds need a shared ground (unless you just hook it up "honey boo boo" style..)
I should really create another video for this question. Basically JD-VCC is the power for the relay. And VCC is the power for the switch to turn on/off the relay. The way I have set it up in this video, the jumper connects JD-VCC & VCC - I did this because it's easy, but this isn't necessarily the best way to do it. Check my how to - but also know there's another way to do it, connecting 3.3V to the VCC. I'll post another video soon. P
ok, I think I got it. here is the schematic: www.sainsmart.com/media/catalog/product/cache/1/image/500x500/b97a0c6c1d16e76f7464abfcbb6a0a8d/4/c/4channel-relay2.jpg you want 3.3 volts on the VCC pin, and 5.0 Volts on the JD-VCC the VCC is the power for the LED portion of the optically isolated transistor U[x] JD-VCC feeds the collector of the optically isolated transistor U[x] and depending on whether or not the IN[y] connected to to pi is either a 3.3 or a 0 will allow the JD-VCC voltage to pass thru to the emitter. JD-VCC is also the power for the relay coil,to the right of D[x] when you apply 5v to the VCC pin you are asking the optically isolated transistor rather than toggling the power to the led of the optically isolated transistor between 3.3 and 0, you are toggling it between 5.0 and 1.7. If it works, its because the 1.7 volts is not enough to power the led, and you are just "getting away with it." you have also disabled the safety mechanism of the optically isolated transistor.as the jumper connects VCC and JD-VCC, you now have a copper to copper connection from the pi to the relay as that relay is mechanical, and might be throwing some real power it can back through into the Rpi What I believe you want is for the VCC and the pin to be coming from the Rpi and the ground and JD-VCC to come directly off of the 5v power supply. BTW, this is not intuitive, this is really confusing. .
Hi pete! I'm pretty new to this stuff and I've read, that there is a problem with the rpi's 3.3V output pins in combination with the 5V relais. I'm about to modify the connection as in github.com/fixedd/RPi_Relay_Interface but it also says, that the relais board may already have this logic included. I would buy this board: www.amazon.de/Tomorrowtop-Aktiv-Niedrig-Relais-Arduino/dp/B00EDHX4Z4/ and I wanted to ask you, if you know if this is safe to use without the additional transistor board. In this picture it shows 2 resistors and a transistor for each input as it is done in the mentioned project above: ecx.images-amazon.com/images/I/61PovzyTvdL.jpg I would be glad if you could help me =)
On SainSmart they say you need to connect the Pi to the Relay board differently in order for it to work with a Raspberry Pi www.sainsmart.com/8-channel-dc-5v-relay-module-for-arduino-pic-arm-dsp-avr-msp430-ttl-logic.html docs.google.com/file/d/0B5-HND9HJkXWSTQtYlFTZ3VyODA/edit I just got a Pi B+ and I am new to the EE side of things. Do I need to wire it the way SainSmart is doing it or can I connect the Pi directly to the relay? I am looking at buying a SainSmart 8 channel relay from Amazon (link below). www.amazon.com/SainSmart-8-CH-8-Channel-Relay-Module/dp/B0057OC5WK/ref=cm_cd_ql_qh_dp_t Thanks a lot for creating videos like this!
The images you show are how to connect a 5V relay. But the optocoupler relay that I use can take lower voltages, so you don't need to connect it in that way...
Thus - as this appears to be - an 8-way 12vDC RELAY board - with opto-couplers on all inputs. I take it (also) that your "Raspberry Pi" - is only outputting a 5vDC power source.. You are attempting (in this video) to tell everyone here, that the 5vDC (your little device outputs) is good enough to provide enough power for all 8 of those 12vDC relay coil circuits, even if these 12vDC coils - are all powered on (as occurs at some stage of the relay ops). I would assume that you have zero idea, what the opto-couplers are there for, as their primary function is to increase the 5vDC signal outputs from your PI - to operate the 12vDC relay coils. Thus - you have to have a 12vDC supply (ready) for the relay coils, and that then allows for these 5vDC signal outputs from your PI device - to control the 12vDC feed to each relay - when controlled via the 8 opto-couplers (when a signal arrives from the various 5vDC PI signals - all of which ONLY have 5vDC signals - that are boosted via the "on-board" opto-coupler circuitry. It is these opto-coupler circuits themselves, that allow the 12vDC to operate the 12vDC relay coils, as they are designed to "electronically" switch the 12vDC supply (to allow each relay coil to get enough voltage & thus working current - off the 12vDC) when your little device can only supply 5vDC signals. An external 12vDC supply is required to be powered ON at all times that you have the board connected to your PI, thus you also need to switch it on & off, (or have that always on) before any of your PI's 5vDC signals will operate the opto-coupler circuits, to electronically control the relay coil circuits. To thus allow the 8 "signal controlled" opto-couplers to switch that 5vDC signal - via the 12vDC feed which in turn switches the coils of the 12vDC relays - that each relay those opto-couplers control, You need to optically isolate the 12vDC supply feed, from your PI's 5vDC signals The relays thus are switched optically from just 5vDC (when your 5vDC PI sends a signal via one of the 8 outputs - all of which ONLY have a 5vDC signal feed, coming from the PI master unit). As the relays themselves require 12vDC - the 5vDC signals coming from your PI will NEVER be sufficient to power-on 1 relay coil - let alone all 8 of the relay coils - unless they are BOOSTED by the opto-coupler booster circuits. Only by way of the opto-coupler circuits, can the 5vDC - switch the 12vDC into their respective 12v Relay coils - which then allows your tiny 5vDC signals to be keeping the relays ON - as this is achieved from the 12vDC supply - powering the relays via the opto-coupler circuit/s. THE 230vAC (lighting mains power) on the relay contacts themselves - that is (ALSO) isolated from BOTH the 12v relay coil circuits, as well as double isolated from the 5vDC PI signal outputs, by way of the relays themselves AND by way of the isolation features - of those 8 opto-couplers. p.s. NEVER FEED any relay's N/O terminals - with 230v AC mains, as these SPDT contacts are designed to ONLY have the commons looped across live mains. The relays then switch the mains via either NO - or the NC contacts. Thus one can have a small RED / GREEN illumination panel at or beside the output contacts, such that (at a glance) one can instantly tell if a relay is powered on - or not. By inserting the mains - into ONLY the NO contact terminals and looping from there. You can NEVER get switch functions indicated on a control panel - showing the aspects of each relay. Why? Because the NC contacts can NOT get power from the NO contact - as the common contact disconnects from the NO before closing the NC (& visa versa). .. Now lets get it straight shall we. Your PI is 5vDC (only) and outputs low power (low current) 5vDC signals The relays are all 12vDC (meaning that they have higher current consumption 12vDC coils) It's the relay contacts - that switch the 230v AC Mains. The 5vDC PI does NOT directly switch the 12vDC relay coils (that's what the 5vDCto12v DC opto-couplers are for) & The PI also does NOT switch directly - any of the 230v AC Mains circuits - (that's what all 8 relay contacts are for via the NO & NC contacts) . By connecting JUST your 5vDC PI directly to the 12vDC relay board - to directly control all 8 relays You seriously run the risk of destroying your tiny PI's 5vDC output signal circuits, as these ARE NOT DESIGNED - to power 12vDC Relay coils. You can get away with direct driving "relays" from the PI - when using one (or two) 5vDC relays only. Never attempt to circumvent the opto-couplers by selecting the JUMP circuit jumper - as that LINK is there for 12vDC signals. Not for direct driving 12vDC relay coils, from the tiny PI's 5vDC low-current signal outputs. Also of note. NEVER EVER loop the 230v AC Mains - by using the NO contact terminals of any relay. The COMMON terminal is best for that - as inside the relay - the common terminal circuit is better protected from the coil circuit. When the NO contact closes, there's usually a load on that circuit, such that the risk of an internal spark-over is lessened. Also - if one needs BOTH a normally open AND a normally closed contact - for any ONE circuit controlled by each relay - by feeding the live AC in via the NO contact - you defeat the need for the NC contact (as it will NEVER see the live AC mains) . The additional reason for center feeding (via the Common terminal) the 230vAC mains is this, when any relay FAILS to operate - there is the option of having a Normally Closed "indicator light" connected. Thus one can instantly see - which relay is powered ON - & which is faulty (if it should be on) You can also see which has blown internally - if all indicators for that relay are both on (or both off) Sparkies know a little more (about electrical circuits and their design characteristics) than your everyday kit-basher - as that's been our lively-hoods, for most of our working lives.
I thought I blow my boards up only to realize, they were high and needed to pull them down via negative. Now i can proceed with my project all thanks to your helpful video
That is some serious camera stabilisation
didn't saw it before, it's just what want! I have some similar relays around, but I'm getting convinced to get a ready to go board like your's there. one of the thing I wanted to do if also get a IR receiver and map the tv's remote to say the gpios, similar to your motion sensors. anyway, thanks for the replays, make some more quick vid's on working thing, forces some inspiration to me:)
I got it from ebay. Check the about section and click show more to see the link to the 8 channel board. When you're buying a relay look for the optocoupler, as this will allow you to run it with your raspberry pi.
These are the one's I use here in New Zealand, as they are "off-the-shelf", and thus there's no bothering with extremely long - covoid shipping delays &/or high cost taxation/custom duty restrictions (on importing anything myself).
www.jaycar.co.nz/arduino-compatible-8-channel-relay-board/p/XC4418
I've seen some info that suggests a resistor betweent he GPIO and the relay. Is that necessary or not in your opinion?
Howdy, Why did you set the jumper to JD-VCC - VCC?
perhaps because he doesn't have the need for opto isolation. Then one would ask, why bother with a board that has opto isolation when the load is already isolated...
@@axa.axa. isn't the other for ground I heard you say the one on the right that's why I was asking. I have my own relays and im using a 2amp 5v supply to give power than im using a arduino
@@lightsonmatfield4031
The JD-VCC - VCC (jumper letters) is a shortened term for:
This [LINK] JUMPS this -VCC onto THAT -VCC
Being the 5vDC jumper - is JUMPED onto the relay's (supposedly 12vDC power) coil circuit feed
Thereby voiding the opto-couplers job, by completely removing them from each relay coil input controls.
This also has a tendency to remove isolation between all of the relay coil circuits - and could potentially screw your 5vDC device - if any of the 8 relays "fly-back" diodes fail.
Thus - why purchase an opto-coupler relay board - if all you want to do - is jump out the opto-couplers and STILL risk your 5vDC device.?
Risking any 12vDC signal source - to direct control the power to 12v relay coils - isn't such a bad thing .
But to overstrain a small 5vDC device - by lumbering it with directly controlling EIGHT 12vDC coil circuits - that's insane.
Is there a way to add a manual switch to each relay to bypass the pi? Basically adding a manual feature to turn on/off each relay...
Thanks for the nice videos on this. Really helping me out, and well explained.
Great stuff. Where did you get that clear perspex case for your pi?
Hey,
Glad it got your interest!
DON'T USE MAINS.
Mains can kill and they're well beyond my skill set (that's why I stick to 12V lights). The relays say they can handle mains, and if you talk to an Electrical Engineer there's no reason you can't. But why die for a little project?
Hope that helps,
P
YES - skiwithpole
Do use these for 230vAC MAINS circuit controllers - as these relays can handle 10A 230VAC
Talk to an electrician first to show them you know what you want to achieve, and AFTER you cold-wire your 8-way relay boards, YOU MUST ALSO ensure that same Electrician - then both check's your board's entire wiring, (as well as to "final connect" any switched 230v terminal circuits)
You though, can "cold-wire" the entire thing, and you can also extend the switched relay outputs (into terminal blocks) for the 230vAC Mains "switching functions".
Thus when completed - all that requires checking by the Sparkie (Electrician) - is a visual check for both the 5vDC signal & 12vDC supply circuits, to the relays.
They then MUST COMPLY with all regulations to both insulation test and continuity test the 230vAC Mains connected to the relay outputs, (to ensure the 230vAC circuits feed correctly into their correct terminal blocks) and finally the electrician is the ONLY ONE who can then connect them into whatever house wiring circuits - these control
To say NO - you cannot use 230vAC Mains in your final circuits - (switched via these "230vAC 10A capable" relays) - is sheer nonsense
To tell you NOT to use an electrician is also WRONG.
You can cold-wire anything - just remember to never connect it yourself, if it is to be connected into 230vAC mains
As that's why an Electrician spends 4 YEARS learning about all aspects of safety and correct wiring methods, before becoming qualified to connect.
It isn't as easy a job as some think (to "safely" connect to mains circuits without the correct qualifications), but it's fairly easy to be cold-wiring something - for an Electrician to (later) thoroughly circuit test & final-connect - BEFORE IT IS LIVENED.
Thinking that ONLY mains can kill is a false knowledge.
5vDC can kill you - if it "gets you" in the most susceptible places - such as directly across your heart .
Something easily achieved if careless by leaning onto a bench (livened with 5vDC) and licking the end of a cable - to see if it's LIVE..?
It may be - but YOU "won't be" - very rapidly.
An unfused 5vDC supply can have enough milliamps of KILLING POWER - to stop your heart beating.
I've had a few tickles in my years of Industrial Electrical work - such that I've been sent flying (rapidly sliding across a machine room floor) - by accidentally touching LIVE 400vAC 3phase mains bus bars.
It didn't kill me but boy what a thumping headache I had for days afterwards (after head-first slamming into the far concrete wall), and even to this day - sharp pains in the nerves of my right arm and both legs - (why - it's because the current went directly from my Right arm and down both legs - BUT NOT via the heart.
220kva (& higher) "overhead transmission line voltages" will generally THROW YOU away from them (that is - if you accidentally get a shock connection between lines) - but at that voltage - you will normally survive.!
That is because the current at that voltage travels across the skin itself, and NOT deep inside your thicker muscle tissues etc. and thus mostly doesn't travel through your veins which means it usually doesn't effect the heart - but simply burns your skin at the contact points, or along the skin where it took the shortest route. .
Knowing how voltage plays a part in powering things, as to how much CURRENT your body can withstand - doesn't lead to the old concept of the lower the voltage the safer you are.
Sometimes the lower the voltage - the higher the risk of deep vein burning - and a stopped heart beat
Could you tell me what camera are you using to record this? Its image stabilization is astonishing.
Un Usuario Sony HDR-11. With image stabilization, then computational stabilization through youtube.
Thanks For the Video. I used that same sainsmart 8 channel relay board with my arduino Uno r3. I power the relay board from the arduino like you do with your pi.
The arduino doesnt deliver enough power to the relay board to operate more than 2 or 3 relays at a time. How would I connect a 5v external Power source to the Sainsmart Relay board and retain a common gnd to the arduino? Thanks!!
Hey - cool video. Can I ask where you picked up your relay board please?
If 2 or 3 or more relays to be kept staying on, would the relay board drawing to much current than the raspberry pi can handle? Thanks.
When I move out in half a year I'm totally gonna rig my lights in my house up to a RPI, some iBeacons and a light sensor!
Beautiful job! Thanks for sharing.
Hi! can you please tell me what is the maximum number of relays that can be operated with 1 rpi3.
Hi amit, you can use as much relays as GPIOS available on your Raspberry Pi, if you want to use more, then you can use Shift Registers
can I use xlights or what show setup can I use I'm wanting a pixel and relay Christmas show so need to use a setup to run both
what you guys use to remote control into this unit and how is it done?please. zz
is it possible to connect the GP10 direct to a mosfet like IRF840PBF ? or i need also relay like the one you showed to turn on and off the gate on the mosfet IRF840PBF ?
GPIO as in Input / Output. I would think yes, you could do that. But then the output would be limited to a maximum of 5V and only a very tiny amperage.
@@skiwithpete the mosfet will be used to turn on and off 220 volts 5amps I guess I will need to use the relays you used but how fast can they turn on and off what is the maximum frequency?
The wiring diagram with relay and how did you connect thee output
Hi Pete, this is an awesome vid, and I'm loving the neat circuit layout, its thing of beauty but it's left me with one question, why have you used 6 way connectors for the 'separate' connections on the right of the circuit (see 0.03 in video)? I get the two 8-ways used for splitting the initial positive and negative wires but why don't they they connect into eight 2-way connectors instead of eight 6-way connectors as shown? Is this essential if you're just running one device off each of the relays, are you connecting three devices into each of the 8 (if you are then you're a lot more hardcore than me ;) Cheers for any help on this
The 6 way connectors would each attach 3 lights. My thinking was 1) path, 2) area 3) highlight (like a tree or a flower). I lived in the woods and it was both dark and a winding path to get to the front door - it had a certain scariness when it was dark. Even when the path was lit. That's why that was the plan was to use multiple lights on each section. My light selection video will probably shed more... err... light on this. As the steps would have used LED strips, floods for the area, and spots for the highlights.
Let me know if I can help any further.
Cheers,
P
skiwithpete
Gotcha more lights have to be good thing... Was kind of a dumb question but I'm new to this, seemed better to ask, thanks
Cameron Behbahani No worries, glad you did.
Cheers,
P
Looks simple enough to me. Nice. How many channels can the Pi handle? I've got a project that's been itching in my head for some time that I'd love to do.
I don't know the answer. 8 channels works great. I'd love to buy a 16 channel relay. Donate with the buy me a coffee paypal link and I will. Cheers, P
You can use tis: www.roboteq.com/index.php/roboteq-products-and-services/navigation-computers/rio-io-detail
Awesome.. You could run SSRs off this, if you wanted to switch storage or water heaters remotely
How did you connect power to the motion detector?
Hey, thanks for watching!
In terms of the "live side" my relays are rated to 240V 10A. You should check the relays on your board, as they could be (and likely are) different.
Truthfully, I don't understand your second question. You only split the live wire to the relay board. Ground and Return, do not connect to the relay directly (they're represented as the Black on my board).
Talk to an electrician. It's not hard. They work at most colleges or are in the Yellow pages.
Don't die,
P
Actually - most electricians are way too busy doing their daily jobs - except for old retired sparkies, (such as myself), who love nothing better than to have a "yarn" to someone who needs help - understanding electrical circuits &/or control of extra low voltage circuits, using (oh yes) relays.
Hy i have a switch tah conected to 15 lamp. Am i able to use relay to switch 15 lamp in one channel. I don't know the specifications of lamps that im use.
Hi, just lurking around and wanted to ask a quick question since I myself em just in highschool and don't know what I'm doing much: Just what can I connect to the relay board? how much can it hold, say can I plug it to a 220v wall socket as a switch? standart light bulbs? a tv/monitor? where should it say how much it held's? Sorry, but I'm just hoping to clear out something before I start the fun.
The jumper JD-VCC VCC must be connected to some place?, What is the function of the jumper?
how can you make the relay be constantly sending power when it itself receives power?
What is the static current drawn form the RPI 5V with all 8 relays on.
And what for the dynamic current ?
Hey Kris,
You're really testing my knowledge here.
The static current would be 5v*XmA + (3.3v *2mA)*8=Y
Unfortunately, I don't off the top of my head know the value of X, different spec sheets say it is in the 50-75mA range (for a single relay, depending on the manufacturer) - though I'm sure you can look it up for your board and the number of relays you intend to power.
As for the Dynamic current, I'd have to measure at the mains - which I haven't.
Let me know if there's any more info I can provide, or if you come to different numbers I'd be interested to hear.
Cheers,
P
skiwithpete I was wondering if a cheap USB phone charger could handle the power for both RPI and all , in my case 4 , relays. And be sure that in case of switching all relays simultaneous , nothing will burn. Which I think will happen since these cheap chargers are common 700 mA rated . .
Hi, i will connect the 8relay board to my rpi2, basically to control lights. Do you have any diagram showing the high voltage connections from the relays to the lights?
thanks
no. don't use mains electricity. it can kill.
+skiwithpete are you sure? Can i connect hight voltage to relay 250 V 15 A?
+1flyman1 That much power will kill. If you're asking the question, you're gambling with your life. Get a 12V system like I did.
+skiwithpete ok, but if i want to turn on a lamp, how i can do?
+1flyman1 Make a 12V lamp. Like this: ruclips.net/video/WpM1aq4B8-A/видео.html
what pi enclosure case is that? looks nice.
The White Model B is a case I found on ebay. The clear & awesome one on the right is the pibow for Model A.
Cheers,
P
What is the switching capacity of that relay?
Is there a way to externally power the relay board without powering it from the raspi?
Jeremy R Sure, just power it directly from a 5V power supply.
heh, it's not such a deadly interest and a single 220v socket hasn't killed my yet(although shaken much, yes.) Not the first time I'm playing with high power, it's just that I'm really afraid to connect the pi to anything since they are hard to come by around where I am. Sorta getting paranoid. ever since I got it, it was running only webservers for my studies, but I did make an apache,php with mysql and a python script thing to control the gpios via the web. thanks for getting back!:)
Hi @funnybasterd - if you are still alive after 7 years of "playing around" the higher power - 220v sockets.
NEVER assume that 220v sockets won't kill you - no matter how LUCKY you have been (in the past), as you won't know when the next one does kill you.
There's no remembering past events - or the current event (excuse the pun - fully intended) - if the next "shock" kills you.
can you control from a web page on a web server hosted by thepaspbeery pi?
yes, using 'Flask' through Python
mattrichardson.com/Raspberry-Pi-Flask/
there is nothing impossible
hi i need some help
i have a rapsberry pi B+ and i connected an 8 channel relay to it
just like you did
and i also have a jumper on VCC and JD-VCC
when i power up my pi,
all relay led lights up... except the last one
is there anything wrong ?
what should i do ?
CS S Watch this vid ruclips.net/video/OQyntQLazMU/видео.html I have problems at the start and you can see my testing method...
hehe thanks i watched all your videos btw :D
do you think its a power problem ?
mu pis power supply is only 750mA
CS S
Yes. You should use a 2A, even if the Pi can only draw a max 1.2A
And thanks for watching. Getting reading for my Pi2 review :)
really ? i can use a 2A power supply ?
actually the 7 leds lights up as soon as i plug my power supply to the pi :/ and when i run a script the led would light brighter :/
its not like in you videos where the leds are off and lights up when a script is run !
ah thats cool awaiting this review ;)
CS S
No, there's something wrong there. Is it an optocoupler relay?
can I use this on timers to turn on my lights and aslo water my lawn
Yep.
I was just experimenting with timers to make the lights turn on only after dark. You could do the same. Look up PyEphem
How it does work?
If internet connection fail but i want to use my 8 chanel Arduino to on off light without internet plz send me wiring diagram for this use
hey can you show the code / software in another video please?
That's a good idea - unfortunately, I've just moved from NZ to NYC and my stuff won't arrive for another couple of weeks. Hope you can hold on until then...
yer sure i am a subscriber to your youtube
skiwithpete Thanks for the video, very insightful can you please update on software portion of the demo.
Imran Saeed
Coming soon. Very soon.
***** Imran Saeed Finally got the complete complete up. Wiring + software examples. It's at ruclips.net/video/oaf_zQcrg7g/видео.html
can you guide more further about the program to operate these relays.
May I suggest this: ruclips.net/video/oaf_zQcrg7g/видео.html
can we use 8 channel relay with b+ model
yashpreet ricky absolutely.
Thank you @skiwithpete for this video.
Can you give some rough dimensions of the 8 channel relay please?
Harvey Wong roughly from memory... 7 inches by 2.5 inches
Thanks
Check my other videos for relay projects, I've made a garage door opener - which is low power and really impresses my mates.
Yes!
Thnx
will this communicate with an app?
If you make an app that communicates with it, yes...
Great video! Can i do the same with AC (as in 230V 2A Alive Current) given i invite all my friends for a kamikaze funeral the day before i plug it in?
A bit puzzled how your relays pretty much the same as the once i have on a board i bought ( sf-innovations.co.uk/custard-pi-6.html ) react to AC since both feeds need a shared ground (unless you just hook it up "honey boo boo" style..)
I should really create another video for this question.
Basically JD-VCC is the power for the relay. And VCC is the power for the switch to turn on/off the relay. The way I have set it up in this video, the jumper connects JD-VCC & VCC - I did this because it's easy, but this isn't necessarily the best way to do it. Check my how to - but also know there's another way to do it, connecting 3.3V to the VCC. I'll post another video soon.
P
ok, I think I got it. here is the schematic:
www.sainsmart.com/media/catalog/product/cache/1/image/500x500/b97a0c6c1d16e76f7464abfcbb6a0a8d/4/c/4channel-relay2.jpg
you want 3.3 volts on the VCC pin, and 5.0 Volts on the JD-VCC
the VCC is the power for the LED portion of the optically isolated transistor U[x]
JD-VCC feeds the collector of the optically isolated transistor U[x] and depending on whether or not the IN[y] connected to to pi is either a 3.3 or a 0 will allow the JD-VCC voltage to pass thru to the emitter. JD-VCC is also the power for the relay coil,to the right of D[x]
when you apply 5v to the VCC pin you are asking the optically isolated transistor rather than toggling the power to the led of the optically isolated transistor between 3.3 and 0, you are toggling it between 5.0 and 1.7. If it works, its because the 1.7 volts is not enough to power the led, and you are just "getting away with it."
you have also disabled the safety mechanism of the optically isolated transistor.as the jumper connects VCC and JD-VCC, you now have a copper to copper connection from the pi to the relay as that relay is mechanical, and might be throwing some real power it can back through into the Rpi
What I believe you want is for the VCC and the pin to be coming from the Rpi and the ground and JD-VCC to come directly off of the 5v power supply.
BTW, this is not intuitive, this is really confusing. .
wait what? you put like 230 V or whatever in this Relais? seems not very safe to me but i'm also not an electronics guru
Thanks
Dude! Where's the code for this, including the PIR?
Ted Mieske Code is here with this. Raspberry Pi: 8 Channel Relay step-by-step with software examples for automation
Hey, thanks for watching! That's a Pimoroni. Check "shop dot pimoroni dot com"
please show the actual coding to set the gpio as needed. thanks
KenFm Reinhart all the code is in the about section.
Hi pete!
I'm pretty new to this stuff and I've read, that there is a problem with the rpi's 3.3V output pins in combination with the 5V relais. I'm about to modify the connection as in github.com/fixedd/RPi_Relay_Interface but it also says, that the relais board may already have this logic included. I would buy this board: www.amazon.de/Tomorrowtop-Aktiv-Niedrig-Relais-Arduino/dp/B00EDHX4Z4/ and I wanted to ask you, if you know if this is safe to use without the additional transistor board. In this picture it shows 2 resistors and a transistor for each input as it is done in the mentioned project above: ecx.images-amazon.com/images/I/61PovzyTvdL.jpg
I would be glad if you could help me =)
On SainSmart they say you need to connect the Pi to the Relay board differently in order for it to work with a Raspberry Pi
www.sainsmart.com/8-channel-dc-5v-relay-module-for-arduino-pic-arm-dsp-avr-msp430-ttl-logic.html
docs.google.com/file/d/0B5-HND9HJkXWSTQtYlFTZ3VyODA/edit
I just got a Pi B+ and I am new to the EE side of things. Do I need to wire it the way SainSmart is doing it or can I connect the Pi directly to the relay? I am looking at buying a SainSmart 8 channel relay from Amazon (link below).
www.amazon.com/SainSmart-8-CH-8-Channel-Relay-Module/dp/B0057OC5WK/ref=cm_cd_ql_qh_dp_t
Thanks a lot for creating videos like this!
The images you show are how to connect a 5V relay. But the optocoupler relay that I use can take lower voltages, so you don't need to connect it in that way...
Ok great. So my link to the Amazon relay should work fine? Sorry for the dumb questions
Lesbian cables...
Nice video. You may also want to checkout the review of home automation on my blog at *bryanreviews. com/home-automation-review/* Thanks, Grove.
Thus - as this appears to be - an 8-way 12vDC RELAY board - with opto-couplers on all inputs.
I take it (also) that your "Raspberry Pi" - is only outputting a 5vDC power source..
You are attempting (in this video) to tell everyone here, that the 5vDC (your little device outputs) is good enough to provide enough power for all 8 of those 12vDC relay coil circuits, even if these 12vDC coils - are all powered on (as occurs at some stage of the relay ops).
I would assume that you have zero idea, what the opto-couplers are there for, as their primary function is to increase the 5vDC signal outputs from your PI - to operate the 12vDC relay coils.
Thus - you have to have a 12vDC supply (ready) for the relay coils, and that then allows for these 5vDC signal outputs from your PI device - to control the 12vDC feed to each relay - when controlled via the 8 opto-couplers (when a signal arrives from the various 5vDC PI signals - all of which ONLY have 5vDC signals - that are boosted via the "on-board" opto-coupler circuitry.
It is these opto-coupler circuits themselves, that allow the 12vDC to operate the 12vDC relay coils, as they are designed to "electronically" switch the 12vDC supply (to allow each relay coil to get enough voltage & thus working current - off the 12vDC) when your little device can only supply 5vDC signals.
An external 12vDC supply is required to be powered ON at all times that you have the board connected to your PI, thus you also need to switch it on & off, (or have that always on) before any of your PI's 5vDC signals will operate the opto-coupler circuits, to electronically control the relay coil circuits.
To thus allow the 8 "signal controlled" opto-couplers to switch that 5vDC signal - via the 12vDC feed which in turn switches the coils of the 12vDC relays - that each relay those opto-couplers control,
You need to optically isolate the 12vDC supply feed, from your PI's 5vDC signals
The relays thus are switched optically from just 5vDC (when your 5vDC PI sends a signal via one of the 8 outputs - all of which ONLY have a 5vDC signal feed, coming from the PI master unit).
As the relays themselves require 12vDC - the 5vDC signals coming from your PI will NEVER be sufficient to power-on 1 relay coil - let alone all 8 of the relay coils - unless they are BOOSTED by the opto-coupler booster circuits.
Only by way of the opto-coupler circuits, can the 5vDC - switch the 12vDC into their respective 12v Relay coils - which then allows your tiny 5vDC signals to be keeping the relays ON - as this is achieved from the 12vDC supply - powering the relays via the opto-coupler circuit/s.
THE 230vAC (lighting mains power) on the relay contacts themselves - that is (ALSO) isolated from BOTH the 12v relay coil circuits, as well as double isolated from the 5vDC PI signal outputs, by way of the relays themselves AND by way of the isolation features - of those 8 opto-couplers.
p.s.
NEVER FEED any relay's N/O terminals - with 230v AC mains, as these SPDT contacts are designed to ONLY have the commons looped across live mains.
The relays then switch the mains via either NO - or the NC contacts.
Thus one can have a small RED / GREEN illumination panel at or beside the output contacts, such that (at a glance) one can instantly tell if a relay is powered on - or not.
By inserting the mains - into ONLY the NO contact terminals and looping from there.
You can NEVER get switch functions indicated on a control panel - showing the aspects of each relay.
Why?
Because the NC contacts can NOT get power from the NO contact - as the common contact disconnects from the NO before closing the NC (& visa versa).
..
Now lets get it straight shall we.
Your PI is 5vDC (only) and outputs low power (low current) 5vDC signals
The relays are all 12vDC (meaning that they have higher current consumption 12vDC coils)
It's the relay contacts - that switch the 230v AC Mains.
The 5vDC PI does NOT directly switch the 12vDC relay coils (that's what the 5vDCto12v DC opto-couplers are for)
&
The PI also does NOT switch directly - any of the 230v AC Mains circuits - (that's what all 8 relay contacts are for via the NO & NC contacts) .
By connecting JUST your 5vDC PI directly to the 12vDC relay board - to directly control all 8 relays
You seriously run the risk of destroying your tiny PI's 5vDC output signal circuits, as these ARE NOT DESIGNED - to power 12vDC Relay coils.
You can get away with direct driving "relays" from the PI - when using one (or two) 5vDC relays only.
Never attempt to circumvent the opto-couplers by selecting the JUMP circuit jumper - as that LINK is there for 12vDC signals.
Not for direct driving 12vDC relay coils, from the tiny PI's 5vDC low-current signal outputs.
Also of note.
NEVER EVER loop the 230v AC Mains - by using the NO contact terminals of any relay.
The COMMON terminal is best for that - as inside the relay - the common terminal circuit is better protected from the coil circuit.
When the NO contact closes, there's usually a load on that circuit, such that the risk of an internal spark-over is lessened.
Also - if one needs BOTH a normally open AND a normally closed contact - for any ONE circuit controlled by each relay - by feeding the live AC in via the NO contact - you defeat the need for the NC contact (as it will NEVER see the live AC mains)
.
The additional reason for center feeding (via the Common terminal) the 230vAC mains is this, when any relay FAILS to operate - there is the option of having a Normally Closed "indicator light" connected.
Thus one can instantly see - which relay is powered ON - & which is faulty (if it should be on)
You can also see which has blown internally - if all indicators for that relay are both on (or both off)
Sparkies know a little more (about electrical circuits and their design characteristics) than your everyday kit-basher - as that's been our lively-hoods, for most of our working lives.