Raspberry Pi GPIO - Getting Started with gpiozero

Sdílet
Vložit
  • čas přidán 23. 07. 2024
  • Learn to use the Raspberry Pi GPIO connector and the gpiozero library to interface with an LED and some switches. We’ll even make a very simple camera and have our Pi take a selfie!
    Article with code samples: dronebotworkshop.com/raspberr...
    More articles and tutorials: dronebotworkshop.com
    Join the conversation on the forum: forum.dronebotworkshop.com
    Subscribe to the newsletter and stay in touch: dronebotworkshop.com/subscribe/
    The GPIO (General Purpose Input/Output) is a 40-pin connector on every modern Raspberry Pi board that allows you to expand your Pi and connect it to external sensors, drivers and displays. And today we’ll start from scratch and see how easy it is to interface simple devices to the GPIO and control them with Python, using the gpiozero library.
    When we need to interface with sensors, displays or motor drivers we generally use an Arduino, but there are several advantages to using a powerful microcomputer like a Raspberry Pi. With its increased processing power, large storage and memory and ability to interface with the Internet and Bluetooth it can add a new level of power to our projects.
    The 10-dollar Raspberry Pi Zero W is a viable replacement for an Arduino board, and it's the Raspberry Pi that I’ll be using in today's demonstrations. In fact, everything I demo today could have easily been run on a 5-dollar Raspberry Pi Zero, as we don’t need the networking or Bluetooth capabilities.
    We’ll keep it simple today and only interface with an LED and a couple of pushbutton switches. Just so you can get a good feel for how easy it is to code for the GPIO, thanks to the power of the gpiozero library.
    To make it interesting the final demos will also use the Raspberry Pi Camera, and we’ll build a functional digital camera with only a few lines of code. Try that with an Arduino!
    Here is the table of contents for this rather long video:
    00:00 - Introduction
    01:45 - Pi vs Arduino
    06:35 - Selecting a Raspberry Pi
    10:28 - GPIO Prototyping Accessories
    15:41 - Raspberry Pi GPIO
    19:51 - gpiozero Library
    21:23 - Hooking up to the GPIO
    22:51 - Setting up the Raspberry Pi
    25:00 - Blink Compare (Arduino vs Pi)
    33:14 - LED and Button Experiments
    40:17 - Hooking up the Camera Experiment
    41:20 - Controlling the Camera
    While today's demos are extremely simple they will pave the way to doing more complex things with the GPIO, and I’ll be doing that in future videos. Make sure you’re subscribed to the channel so that you don’t miss those!
    And keep in mind that the Raspberry Pi GPIO has been unofficially adopted by many SBC (Single Board Computer) manufacturers, so learning to interface to the Pi will also open the doors to working with several other platforms.
    BTW, for those who make it through this long video, there is a short “blooper” at the end!
    Enjoy the video!
  • Jak na to + styl

