Project: Controlling An LED Using Raspberry Pi (Beginner)

Поділитися
Вставка
  • Опубліковано 3 жов 2024
  • Hey Guys,
    In this video you will learn to control an LED on a RPi
    It is very Beginner friendly and one of the first projects in the Raspberry Pi
    Installing gpiozero:
    Python 3 - sudo apt-get install python3-gpiozero
    Python 2 - sudo apt-get install python-gpiozero
    Thanks for Watching!

КОМЕНТАРІ • 124

  • @shaheershaikh
    @shaheershaikh 6 років тому +47

    Did this,,, I feel like a rocket scientist now :D

  • @qazme5310
    @qazme5310 6 років тому +12

    Finally after trying different tutorials for hours and actually yours worked!!
    Thank you for the video. I already had python 3 installed in my Pi so I didn't have to use sudo.

  • @EchoVids2u
    @EchoVids2u 6 років тому +7

    Finally, the first tutorial video I can understand.

  • @sidharthakumar3497
    @sidharthakumar3497 5 років тому +1

    i saw just 2 min of your video u explained everything in your video led , breadboard and each thing beginner and pro both can understand. nice and tx

  • @chriswalker6062
    @chriswalker6062 6 років тому +7

    Very good job clearly explaining a bit of coding. I will be back for more.

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

    This is the best tutorial ever, btw!

  • @anirudhpuranik5222
    @anirudhpuranik5222 4 роки тому +3

    Loved the explanation! Thanks for the video.

  • @manuchaudhary7902
    @manuchaudhary7902 5 років тому +1

    Thank you. Its now working for me.

  • @TonyLee-cs1bu
    @TonyLee-cs1bu 4 роки тому +1

    i'm very happy to be your fan! i looked at other videos and only two of them worked and one of them is you. but can you make a video of how to make two leds flash with a time limit?

  • @mattrhys-roberts2983
    @mattrhys-roberts2983 3 роки тому

    Thanks for simplifying a great way to get started!

  • @nikhilchitroda6409
    @nikhilchitroda6409 5 років тому +2

    Excellent explanation ...
    Bro, please make more videos like this ...😅👍

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

    Cool, worked first time . Thanks

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

    Great Explanation. Would like to suggest an advanced board for Raspberry pi. I am familiar with "Sania Box" and by using this board you can get hands-on experience on LED, 7-Segment, Buzzer, Sensors etc.

  • @invincible.456
    @invincible.456 3 роки тому

    So simple and yet so fun...
    that's cool!

  • @Alex-xi3bw
    @Alex-xi3bw Рік тому

    this guy sounds like a mad scientist

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

    666th subscriber, HAiL yaaaah. Thanks for posting this video man!

  • @MajorCaliber
    @MajorCaliber Рік тому

    Good job, but since you're using "toggle", you could just make your while-loop contain 2 instructions instead of 4, and it would work exactly the same, eh wot? ;')

  • @flaviogjoni5747
    @flaviogjoni5747 3 роки тому +3

    3:19 my man died here

  • @fabrizziocht
    @fabrizziocht 6 років тому +1

    Good explanation!! thanks for sharing

  • @MischiefMemoirs
    @MischiefMemoirs Рік тому

    Thank you this was v helpful

  • @skyjoe55
    @skyjoe55 4 роки тому +5

    I was watching this on my pi and i forgot i didn't have speakers/headphones connected

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

      i realize I'm pretty randomly asking but does anyone know a good website to stream newly released movies online?

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

      @Rogelio Alonso lately I have been using flixzone. You can find it by googling =)

  • @bread-mp5kx
    @bread-mp5kx 6 років тому +1

    Great vid!

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

    Thank you for telling me I can use resistors that are over 100 ohms. I some how couldn’t find any info. This other UA-cam channel was telling me to use 270 ohm and I’m like... but it’s a small light? 🤷🏻‍♀️

    • @abhijack.1036
      @abhijack.1036 4 роки тому

      Led resistor design is simple
      Supply voltage-Led voltage ÷ Iled
      Supply voltage (Vs) is 5volts from rasberry pi board and led voltage is 3v and led current is 10milli ampere.
      (Vs-Vled) ÷ Iled
      5-3 ÷ 10 x 10^-3
      2 ÷ 10^-2
      200 ohms.
      It not a standard value use standard value 220 ohms this is the correct design.

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

    Great guide!

  • @mmuradiqbal-technuggets-ja3597
    @mmuradiqbal-technuggets-ja3597 6 років тому

    You are awesome man

  • @VikramSingh-de3dx
    @VikramSingh-de3dx 6 років тому

    Very helpful video.😀

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

    Yes,
    This is great

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

    Excellent video

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

    Nice👍👍👍

  • @KaurPreet_-gd8jy
    @KaurPreet_-gd8jy 3 роки тому

    1.What software/hardware is needed in this project?
    2.what hardware/electronics is needed in this project?
    3.what other equipments will neend in this project?

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

    tryed it nice job

  • @EchoVids2u
    @EchoVids2u 6 років тому +1

    Also, you may get a warning when you run your program. If you put GPIO.cleanup() at the end of your program the "Use GPIO.setwarnings(False)" warning will go away.

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

      That happens only with the RPi.GPIO library I am (in this video) using the library gpiozero.
      gpiozero does not require cleanup

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

    Can I do it using pc without Raspberry-pi/microcontroller/Arduino.?

  • @RMV0746
    @RMV0746 5 років тому +2

    Iam like for your pro

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

    Nice

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

    great instruction

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

    what color is the resistor ?

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

    Can we do this using windows 10 and python compiler

  • @lachiondo0097
    @lachiondo0097 Рік тому

    if anyone got "TypeError: an integer is required (got type str)"
    Just substitute the line "K = input("Sleep for: ")" for "K = float(input("Sleep for: "))" and problem solve
    hope it helps

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

    resistor size how many ohm ?

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

    very nice

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

    Why is the PIN number 18 of your led?

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

    good work

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

    nice explanation

  • @tushar8994
    @tushar8994 6 років тому +2

    can i do this also with 30 pins bread board plzZ reply fast

  • @mylodefaut-juneja3705
    @mylodefaut-juneja3705 2 роки тому

    At 5.10 @Confiding_RPi goes into documents but when I try it says 'No such file or Directory'. Can someone help please?

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

    Thank you for this video, I didn't understand why the LED is assigned to the 18th pin (in the picture) ?

    • @sitisallyaishak8555
      @sitisallyaishak8555 5 років тому +2

      becouse that was the pin 18

    • @TonyLee-cs1bu
      @TonyLee-cs1bu 4 роки тому

      it is that the jumper cable is connected to pin 18 so it could get power for the led
      and yes the pin is on the picture

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

      It can be any pin that is gpio
      I think so..

    • @TonyLee-cs1bu
      @TonyLee-cs1bu 4 роки тому

      @@rishabmudliar1058 not really depends if the jumper cable if it is connected to a GND GPIO pin and a normal gpio pin

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

    hats off for your accent lol 😂😂😂

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

    thank you bro

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

    Nice , but i hope there are more in explaination like why LED(18) , what is toggle , on .. maybe u should put more information in description (or just link the phyton documentation )

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

      Thanks for the feedback, I will sure work on it!

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

    Bro can u make some video on and off the relay.

  • @osirisreyes7605
    @osirisreyes7605 Рік тому

    Muy bien

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

    hello.ik he de script van de led nodig.kan opsturen,of download. thanks for top review

  • @JitenderKumar-up6nj
    @JitenderKumar-up6nj 6 років тому

    How to connect IP camera
    And loop decter

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

    4:36 shouldn't you remove the power source before plugging anything in?

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

      no need

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

      Yes, you should ... No need if you not sure or it will blow your raspi.

    • @TonyLee-cs1bu
      @TonyLee-cs1bu 4 роки тому

      it is alittle safer so you wont get a shock

    • @TonyLee-cs1bu
      @TonyLee-cs1bu 4 роки тому

      while you are plugging in the led

  • @mericet39
    @mericet39 2 роки тому

    you don't need led.toggle() and time.sleep(k) twice.

    • @stephenwik2423
      @stephenwik2423 2 роки тому

      but having it twice inspired me to try different values say “K” and “L”… can run them really short, play with duty cycle… effectively brightness control

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

    Yessssss

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

    Can you please please please tell me who you connected raspi 3 directly to the laptop?

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

      The Ethernet cable(mine is CAT5) is inserted in the Ethernet port on the Raspberry pi and the other end is inserted into my laptop(can also work with a desktop pc)

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

      @@confidingrpi7174 so bro pls help me out that ,u didn't connected any HDMI cable to monitor instead you connected the ETHERNET cable.
      Does RPI OS can work on the laptop with simply the ethernet cable connected?
      Does it affects our current laptop OS?
      I am using MacBook Air, it didn't contain any HDMI cable connection
      and
      I didn't know how to connect the ethernet cable to laptop!
      if possible pls pls make a tutorial on it............ pls sir it would be a great help

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

    Hi I am a design student and have never used programmable LED , but for my senior design project I have to build an interactive LED (RGB) wall, the interactivity can be based on touch or motion . so when users touch or move the LED's colour tracks the user or a new colour is added to visualize the interactivity.
    some examples : ua-cam.com/video/ZItqHJF-l98/v-deo.html
    ua-cam.com/video/D_f0rzwi_LI/v-deo.html
    So I need to know what sort of products I need to order to build this prototype.
    Thank you

  • @BAT_24
    @BAT_24 6 років тому +2

    Python 2 - sudo apt-get install python-gpiozero , after applying this im getting invalid operation. how i sort out this problm

    • @confidingrpi7174
      @confidingrpi7174  6 років тому +1

      I hope your command was- "sudo apt-get install python-gpiozero"
      also the gpiozero library is preinstalled in official raspbian OS.
      If your command was exactly same as mentioned above then more information is required.

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

    Just wanted to comment so it was a odd number. :)

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

    what is the white thing called

    • @confidingrpi7174
      @confidingrpi7174  6 років тому +1

      The board on which the LEDs are plugged -> Breadboard

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

    what if i want to use c ++

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

      if you want to use it then.... USE IT!!!! :)

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

    WHEN I TYPE leafpad Led.py it says command not found

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

      Try "sudo apt install leafpad"
      The try entering "leafpad led.py"

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

    the second code does not work in python3, but it works in python2 why?
    TypeError: an integer is required (got type str)

    • @GarlitoMc
      @GarlitoMc 5 років тому +1

      try K=int(input("Sleep for: "))

    • @TonyLee-cs1bu
      @TonyLee-cs1bu 4 роки тому

      @@GarlitoMcs code that he typed means the time for blinking

    • @TonyLee-cs1bu
      @TonyLee-cs1bu 4 роки тому

      this is the code for the led turning on
      from gpiozero import LED
      import time
      led=LED(18)
      led.on()
      time.sleep(5)
      led.off()

    • @haluklacin4190
      @haluklacin4190 4 роки тому +2

      I would use float instead of int @@GarlitoMc

    • @GarlitoMc
      @GarlitoMc 4 роки тому +1

      @@haluklacin4190 Sure, you could do that too. I was just explaining that with K = input("Sleep for: "), K is a str type, while time.sleep(K) requires K to be a numerical value, int/float.

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

    L E D !

  • @kctronics6329
    @kctronics6329 7 років тому +1

    This video is very useful for beginners and I'm also trying to make such videos. Till now I had uploaded only one video, hope u watch that. :-)

  • @j.sridhar7039
    @j.sridhar7039 7 років тому

    The resister is how many omh

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

      You can use a resistor that is at least 470 ohms (in my experience I have not seen an led blow up with 470 ohms), you can use a higher value resistor but the led will be dimmer!
      Side-note: In the video I used a 1000 ohms resistor!

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

    Sir , can you tell me the cost of this rasberry pi

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

    Why is the PIN number 18???

    • @jynclr
      @jynclr 5 років тому +1

      I don't know if you figured this out yet, but I can help. Pause the video at 4:50. you'll see the red wire line goes to the row of pins that is to "GP18" on the board. (it's a drawing.) I had to watch this twice and pause to study the diagram.

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

      @@jynclr tnx!

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

    I hope you can sheee

  • @user-el1gx2ve8c
    @user-el1gx2ve8c 4 роки тому

    I named my file Led.py and when I type that into Terminal it says no such file exists

    • @TonyLee-cs1bu
      @TonyLee-cs1bu 4 роки тому

      did you typ leafpad +Gvidas?!1?

    • @TonyLee-cs1bu
      @TonyLee-cs1bu 4 роки тому

      leafpad Led.py?

    • @user-el1gx2ve8c
      @user-el1gx2ve8c 4 роки тому +1

      @@TonyLee-cs1bu I figured out a way to do it, I just typed python the Documents/(Folder Name)/(File Name) and it opened

    • @TonyLee-cs1bu
      @TonyLee-cs1bu 4 роки тому

      ​@@user-el1gx2ve8c ok
      that works too but you can use thonny python IDE

    • @TonyLee-cs1bu
      @TonyLee-cs1bu 4 роки тому

      it just shows leafpad

  • @JitenderKumar-up6nj
    @JitenderKumar-up6nj 6 років тому

    Please send me connection and coading

  • @KIsuu-us2lf
    @KIsuu-us2lf 3 місяці тому

    Huththige putha

  • @KIsuu-us2lf
    @KIsuu-us2lf 3 місяці тому

    Pakaya

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

    Can i take your email?

  • @harpermartin7813
    @harpermartin7813 2 роки тому

    Jesus is King! If you do not know Jesus as Savior please pray, “ Jesus save me. At this moment I choose to have faith that You gave Your life for me and rose from the dead. Doing this You defeated death, even though it meant You had to die. You surrendered Your life for me, so I chose to surrender my life to You. Forgive me Jesus, my God. Amen.”
    Jesus loves you so much. Please accept His love. I encourage you to read the Bible and pray.
    “For God so loved the world that he gave his one and only begotten Son into this world, that whoever believes that in him shall not perish but have eternal life.”
    John 3:16
    🙏❤️🙏
    Jesus is enough!
    Again I tell you, Jesus loves you!

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

    :P