Raspberry Pi Pico Tutorial - 5V Relay Module

Поделиться
HTML-код
  • Опубликовано: 17 авг 2024
  • ХоббиХобби

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

  • @-Karus
    @-Karus 2 года назад +3

    dear god you explain more that was expecting, thank you so much to make this tutorial! i hope you do more, you have a really good speeching

    • @NerdCaveYT
      @NerdCaveYT  2 года назад

      Thank you for the comment, Glad it was helpful! I try my best to upload weekly and more if I have time

  • @raddaks2039
    @raddaks2039 2 года назад +1

    Very useful info, thx! Was just thinking I should research relays for my projects.

  • @geddavis932
    @geddavis932 2 года назад +22

    Hi, It is very bad practice to switch the neutral, because when the light is turned off there is still 120 - 240V at the fitting, which can electrocute an unsuspecting person. ALWAYS switch the live wire. An for safety unplug the unit before making adjustments

    • @NerdCaveYT
      @NerdCaveYT  2 года назад +6

      I know, I cut the wrong wire and just use the neutral but being save made sure there is no power before touching any wires I will probably make a follow up on this rather to make a custom PCB with more protection to control a few different things.

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

    Thank you for taking the time to make this video, this is the perfect tutorial for my pico pump project with ir water level sensor thanks man

    • @NerdCaveYT
      @NerdCaveYT  Год назад

      Glad it was helpful!

    • @tonymowder
      @tonymowder Год назад

      @@NerdCaveYT except when it came time to actually do it i couldn't get more than 3.3v out of the pico gpio and my relay requires 5v... did i just use the wrong gpio or relay... now im confused again...

    • @NerdCaveYT
      @NerdCaveYT  Год назад

      @@tonymowder I think I got confused, in the video I did use a 3.3V relay, if you are using a 5V relay and you want to turn it on with the VSYS 5V you will have to use a transistor that can act as a switch from the digital pin to turn the relay on and off

  • @jeremyisme
    @jeremyisme 2 года назад

    Awesome, thank you. There were some that said the pico couldn't control a 5v, but it does work. Thank you.

    • @NerdCaveYT
      @NerdCaveYT  2 года назад +2

      Since it is only one relay it doesn't take so much current to magnetize the coil for lot of relay's better to supply from external 5V and switch with pico the state

  • @rodrigodemarchi1184
    @rodrigodemarchi1184 2 года назад

    great class

  • @CarlosSanchez-dp9nz
    @CarlosSanchez-dp9nz 2 года назад

    Great instruction

    • @NerdCaveYT
      @NerdCaveYT  2 года назад

      Thank you for the feedback

  • @armand9910
    @armand9910 2 года назад +1

    Well done! Awesome tutorial :)

  • @orph4nsx
    @orph4nsx 7 месяцев назад

    Can i use it for small sensor with 5v with battery 3.7v ?

    • @NerdCaveYT
      @NerdCaveYT  6 месяцев назад

      if the sensor requires a voltage level of 5V and you give less it might not work correctly, for the Relay module I used 5V from the Pico but for the signal trigger pin, to switch it on I used the GPIO pin that is 3.3V which works

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

    Pico has a 5v output?

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

      Wekk the Vbus here is the 5V it gets from the computer the pico GPIO pins are 3.3V out

  • @damianbutterworth2434
    @damianbutterworth2434 Год назад

    I needed to connect the shield to 3.5 volts instead of 5 volts. I had problems with the relay activating when the digital lead was connected to GRD or 3.5 volts. Was OK when I powered it with the 3v3 pin.

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

      I saw a few people struggling with that, I think for the 5V active trigger can use a transistor and VBUS to use a GP pin to open or close relay

  • @user-xy7rg3jd7t
    @user-xy7rg3jd7t Год назад

    thank you for sharing your knowledge I have a query will the pico be able to control the 5v relay as it has only 3.3 volt signal we tried using 5 v SSR and was unable to control the load

    • @NerdCaveYT
      @NerdCaveYT  Год назад

      So your load will not be able to be powered by the Pico due to current limitations on the Pico, but to control the relay and if I understand it used 5V signal to trigger then I would suggest using a transistor. The you can use the Vsys which is 5V with a gpio pin to trigger the relay.

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

    Great video! I'm trying to set something similar, but my Pico isn't turning the relay off. Do you have any troubleshooting ideas/advice?

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

      How do you have the relay connected to the Pico in which mode or setup?

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

      @@NerdCaveYT I actually got it! For future reference for anybody else:
      (Pico W -> Relay)
      3v3 -> VCC
      GND -> GND
      VSYS -> RY-VCC (This is also JDVCC on some models)
      GPIO Pin (Doesn't Matter which one is used) -> IN1.
      The reason it didn't turn off was the VSYS was connected incorrectly.

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

      I had the same problem, the thing is that some relays (like FL-3FF-S-Z) can't be powered on 5v and triggered with 3.3v so what you can do is power the relay module with 3.3v and then you can control it also with 3.3v. (VSYS->VCC, GND->GND, GPIO PIN->IN)

    • @fieldjx
      @fieldjx Год назад +2

      Thanks all - my PicoW works great with connections PicoW to relay:
      - 3V3(OUT) (pin36) to VCC
      - GND (eg pin 23) to GND
      - GP18 (as example, pin24) to IN
      This ensures the relay VCC and IN high voltages must be the same, as codyrap says.

    • @bergamot4832
      @bergamot4832 Год назад

      @@fieldjx connecting vcc to 3v3 pin worked for me, thanks.

  • @christopherpetrov2355
    @christopherpetrov2355 2 года назад

    Cool !!

    • @NerdCaveYT
      @NerdCaveYT  2 года назад

      going to try and make my next apartment I am moving to, to be a "smart" home, having sensors and relays everywhere.

  • @DuderScooter
    @DuderScooter 2 года назад

    Thanks for the lesson today, brother 😎 one question: why “elif” instead of another “if” for turning off the LED?

    • @NerdCaveYT
      @NerdCaveYT  2 года назад +1

      I will have to check my code hopefully in few days waiting for truck today to bring all my stuff from another city, but in general you want an if which will be your first condition being tested if that is false it goes to elif in some cases you can just use if but bad coding practice if you Google why use elif in python you will see the reason why, I guess that is why I used elif since if first statement is not true try second

  • @dsutedja
    @dsutedja Год назад

    Hi, would it be possible to control exactly 2 5v relay using the vsys pin? Thank you for making the video btw, very informative!

    • @NerdCaveYT
      @NerdCaveYT  Год назад

      yes the 5V will be used to close the coil so it does not draw a lot of current, if you are making it to be power from a battery you can power the pico and the relay are connected in parallel so it won't draw current from the relay

  • @12polizei24wegvonhier
    @12polizei24wegvonhier Год назад +1

    I connected it all and everything worked fine, until I touched the soldering underneath the relais by accident and got electrocuted...

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

      sh*t hope you didn't get a scar or anything that is why I said in beginning do not attend to make this because working with live energy I am also always paranoid and made sure everything was unplugged when connecting wire or working with relay

    • @Chris_t0
      @Chris_t0 9 месяцев назад +1

      I soldered the inside of a vaccum cleaner connected to live mains 5 years ago and it made a giant blue spark, smoke, bang. To do this day if genuinely feel sad I may have created an alternate reality where I died on my bedroom floor and my mother found me. I really hope that's not the case but I literally soldered a fucking vacuum cleaner thats like as high voltage as you get in a home. I'm traumatized to this day, zero injuries though all mental

  • @abdulkaif123go_yt
    @abdulkaif123go_yt 2 года назад

    Plz mention link of the relay or details of the relay

    • @NerdCaveYT
      @NerdCaveYT  2 года назад

      Hi, I do not mention parts because they are bought on Taobao which is what people use in China, but you will be to find similar relays on AliExpress. The main reason not to put link is I can't verify the supplier. I used a 3.3 V relay but 5V should be able to trigger aswell.

  • @hopi9927
    @hopi9927 2 года назад

    Dear,How about 220v relay ?
    Can you explain me ?

    • @NerdCaveYT
      @NerdCaveYT  2 года назад

      Hi, these relay module will be able to switch 220V AC, the maximum rating is 10A 250VAC, some modules will show the maximum DC voltage as well. The LED lamp base I switch on and off with the relay was connected to 220V AC supply voltage and 50Hz (China operating voltage).
      You just need to make sure about the relay operating voltage since some relay has different operating voltages. This one is 5V DC so it is fine to use with microcontroller.

  • @isakpretorius852
    @isakpretorius852 2 года назад +1

    Tell me you're South African without telling me you're South African :)

    • @NerdCaveYT
      @NerdCaveYT  2 года назад +3

      Kan jy braaibroodjies maak 😂

  • @theadventurousprogrammer6449
    @theadventurousprogrammer6449 2 года назад +1

    I thought you weren't supposed to use the vsys like that?

    • @NerdCaveYT
      @NerdCaveYT  2 года назад +1

      VBUS is the 5V input from the micro-USB port, which is fed through a Schottky diode to generate VSYS, so for simple applications not using much current the VSYS will be fine to use, because not exceeding the 300mA limit, if however you plan to use multiple relays then having an external power supply and using relays with photocouplers will be recommended to protect and isolate the Pico. I hope it makes sense? If not I can answer other questions you have.

    • @theadventurousprogrammer6449
      @theadventurousprogrammer6449 2 года назад

      Awesome explanation. Going to go try it! Thanks! Great channel and I'll subscribe to see more:) have fun and keep learning!

    • @NerdCaveYT
      @NerdCaveYT  2 года назад

      @@theadventurousprogrammer6449 Thank you

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

      @@NerdCaveYT Why not power the 5V relay from VBUS pin 40? It's 5V - seems simpler to me than 'worrying' about using pin 39 that can be an input. To be clear, I am not saying it's a bad idea, but seems to invite the problem in your last reply.

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

      @@johnouellette1098 The VBUS pin is connected to the VBUS of the micro USB connector. There is an onboard diode connecting VBUS to
      VSYS, which means that VBUS can be used to power VSYS, but not the other way around. This would internally power VSYS via the onboard diode, but we must be sure that we do not connect another power supply to the USB connector on Raspberry Pi Pico or Raspberry Pi Pico W.

  • @jhulindawati7489
    @jhulindawati7489 Год назад

    hello, I can't speak English. I'm using google translate. I'd like to ask. I get the message "RPi.GPIO as GPIO no module" what is the solution? I have installed but it didn't work. Please help me 🙏🙏🙏

    • @NerdCaveYT
      @NerdCaveYT  Год назад

      are you using the raspberry pi computer or the raspberry pi pico, the raspberry pi computer use the RPi.GPIO library, where in this video I used "from machine import pin" which is from micropython firmware

    • @jhulindawati7489
      @jhulindawati7489 Год назад

      @@NerdCaveYT i am using raspberry pi on laptop

    • @jhulindawati7489
      @jhulindawati7489 Год назад

      Raspberry pi 3 model b 🙏

  • @joecies
    @joecies 24 дня назад

    Dude, you're going to get someone seriously hurt with your botched AC wiring of the common through the relay. Fix it!

    • @NerdCaveYT
      @NerdCaveYT  23 дня назад

      Yes, it was pointed out, Thank you I will remove the video and make a new video just to ensure no one gets hurt

  • @vaibhavkarar8858
    @vaibhavkarar8858 2 года назад

    1000