Komentáře • 240

  • @scottburfoot3930
    @scottburfoot3930 Před 3 lety +12

    Dronebot, you inspire me to learn this stuff in the best way possible. So detailed, yet so precise with only the most important information displayed.
    Cant wait to see you introduce openCV to the 5dof robot arm

  • @sophianekhalfouni5004
    @sophianekhalfouni5004 Před rokem +6

    I just wanted to express my gratitude for the quality of your courses. You are doing an excellent job, sir! Please keep doing well. Thanks again. 😊

  • @brebre3582
    @brebre3582 Před 4 lety +11

    Loved your video instantly sir. One of the best explanations of Pi anywhere on the Internet. You have the pace and patience of a seasoned teacher. Kudos to you and thank you. Subscribe done!

  • @raymondmichael4987
    @raymondmichael4987 Před 4 lety +15

    I really like how do your presentation, very impressive.
    I'm going full on Raspberry Pi now; keep them coming.
    Greetings from Tanzania 🇹🇿

  • @rondlh20
    @rondlh20 Před 4 lety +36

    Amazing job again, very interesting and educational

  • @soky157
    @soky157 Před 4 lety +5

    You make everything so clear and easy to understand. Thank you.

  • @JakeThomasCreative
    @JakeThomasCreative Před 3 lety +9

    Detailed yet engaging! Thank you once again.

  • @shingabiss
    @shingabiss Před rokem +1

    in my opinion, your have THE BEST videos! Delivery pace perfect, clarity perfect, friendliness perfect!

  • @bawadanieldangema1146
    @bawadanieldangema1146 Před 10 měsíci +1

    You make learning embedded systems so easy and fun. Thank you Sir 😊

  • @paulaxford6754
    @paulaxford6754 Před 4 lety +5

    Great video! Even with Arduino and Python experience I learned a lot from that, specifically that GPIO can be shared among Python programs.

  • @norbertbans
    @norbertbans Před 3 lety +2

    Cool, I like the small scene at the end with the mixed up PI‘s!!! Keep doing more of those well explained clips!

  • @ShuMO99
    @ShuMO99 Před 3 lety +1

    that was awesome. I really needed this level of information fed at this pace. Looking forward to watching many more. thank you!

  • @dave-in-nj9393
    @dave-in-nj9393 Před 4 lety +1

    This is a good video and you cover things in detail. Since it is a RPi video, it is focused on that and you do a good job.

  • @BigDogMoya1
    @BigDogMoya1 Před 3 lety +6

    Thank you so much! You're an amazing teacher.

  • @chuckmuckamuck8001
    @chuckmuckamuck8001 Před 3 lety +1

    I've recently taken up this hobby and this my new favorite channel. Thanks!

  • @victorkarthik8135
    @victorkarthik8135 Před 2 lety +1

    Great job providing all I need to get start with Raspberry Pi. It was nice comparison with Arduino. It gives a good understanding between microcontroller and Single Board Computer. Keep up the good work. Thanks!

  • @ggattsr
    @ggattsr Před 4 lety

    Best video comparison on the features and functionally of the Pi and Arduino that I have found on CZcams. Thanks for the info.

  • @petermolnar6017
    @petermolnar6017 Před 2 lety

    As always, clear and to the point! Thank you for sharing this!

  • @Michael-1205
    @Michael-1205 Před 4 lety +7

    Awesome, very concise and easy to watch presentation. I thought Python was something to be afraid of but your presentation has just changed my mind. Thank you!

    • @idris7464
      @idris7464 Před 2 lety +1

      Micheal python is easy it is not C++😁

    • @kingofhavila9850
      @kingofhavila9850 Před 2 lety

      @@idris7464 I'm struggling to learn it 😪 😩

  • @AnthonyFournier
    @AnthonyFournier Před 2 lety

    I'd love more content like this. You have such a wonderful way of explaining things, I'd watch tutorial's of any kind.

  • @paullee107
    @paullee107 Před 3 lety +1

    I commented earlier; sir, you have THE BEST Arduino & RPi videos for beginner & intermediate users -- The best channel, that I will support and market. TY!

  • @sampreechar5368
    @sampreechar5368 Před 4 lety +1

    Wow, Awsome!!! very professional, VDO, Sound. Well put together. Thanks a million.

  • @robertdouville74
    @robertdouville74 Před 4 lety +2

    Loved it, thanks, very well done and informative!

  • @ar.mamunhossain9592
    @ar.mamunhossain9592 Před 4 lety +3

    Great!. Thank you sir!. We are expecting more video on this topic.

  • @grand.pitcher
    @grand.pitcher Před 4 lety +2

    Fantastic, you did very useful and great job. Thank you so much!

  • @DavidVine-DOCVIDPRO
    @DavidVine-DOCVIDPRO Před 3 lety +1

    Wow! What a great workshop. Super organization too!

  • @antonnym214
    @antonnym214 Před 4 lety +2

    Outstanding video! Very interesting and informative. I really like your relaxed tone. Super easy-going, which is great. I have a Pi 2B and not doing much with it. just wrote a few programs to the display. more or less a screensaver, but have my eye on a new Pi4 (maybe for my birthday) so I can enjoy it with wifi. That model really impresses me, because it's virtually a desktop computer replacement. All good wishes, sir!

  • @Meine_Rede
    @Meine_Rede Před rokem

    This is perfectly explained. Short and clear! Thanks a bunch.😄

  • @NewAgeDIY
    @NewAgeDIY Před 4 lety +2

    Great video today! Can’t wait until the next one. You will of course need to update your shopping channel and add a “ I love my Raspberry Pi” T-shirt😘

  • @mandelbro777
    @mandelbro777 Před 4 lety

    Wonderfully explanatory as usual. Great vid.

  • @davidlira8853
    @davidlira8853 Před 2 lety

    your back wall is so organized! awesome

  • @robertpendergast2620
    @robertpendergast2620 Před 4 lety

    Clear and detailed. Thanks.

  • @abusultanfahad2789
    @abusultanfahad2789 Před 2 lety

    Excellent simple clear explanation
    thanks.

  • @Hitmonkey420
    @Hitmonkey420 Před 3 lety

    What a workshop! Lookin pretty sharp, I'm jealous

  • @goldenpacificmedia
    @goldenpacificmedia Před 2 lety

    Thank you for your terrific lesson and teaching.

  • @itsmmdoha
    @itsmmdoha Před 2 lety

    I thank you from the bottom of my heart ❤️ for making this video.

  • @warrenscorner
    @warrenscorner Před 4 lety +1

    Of course they didn’t need to social distance themselves when you did this video. Thank you for the videos. Stay well!

  • @mursitkc5328
    @mursitkc5328 Před 3 lety +1

    thanks a lot . i love your documenteries

  • @davekendall4698
    @davekendall4698 Před 4 lety

    Great video. I have been wondering what to choose for a stand alone logger for my costly heating system.
    i have (4 zones + boiler) for on / off times to display on grafts so which is on longer ( not hotter) & then maybe then show temperatures for (send & return of boiler water). I think it would be a very useful project for many people to used. Thank you again

  • @kandarpsoni7529
    @kandarpsoni7529 Před 4 lety +1

    Awesome video. Simply brilliant. Thanks a Ton. 👍🏻

  • @peterashley6042
    @peterashley6042 Před 4 lety +1

    Excellent video. Thank you.

  • @EvileDik
    @EvileDik Před 4 lety

    Another great video, I've been wanting to graduate from attempting to blow up Arduinos to something more expensive for a while!

  • @havafazai9023
    @havafazai9023 Před 4 lety

    Please make more tutorials. Best mechatronic teacher ever

  • @sugundanmm1160
    @sugundanmm1160 Před 2 lety

    Detailed explanation.I really enjoyed learning here

  • @khun_le
    @khun_le Před 4 lety +1

    Awesome video. Thanks and keep up the great work.

  • @karthikeyank3219
    @karthikeyank3219 Před 2 lety

    Excellent!!! Really helpful for beginners

  • @abegafouda9136
    @abegafouda9136 Před 3 lety

    Hé hé ! Incredible! God-sent man! You are answering all the questions I have in mind! I have been offered a Raspberry Pi 4 by my only real friend in the world. Bought yesterday, not yet sent. Am in Cameroon, he is in Europe... And the 1st video as I open CZcams is this one, created by whom? You, one of the best, with clear, concise, comprehensive explanations ever. Thank you.

  • @bonganijele9770
    @bonganijele9770 Před rokem

    Nice content i like the way he talk's he's loud and clear. Fully explained in details.

  • @Sam-tg4ii
    @Sam-tg4ii Před rokem

    very clear. Thank you

  • @hmdmddh
    @hmdmddh Před 3 lety +1

    Thank you very much for your well explained Videos

  • @cybersean3000
    @cybersean3000 Před 3 lety

    Excellent tutorial. Thank you.

  • @Perspectologist
    @Perspectologist Před 4 lety +1

    There are many different Arduino IDE compatible microcontrollers now. I was late to the Arduino world. I got started with the BASIC Stamp and their Javelin board. I bought one genuine Arduino Uno to help support their effort. It was much slower, less capable and more expensive than other options. I’ve rarely used it. I’ve mostly been using the ESP 8266, ESP32 and ATSAMD boards. The newer Arduino boards may help them to be more competitive. Certainly the Arduino Uno is a great tool for some things, I just mostly skipped over it due to when I got into this hobby. These days I’m also getting away from the Arduino IDE, and using Platform IO. I’m open to trying the new Arduino Pro IDE when it is further along. I need project settings.

  • @hubercats
    @hubercats Před 3 lety +1

    Great video! Thank you.

  • @chrismoore9223
    @chrismoore9223 Před 4 lety

    You’re the best. Thank you.

  • @danieldefo7801
    @danieldefo7801 Před 2 lety

    Great video! Thanks you!

  • @tomjoad1060
    @tomjoad1060 Před rokem

    Thank you for a well-made video!

  • @ESwitchInc
    @ESwitchInc Před 4 lety +4

    Great stuff, once again! Would love to send you some switches to work with for your next video, let's talk!

  • @bigsteve6729
    @bigsteve6729 Před 2 lety

    Just got some new pi gear thought I'd pop back to the workshop to freshen up my knowledge after a nodemcu binge 😁

  • @johannespralle6831
    @johannespralle6831 Před 3 lety

    You are a great instructor. Thanks.
    Suggestion: Talking about Pi to Pi communication via SPI Bus and CAN Bus.

  • @levelmastersystems117
    @levelmastersystems117 Před 4 lety

    Thank you very much, for this video.

  • @jeremiahayres103
    @jeremiahayres103 Před 2 lety

    You are awesome! This helped me a lot! Also I love the lab!

  • @anurasenarathna1703
    @anurasenarathna1703 Před rokem

    Great Video as Always.

  • @billstrain1
    @billstrain1 Před 4 lety

    Very good video. You are a good instructor.

  • @psudrat
    @psudrat Před 3 lety +1

    Thank you so much!
    Merci beaucoup!

  • @MarkLawry
    @MarkLawry Před 2 lety

    It was a good reminder seeing you attached to an antistatic ground.

  • @myusernameisrighther
    @myusernameisrighther Před 4 lety +2

    I’d really like to know where I can get one of those multipurpose hubs. 3 usb AND wired network on one device? Awesome.

  • @dav8485
    @dav8485 Před 3 lety

    a great video, congratulations!

  • @scotthiggins7804
    @scotthiggins7804 Před 4 lety +1

    Great instructional video! Can you add some links for the bits and bobs that you used in this project?

  • @EsotericArctos
    @EsotericArctos Před 4 lety +5

    Do you ever use the ESP8266 or ESP32 chips?
    They don't have quite so many GPIOs but they definitely have uses.

  • @eduardovillar2211
    @eduardovillar2211 Před 3 lety

    Thanks for video, that shows the unlimited capabilities of combine gpio with a computer, I guess it is the next steps learning after MCU is under control. Combined by displays, mqtt, cameras, HMI and so on possibilities are unlimited!! This is my first contact with Python and seems more compact language than Arduino C, interesting to keeping curious mind.
    Thanks again, hope to see more videos like that.

  • @lollllloro
    @lollllloro Před 4 lety +2

    Hi!
    I believe there is a mistake on the slide at 3:48
    A byte (B) usually means an octet [eight bits (b)] and computer memory and storage size is usually expressed in bytes instead of bits.
    As far as I know after searching online, the RAM and SRAM size units in the slide should have been [kB, MB, GB] instead of [kb, Mb, Gb]
    For example, the ATmega328 has 2 kB (16 kb) SRAM and 32 kB (256 kb) flash memory.
    The number etched on the top of SRAM and flash chips is usually in bits, though, and so are transfer speeds.
    I really like your videos, keep up the good work! :)

  • @rgdphome8974
    @rgdphome8974 Před 4 lety

    👌 Gr8 as usual.

  • @Boradumir
    @Boradumir Před 4 lety

    Very good information and even perfectly understandable for a not native speaker...
    One question about switches and raspberry pis... does the library you used automatically ignore keybouncing?

  • @torque6389
    @torque6389 Před 2 lety

    Great video!

  • @sannyabacha4025
    @sannyabacha4025 Před rokem

    Brilliant!!!

  • @153SCORN
    @153SCORN Před 4 lety

    Used the PI & Arduino together. Best of both worlds.

  • @logovka9671
    @logovka9671 Před 3 lety

    Super helpful!

  • @user-fq3pz4io2y
    @user-fq3pz4io2y Před 26 dny

    Thank You!

  • @testbranding
    @testbranding Před 4 lety

    Amazing job it's educational too if possible 1000 thumbs up

  • @whatwhat9485
    @whatwhat9485 Před 3 lety

    Very nice. Thank you

  • @cybergames33pl52
    @cybergames33pl52 Před 2 lety

    so clear explained after bought i chosen good rasberypi but if i founded you before i could get easy explained my choice between rasbery and arduino i am begin of begin with exp programming so all understanded more easy with you yt channel

  • @ertan1147
    @ertan1147 Před 4 lety

    it was very clear thank you. You could add also Windows 10 IoT and use c# to code :)

  • @randomperson619
    @randomperson619 Před 4 lety

    What is the blue band you are wearing, while explaining the Types of Raspberry boards?
    Is that ESD strap?

  • @kajmolin297
    @kajmolin297 Před 3 lety

    Interting! I have a Raspberry Pi 4B, but I can´t gett a current out of the usb port. I wounder if I had to connect the GPIO also?

  • @PacocaAir
    @PacocaAir Před 4 lety

    Thanks !! Please make more videos about the subjects raspberry and jetson nano!

  • @ttheo3
    @ttheo3 Před 2 lety

    Hey ! I love your channel and your videos !
    I just wanted to correct a few things, arround 4:50, you says Raspberry needs a bunch load of USB devicesto get starting.
    I actually find it much easier to start than arduino.
    I just use for my PI : USB power supply, SD card.
    Having the computer connected to the wifi is really easy, and using SSH to get distant access is easy to.
    You just need a computeur to SSH into the pi, but you don't need USB devices to access and programm it.
    Wich for certain case it's easier than accessing the USB port of an arduino builted in the project.
    Anyway, thanks a lot fort the sharing of this very good video :D

  • @wallaceshackleton1889
    @wallaceshackleton1889 Před 4 lety +5

    Great idea, although I've got to say that Unicorn poo is easier to buy than a Pi W.

  • @alexandrpetrov1110
    @alexandrpetrov1110 Před 3 lety

    Thank you!

  • @sebbel3260
    @sebbel3260 Před rokem

    The raspberry pi party lol! That made me sub

  • @yudhobaskoro8033
    @yudhobaskoro8033 Před 3 lety

    Can i use ubuntu mate on a pi4 for this project, and im curious to how can the GPIO only deliver 3.3v but there's an always on 5v that i use for fans

  • @balkrishnawagle7205
    @balkrishnawagle7205 Před 2 lety

    Sir You r a Great
    Thanks you Sir

  • @usmanmehmood5224
    @usmanmehmood5224 Před 4 lety

    Great video, can you please make a video of RFID sensor interface with rpi3

  • @electrotsmishar
    @electrotsmishar Před 3 lety

    wonderful video

  • @lesbac
    @lesbac Před 3 lety

    thank you.

  • @4STEVEJOY34
    @4STEVEJOY34 Před 4 lety +4

    9:15 Do you have a link for $5 PI Zero? I only found $15.00. Love all your videos.

  • @nrupensix
    @nrupensix Před 3 lety

    Well done

  • @desertbotio
    @desertbotio Před 4 lety +1

    Great videos. The Arduino MKR 1000 and 1010 WiFi - have WiFi in their name. Though a bit pricey. There is also a huge community that prefers the ESP32 related Arduino compatibles with their built in WiFi.

  • @naeemhaq3504
    @naeemhaq3504 Před 4 lety

    i like your videos
    quality

  • @uhmasyt
    @uhmasyt Před 4 lety +1

    I really enjoyed the video. Allthough I am known to the Raspberry Pi for a while and being a software engineer I had a fast forward look at the video to get an idea how you see it as I remember the other videos focus more on Arduinos. It was great to see the different versions of the Pi!

  • @martincregg
    @martincregg Před 3 lety

    Thank you