Raspberry Pi: 8 Channel Relay step-by-step with software examples for automation

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

ความคิดเห็น • 710

  • @dutchman55
    @dutchman55 5 ปีที่แล้ว +25

    Watching and loving this in 2019

    • @dutchman55
      @dutchman55 5 ปีที่แล้ว

      1 week later I have my parts and the free time, it works! You're awesome man!!! I'm a full time software engineer, but I've never messed with this stuff before. So cool!

    • @i_Tubs
      @i_Tubs 5 ปีที่แล้ว

      What pi did you end up using? I’m in uk and can’t find the exact one that’s in the video- I’m also new to the pi so don’t know the difference between the models!

    • @dogbite1516
      @dogbite1516 5 ปีที่แล้ว

      @@i_Tubs have you found what you were looking for? I am using the pi Model B rev 2 and i did have the issue acouple of years ago, that swpete was talking about, but revisiting this, it just simply worked... okay, after adjusting the GPIO numbers in the list. as long as you know what pi you are ussing you can search the 'net for pin/gpio layout. This also worked for me using raspberry pi 3

    • @i_Tubs
      @i_Tubs 5 ปีที่แล้ว

      Stephen Viner yes thanks Stephen. In the end I just went for the 4gb pi 4, for the extra £20 or so I thought it would be worth to go for the newest and highest spec one! Got it controlling my Christmas lights at the moment!

    • @ru-pirie1952
      @ru-pirie1952 4 ปีที่แล้ว

      try 2020 :P

  • @HamzaQayyum
    @HamzaQayyum 8 ปีที่แล้ว +35

    I really love how you explain this everything such depth, all while sounding very non-monotone.
    Keep doing what you're doing!

  • @RobertAlexanderRM
    @RobertAlexanderRM 4 ปีที่แล้ว +5

    Watching this in 2020! :) Did my first use of GPIO with a spare RPi 2 v1.1 and your same 8 relay module. Pinout was the same. Worked flawlessly with your script. My board is attached to cabled Ethernet not WiFi. Thank you very much.

    • @skiwithpete
      @skiwithpete  4 ปีที่แล้ว

      Awesome. Thanks for the comment!

  • @jameshyde6395
    @jameshyde6395 8 ปีที่แล้ว +7

    Hi I have just hooked up the Raspberry pi 3 to the 8 channel relay board exactly how it is in this video , however i had an intermittent problem with channel 3, this was easily solved by moving the wire for GPIO pin 4 to GPIO pin 5 and Edited the code at the start of the script to output to GPIO5 pin instead, problem solved. great Video clear instructions and got to the point without beating about the bush.

    • @skiwithpete
      @skiwithpete  8 ปีที่แล้ว +3

      Thanks!

    • @F0YF0YT0S
      @F0YF0YT0S 6 ปีที่แล้ว

      James are you using the same relay? I cant get it to work and its suggested that i get an external power source for the relay. I am using RSpi 3 model b.

  • @woodywood6961
    @woodywood6961 3 ปีที่แล้ว

    You sound like Christian Slater. I found this comforting and reassuring. Great video

  • @Skilldibop
    @Skilldibop 10 ปีที่แล้ว

    Very simple but effective demo. I'm a network engineer by trade and like many I have a test lab at home full of kit I can connect to remotely. Downside is leaving it all on so it's accessible can burn something like 650-700w. The plan is to borrow some of the principals and code you kindly provided to be able to connect remotely to the Pi and power on only the equipment I need, only when I need it. Hopefully saving me a heap on my energy bills!
    It should also be a fair bit cheaper and more fun than buying a proper network managed PDU off the shelf :)

  • @shiro.kabocha
    @shiro.kabocha 7 ปีที่แล้ว +4

    This seems to be the most friendly community i ever saw on youtube.

    • @Juasml
      @Juasml 7 ปีที่แล้ว

      This is just one person's opinion, but I think that the general profile of people who watch these videos is that of someone who puts themselves to work and produce stuff, people on the internet who just want to be entretained by YT videos end up not having fun, being bored and frustrated which makes them angry and toxic.

  • @nikf3188
    @nikf3188 8 ปีที่แล้ว

    Top tutorial which has just resulted in a Pi, Relay, Asterisk mashup to control gate opening & closing via SIP. Thank you!

    • @skiwithpete
      @skiwithpete  8 ปีที่แล้ว

      show us a vid when you get a minute to film it.

  • @ianmoore5129
    @ianmoore5129 7 ปีที่แล้ว +2

    Just noticed that the relay supports two power supplies - one from the PI and the JCC being the 5V for the relays. These can operate independently as from the internal diagram, the two parts (input control and relay control) are connected via a photo diode .
    As each relay requires 20mA, then it would seem better to use a separate power supply. To change, remove the jumper. Connect the PI power supply using the GND and VCC on the jumpers next to the inputs, and use the other GND,JVCC to connect power for the relays

  • @azelbane87
    @azelbane87 ปีที่แล้ว

    I DISCOVERED your channel JUST&ONLY NOW!!! and I LOOOOOOOVE IT!!! YOU ARE MY SAVIOR!!!!BLESS YOU WHOEVER YOU ARE!!BLESS YOU BLESS YOU BLESS YOU BLESS YOU BLESS YOU!!!

  • @999monkeymonkey
    @999monkeymonkey 10 ปีที่แล้ว

    Hi matey update is, the 8 channel relays I got are faulty. I since brought 4 channel relays from another ebay seller and its all working great! Thanks for your help!

    • @skiwithpete
      @skiwithpete  10 ปีที่แล้ว

      999monkeymonkey Cool, glad you got it sorted. I just posted a new 4-channel tutorial this morning here: th-cam.com/video/OQyntQLazMU/w-d-xo.html

  • @blenderbari
    @blenderbari 7 ปีที่แล้ว

    Thank you so much for the tutorial videos. It took me a few days to figure it out, but finally, everything worked just like your video. I had to edit the scripts a little to update the print commands, but then everything came to life. Please post more - we appreciate them, and the work you put in.

  • @andrespinillai
    @andrespinillai 9 ปีที่แล้ว +24

    Hi, I think the problem with the delay in minute 9:30 is a thing that use to happen to me when I was programming applications using C in linux. Many devices use buffers for operation. The program screen output is called stdout in C and if you don't free the buffer, it will remain stuck some times until the program ends.
    So the solution is to flush the bufer tight after you need to:
    printf("seven"); // the C instruction for printing seven on the terminal
    fflush(stdout); // the instruction to force to free the screen buffer
    I guess it must work the same way on other programming languages.
    Regards

    • @sengerandu
      @sengerandu 9 ปีที่แล้ว +2

      +Andres Pinilla Yes, this is the way to go. When we want a thing to occur in almost realtime, then we have to do like that. In one of my projects long ago, I had to read keypresses and avoid multiple presses; I had used fflush().
      Thanks for sharing.

    • @smokeycloudzzz
      @smokeycloudzzz 9 ปีที่แล้ว

      s

  • @ericsinclair4704
    @ericsinclair4704 5 ปีที่แล้ว

    I just built my relay box 8 channels similar to how you have yours set up, mine is a box looking thing but non the less functions just like your does. However I do not get the same problem as you on the test script countdown the very first one you run, it lags out at 7 8 and yours but on mine it does not do that at all, Even with all WiFi Bluetooth and HDMI with Ethernet didn't make it trip like that I'm not sure why your is doing that. My model is the pi 3 b+. Thank you so much for this video it worked wonders for my build, I built a controllable 8 channel wall plugs 4 of them but able to control individually by snipping the positive connecting piece on the plug thus I can control 8 plugs. I'm using mine for this years Christmas lights show. Yes I went with mains on this project because of what I wanted to do, I know everyone says stay away, but your good if you have the right equipment, a gfci plug goes a long long way to test these things and common sense is the best form of safety. Also the pi supply's all the power to the relay board on my setup, no additional power source needed, I also using python coding to control so that may play a factor idk I'm knew to the pi world and loving it, not knew to how pc's works and what not but knew to tinkering with it and controlling it the way I want it to be controlled is awesome

  • @Channel-nc9yl
    @Channel-nc9yl 10 ปีที่แล้ว

    I build one of 30 years ago using a VIC-20 and a hand-build 4-relay board. Programmed it with BASIC.

  • @LukeAlderton
    @LukeAlderton 9 ปีที่แล้ว

    Thanks man! Saw your video, immediately ordered the parts, just used wget on the Pi over SSH to get your scripts and it's all working. Brilliant!

    • @skiwithpete
      @skiwithpete  9 ปีที่แล้ว

      +Luke Alderton :) Thanks. Let me know if you make a vid for your project and I'll link it here.

    • @LukeAlderton
      @LukeAlderton 9 ปีที่แล้ว

      +skiwithpete Will do! I just hooked up the lamp on my desk. At first I was a bit hesitant to use the mains electricity but it works brilliantly. :D

  • @tonylock7657
    @tonylock7657 10 ปีที่แล้ว +11

    The question about why the output stopped displaying when using the Model B may have been rhetorical, but if not, I'd guess that there wasn't enough current to run the relays and the wi-fi adaptor, so when you operate enought relays, the wifi stops working. The code finishes, the wi-fi comes back on and the laptop them displays the remaining counts 7, 8, 9. My suggestion would be to give the relay board its own 5V supply.

    • @TheNeverFinishedProject
      @TheNeverFinishedProject 6 ปีที่แล้ว +3

      A quick way to test this theory would be to have a continuous ping going to the device IP - i.e. "ping 192.168.0.2 -t" in CMD Windows, if the pings drop "Request timed out", then you'd know communication to the Pi over Wifi was stopped.

  • @JayMoodley
    @JayMoodley 4 ปีที่แล้ว

    Thanks for the video.. used it as my lockdown project for get my reef pi up and running.👍🏽

  • @jK-zv7nk
    @jK-zv7nk 5 ปีที่แล้ว

    Dude, this is awesome! I have no programming experience, but the idea of programming something for automation is awesome. I would like to get a raspberry pi to learn how have it water plants at a certain time/length of time as a fun, side project. Great work! :)

    • @skiwithpete
      @skiwithpete  5 ปีที่แล้ว +1

      The code is downloadable in the about section

  • @xcruell
    @xcruell 7 ปีที่แล้ว +2

    Thanks a ton for all the videos about the RaspberryPi & 8ch relay!
    Im planning on doing the same in my rather small garden, since i dont have any lights atm.
    Keep up the great work man! :)

  • @brightideas5782
    @brightideas5782 4 ปีที่แล้ว +1

    Awesome video love it !!!! Question im trying to connect a relay switch with Bluetooth to turn on a light by Bluetooth from a vibration sensor?
    So when the vibration sensor goes off it turns on the light. Thank you 😊

  • @RandyRasmussen
    @RandyRasmussen 10 ปีที่แล้ว +1

    I must say your videos are very impressive. The tutorials are great and I love the way you put in the links. Very nice.

    • @skiwithpete
      @skiwithpete  10 ปีที่แล้ว +1

      Randy Rasmussen Thanks, that's very kind of you.

  • @stankrajewski8255
    @stankrajewski8255 8 ปีที่แล้ว +1

    Thank you for the tutorial. I am resurrecting a 5 loop guitar effects rack that I built in the late 80's. I am dropping one of my effects and focusing on using four relays for clean signal switching and the other four for powering LEDs at the foot controlled switch box. I have been told that I can simply apply digital on and off signals to the relay triggers. However, it would be better if four input switches could enable a more complex array of effects e.g. 1=comp, 2 = comp+dist, 3 = dig delay, 4 = octaver + dig delay. My question, yet unanswered, is how do I get my dry closures from my foot switches inputted into the RasPi or other?

  • @chrisurban6835
    @chrisurban6835 4 ปีที่แล้ว

    Bravo! It worked with my Raspberry pi 4 b. in conjunction with Mu 1.0.2. Finally i made it do something.

  • @PyroRob69
    @PyroRob69 6 ปีที่แล้ว

    Power the relays externally. On the set I have (mine are made by Sainz but they are all the same), the JD-Vcc is 5VDC, and the Vcc is 3.3VDC. Power the relays externally and you won't draw down the power buses on the Pi. I have run banks of 8 relays this way with no issues.

  • @tubeDude48
    @tubeDude48 9 ปีที่แล้ว +3

    Personally I like to use: from time import sleep
    That way, you only need to enter: sleep(20) , rather then time.sleep(20)
    Saves on code size.

  • @scottbrim9020
    @scottbrim9020 7 ปีที่แล้ว

    Nice job explaining clearly! I setup my new PI and I think it doesn't have enuf power as the older models do. I get the full display on the screen of each step but no response from the 8 channel board. Is there a 3.5 V 4 or 8 channel board or can I somehow get 5 v to the PI?

  • @tubeDude48
    @tubeDude48 2 ปีที่แล้ว +2

    Weird delay is from the Wi-Fi which was common back then. It wasn't fixed until *Pi 3 B* - Watched Dec. 2022

  • @fetchitnowuk
    @fetchitnowuk 4 ปีที่แล้ว +1

    Thank you so much for this. Followed the instruction and using this now for an Aliuminum Can crusher project. I'll share the automation code once done. Thanks again.

  • @kentuhler6104
    @kentuhler6104 7 ปีที่แล้ว

    Hey thanks to his video I've got a crazy idea to build a car computer / infotainment thing for my 2011 Jeep JK. Much like the Alpine X109-WRA. So I got a Raspberry Pi 3 B I think it's the plus and this same relay board within an acrylic. Now my question is I want to run everything through a touchscreen and make auxiliary switches through the touch screen for off road lights, lockers, winch, etc. I've got a fuze box to run the 12v from my Jeep to each really through a 30A fuze and a ground bus for all the grounds. My biggest issue is the software. I really like the Blynk app but since my Pi has arrived in the mail yet I'm worried it won't work on the Pi unless connected to the internet. Any ideas that I can use for the touchscreen switches?

  • @derekbeaumia8780
    @derekbeaumia8780 7 ปีที่แล้ว

    Hi Pete, I like the video and am wanting to do something along these lines. What I want to do is set up a relay to switch from an external power source (the grid or battery bank) to an internal one (ThermoVoltaic cell bank within the heating unit) when the internal source reaches the proper voltage for the DC motor. Do you or anyone else have any thoughts or advice?

  • @dannye6912
    @dannye6912 3 ปีที่แล้ว +1

    What a wonderful human u are. Respekt Bro

  • @타마-w3j
    @타마-w3j 2 วันที่ผ่านมา +1

    Watching and loving this in 2024

  • @ellis123lee
    @ellis123lee 8 ปีที่แล้ว

    I'm currently undertaking a project in which we have to use a raspberry pi to control some pumps and also a couple of rotary/ linear actuators. Is this the sort of route we should be going down to enable us to do this, or would it be better to use transistors? (I have no experience in electronics so this is all very new to me!). Thanks for any help.

  • @chasetheinflatablegod
    @chasetheinflatablegod 3 ปีที่แล้ว

    I have questions, I want to program an LED lightshow to music (not pixles, just regular 12 volt LEDs) how much is the output of the replays, it can’t be anymore than 12v or it will fry my custom made LED strand. I wired a bunch of 12v single LEDs together to make a strand. If this is more power than I need, where can I find a board that I can use LEDs on and program it with my raspberry pie?

  • @TheIndustrialphreak
    @TheIndustrialphreak 9 ปีที่แล้ว +1

    So my question is how easy would it be to throw a light detecting diod that could control if a relay state is on or off. I want to setup a controll system with my aquaponics system and possibly use it to control a robotic arm kit to tend the plants.

  • @ravenBXNY
    @ravenBXNY 9 ปีที่แล้ว +4

    This is a great video. After I copy/paste the script what is the cmds to run them? I am new to python

    • @turboromy
      @turboromy 7 ปีที่แล้ว

      On pc, it'll be "py -3" + filename.py It depends on specific versions, os etc, but should be similar to it.

  • @artica01zero
    @artica01zero 10 ปีที่แล้ว +1

    Following this video Using Relays and Relay Boards with the Raspberry Pi we should use 3.3V for Vcc (GPIO pin 1) and 5V for JD-Vcc (GPIO pin2) to hadnle relay board better. Hope you will sometime update your great video with this info. Thanks.

    • @skiwithpete
      @skiwithpete  10 ปีที่แล้ว

      I have tried this method with the board shown in this video - and it simply does not work. Sorry.

    • @artica01zero
      @artica01zero 10 ปีที่แล้ว +3

      Yep, I tried 3.3V with with B+ model and also it does not work. So only 5V and jumper on Vcc-JDVcc

  • @Cmdrlucky8
    @Cmdrlucky8 8 ปีที่แล้ว

    Great posting, I love your pull to generate community from this video.

    • @skiwithpete
      @skiwithpete  8 ปีที่แล้ว

      thanks for posting. it works

  • @meatyoker
    @meatyoker 7 ปีที่แล้ว

    I’m not that savvy on computers but i have been watching your videos and are wonderful. I just would like to no what is the best raspberry pi for doing a light show or what to install a program. Can you make a video on this of how to start and end on it. Thx

  • @FOATE
    @FOATE 5 ปีที่แล้ว +3

    You can remove the jumper and power the relay on jd-vcc with a seperate power supply!

    • @Wiggs138111
      @Wiggs138111 5 ปีที่แล้ว

      Then you could do away with the VCC and the GND to the Pi , Correct ?

  • @Cmdrlucky8
    @Cmdrlucky8 10 ปีที่แล้ว +1

    Fantastic video! Really appreciate the time you've put into this. Looking forward into delving into these projects!

    • @skiwithpete
      @skiwithpete  10 ปีที่แล้ว

      Thanks! Hope you'll subscribe!

  • @TheHarryspidy
    @TheHarryspidy 9 ปีที่แล้ว +1

    Thanks for this tutorial...
    When i try to connect the 8ch relay with Rpi, channel 8&3 are in HIGH and other channels are in LOW state: Why is this happening?
    also this following error occurs..
    RuntimeWarning: A physical pull up resistor is fitted on this channel!

  • @SmartLifeEnthusiast
    @SmartLifeEnthusiast 9 ปีที่แล้ว

    1) You should explain what Ground and VCC stands for (1:30).
    2) Not sure whether having a delay in the output (but not in the actual action) should be thé reason not to pick a model B, unless it is power-usage linked (although, if you don't need all 8 ports, it's probably be less of a problem).
    PS: difference in pin lay-outs: raspi.tv/wp-content/uploads/2014/07/Raspberry-Pi-GPIO-pinouts.png

  • @skiwithpete
    @skiwithpete  9 ปีที่แล้ว +2

    Dylan Manthei Q1) Yes. Q2) I don't know, that's outside of the scope of my knowledge. If you can get it down to 5V, I don't know why you couldn't - but I don't know for sure.

  • @vincentxie7571
    @vincentxie7571 9 ปีที่แล้ว

    Hello, thanks for the great video.
    I bought a pi today and wanted to do what you are doing, but i have no idea how to set up my pi with a mac, like you did in the video (being able to run raspbian/control gpio pins from a mac). Im pretty sure i have all of the materials i need: SD card with raspbian, wifi dongle, ethernet cable, and of course the pi and a mac. I know its probably gonna be too long to explain over this, but do you know any articles that can show me how to set up a pi and use it like you did in this video? thanks so much

  • @leerman22
    @leerman22 8 ปีที่แล้ว

    Does this offer the same protection as a programmable logic controller? It would be cool to use this to start a few horsepower induction motors.

  • @zulfqarali8603
    @zulfqarali8603 8 ปีที่แล้ว

    Nice demo, why not use external power with model b, or newer models with relay card

  • @ewl9864
    @ewl9864 9 ปีที่แล้ว

    Really like this video. I added the coding to setup all 8 of my relays and they all work. I have two questions:
    1. When the webpage initializes it takes two button presses to activate the relay. Would it be that there is NO initial state set to Low for all outputs? If so how can I fix it ?
    2. How can I Add a function to a button to cycle on/off. I have a couple of garage doors that I want to control, so a single press of the button would be good.
    Thanks For any suggestions

    • @skiwithpete
      @skiwithpete  9 ปีที่แล้ว

      +Ed Lentz Q1: Great question but I don't know. Have you tried a different browser? Q2: You probably want to watch my garage door vid: th-cam.com/video/p2abZ90-eU0/w-d-xo.html (basically you want to add a timer to the relay to have it trigger for .5secs or so)

    • @ewl9864
      @ewl9864 9 ปีที่แล้ว

      +skiwithpete Wow quick reply! I tried Edge and it wouldn't work at all. I am using Chrome on both my laptop, phone (android) and a tablet and they all work the same. Firefox doesn't work at all, funny that Edge , and Firebox force me to login before they present the page. I don't get that in Chrome at all.
      I have seen your Garage video and I have that working, I woul dlike to incorporate it into the relay page, looks nicer :) I am pretty green on all this. I don't know how to change the buttons to run the .py scripts

    • @skiwithpete
      @skiwithpete  9 ปีที่แล้ว

      +Ed Lentz Q1) I'm still sorry, and I still don't know. Hopefully someone else will read this and be able to provide insight.
      Q2) I don't quite understand yet. Are you saying that you've got an 8 channel relay and one of them will control a garage door? In that case, all you need to do is trigger the correct script with the button press.

    • @ewl9864
      @ewl9864 9 ปีที่แล้ว

      +skiwithpete No worries on the Q1. On Q2, maybe I should just use the index.php from the garage door video, get the buttons to get bigger and line them up. I would just then need to remove the timing for the .py scripts for the other relay functions I wanted.

  • @louisbradier8725
    @louisbradier8725 9 ปีที่แล้ว

    Hi,
    Thanks for the tutorial, I am thinking using this setup as part of a project.
    However I am a bit confused on which type of Raspbery pi to use. I would like to avoid the use of an additionnal power source for the relays. You mention that for this reason, only the type A should be used. Will the A+ or 2B (in the part list) that were not out at the time will work without "burning"?
    Thanks in advance

    • @skiwithpete
      @skiwithpete  9 ปีที่แล้ว +1

      Louis Bradier They'll both work just fine. Cheers, P

  • @mmincer1
    @mmincer1 2 ปีที่แล้ว

    Thank you, I did set this up i am using B model however the lights come on as yours did but the relay never changes state it never closes although the light changes state and there is no noise for any of the relays,
    I bought 3 of these and all three do exactly the same thing

    • @skiwithpete
      @skiwithpete  2 ปีที่แล้ว

      First, just make sure that they are optocoupler relays. If they have bulb type LEDs, then you might have the wrong type. If they are optocoupler try changing the high and lows in the script to see if that gets you different results.

  • @tomhuck3881
    @tomhuck3881 10 ปีที่แล้ว

    Thanks for the video, very nice. I could use some help if you don't mind. The relay seems to be working just fine as expected, clicks and all. What I'm trying to do is light up a LED with the relay, but it is not lighting up. I have the - side connected to COM, and if I plug the + side in to either NO or NC, I get no light. The LED is good and tested by connecting it to a battery. Can you help with what I'm missing so that I can light up external LEDs?

    • @skiwithpete
      @skiwithpete  10 ปีที่แล้ว

      Tom Huck Sounds like there's something wrong here. I show how to connect the Relay in this video: th-cam.com/video/WpM1aq4B8-A/w-d-xo.html at the 7:45 mark. If you're connected to COM and NC, the light should be on with no power to the Relay. If not there's something wrong. You can test it with a multimeter. What do the solders look like underneath the board?

  • @frozencons
    @frozencons 8 ปีที่แล้ว

    Very clear and easy to wrap my dumb head around. Thanks so much for doing this!

    • @skiwithpete
      @skiwithpete  8 ปีที่แล้ว

      frozencons thanks for the kind words!

  • @girardaquino
    @girardaquino 9 ปีที่แล้ว +1

    Thanks so much man! I had a slightly different setup but your video provide a good starting point.

  • @tfaqir
    @tfaqir 10 ปีที่แล้ว

    Great video...excellent quality. In my RPi circuits I always use a secondary power supply even if what's needed is 5volt for the external board. I connect the grounds together and things work fine. I'll order the relay on amazon and give it a try with the model B using an Edimax Wifi dongle. I'll post back my results.

    • @JustinBarak
      @JustinBarak 3 ปีที่แล้ว +1

      Results?

    • @JorgeHernandez-ob6jj
      @JorgeHernandez-ob6jj 2 ปีที่แล้ว

      Still waiting on those results, please, post them up so I can move on with my life.

  • @originalanthraxtony
    @originalanthraxtony 6 ปีที่แล้ว

    I want to use a similar set up for starting a car, I only need 3 to 4 relays, which will in turn activate 30~60 amp relays @ 12VDC, should I use an A board for this as well?
    I have been hesitant to buy any hardware cause I don't know anything about it, but my build is getting stale and I need to make a move before the year is up.

  • @edwinmartin1924
    @edwinmartin1924 8 ปีที่แล้ว +6

    I followed this tutorial and used a raspberry pi B+, but my relay would not work. in the end i found that i had to use an external 5v power supply straight to the relay board vcc. and another for the pi.

    • @ApplySkills
      @ApplySkills 7 ปีที่แล้ว

      how do i make/find a external power supply

    • @mr.reeftank1456
      @mr.reeftank1456 7 ปีที่แล้ว +1

      Just run a single power supply 5V that can handle both... that way you only take up 1 plug from the wall...

    • @F0YF0YT0S
      @F0YF0YT0S 6 ปีที่แล้ว

      I am trying to do the same and apparently RSpi 3 model b cannot power the same relay used on this video. Where did you find the power adapter for the relay? did you make on yourself or can you buy it of the shelf?

  • @nalinfernando8184
    @nalinfernando8184 3 ปีที่แล้ว

    Thank you, this made my day! Also I have modified your code I will put it up...

  • @salman7787
    @salman7787 3 ปีที่แล้ว +1

    Guys I am having a hard time connecting my 1 channel relay (from Tongling) to a raspberry pi 4 model B. Does any know how to do it?

  • @bubba1984
    @bubba1984 10 ปีที่แล้ว +4

    What about the whole 3.3v business when interfacing a 5v driven board? Doesn't the relay board pull up all inputs to 5v?

    • @skiwithpete
      @skiwithpete  10 ปีที่แล้ว

      The Optocouplers on the Relay board allows the GPIO to output at 3.3V.

  • @rawl05
    @rawl05 8 ปีที่แล้ว

    okay!! thanks. Can you help me out with this example, like to control an individual relay from a 8 channel relay using a mobile phone. Each relay has individual control on the phone, and also through switches connected to the pie. I'm totally new to Pie.

    • @skiwithpete
      @skiwithpete  8 ปีที่แล้ว

      try this one: th-cam.com/video/OQyntQLazMU/w-d-xo.html

  • @vedardhagudapati4996
    @vedardhagudapati4996 4 ปีที่แล้ว +1

    Hi, can i know the command you gave to test the relay, it will be a very helpful command to test the relay before starting the project
    Thank you in advance

  • @moonsikkong4047
    @moonsikkong4047 10 ปีที่แล้ว

    Hi
    Thank you for the video.
    I was following along your video and I noticed that the GPIO pin only provides 3.3v when they are on HIGH
    so my 5V relay only blinks, but does not give a control and that click sound/
    How did you manage to supply the relays 5V with GPIO outputs?

  • @LiezerZero
    @LiezerZero 9 ปีที่แล้ว

    I have a 16 relay module that uses 12v 320ma, while powering the relay module I also have the relay module powering my raspberry pi 2. Its nice.. No noticeable lack of power to the pi since there is no dimming or shutting off of the red power led as an indicator.

    • @TomasNovak_oriven
      @TomasNovak_oriven 9 ปีที่แล้ว

      +Valueless Dollar do you use Raspberry 2 PI model B ?

  • @jonatasheringer
    @jonatasheringer 9 ปีที่แล้ว

    About the bug on RP B when it hangs on the 6th switch, i i don't think its a power problem, its more like a architecture problem of the board. I'm using the RP B+ and this same problem happened to me . using the GPIO 10 and 9 together would cause the problem so i switched them to GPIO 13 and 26 and now i can open all the RELAYS

  • @joshuacresswell8713
    @joshuacresswell8713 4 ปีที่แล้ว

    Great Video!!! One question. Can you use these scripts on any Raspberry pi model? I figured out a way to get around the power issue from a different video and was hoping I could still use these scripts. Thanks.

    • @skiwithpete
      @skiwithpete  4 ปีที่แล้ว

      Yes. But check your pins for your model. Scripts will work with adjusted pins.

    • @movementbruce
      @movementbruce 4 ปีที่แล้ว

      I just used the scripts on a RP4, changed the pin #'s, and it worked like a champ!

  • @ImranSaeed
    @ImranSaeed 10 ปีที่แล้ว +2

    Great effort skiwithpete

    • @skiwithpete
      @skiwithpete  10 ปีที่แล้ว +1

      thanks Imran Saeed appreciate your patience.

  • @EnergySeeker
    @EnergySeeker 4 ปีที่แล้ว

    so i can just connect 120 volts to the common and to the 120 volts 10 amps lamp and it will light up ? do i need anything between the light and that relay ?

  • @JeffreyHarrington
    @JeffreyHarrington 10 ปีที่แล้ว

    Few questions:
    Is the click from the Relay? Can the click be silenced or is that just an effect of the relay?
    Could you use more relays on the pins from the outside edge of the RPi?
    I have a B+ with the 40 pins be used? I'm guessing I'd need to use external power.
    Thanks!

  • @stuartjergensen1155
    @stuartjergensen1155 8 ปีที่แล้ว +2

    Why did you not connect a resistor in line with the gpio pin? I have heard you can cause some serious problems by not putting in a resistor when using gpio pins. Thanks!

    • @nobytes2
      @nobytes2 5 ปีที่แล้ว

      You're thinking about wiring an led, this relay board probably has a built-in resistor.

  • @AnimosityGamers
    @AnimosityGamers 9 ปีที่แล้ว

    Great video I'm trying to get my kettle to turn on via my phone from my bed in the morning while i get dressed. Also I am a electrician so I don't mind messing with mains (hopefully won't burn out my board though) but I will say i'd cost more than a few dollars to check your work safety wise lol. Although yea, don't be stupid folks. keep out of your 120v/240v mains.

    • @skiwithpete
      @skiwithpete  9 ปีที่แล้ว

      +AnimosityGamers sounds like a cool project, and defo good advice. Let us know how you go.

  • @ehlai1676
    @ehlai1676 10 ปีที่แล้ว

    Try all the codes on model B and they work fine. I ran them using Python 3 so for print statement, I would to add parentheses like so print("xxxx"); semicolon should be removed from the codes as well. Your codes are for python 2. Don't see the strange thing you encouraged. By the way, there's no click sound on the relay...which is great. Thank you.

  • @EdGreenberg
    @EdGreenberg 6 ปีที่แล้ว +1

    I am thinking of this video/technique to build an electric menorah that will go on and sundown, off at sunup, and display the correct lights. I doubt I'll get it done by Chanukah this year, but when/if it's done, I'll post a comment here.

    • @skiwithpete
      @skiwithpete  6 ปีที่แล้ว

      Cool, sounds like a fun one. Keep me posted.

  • @elt92
    @elt92 6 ปีที่แล้ว

    Can I wire these relays with a residential circuit breaker to, say, control electric circuits in my house?

  • @ApplySkills
    @ApplySkills 7 ปีที่แล้ว +1

    my lights work but i dont hear the clicking sounds. Im using the model b+ is it a power issue

  • @whyvas
    @whyvas 10 ปีที่แล้ว

    My guess would be lack of power, you see the little yellow jumper on the relay board? With that jumper in, the pi is energizing the relay coils which takes up too much juice for the model B. If you remove that jumper and plug in a separate 5v power supply properly, it will power the relays while the pi only turns on the opto isolators or transistors.

    • @skiwithpete
      @skiwithpete  10 ปีที่แล้ว

      It's a good idea. This might be the solution I've been looking for, for a 16 channel relay!

    • @whyvas
      @whyvas 10 ปีที่แล้ว +1

      skiwithpete Simply remove the jumper and plug a separate power supply into the JD-VCC and GND.

    • @gordslater
      @gordslater 10 ปีที่แล้ว +1

      skiwithpete yep, as whyvas says, it's a power-related problem. The relay coils will draw quite a bit of power form the 5v line (12v coil relays would draw less, but then you'd need to use two supplies - 12v and 5v.
      The combined current draw from your PSU of the Pi itself plus the relay coils supplied form the Pi 5v pin is way beyond what can be tolerated. That's whey the first few work, but the last don't. A simple way to test/prove this would be try with a Mod-B and activate the last 2 or 3 relays alone, they should work, but not when you want them all to switch.
      In a perfect world, you would use a good 5V 1A or 2A PSU for the RasPi and another 5V PSU for the relay board/s. That's 1A or 2A real measured output, not what it claims on the label ;)
      That way the coil of the relay doesn't load the Pi power rails in any way. The relays may, if you are lucky, have a coil current rating on them, in mA, or a resistance (from which you can work out the coil current using Ohm's Law) - or you may have to look it up from the relay model code. They will also have the switch-side ratings on there too, probably 10A/120v and 7A/250v or similar, but you want the *coil* rating at 5Volts.
      5Volt relays tend to be heavy on coil current (compared to 12Volt or 24Volt relays, Ohm's Law again) , some draw 125 or 150mA each when the coil is energised.
      Multiply the coil current rating by 8 (8 relays), then add some extra for the LEDs and Optocouplers on the board (I'd go for 100mA extra for them as a very,very safe estimate) and that's the current rating you need from the relay-board 5V PSU.
      Personally, I'd just use another 2A PSU for the relays, to be on the safe side and for an easy life, but that may be overkill. You might be lucky and get away with a 1A one, a lot depends on the relay rating/quality (*)
      The power supply "rails" as we call them are critical to any circuit's reliability, a saggy rail means trouble sooner or later. In your case, you hit it early on.
      Low-current coil relays, or latching ones, cost much, much more than standard ones. Common ranges for smaller 5v mains-rated relays are 36 Ohms up to 208 Ohms, at 5Volts, which gives a coil current of 138mA and 24mA respectively, so it can vary a lot depending on the relay:
      I (Amperes) = Volts / Resistance (Ohms)
      I =5 / 36
      swapping that around....
      5 / 36 =0.138A (that's milliAmperes) approx
      same for the 208 ohm coil example:
      5 / 208 = 0.024 A (that's 24 milliAmps) approx
      Asking the Pi to supply more than 1.11 Amps (138mA x 8 relays) plus some extra for the LEDs and optocouplers is going to cause a problem :)

    • @gordslater
      @gordslater 10 ปีที่แล้ว

      somebody check my working there ^ I'm tired lol

  • @humorean
    @humorean 8 ปีที่แล้ว

    Nice Video. One question, do I need to use breadboard and resistors in order for this to work? Or can I just plug straight from RPI to the relay board like you did?

  • @HandFedMole
    @HandFedMole 10 ปีที่แล้ว

    Pretty amazed you got this working... Those pins only output a few ma and at 3.3v...

    • @skiwithpete
      @skiwithpete  10 ปีที่แล้ว

      jasonroxorz that's why you need to choose the Optocoupler Relays as 3.3V and just a few ma is all that is required to trip the switch.

  • @thegamechanger3793
    @thegamechanger3793 5 ชั่วโมงที่ผ่านมา

    Where does 8 channel relay come in handy? I’m just trying to understand relay part and where can you apply this in project? Where to? Can someone provide some scenerios?

  • @sadonEmsi
    @sadonEmsi 8 ปีที่แล้ว

    Hey there, nice video really made me understand how the relay board works but I wanted to ask something. So what happens if you "plug" something into the relay (not the pins, I mean the other way around where you can plug wires) can you explain how can I control those?

    • @skiwithpete
      @skiwithpete  8 ปีที่แล้ว

      This video will help you to understand: th-cam.com/video/3u45htuQeag/w-d-xo.html

    • @sadonEmsi
      @sadonEmsi 8 ปีที่แล้ว

      I've already seen this one (great videos btw really helped me) but I'm talking about the software side of controlling. Like if I connect a light bulb for example, how will I be able to control it through my pi?

  • @EmmanuelOchoa8a
    @EmmanuelOchoa8a 10 ปีที่แล้ว +1

    Good video! Where are you get the 8 channel relay? or did you make it?

  • @BechirZalila
    @BechirZalila 8 ปีที่แล้ว

    Thanks for the tutorial. I dit it with an Rpi model B rev 2 and it did juste fine. May be the problem you described is a software bug resolved in the latest version of the OS.

    • @skiwithpete
      @skiwithpete  8 ปีที่แล้ว +1

      Cool. Thanks for letting me know.

    • @jamiet2130
      @jamiet2130 8 ปีที่แล้ว +1

      I had the problem with model B and I just started and got fresh OS

  • @iliaskaras100
    @iliaskaras100 10 ปีที่แล้ว

    this is amazing ive just iscover raspberry pi and your job is excellent i need more imformations about the programming of this because i cant understand how you test it if you can give me some explanations pleaseee!!!And something else i need to put a ruspberry pi into me garage because the gear that contact with the old controler is damaged and i want to replay with this how can i do this!!!

    • @skiwithpete
      @skiwithpete  10 ปีที่แล้ว

      Hey you should check out these two vids as they use relays and are complete projects: th-cam.com/video/WpM1aq4B8-A/w-d-xo.html and th-cam.com/video/p2abZ90-eU0/w-d-xo.html They'll probably help to give you a sense of what the relays do.

  • @BipinDhingra
    @BipinDhingra 9 ปีที่แล้ว

    I wish to play a video on a series of video screens with a slight delay on successive screens. Is it possible on the RPi?

  • @DaveDugganITPro
    @DaveDugganITPro 10 ปีที่แล้ว

    good job , very interesting and informative - suggest: you could use built in quicktime to record your laptop screen for an improved experience - also: how can we know / monitor the power draw issue more definitively (measure) ? A vs B vs B+ ?

    • @skiwithpete
      @skiwithpete  10 ปีที่แล้ว

      Yes, you're right. I should get something to measure the power draw... I'll look into that.

  • @Erdiil
    @Erdiil 9 ปีที่แล้ว

    great video. Do you need external power supply to control the relay board ? or just the power from Raspberry (5v) and will this work with the new raspberry pi 2?
    thanks

  • @CamCroz99
    @CamCroz99 9 ปีที่แล้ว

    I am trying this for Christmas lights. I have a raspberry Pi model B+. Did you ever figure out what was happening with the ssh freezing? I haven't gotten my relay board yet so I cannot comment if it has happened or not. I am looking to get an external power source for my relay board however.
    Also, does it matter what pins I connect the relay board to?

  • @MichaelGriffis
    @MichaelGriffis 7 ปีที่แล้ว

    I guess the relay is a switch? Can you control a something coming out of 120 V AC outlet?

  • @lucassherry3126
    @lucassherry3126 8 ปีที่แล้ว

    Would I be able to wire the relay board to solenoids and run them on timers (as long as they were the same voltage)?

  • @tyeron9192
    @tyeron9192 8 ปีที่แล้ว

    I really enjoy your videos. I plan on getting a raspberry pi. I want to build a sound activated light and pump fountain. any ideas or helpful thoughts

    • @Eatmykebab
      @Eatmykebab 8 ปีที่แล้ว

      tye ron jasper

  • @XW0RKS
    @XW0RKS 8 ปีที่แล้ว

    I have calorifier in my garage... Can I use relay as a switch for it, or do I need any extra components?
    I'm in Europe so we use 220V, if that makes any difference I should mention it.

  • @oliverpisco3115
    @oliverpisco3115 8 ปีที่แล้ว

    Very very nice video!!!
    But I have a question..
    How can I place a text on the PHP file indicating the status of the relay??
    Like, if I switch the button ON, a text or label will say " THE relay 1 IS ON"..
    And since I am using 8-channel relay, I would like to have an individual indicator message for the status of each relay..
    I hope you could help me...
    Thank you in advance!!!

    • @skiwithpete
      @skiwithpete  8 ปีที่แล้ว

      Don't know the answer. Let me know how you decide to solve it.

  • @2om476
    @2om476 7 ปีที่แล้ว

    Please explain more about the scripts.

  • @Silencedpulse
    @Silencedpulse 9 ปีที่แล้ว

    I greatly appreciate what you've put together here, it's helping me a lot. I've got all of the relays working my question is that I'm wanting to run an RS-360SH pump that supports 3v-12v power and I'm not certain on how to connect the pump to the relay. I've looked through many of your videos and I didn't seem to find one that shows connecting devices to the relay. Can I run the pump off of the raspberry pi or does it need a separate power supply?
    Thanks for your help!

    • @skiwithpete
      @skiwithpete  9 ปีที่แล้ว

      Chandler Gray My 1-relay video probably best shows the answer. th-cam.com/video/3u45htuQeag/w-d-xo.html Basically you want to cut one of the wires from the power to the pump and send it through the relay.

    • @Silencedpulse
      @Silencedpulse 9 ปีที่แล้ว

      skiwithpete
      That I what I thought but I wasn't sure if I needed to externally power the pump or if I could use one of the 5v leads & ground from the Raspberry Pi to power it. Thanks for the fast response as well!

    • @Silencedpulse
      @Silencedpulse 9 ปีที่แล้ว

      skiwithpete
      One other thing I noticed in your Automated Lighting control video is that you have loops in & out between each relay. Pardon my ignorance, but if I were to have several pumps powered, how would I connect the relays?

    • @skiwithpete
      @skiwithpete  9 ปีที่แล้ว

      Chandler Gray It's hard to describe without showing you, but "like this" th-cam.com/video/xc1daIb1LVc/w-d-xo.html you see how one wire connects all of the "ins" with those little loops? Then the outs go to each individual device.

    • @skiwithpete
      @skiwithpete  9 ปีที่แล้ว

      Chandler Gray No, that would be too much draw on the pi. Try splitting the power from the source before it goes into the Pi. That way you could have one supply (say 5V5A) and split it so the Pi draws 2A and the pumps draw 3A. That's something I do in my th-cam.com/video/17-8kzAiuCQ/w-d-xo.html

  • @thomasgambardella8315
    @thomasgambardella8315 9 ปีที่แล้ว

    I have a new raspberry pi 2 and looking to do christmas lights with music controlling it . what programs do i need to install on my sd card to get this started .

  • @dpm608
    @dpm608 9 ปีที่แล้ว

    Awesome video walk-through, thank you! I didn't realize relay boards were this affordable.
    Q1) If I want to use the B+, can I connect all the GPIO and then provide power externally using the 5v/GND pins and a power supply?
    Q2) If the first answer is yes, can I use a voltage divider to drop my 24v supply down to 5v? In other words, will the required current be too high for small resistors (

  • @llamallama2007
    @llamallama2007 9 ปีที่แล้ว

    Great video, this really helped me understand Raspberry Pi GPIO so much more. I'm currently working this video through and trying to get it to automate some lights. Working well so far! but my in4 on my relay isn't functioning. So I hope it's not one of my pins, I've changed the wire and that had no effect. Going to have to try it on a different GPIO pin.. :)

    • @llamallama2007
      @llamallama2007 9 ปีที่แล้ว +1

      Abraham Gihawi Just tried a different GPIO pin, as well as a different wire, and it's definitely the relay that's faulty. :(

  • @CharizardFan_og
    @CharizardFan_og 3 ปีที่แล้ว

    Can you use a raspberry pi to run all the functions in a car? eg: monitor engine and all sensors, control fuel, as well as all dash instruments...
    I don't know all that a modern car computer controls, was just wandering if the Raspberry Pi could do all that?

    • @skiwithpete
      @skiwithpete  3 ปีที่แล้ว

      read the functions of a car or run the functions? Read - look up the ODBII or ODB2. Run - well you'll need to start with realtime kernels because some functions and sensors on a car needs capabilities beyond the responsive lagtime of an off the shelf Linux OS. And, this is way way wayyyyyy beyond my knowledge of Car CPUs and all of their functions. But, interesting question. Reply back as you dig into this.

  •  8 ปีที่แล้ว

    niiiice tutorial. How long those jumper cables from the relay to the GPIO can be to this to continue working fine?

  • @Honeybadddger
    @Honeybadddger 7 ปีที่แล้ว

    Hey, man
    I am really confused about how the loop works. I made exactly as yours except I want it to run a test sequence such as turning all on/ off one at time. After the test I like to have 4 out of the 8 turning on 30 sec off 30s one relay at time. The last 4 relays on for 50s and off for 80s. All 8 is running in a loop after the initial test sequence. Can you help me out on this?