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

Поділитися
Вставка
  • Опубліковано 15 січ 2025

КОМЕНТАРІ • 711

  • @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 5 років тому +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  5 років тому

      Awesome. Thanks for the comment!

  • @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.

  • @woodywood6961
    @woodywood6961 3 роки тому

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

  • @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.

  • @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.

  • @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!!!

  • @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.

  • @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 :)

  • @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! :)

  • @JayMoodley
    @JayMoodley 4 роки тому

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

  • @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.

  • @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

  • @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

  • @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

  • @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.

  • @dannye6912
    @dannye6912 3 роки тому +1

    What a wonderful human u are. Respekt Bro

  • @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.

  • @ericsinclair4704
    @ericsinclair4704 6 років тому

    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

  • @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.

  • @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!

  • @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: ua-cam.com/video/OQyntQLazMU/v-deo.html

  • @girardaquino
    @girardaquino 9 років тому +1

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

  • @ImranSaeed
    @ImranSaeed 10 років тому +2

    Great effort skiwithpete

    • @skiwithpete
      @skiwithpete  10 років тому +1

      thanks Imran Saeed appreciate your patience.

  • @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

  • @Cmdrlucky8
    @Cmdrlucky8 8 років тому

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

    • @skiwithpete
      @skiwithpete  8 років тому

      thanks for posting. it works

  • @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!

  • @타마-w3j
    @타마-w3j 21 день тому +1

    Watching and loving this in 2024

  • @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.

  • @thegamechanger3793
    @thegamechanger3793 19 днів тому +1

    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?

    • @skiwithpete
      @skiwithpete  18 днів тому

      So a "relay" is just basically an electronically controlled switch. You know, like a light switch, but instead of controlling it with your finger you control it through electronics. So, basically anywhere you have a switch - like lights, or circuits, or devices - you can control it with this. Some examples? I control my furnace with a relay. Lots of home lights, and christmas lights. And check this video out: Garage Door: ua-cam.com/video/p2abZ90-eU0/v-deo.html&ab_channel=skiwithpete

  • @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.

  • @yawmbox
    @yawmbox 10 років тому +1

    Fantastic! Very, very easy and clear! Thanks!

    • @skiwithpete
      @skiwithpete  10 років тому

      Cool. Let me know if you build anything with it.
      Cheers,
      P

  • @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 😊

  • @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.

  • @j.r.3664
    @j.r.3664 5 років тому

    Very useful and interesting video, congratulations!

  • @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

  • @risingtiger42
    @risingtiger42 10 років тому +1

    awesome. I've got a raspberry pie B+ running nodejs which will power a sprinkler system. I'm hoping this will work. Thanks for the vid:)

  • @nalinfernando8184
    @nalinfernando8184 3 роки тому

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

  • @Mr.P539
    @Mr.P539 5 років тому

    Watching now love 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

  • @TheHarryspidy
    @TheHarryspidy 9 років тому

    Got it... Working fine with your code... Thanks!!!

  • @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 ?

  • @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.

  • @starbug1630
    @starbug1630 8 років тому +1

    nice presentation...
    keep on!

  • @berkcan3475
    @berkcan3475 9 років тому

    its really helping and lerning centered video thank 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?

  • @skiwithpete
    @skiwithpete  10 років тому +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.

  • @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. :(

  • @63thrasher
    @63thrasher 9 років тому

    Great video helped out alot

  • @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

  • @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

  • @2om476
    @2om476 7 років тому

    Please explain more about the scripts.

  • @zulfqarali8603
    @zulfqarali8603 8 років тому

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

  • @ld_stacey
    @ld_stacey 8 років тому

    dude love your videos so good so awesome

  • @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?

  • @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.

  • @dawers6233
    @dawers6233 10 років тому +1

    it helped me!
    Thankyou.

    • @skiwithpete
      @skiwithpete  10 років тому

      Thanks! Appreciate you taking the time to let me know.

  • @anilsinghmalara865
    @anilsinghmalara865 7 років тому

    helped me a lot.. Thankyou

  • @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.

  • @EmmanuelOchoa8a
    @EmmanuelOchoa8a 10 років тому +1

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

  • @adamnawzad
    @adamnawzad 10 років тому

    thank you so much please continue

  • @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?

  • @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?

  • @raphalopes495
    @raphalopes495 9 років тому

    Nice video friend, thank you so much for this help =)

  •  8 років тому

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

  • @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.

  • @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

  • @dpm608
    @dpm608 10 років тому

    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 (

  • @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.

  • @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.

  • @williewill4949
    @williewill4949 6 років тому

    Good stuff , can't find the code below video,

  • @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

  • @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.

  • @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!

  • @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.

  • @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: ua-cam.com/video/WpM1aq4B8-A/v-deo.html and ua-cam.com/video/p2abZ90-eU0/v-deo.html They'll probably help to give you a sense of what the relays do.

  • @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?

  • @tulaconalas
    @tulaconalas 9 років тому

    great vid mate, im a noob and i wonder how did you set up so you can connect and program wirelessly your pi??
    Cheers

    • @skiwithpete
      @skiwithpete  9 років тому +1

      Nacho Miranda It's called SSH. If you have linux or a Mac, use terminal to SSH in. If you are a Windows user, the program you need is PuTTY.

    • @tulaconalas
      @tulaconalas 9 років тому +1

      skiwithpete thnx a lot man..you are awesome...one of the few youtubers thats responds every message posted...

  • @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.

  • @brahimelboudani601
    @brahimelboudani601 9 років тому

    skiwithpete thanks I will have a loot at it amazing work ! keep it up

  • @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: ua-cam.com/video/p2abZ90-eU0/v-deo.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.

  • @danjourno24
    @danjourno24 9 років тому

    Hi, Great video. Is there enough power with the RPI 2?

    • @nobytes2
      @nobytes2 5 років тому

      Willing to bet not enough current.

  • @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 ?

  • @troymaglalang9554
    @troymaglalang9554 9 років тому

    Hi,.... thanks for sharing...Will this work on Raspberry PI 2 model B?

  • @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.

  • @oachkatzlschwoaf01
    @oachkatzlschwoaf01 7 років тому

    Cool mate thanks a lot!!

  • @magnusg-blog3674
    @magnusg-blog3674 10 років тому +1

    Very nice tutorial (Y)

  • @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

  • @MRBROWSER2012
    @MRBROWSER2012 6 років тому

    Did you ever figure out the problem with RPi B+ models? According to the reviews on Amazon, this is not a problem as long as the power jumper is connected between JD and VCC on the relay PCB. Will find out soon as I just ordered one to use with and RPi 3 B+ but this is not a typical complaint in the hundreds of reviews on Amazon.

    • @skiwithpete
      @skiwithpete  6 років тому

      John Baxter I assume it was low power input, but I don't really know

  • @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!

  • @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

  • @Gsavell
    @Gsavell 5 років тому

    what OS are you using in the pi? how are you connecting the laptop to the pi is it ssh?

  • @louisbradier8725
    @louisbradier8725 10 років тому

    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  10 років тому +1

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

  • @ijustneedaname47
    @ijustneedaname47 3 роки тому

    Question from a software engineer getting into hardware - what does VCC mean?

  • @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.

  •  10 років тому

    very nice thank you!!!

  • @nmaniacos
    @nmaniacos 9 років тому

    Excellent tutorial and very good starting point! I saw that you don't use resistors (I also didn't use in my project). Is it necessary to use resistors? Are there any dangers if not? Thank you!

    • @skiwithpete
      @skiwithpete  9 років тому

      +Nikos Maniakoudakis the optocoupler relays (like mine, but not like every relay) don't require resistors. Thanks for watching. Cheers, P

    • @nmaniacos
      @nmaniacos 9 років тому

      +skiwithpete Thanks! Actually we have exactly the same relays but i didn't know this spec :-)

  • @iechlong
    @iechlong 8 років тому

    nice work