Raspberry Pi: 4-channel Relay step-by-step with example scripts for home automation

Поделиться
HTML-код
  • Опубликовано: 6 сен 2024
  • Check here for all the further information relating to this video.
    Get the relay here: amzn.to/1BoBucC
    Get the GPIO wires: amzn.to/1VyYIYb
    Get the WiFi dongle: amzn.to/1v8L7Ho
    Get a 5V2A power supply: amzn.to/13LeA49
    Get the Macbook Air: amzn.to/1Hignwv
    And, the Raspberry Pi Model A+: amzn.to/1vxr85T
    Or get the new RaspberryPi2: amzn.to/1zJlP9L
    Get the parts in the UK: bit.ly/15XFRBH
    **Remember: Help each other in the comments section. And please repost your code.
    Find the scripts here:
    github.com/ski...
    Watch my other Raspberry Pi relay videos:
    1 channel relay video: • Raspberry Pi: 1 Channe...
    8 channel relay video: • Raspberry Pi: 8 Channe...
    16 channel relay video: • Raspberry Pi: 16 Chann...
    Check out my other Raspberry Pi projects:
    Garage door remote: • Easy Raspberry Pi Gara...
    Outdoor Automated Lights: • Raspberry Pi Automated...
    File Server (NAS): • Raspberry Pi: File Ser...
    Weather Station: • Raspberry Pi: Weather ...
    How to Bitcoin Miner: • How to: Mine Bitcoins ...
    Voice activated lights: • Raspberry Pi: Voice ac...
    Control a light with your Mobile phone: • Raspberry Pi: how to t...
    Donate here: If you like the video or think it's useful buy me a coffee bit.ly/1kAous6
    Donate with bitcoin! 1HfHr25qZQjPzwphPxpNaD5CytDNYcfzrJ
    Support this channel on Patreon!
    / skiwithpete

