RASPBERRY PI - All About controlling Relay Boards for Home Automation

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ก.ย. 2018
  • Controlling Relay Boards with Raspberry PI.......
    This video describes the best suited relay board to use with PI , which is essential for all Home Automation Projects.
    Python code is explained on how to control the relay board automatically.
  • แนวปฏิบัติและการใช้ชีวิต

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

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

    I used to learn machine and assembly code programming in college. After getting RPi I was thinking of starting automation programming again. Your tutorial definitely helped me and you explained everything so simple and clear. I am looking forward to seeing more videos like this from you. thank you sir for your good work.

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

    "For the single channel relay, don't use 5v, use 3v." this little statement made my whole project come together. thank you.

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

      Damn, this did the trick for me. I was going crazy not getting it to work with 5v. Thanks a milion!

  • @calebmallen
    @calebmallen 5 ปีที่แล้ว +32

    Thank you for explaining the JD-VCC/VCC jumper pins. I'm new to this stuff, and I was trying to figure out what to do with that.

  • @justjuu
    @justjuu 9 หลายเดือนก่อน

    As a newbie to RPi I appreciate your explanation of the functions of the commands very much. E.g. that the GPIO.cleanup() is needed to free the resources such as the pin number reservations.
    I also like your explanatory handwriting while speeking.
    The 5 - 3.7 = 1.3 V point related to the supply voltages was easy to follow.
    Thank you for this video!

  •  4 ปีที่แล้ว

    That is exactly the right amount of detail and b/g to make it click in my head. Definitely the best of several videos on this subject.

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

    Appreciate that you physically show the wiring up and go through it slowly. Thank you

  • @PaulClifford
    @PaulClifford 5 ปีที่แล้ว +6

    Thank you SOOOO much. I hadn't heard the part about JDVCC and VCC and the jumper before and that was all I needed to get the relays to work reliably.

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

    Thank you. You solved the issue I had. My relays only switched on but never off. Your jumper trick fixed it!

  • @JeffsTravels
    @JeffsTravels 5 ปีที่แล้ว +8

    finally some detail for these relays under 3.3 volt control.
    Appreciated.

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

    This is the explanation I needed , everyone just expects you to know what the vcc is jumper is for.

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

    BEST video and information on wiring up a pi to a 5v relay. I am going to try it tomorrow! thank YOU! It works perfectly.

  • @marco6ocram
    @marco6ocram 2 หลายเดือนก่อน

    Really well explained. Thank you very much.

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

    Very educational! thank you for this! Just started playing with relays with my Pi and this clears up a lot of questions for me:)

  • @dr.vijayanbalasubramanian818
    @dr.vijayanbalasubramanian818 5 ปีที่แล้ว +1

    Your presentation is precise and clear. Thank you.

  • @SubramaniamSrinivasan
    @SubramaniamSrinivasan 5 ปีที่แล้ว +20

    One of the best raspi-relay tutorials on TH-cam! :)

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

    This makes me so happy. This totally takes my fear of the unknown away for me. Thank you so much! My next bucket task is Arduino, or some clone.

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

    yo this is literally the best explanation of this i could ask for. lol all the other videos were not giving me the explanations to the parts of the relay switch and how it ACTUALLY OPERATES!!!! god lol thankyou Saravan AL for sharing your knowledge.

  • @jonasvervoort1399
    @jonasvervoort1399 4 ปีที่แล้ว +6

    Thanks for clearing out JD-VCC/VCC jumper pins!

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

    I just achieved to connect my RPi to a relay thanks to your explanations and it works perfectly, exactly like it does in your video. I feel I learned something valuable so I have to warmly thank you !! :)

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

    This is really fantastic content, love from the US

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

    Thank you for this information. Very useful and clearly explained. Thanks!

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

    Thank you Saravanan. Much appreciated. Good luck with your projects!

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

    Very clear and precise instruction... Thank you, great video

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

    Confusion cleared sir. Thanks a lot

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

    Thanks so much for sharing your knowledge. Great tutorial!

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

    Hey Saravanan, thanks for this video. I'm working on a home automation project and it was really useful. Great work!

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

    Thank You for this Amazing Video👍

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

    one of the best video on youtube if i had more option to like this video i can do that very very helpful and clearly explaind video
    must very clearly explained connections by which i can understand to connect 12v relay module to external power supply
    thank you so much

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

    Thank you for the clear and concise explanation

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

    Excellent video! Thank you!

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

    Nice explanation, thank you sir...

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

    Thanks, clear and concise, well done.

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

    This is a very useful video. As and IT guy I know a little but this helped put it all together. I am making a pi zero project to open my garage door from my phone. Thanks!

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

      Can this relay be used to control a socket ouet??t

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

    I've been thinking about a project and your video has helped me out together some of the part #s I will need to look for. Excellent video your english is awesome too.

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

    excellent demo, thank you

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

    Useful video. Thanks a lot.

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

    Thanks Sir for your higly informative video,

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

    I agree. This is most informative. Very grateful.

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

    Nicely done, to the point, thank-you

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

    Great video, helped me alot! Keep it up!

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

    I just saw 5 seconds of youre video and i really like it!!!!!

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

    Great video mate. Thumbs up!

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

    sir I am a big fan of yours :-) very nice explanation sir

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

    Great video Saravanan!

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

    Thank you so much for this.

  • @dennysam829
    @dennysam829 6 หลายเดือนก่อน

    Well explained!

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

    Very nice explaination

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

    My friend, thank you for this content.

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

    nice explanation.. exactly what i needed.

  • @LuisGarcia-mv4ep
    @LuisGarcia-mv4ep 4 ปีที่แล้ว

    i agree great video !!!! i had one question if i wanted to add additional buttons how can i do so so each operates individually. ive added the buttons but 1 2 3 show response on 4

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

    I'm wondering if there's any practical drawback from powering the single channel boards with just 3.3V?
    The relays switch & holding power is weaker I assume, which could become an issue if you switch high current via the NC line. But for otherwise for the NO line?
    Maybe that there's a risk of the relay not being switched probably?

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

    thanks for this video sir.

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

    Super useful video.

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

    nice, thank you mr

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

    Thanks! Do you know if we can connect one pin from the RPi to turn on 2 ralays at the same time or do I have to use a small transistor to do that?

  • @yewfh-oz7in
    @yewfh-oz7in 3 ปีที่แล้ว

    Awesome, thank you :)

  • @stefannaujoks2982
    @stefannaujoks2982 10 หลายเดือนก่อน

    First of all I would like to thank you for the great video and explanation. That helped me a lot with my project. I have three technical questions regarding your representation in the circuit diagram. The first concerns led IN 1-n. I use an LED0402-R-RD as the LED and calculated a resistance of 25.5 ohms at 3.3V. which would then have to be connected instead the 1k(eg R1) resistors... right? This is where my second question comes in: doesn't the LED have to be connected to GND somehow? My last question: How did you calculate R2 510?
    Hope you can help me.
    Best Stefan

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

    Thank you! I'm wondering how I go about looping a modified version of this code? So I can have lights go on and off every so many hours?

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

    THX for this nice Video. Greetings from Germany ;-)

  • @andrashuszti1407
    @andrashuszti1407 5 ปีที่แล้ว +6

    Galvanic isolation due to the optocoupler is disabled if you connect the 3V3 and 5V from the Raspberry Pi to the relay pcb. The 5V should come from a galvanic isolated power supply and not from the raspberry pi. This way the optocoupler is just a waste of money.

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

    If I want to connect the relay board to an external source, do I have to connect the JD-VCC pin and the GND pin of the board to the external 5v source and the VCC pin of the board to pin 3.3v of the raspberry?

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

    I have a very similar looking "4 Relay Module" but the relays do not click however the LEDs on board turn on/off as they should. When I use the 5 Volt to VCC and jumper between VCC and JD-VCC it works. What do you think the problem is? (board brand is "sainsmart")
    The other question is, how we know how much amperage comes back to relays from the on/off of the high inductive loads like a motor?

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

    You do not need to remove the JD-Vcc to Vcc jumper. Looking at the schematic you provided, the two resistors act as a voltage divider. If you are just wiring up a basic Rpi setup with a relay, you only need to connect Vcc to the Pi's 5V and GND to GND and then the 4 INs to 4 GPIOs.

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

    To power a 12v peristaltic pump
    via a 8ch relay, I connected a lithium battery pack to the relay at the top left of the relay, JD-VCC pin and GNC pins. After I did that the raspberry pi started to blink. Even after disconnecting the battery pack the raspberry pi and relay continues to blink. Did I cause a permanent malfunction. No putty connection is possible now.

  • @AjeetKumar-dg5mt
    @AjeetKumar-dg5mt 5 ปีที่แล้ว +1

    if LOW is making ON then at the time of raspberry pi bootup it un-necessarily switches on the relay, how to get rid of it??

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

    Thank you , this video helped me a lot in understanding wiring . I am trying this for the first time and don't know how to run scripts that are available in the Description of the other videos available on you tube I mean the very basic thing. can you please help me.

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

    Great Sir ..

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

    Got the 4 relay board and a Raspberry Pi Zero 2. LEDs light up but the relay doesn’t click unless it is tapped or jarred, when the led is on.

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

    Excellent!!

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

    Nice video!

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

    I want to use SSR with RPi. Is there anything I need to be careful about?

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

    Great video! A question, how can I receive a gpio text command throuth ethernet and then execute the gpio commands to set on the the relays?

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

    nice video, i hope what you can do a video usign shift register with relay greetings from Mexico

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

    do you know of any good rela board the utilize i2c ?

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

    Do we need to use jd vcc in case of pi4 or its just the case for pi3 as i ve seen videos where they did not removed the jumper. Please help as i am confused. You are using pi 3 in demo.

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

    Awesome

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

    Can I connect external power source of more than 5V to jd vcc if yes what is the maximum voltage that I can give to jd vcc

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

    You show in your schematic that a LOW is required to power the relay driver. Your code though shows your pins go HIGH to turn them on. I use the same relay board, with an Arduino, and use HIGH on the output pins to activate the relay. Can you confirm that your schematic is correct?

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

    Thank you

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

    Hi,
    thank you for this very good video and all the explanations about the jumper. can you, please, put some URL (Aliexpress/Ebay/..) where we can find these exact boards?

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

      I bought mine from here: www.ebay.com/itm/5V-1-2-4-6-8-Channel-Relay-Board-Module-Optocoupler-LED-for-Arduino-PiC-ARM-AVR/401237960337?hash=item5d6ba56691:m:mzkfWblEtqpHZfTceI9Bh9A:rk:1:pf:0

  • @smartassist9700
    @smartassist9700 7 หลายเดือนก่อน

    If sensor is 20 feet away, what gauge wire do I use? How many volts?

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

    Sir what is the datasheet of the diode used in the above relay module

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

    I made this adjustment and only one of 4 relays physically clicks the others just give a led on/off but not switching the relay itself. What could be the problem?

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

    I got ripped off buying similar ones from Amazon. The pics showed the jdvcc connectors but the ones that turned up didn't have them :/ needless to say the Pi cannot provide enough V to flip them from GPIO and requires the 5v line that you cannot connect. Just double check the seller before you waste your time and money. Waiting another few days before I can complete my project grrrr.
    Really good video though, thank-you x

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

    does it work with 16 channel relay board ?

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

    Why it’s neutral? At 13.21. There any specific reason for that.

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

    Instead of programming in java can we do in scratch ?

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

    Hey, I am disabled and want to use these to sense dry soul and auto water pump to my plants. Cut off when sensor wet..
    Can relays hold code themself?
    It will become very hot and raspberry pi may not work.
    Also I need regular size wire and some wire very long. As well as different length tubing.
    Can you advise?
    Most Humble Appreciation! Alton

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

      The relays will not hold code themselves. You need to switch them using a Raspberry pi or Aurdrunio or something. Cat 5 (I'm using Cat6 as I had loads spare) Ethernet cable works really well for sensors and for signals to the relay boards and is really cheap compared to individual wires, I prefer the solid rather than stranded but either should work. The cable for your pump or device should be rated for the load probably upwards of 2mm for a big pump or less for a small 5v one (you can measure the ones that come off the pump), you can recycle computer psu cables / kettle leads normally but check with a qualified person if you are wiring up to mains power. Good luck with your project !

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

    THX

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

    How can we connect it with switch so we can control from switch as well as pi

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

    Hi sir, can you help me about programming in mplab ide? i really need help :/

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

    I need video to show connecting wire close up and clear. My disability it cannot be complex.

  • @adamwalter2573
    @adamwalter2573 3 หลายเดือนก่อน

    Those modules tend to fail too often. Anyone can recommend something for 240V 2A ? Some quad-channel, but not as a "hat", but even as a separate module board ?

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

    can i on relay using an app?

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

    Can control with blynk??

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

    Hi, can i discuss the mains 230v relay project with you...

    • @user-cr4kc7py3k
      @user-cr4kc7py3k 2 ปีที่แล้ว

      Raspberry freezes, am i right? :D

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

      @@user-cr4kc7py3k no, I'm by profession Electrician, i have 4 relay pie stack from raspberry pie and raspberry pi 4.so i need simple solution to turnon off relay via cloud /internet... And i need help

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

    Im unable to control the relay as my GPIO pin is unable to output a 5V control signal

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

    when I wire up the relays, the leds on the relay board light up very dim. is this normal?

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

      You probably have 3v3 instead of 5v

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

      I have the same problem,
      just connecting the jumpers on the board, I discovered that it happens in the gpio mod IN and V = 0, two gpio mod IN do not do that, they are BCM 4 and BCM 5 or wpi7 and wpi21, for now I use these two I do not need more, but the symptom is the one you describe.
      As for the explanation in the video, thank you, very good.

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

    Why Im getting error?
    its says
    GPIO.cleanup()
    syntax error: invalid syntax

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

    You get a Pi HAT that has relays compatible with the Pi’s 3.3V.