Комментарии • 265

  • @kennethherring2918
    @kennethherring2918 9 лет назад +15

    I'm just starting out with the Raspberry pi as a way to expand on the electronics that I have learned over the years and when looking for examples for relays I found your scripts. I've given them a try and I find them very helpful. Thanks.

  • @DotcomL
    @DotcomL 9 лет назад +2

    Nice video :)
    I actually thought you could be harming the life expectancy of the relays, but went on to check and the number of switches is in the millions. That's the incredible!

    • @skiwithpete
      @skiwithpete  9 лет назад +2

      Guilawless nah! Use 'em. I reckon it'd be a badge to honor trying to kill one of these things.

  • @CigaretteTricks
    @CigaretteTricks 8 лет назад

    make sure to reset the pi and set all your pins to low after install. mine were all over the place and was giving me problems and that did it for me! (rpi 2 b)

  • @ashutoshtiwari3785
    @ashutoshtiwari3785 5 лет назад +2

    You can almost do a music concert with those relay sounds. I liked that second script.

  • @DevEncryptionNull
    @DevEncryptionNull 3 года назад +1

    Hello! Can anyone point me in a direction where it shows using this relay with the Raspberry PI being isolated? From my web searching it seems to indicate that power be provided to JD-VCC & GND but the jumper seems to be bridging JD-VCC & VCC and I don't see a separate GND to use when connecting up a separate 5V power supply. I hope someone can shed some light on this. Thanks!

  • @Ultramesh
    @Ultramesh 4 года назад

    Very nice scripts. Works perfectly. Now I just want to link it all to the Alexa Echo Dot.

  • @wastinghours4758
    @wastinghours4758 7 лет назад +3

    Holy heck man! I've spent DAYS trying to launch my script through a browser. Your code showed me the way. Thank you so much for posting it!

    • @wastinghours4758
      @wastinghours4758 7 лет назад +2

      "sudo nano /etc/sudoers
      add to bottom of file: www-data ALL=(root) NOPASSWD:ALL"

    • @israelgoytom6085
      @israelgoytom6085 7 лет назад

      sudo nano /etc/sudoers
      add to bottom of file: www-data ALL=(root) NOPASSWD:ALL"
      is this setting has no any effect regarding to security?

    • @asyrafhasanuddin8057
      @asyrafhasanuddin8057 7 лет назад

      thanks heaps. this got my code working.

    • @RakTheGoose
      @RakTheGoose 6 лет назад

      this allows sudo script access without providing root password.

  • @40nmugzy
    @40nmugzy 7 лет назад +2

    Hi pete. My name is Nick. I've been looking for a way to control a machine I've been building for my plasma cutter. I designed and built a relay circuit but it seems pretty bulky. Since I saw your video on relay board controlled by a raspberry pie I just know this would be perfect. Now the only thing I didn't see in the video was how to create a program to integrate contact switches to input to the raspberry pi. What I'm talking about is I need a motor to start. This spins an acme thread. A nut on the acme thread is connected to a sled, runs down on two polished rods that have linear bearings connected to the sled. The sled holds a plasma torch. The function of this machine is to run a plasma torch in a straight line to cut metal. So, turn on the torch, it needs to start the motor, run for a predetermined time, at the end of the cut turn off the torch, stop the motor, return the sled to start position and stop the motor. So if you could make a video on how to control the relays I would greatly appreciate it

  • @jorgesepulveda2866
    @jorgesepulveda2866 7 лет назад +2

    I'm assuming this doesn't need resistors while wiring those jumper cables, correct?

  • @felixcomms
    @felixcomms 6 лет назад

    A couple of days of trying this and that and it all works great.... Many thanks for the guidance

  • @mvpsvable
    @mvpsvable 6 лет назад +2

    Exactly what i was looking for, my 4 channel relay is on its way. Thanks for posting good video!

  • @matfloyd2008
    @matfloyd2008 8 лет назад

    FYI, in some of the python programs there are missing parenthesis. This causes an error message to populate, and the program will not work until the parenthesis for the print statements are typed. Parenthesis are required for python3.x.
    Ps. I just got my relay board to work just as your video shows! Thank you for all your help with the tutorial and your python code! I am planning on making a 3000 ft. AGL rocket that is controlled by the pi and the relay switches. And this is using the Pi 3.

  • @talibiton3972
    @talibiton3972 8 лет назад +1

    I Liked you're video very much,
    because its not like i've learnd how to use relay, i also learned how to trubleshoot which is as important! THANKS!

  • @AskShahzad
    @AskShahzad 7 лет назад

    Amazing and Lovely, nicely taught ! i tried it and it worked like charm !!! just anyone who wish to use remember to check your ports and remember them,

  • @sagnikbhattacharya
    @sagnikbhattacharya 8 лет назад

    Cool video. Can you tell me a. How to connect appliances such as sensors to the relay (not the software, just the circuit)b. How to power the relay with external power.

  • @boomwithpeter623
    @boomwithpeter623 4 года назад +2

    Windows has built in SSH from 2016 in command prompt

  • @juggalizzle75
    @juggalizzle75 5 лет назад

    some people say to use a 3/3.3 v relay instead of a 5v relay. Have you noticed the raspberry pi not delivering quite 5v and failing to trigger the relays? I assume this is why the recommend using relays with a lower trigger value

    • @skiwithpete
      @skiwithpete  5 лет назад

      Not a problem with optocoupler relays

  • @josecunha731
    @josecunha731 8 лет назад

    ...loved the tutorial. I need to do something very similar involving controlling relays remotely, you were an great help to get started. Thanks much!

  • @andrewdavis6917
    @andrewdavis6917 6 лет назад

    Wow, very nice. Glad you showed the trouble shooting. Hey from TX

  • @wsoundman
    @wsoundman 6 лет назад

    This is great stuff. And better again you never said "uhhhhh ". Most polished

  • @marksmanaz
    @marksmanaz 4 года назад +4

    "I'm going to face the metal tabs outwards so if anything goes wrong I can test with my multi meter." Something goes wrong and no multi meter 😖 OCD must be tough to live with

  • @claudioguendelman
    @claudioguendelman Год назад +1

    hi from chile well done thanks

  • @johnnyrizzo8057
    @johnnyrizzo8057 7 лет назад

    that is really cool. do you think this can run on the FPP (falcon Christmas player) this would be a great tool used to turn 12v power supplies on and off remotely.

  • @zhouyu9971
    @zhouyu9971 3 года назад

    I’m very new to this. Is that possible to make some nice looking interface to cover the coding, then we can use a touchscreen to make a center control panel in home automation? I wish to use it on my motorhome.

    • @skiwithpete
      @skiwithpete  3 года назад

      github.com/skiwithpete/sesamepi is the code for this: ruclips.net/video/p2abZ90-eU0/видео.html yeah, you can control the relays on a web page.

  • @eaglewitharifle
    @eaglewitharifle 8 лет назад

    Hi, nice video. My 4 channel relay works but for some reason (depending on what GPIO it's plugged into) some of the relay lights illuminate with a dim red color when it starts up. The same as what your first LED does at 5:26. Why is this?

  • @JCaliSwag96
    @JCaliSwag96 9 лет назад

    Quick question... so I got everything to work, and I made new scripts that are identical to script5 and script5a, the only difference is the pin number. However, whenever I attach electronics (I'm using a lamp that I cut the wire in half) they only work when I touch the two ends of the wires to the center and right metal part. Whether the channel is on or off, the light turns on only with the center and right part. And whether the channel is on or off, the light never turns on when the wires are attached to the center and left part. What might have gone wrong? Maybe a problem with the actual relay? Thank You!

  • @SuperLefty2000
    @SuperLefty2000 9 лет назад

    The easiest way to control relays is with Arduino. It has bunch of libraries and generally it's easier to manipulate it to suite your application.

  • @misteraon
    @misteraon 9 лет назад

    So looking at your code examples it looks like these relay boards are active low. I was planning on using one of these boards to operate sprinkler solenoid valves for my garden irrigation with WebIOPi. Do you see any concerns with the pins reverting to an active low state after a reboot...say the power goes out. Don't want my irrigation valves opening unexpected say if I'm away.

  • @davetheglidingbum
    @davetheglidingbum 5 лет назад +1

    Thanks for this, I have learned a lot from your code in a short time. Do you think it would work as well on a pi zero?

  • @ZGC.
    @ZGC. 8 лет назад +1

    Everything is working fine but only the web part not im using the pi 3 and google chrome

  • @gdjobufckngfruitcake
    @gdjobufckngfruitcake 8 лет назад

    Really great video, subscribed definitely. Im going to use a similar design to yours for a switch controlling cold cathode PC case lights.

  • @the.money.mentor.825
    @the.money.mentor.825 7 лет назад

    So my led turns on and I hear the click, but nothing is coming out. When I hook up a multimeter to it nothing shows. What am I doing wrong? I'm trying to bypass a tactile switch using this.

  • @jmsiefer
    @jmsiefer 8 лет назад +1

    Awesome video! Thank you so much for posting. :)
    Couple questions:
    1) Do I need to have an OS of any kind flashed to the card prior to doing all of this? Or can I put the Python files directly on the SD card, insert it into the Pi, and run it like that?
    2) I need a relay to turn on for 1 second every weekday at 8AM (watering a plant, for example). Is there a way to have the relays activate based on time and day, and then repeat all over again? I checked out your Alarm Clock video, but I'm afraid that's way more sophisticated than what I'm looking for.

    • @skiwithpete
      @skiwithpete  8 лет назад +2

      +J. Siefer You need Raspbian installed. And then to run the python code from wherever you put it inside Raspbian. Check out my Garage Door opener, that runs for .5 seconds. Change it to 1, and then set it on a timer.

  • @xilefonemusic
    @xilefonemusic 9 лет назад

    With the 5 and 5a programs, can i connect my garage door to the relay, and would it open and close? Also, can i just set the pi and the relay on a board, or do i need to wall mount it.

  • @yashindian4233
    @yashindian4233 4 года назад

    Awesome..planning to buy one can u please help me with..a video where u can add music to it

  • @sccec1
    @sccec1 6 лет назад

    Hello. I don't know why don't stay the rellay on, just couple of seconds ... the relay is 5v 8 relay modules, the jumper is on vcc-jd vcc, conected vcc to pin 2 on 5v, the gnd conected to pin 6, and the gpio on pin 7. I copied your script5.py and I run the program.

  • @fabicon
    @fabicon 6 лет назад

    Hi Man! great video. How would you include a GSM Module to this setup? im in process of trying to build this for my off the grid cabin(with solar panels)

  • @BennyCFD
    @BennyCFD 7 лет назад

    Great video as always . 2 questions...1, in order to connect my laptop via WiFi to the raspberry pi how do you know what the access code of the raspberry pi is. 2, The raspberry Pl 3 uses I believe 3 or 3.3 volts in th GPIO.. Are there 3.3 volt devices like relays etc.
    Thanks

  • @nielsenaaa
    @nielsenaaa 3 года назад

    you are a php guy, im sure, i can tell ! proud to be one too ^^

  • @berkcan3475
    @berkcan3475 8 лет назад

    is it dangerous to use relay module for controlling extending cable coming from mains electric???

  • @charliemesa
    @charliemesa 7 лет назад

    Hello, quick question. If you put this up on your lights at home...and somehow the pi is broken, how can you manually switch on and off the lights?

    • @Anonymous-vh6kp
      @Anonymous-vh6kp 7 лет назад +2

      You can set the relay to be on by default. So if the relays lose power, everything will be switched on. You should control your circuits at the device itself rather than through an existing switch, that way your normal physical switch will still be functional.

  • @Marva123
    @Marva123 6 лет назад

    Wasn't your pin layout GPIO.BOARD isn't that the physical pin layout and not BCM layout which is numbered all down both sides and not going across the pins?

  • @andrebugeja283
    @andrebugeja283 8 лет назад

    i have tried this project but i ve gotten stuck, i do manage to turn the relay on but i cant seem to make the relay turn off. could you help?

  • @markkerr7094
    @markkerr7094 8 лет назад

    got it running first time big step for me thanks again

  • @kg5nub
    @kg5nub 11 месяцев назад

    can i use this like in my work, i work on chicken houses all over the place, can i take this or say the 8 channel and hook it to my stuff and control it from anywhere in the world and the pi has internet access? how hard would it for a newbie that's not that smart and just getting into this...

  • @GiorgioSegatori
    @GiorgioSegatori 4 года назад

    Very nice really and I'm using it....but where can I find php section? I'd like to put it in a web browser

  • @rawl05
    @rawl05 8 лет назад

    hey I am totally new to raspberry pi. can you guide me to use raspberry pi to control 4relays using input via switch from the user. and those relays to be also controlled wirelessly by android device via ip using web.

  • @haroonnaseem1
    @haroonnaseem1 6 лет назад

    why my relay Module is working inverted. Relay get activated when input signal to relay is Low.

  • @jitendravishwakarma1523
    @jitendravishwakarma1523 6 лет назад

    Hey
    I need help.... My relay board is not working(i cant hear d voice click ) whenever the program is run d light on relay board glows n relay isnt working..... Whats d prblm?

  • @zakariaellougbi3893
    @zakariaellougbi3893 6 лет назад +1

    a little tip for your next videos, you can use the Zoom option of your browser for bigger buttons... (just for the video ^^ )
    Thanks for sharing (y)

  • @mba2ceo
    @mba2ceo 6 лет назад

    please do a video on bit banging using c++ console application windows 10.

  • @Randy2747
    @Randy2747 4 года назад

    Is it possible to hook pir up with these codes? Woukd it be hard to do? I'm new with the pi

  • @bobbyjoedill
    @bobbyjoedill 6 лет назад

    How hard would it be to control off road lights via the app and switches? Thinking of using a pi to control my truck lights. I have used ardiuno boards before and have limited programming skills.

    • @skiwithpete
      @skiwithpete  6 лет назад

      The disadvantage is that the Raspberry Pi needs to boot and shutdown properly, so I would say it would have limited use in a vehicle that doesn't have an "always on" power source.

  • @kyleconway2691
    @kyleconway2691 8 лет назад

    Could someone write an example code of turning a relay on with say the button enter and then without changing the code save file hitting enter again and it shutting off the relay. So essentially code one displayed in this video except being on a timer make them operate on say a switch? press enter for on press enter for off

  • @onlyiwilknow
    @onlyiwilknow 6 лет назад

    How would I go about to switch on and off something using 4 - 5 kilowatt (20 - 25 Amps -220Volts).
    I could not find a RPi relay that will be able to handle that high Amps but I am sure a plan can be made.
    Perhaps two stage relay: %v to 30 Volt and a second 24V to 220 volt monster relay able to handle 30 Amps, or ir there an easier way of doing this?

    • @jeffpynnonen3445
      @jeffpynnonen3445 5 лет назад

      Frits, why not use a SSR (Solid State Relay)? What did you use?

  • @tratzum
    @tratzum 9 лет назад

    Thanks for the video..all of your videos. I know nothing of python so learning is slow going.
    question I have is how do you get the scripts to work through the web browser. It was mentioned you have to use php. I have the concept of using Apache but that's it.

    • @skiwithpete
      @skiwithpete  9 лет назад

      Matthew Tratz Yeah check the About section, I tried to make it as easy as poss. The PHP section lists which packages to install, and all you should have to do is copy and paste the php contents and you'll be away (as long as it points to the right place where the file is). Let me know if you hit any snags.

  • @chrispospisil7180
    @chrispospisil7180 6 лет назад

    you ever use xlights to control your relay boards

  • @agumonkey
    @agumonkey 6 лет назад

    ah wires, so simple yet so subtle

  • @adevilla
    @adevilla 7 лет назад

    Great work Pete, it worked a treat 1st time. Thanks.

  • @sahilharit7736
    @sahilharit7736 8 лет назад

    Can you suggest me, which type of wiring should I do to operate mains(lights, fans etc) with relays so that the normal/manual switches also work if raspi system is not online?

    • @skiwithpete
      @skiwithpete  8 лет назад

      +Sahil Harit Don't play with mains!

    • @sahilharit7736
      @sahilharit7736 8 лет назад

      but I'm up for home automaton, that's why I'm asking!!!

    • @sahilharit7736
      @sahilharit7736 8 лет назад

      +skiwithpete ok... thanks!

  • @pbrown4
    @pbrown4 9 лет назад

    sorry for the "silly" question, but can you only access the webpage (for 5 and 5a) from your home wifi? or can you do it from anywhere (eg. your work or friends house)?

    • @skiwithpete
      @skiwithpete  9 лет назад

      Peter Brown Only internally unless you do a lot of configuring (including Port Forwarding on your modem). I intend to do a video to show how this is done soon. But for now, only on your internal network. P

  • @markkerr7094
    @markkerr7094 8 лет назад

    Hi anybody show me how to edit a script got the four relays running but want to change the time the fire and repeat them them. prob best to wright a new script but can't figure it out

  • @dr.agostefun
    @dr.agostefun 9 лет назад

    Hello, Thank you for your great video tutorial.
    I try to do/run your examples about open and close some relays but I have some difficulties on closing the ralys. Do you know if I'm doing something wrong? (i'm using the same code as you wroten in script5 and script5a. script5 is working but script5a not).
    thank you for your answer.

    • @skiwithpete
      @skiwithpete  9 лет назад

      Dragos Florin Stefan From the information you've given me it's very difficult to tell what has gone wrong. I think that you should check if pinList = has the same number on both. Besides that, any further information about the error will help.

    • @dr.agostefun
      @dr.agostefun 9 лет назад

      skiwithpete well... I can Open the relays but I can't close them. script5 is working, script 5a not working. :))

    • @skiwithpete
      @skiwithpete  9 лет назад

      Dragos Florin Stefan are there any error messages? what is does the line with PinList say on both scripts?

  • @isjesse1
    @isjesse1 7 лет назад

    im new to this, how do you program an android app to control a relay via raspberry access point or bluetooth?

  • @JohnPaulLafata
    @JohnPaulLafata 7 лет назад

    Hey, I'm new to all of this so sorry if this isn't a great question, but is the this configuration enough to power a 110v AC or 12V DC solenoid valve?

    • @jyvben1520
      @jyvben1520 7 лет назад +1

      depends on the relay, most relays have that info printed on top
      example if it says 10 A 125VAC it can power a device that uses 110v ac and is about a 1000 Watts.
      it can also say 10A 28VDC then that is enough for your 12V solenoid valve and less than 120 Watts

  • @klintkrossa6885
    @klintkrossa6885 6 лет назад

    simple fix for py code 4. De-indention the cleanup.

  • @raviratansingh1805
    @raviratansingh1805 9 лет назад

    Can you share some thing controlling the 4/8 channel or relay () using Intel Edition for automation

    • @skiwithpete
      @skiwithpete  9 лет назад

      Ravi Ratan Singh I don't understand your question. The source code is in the About Section. What's that about Intel Edition?

  • @WayneRigley
    @WayneRigley 5 лет назад

    Any way you can show how to make a script for turning a relay on and off for a specific time every day

    • @skiwithpete
      @skiwithpete  5 лет назад

      I would do that through cron, running the script. Rather than in the script.

    • @WayneRigley
      @WayneRigley 5 лет назад

      @@skiwithpete ya no idea on this stuff.. I'm new to the coding side

    • @skiwithpete
      @skiwithpete  5 лет назад

      @@WayneRigley ok, so choose the script that you want to modify (from my open source examples), and then add it to cron (which is a system level timer). So you can schedule things inside the OS. Like if you want a program (like a diskscan) to run at a time (3AM everyday).
      So step one, get the script working the way you want it to.
      Then step two, learn about cron to get the script to run at a specified time.

    • @WayneRigley
      @WayneRigley 5 лет назад

      @@skiwithpete thank you very much for taking the time to respond to me what I'm doing is I have a 12 volt linear actuator which is going to operate my chicken coop door as well as LED lighting inside the chicken coop. this is the reason for me wanting to automate this on my Raspberry Pi 3 B plus I have a 4 channel relay that's going into the mix both the actuator and the LED or 12 volt source. I'm very familiar with how relays work so that's not an issue it's mere getting the script to do what I want or the file I should say. I'll definitely be taking a look at your examples within the hour. Again thank you

  • @prabanjam1111
    @prabanjam1111 8 лет назад

    hi, could u please teach without Rasberry, how to use dc relay ?

  • @davidlyons24
    @davidlyons24 7 лет назад

    Is not strange that to turn on the relay you have to GPIO.output LOW and to switch it off to GPIO.output HIGH. It cannot be setup in the opposite way?

    • @skiwithpete
      @skiwithpete  7 лет назад

      davidlyons24 you can... But I don't think it works the way you think it works. But yeah, do it anyway. It won't harm.

  • @chesterweirdo1978
    @chesterweirdo1978 9 лет назад

    Hi I have tried a number of these and I just can not get the Relay to turn off. Relay turns on using GPO 4 but does not turn off. I have copied the code exactly.
    The only error is scrit1.py:14: RuntimeWarning: A physical pull up resistor is fitted on this channel!
    GPIO.setup(i, GPIO.OUT)
    Can you help?

  •  6 лет назад

    Nice tutorial. What Image do you use for the raspberry?

  • @markkerr7094
    @markkerr7094 8 лет назад +1

    found the scripts but how do i get them to run i paisted them into terminal but can't get the to run
    total new ti raspberry pi and code

    • @skiwithpete
      @skiwithpete  8 лет назад

      +Mark Kerr I'm pretty sure I show that in the video... if not, watch this one: ruclips.net/video/TFt480sxNWg/видео.html

  • @FIGTHER011
    @FIGTHER011 7 лет назад

    Hi skiwithpete.I am trying a lot here but no luck :( your script 4, can you make that in php wit out count down? just kiip it blink? and a butten there stop the script again?Cheers Jimmy

  • @0streamer0
    @0streamer0 6 лет назад

    Thanks for the scripts they helped alote

  • @alamgirkabirhira2328
    @alamgirkabirhira2328 9 лет назад

    great video for learning , thanks

  • @stephanest-denis9801
    @stephanest-denis9801 6 лет назад

    Thank you, one thing, i use webpage to light on and off, but if i use the script2.py, i don't know how to stop it from my webpage, can you give a php code for stopping the flashing lights, thank you.

  • @PrimeGoat1357
    @PrimeGoat1357 8 лет назад

    Is it possible to have a single web interface with two or more Pi's (each having its own relay board)?

    • @skiwithpete
      @skiwithpete  8 лет назад

      +Alan Green Yes. But that doesn't mean I've figured out how to do it. Just have a text file on one, and the other reading it every so often interval... As a first thought.

    • @OfficialVeteranMusic
      @OfficialVeteranMusic 8 лет назад

      yes just give them different local IP addresses and use PHP to access databases created seperately by each PI... very easy logic to follow

  • @teytu
    @teytu 8 лет назад

    Thank you very much, I helped me a lot. Keep it up.

  • @alexandreabreupassos2560
    @alexandreabreupassos2560 8 лет назад

    Just figured that the directory where python script resides must have CHMOD set to 777. Now everything works fine.

  • @Fredters
    @Fredters 9 лет назад

    Nice tutorial very clear!

  • @dgcompany54
    @dgcompany54 9 лет назад

    What's the purpose of that blue jumper on the relays?

    • @skiwithpete
      @skiwithpete  9 лет назад

      dgcompany54 the blue jumper links VCC and JD-VCC. If you want to isolate the relay coil drive voltage from the optocoupler VCC, you will need to drive the node labelled JD-VCC with another 5V supply. In the example in the video, I leave the jumper connected.

  • @quiksilver3232
    @quiksilver3232 7 лет назад

    HI! i have done everything as shown. all works fine, except the .html php code
    Just nothing happens! Any help?

  • @ramyrutu
    @ramyrutu 8 лет назад

    skiwithpete I can't get script5a to turn off my relay light ??!! please help

  • @RohanHawthorne
    @RohanHawthorne 9 лет назад +1

    Thanks man, I bought you a coffee!

  • @farhanryandi
    @farhanryandi 9 лет назад

    Thank pete, this video help me

  • @redmist336
    @redmist336 9 лет назад

    Little confused as to how you are reliably triggering the relays. All reviews on the amazon link you provided, some documentation, and other youtube videos, state you can't trigger them with 3.3v and that either a transistor or optocoupled 5v rail is required. Obviously your solution is considerably simpler (and simple is better in the race car situation I wish to place my pi) however wondered if you considered it reliable, or electrically responsible (as in it shouldn't work, but does... for how long I don't know?)

    • @skiwithpete
      @skiwithpete  9 лет назад +1

      Daniel Powell There is a lot of confusion surrounding these relays. If you watch Gavin McDonald's video, you will see that my method results in difference of 1.7V across the optocoupler. This is fine for working "in practice" but if you want to further study this switch for electric responsibility you should check out his complete video here: ruclips.net/video/b6ZagKRnRdM/видео.html

    • @redmist336
      @redmist336 9 лет назад

      skiwithpete Thank you very much for the reply.From someone as electronically inadequate as I your assistance is most appreciated. . I note that Gaven uses both the 3.3v and 5v supplies for VCC and JD-VCC respectively.Given this negates your 1.7v difference, why did you not opt to simply set the jumper on the relay board and supply the relay with both 3.3v and 5v (as Gaven did)? Cheers, Daniel

    • @skiwithpete
      @skiwithpete  9 лет назад

      Daniel Powell
      It doesn't work. But, I understand that if you buy a different relay or if you use an external supply that you might be able to achieve different results. You asked for the "electrically responsible method" - and I know that in theory it is meant to work in that way. Not that the 1.7V is of major concern to me - but if it is to you, I just want to be clear that this is an 'in practice' video.

    • @redmist336
      @redmist336 9 лет назад

      skiwithpete Pete, wanted to thank you very much for your assistance, your tutorial, and the theft of your code. Works a treat and saved many a keyboard from having a forehead imprint (and forehead having a keyboard imprint) As an aside it appears that I have the same relay package as you, and mine works with the jumper removed JD-VCC connected to the pi 5v and the VCC on the larger jumper block connected to the pi 3.3v....Now to start coding the sequential gear shift.

    • @skiwithpete
      @skiwithpete  9 лет назад

      Daniel Powell
      Thanks for your kind words. I think I'll have to give it another go...

  • @markkerr7094
    @markkerr7094 6 лет назад

    hi could anyone help i would like to control a 4 channel relay with raspberry pi to turn on -off in sequence sometimes all together sometimes two at a time -one at a time and be able to alter time between them
    thanks

  • @nokopeets
    @nokopeets 8 лет назад

    cool video, will use information for university :)

  • @aadityamundhalia
    @aadityamundhalia 8 лет назад

    i understand you posted it last year but i cant get it working. on pin 2 it is on cant turn it off and on pin 8 it is just off cant turn it on using raspberry pi 3 model b single relay. my relay has +, -, and s i presumed + for 5v, - for ground and s for signal. Hooked it + on pin 2 and - on pin 3. running your script gives
    Traceback (most recent call last):
    File "on.py", line 22, in
    GPIO.output(14, GPIO.LOW)
    RuntimeError: The GPIO channel has not been set up as an OUTPUT
    Any help will be appreciated.

    • @skiwithpete
      @skiwithpete  8 лет назад

      your traceback error tells me you have modified the code. unfortunately I don't have enough information to help you. the error you describe with lights staying on makes me wonder in you have the correct optocoupler relay. I suggest you look on Google for more help. thanks

  • @siddheshmhatre4366
    @siddheshmhatre4366 6 лет назад

    can u suggest good relay board make.?

  • @rodholland4389
    @rodholland4389 9 лет назад

    why didn't you show the alternative normal PC versions in the UK we all use PC's not MACs

    • @skiwithpete
      @skiwithpete  9 лет назад +2

      Rod Holland I don't have a PC.

  • @konstantinosmavros5489
    @konstantinosmavros5489 6 лет назад

    Very intersting..Can you show the code in Python as an example

    • @skiwithpete
      @skiwithpete  6 лет назад

      Konstantinos Mavros yes, it is in the video description.

  • @honeybadger6127
    @honeybadger6127 7 лет назад

    in what folder location on the pi do you store the index.php file at?

    • @jyvben1520
      @jyvben1520 7 лет назад

      on a raspberry pi using apache2 webserver then probably in the /var/www/html folder check your /etc/apache2/apache2.conf file for

  • @rimantasmatuliokas4307
    @rimantasmatuliokas4307 3 года назад

    Hi, hou to control boiler remotely via rasberry+module control+modem via mobile? Is it any video tutorial?

    • @skiwithpete
      @skiwithpete  3 года назад +1

      Look at my garage door video. That's how I'd do it, but with a boiler instead of a Garage Door connected to it...

    • @rimantasmatuliokas4307
      @rimantasmatuliokas4307 3 года назад

      @@skiwithpete ok, but is it will work if i am in town and between my boiler and mobile phone is a 20kilometers distance? As i understand garage doors works only in range of wifi?

    • @skiwithpete
      @skiwithpete  3 года назад

      @@rimantasmatuliokas4307 then you need to learn to expose your device to the internet. I try to cover that in a video. But it's risky.

  • @minidgreat
    @minidgreat 6 лет назад

    having trouble with installing php5 and libapache2-mod-php5.. they say its been removed and php7 is in the market. can we make the web work with php7??
    Thanks

    • @skiwithpete
      @skiwithpete  6 лет назад

      Yes, PHP7 should work, no reason newer tech will break this, since it's all based on Linux.

  • @lilchivi16
    @lilchivi16 9 лет назад

    Hey, really good video! I really hearing about your raspberry pi project. I have new raspberry pi and i am a little bit confused about one line of code:
    # loop through pins and set mode and state to 'low'
    for i in pinList:
    GPIO.setup(i, GPIO.OUT)
    GPIO.output(i, GPIO.HIGH)
    thr comment says that the GPIO has to be set to LOW. Then why is the GPIO output set to HIGH ?

    • @skiwithpete
      @skiwithpete  9 лет назад +1

      Erm. I erm... errr... Because... err... Are you saying I made a mistake? IMPOSSIBLE. Only humans make mistakes!
      (Well spotted, I've already adjusted the code and reposted it on lpaste - I've recently started a github too, and I'll post it there soon. I noticed another booboo too, but shhhh... don't tell anyone.)

    • @mrwess1927
      @mrwess1927 Год назад +1

      @@skiwithpete there are no mistakes only happy accidents and
      Learning opportunities. :)

  • @barryblack1411
    @barryblack1411 7 лет назад

    I have this working but I am using the Keyes 4 Solid State Relay 'High Level Trigger'. When I energize this unit, relay 1 and 2 light up. When I run the script first all the led's go out then it runs through the sequence as it should, but when it ends, relay 1 & 2 light up again. Also when I put my meter on the output terminal, there is no change of state of the relays. Anyone have any idea what is up with this?
    Thanks in advance.

    • @skiwithpete
      @skiwithpete  7 лет назад

      1) Is it an optocoupler relay? No. So it won't work.
      2) Solid state relays typically have a minimum voltage, which your meter won't output.

    • @barryblack1411
      @barryblack1411 7 лет назад +1

      It's a Keyes 4 Solid state relay. High level trigger. It came with some Arduino stuff I bought on Ebay. It has a red coloured circuit board and I see lots advertised. I will give it some load and see if that changes things.

    • @barryblack1411
      @barryblack1411 7 лет назад

      I connected an led with a resistor and a 5V supply to one of the relay 'contacts' and although the input led's do as the should, the relay does not change state turning off the led. I tried it on all 4 relays and non work. Not sure how else to test this relay board. Any ideas?

  • @victorpeter8840
    @victorpeter8840 8 лет назад

    Would this work with a raspberry pi 2b? If not, how do i get it working?

    • @skiwithpete
      @skiwithpete  8 лет назад

      +Victor Peter Yes, will work without modifications.

  • @LRC-rn5ox
    @LRC-rn5ox 8 лет назад +1

    Hi, I'm having a problem getting your index.php file to run. The page shows up in my browser, but when I click on the button nothing is happening. Your scrips run perfectly from the command line. It seems like the file isn't executing. I'm running python3 & have made the changes to run from the command line & made the change to python3 in the index.php file. Anyone have any suggestions.Thanks

    • @LRC-rn5ox
      @LRC-rn5ox 8 лет назад +3

      Changed exec() to system() and it is now running

    • @skiwithpete
      @skiwithpete  8 лет назад

      +LeRoy Cote great tip. Thanks!