Raspberry Pi LESSON 4 : Understanding and Using GPIO Pins

  Переглядів 48,063

Paul McWhorter

Paul McWhorter

День тому

Guys the pinout I show in this video has an error on Tx/Rx. You can download your own correct Pinout from my WEB site HERE:
toptechboy.com/understanding-...
Announcing the Most Awesome Raspberry Pi Lessons of All Times! This time we RUMBLE!
In this class series, we will be using the most excellent Sunfounder Ultimate Raspberry Pi kit, available here: (Affiliate Link)
amzn.to/3tSk9Mo
or for our UK friends, amzn.to/3I5d401
In this lesson I will take you through use of the GPIO pins on the Raspberry Pi. We will learn the pinout, and which pins are used for what.
You guys get your hardware ordered so you can follow along at home!
You will also need a Raspberry Pi. I suggest the Raspberry Pi 4. If you do not already have one, this is the most suitable gear I could find:
amzn.to/3pBMfKm
The Raspberry Pi's are sort of pricy right now, so you can look on ebay or elsewhere to see if there are any deals. You will need a SD card. If you do not already have one, this is a good one:
amzn.to/3KcXTn2
I like using a wireless keyboard and mouse to have fewer wires. You can certainly use your USB keyboard and mouse, but if you want a nice wireless one, this one works on the pi.
amzn.to/36Rv9Sk
You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:
/ paulmcwhorter
[Disclosure of Material Connection: I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. ]
#GPIO
#RESISTTHEMETAVERSE
#RASPBERRYPI

КОМЕНТАРІ: 140
@wwcr893
@wwcr893 2 роки тому
Question: Shouldn't board pin 6 be shown as ground, tx on board pin 8 (GPIO-14) and rx as board pin 9 (GPIO-15)? Am I missing something?
@paulmcwhorter
@paulmcwhorter 2 роки тому
Good catch. I will add a note to the video. You can down load corrected pinout here: toptechboy.com/understanding-raspberry-pi-4-gpio-pinouts/pinout-corrected/ Next couple lessons unfortunately also have this error, but I will correct it in future videos. Thanks for your help!
@SPADMI
@SPADMI 2 роки тому
@@paulmcwhorter On the same issue, Board pin 24 should be marked as (GPIO-8), right?
@paulmcwhorter
@paulmcwhorter 2 роки тому
@@SPADMI Thanks, that correction has been made in the downloadable one on my web site now. Thanks
@aman-sood
@aman-sood 2 роки тому
I was wondering that exact thing!!
@mykyta1235
@mykyta1235 6 місяців тому
unfortunately that url doesn't work anymore :(@@paulmcwhorter
@opalprestonshirley1700
@opalprestonshirley1700 2 роки тому
I've been doing this since 1979 and I always get a sense of satisfaction seeing the LED come on and go off.
@paulmcwhorter
@paulmcwhorter 2 роки тому
Me too!
@daviddun1389
@daviddun1389 Рік тому
Me2
@annastrong1146
@annastrong1146 4 місяці тому
Thanks for the shoutout to the ladies. Love your videos. Super helpful. Thank you for making them!
@brandonzawaski
@brandonzawaski 3 місяці тому
Paul, I've rewatched the beginning lessons and up to this point just so I am not missing anything. You are a great explainer.
@madisonhypes5332
@madisonhypes5332 Рік тому
This video is incredible. Thank you so much for all your hard work teaching.
@rockymountainfacet5958
@rockymountainfacet5958 8 місяців тому
Love your content as always. Thank you!
@djbroake9810
@djbroake9810 2 роки тому
Here from the Arduino course's, This was needed and as good as them. Thank you so much!
@bryantfitzmorris
@bryantfitzmorris Рік тому
Thank you. You're an inspired person on a mission. Enjoy your work!
@alanabela1900
@alanabela1900 Рік тому
Thank you for all these lessons.
@MattFacer
@MattFacer 2 роки тому
I’ve learnt more in this one lesson than I have over hours of googling!! Thanks. Great video and delivery
@paulmcwhorter
@paulmcwhorter 2 роки тому
Great to hear!
@gplayer01
@gplayer01 2 роки тому
Really cool lesson. Many thanks!!
@carol-lo
@carol-lo 6 місяців тому
You are superstar! I feel more confident on using the GPIO now. Thanks.
@chandanasrin3252
@chandanasrin3252 Рік тому
Hloo Paul this is chandana , i am following all your lessons from starting , i love the way you teach us ......Thank you
@paddler-sn7ub
@paddler-sn7ub Місяць тому
Thank you for the website and tutorials
@mmulisha1022
@mmulisha1022 Рік тому
Just Received my kit and started following this series. No programming background at all. (outside CNC and robotic programming). I am loving this series, and looking forward to getting all the way through it.... long way to go. I never thought i would be this happy about a blinking light lol!! Awesome! Homework is done, may jump to lesson 5 tomorrow!!
@albertwu8244
@albertwu8244 Рік тому
Great!😅
@sunilkulkarni4426
@sunilkulkarni4426 2 роки тому
Excited for the GPIO video !!!
@halcyonramirez6469
@halcyonramirez6469 7 днів тому
Thank you so much for this. I do have some programming background but never any hardware. Seeing the LED turn on brought almost a tear to my eye as it reminded of my initial journey in programming. Thank you!!. FYI. folks with a Raspberry pi 5. this instructions wont work. RPi 5 changed some things and code written for previous pis wont work.
@callumm.15
@callumm.15 4 місяці тому
Following along with the Pi 5 has been smooth sailing up until this video, where RPi.GPIO can no longer be used unfortunately. I will try to follow using gpiod, but it seems more complicated. With that aside, tutorials have been really great so far! EDIT: I noticed the Raspberry Pi documentation recommends using "gpiozero", though it works much differently than "RPi.GPIO" using device objects rather than controlling the pins directly which I'm not a fan of. On the other hand, "gpiod" seems more complicated and above all, has very little documentation (atleast of what I could find). For anyone looking for a library like RPi.GPIO, I definitely recommend "lgpio" which behaves very similarly. The biggest difference it seems is the chip select, but this is because of Pi 5's new structure. This is very easy to use, just by selecting chip "4" (use "chip = lgpio.gpiochip_open(4)" ). Then, follow the "lgpio python" documentation to use the gpio pins by using the "chip" object as a handle. Hope this helps someone!
@tarekazakir9919
@tarekazakir9919 2 роки тому
You are the best I am a a stem teenager and I really wanted to learn alot of things about robotics and I found all my answers in your videos. Thank you very much
@paulmcwhorter
@paulmcwhorter 2 роки тому
Great to hear! You are going to go far in life. Maybe even make the world a better place!
@bendibhafed1687
@bendibhafed1687 2 роки тому
Thank you Mr. Paul, This is really interesting.
@ricardorodriguez218
@ricardorodriguez218 5 місяців тому
Best coffee tutorial ever! :)
@timeforrice
@timeforrice 5 місяців тому
This guy is amazing!!!
@isimsiz-ok1jg
@isimsiz-ok1jg 3 місяці тому
I'm surprised there are still good men like you in this world, thank you. :)
@floridian080
@floridian080 2 роки тому
After watching this video twice, I see the advantages of library you used over the GPIO Zero library used in Official Raspberry Pi Beginner's Guide. Also, I've been using VSCode on my Pi400 without difficulty. The breadboard adapter makes for a more Arduino-like experience than attaching wires directly to the Pi.
@keithlohmeyer
@keithlohmeyer 2 роки тому
I also wondered why Paul chose this library. After some reading I see that GPIOzero is a wrapper for RPi.GPIO and handles some of the setup code for you. Most of us are coming from Arduino and understand setup and pullup / pulldown so I think RPi.GPIO was the right choice. It is good to know about GPIOzero as you will see it in example code online.
@sumantakumardutta986
@sumantakumardutta986 10 місяців тому
Homework solved!!😁 I even added another user-input about the time delay between 2 blinks. So the blinking is sometimes too slow or too fast, depending upon the user-input. 😀 This is really exciting!!😃 And thank you for mentioning the amazing "time" library of Python.❤
@steffig7282
@steffig7282 2 роки тому
You are brilliant Sir. I ♡ that your shirt always according to the tutorial. Greetings from Belgium
@paulmcwhorter
@paulmcwhorter 2 роки тому
Thanks! 😃
@Event.Horizon.
@Event.Horizon. Рік тому
You got another woman watching your vids over here, thanks for all the help!
@paulmcwhorter
@paulmcwhorter Рік тому
Excellent!
@farazahmed1668
@farazahmed1668 Рік тому
Thank you so much mister paul.
@paulmcwhorter
@paulmcwhorter Рік тому
Welcome!
@tpobrienjr
@tpobrienjr 2 роки тому
Cool stuff, indeed!
@ttl5842
@ttl5842 2 роки тому
I'm a woman, I love your programs !!
@charlotteswift
@charlotteswift 2 роки тому
Hi Paul In the first video for this series, someone corrected you for pronouncing the 'G' in GNOME. I wasn't sure but I was biased towards pronouncing it. Well it turns out that you were right👍(as usual). GNOME is an acronym for “GNU Network Object Model Environment,” and since the 'G' in GNU is pronounced and GNU is the first word in the GNOME acronym, the 'G' in GNOME is also pronounced.
@rockymountainfacet5958
@rockymountainfacet5958 8 місяців тому
I actually did the sum. I did not fold like a cheap lawn chair. I also have my Ice Coffee for this next video. I appreciate you Paul! I defiantly look up to you.
@paulmcwhorter
@paulmcwhorter 8 місяців тому
Great job!
@Bianchi77
@Bianchi77 4 місяці тому
Nice video, thanks :)
@onlynonsense8723
@onlynonsense8723 Рік тому
Great videos. Some timestamps would help greatly. If you could also keep the picture of you small rather than large so we can see the content, that would be super.
@Compuscience-Python-Prog-Exps
@Compuscience-Python-Prog-Exps 8 місяців тому
I've learned how to do a Breadboard because of you Paul. Another UKposts teacher showed me tips to create a breadboard with cobbler. Excellent choice I even recommend it. Cobblers avoid actual Rasp Pi pinouts from getting damaged. I'm just over a year and a half from having this amazing machine It taught me much in such a very short time. Please check out my work. when you have the time... Thanks Paul.......🙂👌👍
@daveflatters4981
@daveflatters4981 2 роки тому
If you type ‘pinout’ without the quotes, on the terminal you get a basic diagram of the actual model of Pi you are using, some basic information about it and a GPIO diagram. The GPIO diagram shows the board PIN numbers power and ground pins and the GPIO numbers but there is no extra information about the use of the GPIO pins i.e. UART, I2C etc
@paulmcwhorter
@paulmcwhorter 2 роки тому
Dave, I just learned something new, cool and important. Thanks!
@VivekAnandJ
@VivekAnandJ 5 місяців тому
Oh cool! Thank you so much!
@TradersTradingEdge
@TradersTradingEdge Рік тому
Wonderful, thanks very much. Can't wait to learn more in the next videos. §8-) Have a happy day. 🌞
@OZtwo
@OZtwo 7 місяців тому
Let us all sing: My LED is on! My LED is on! wow, LOVE to see that my LED turn on!
@tahababazadeh8444
@tahababazadeh8444 2 роки тому
Hi Mr.McWorter as always thanks for your great videos . unfortunately in my country with my income I cant afford to buy a raspberry pi although I am really interested and full of ideas and so passionate about it. is there any simulator or anything that I can rely on for learning raspberry pi thank you sincerly,
@SPADMI
@SPADMI 2 роки тому
I don't know is this the better answer for you. Your alternative choice is to buy a Raspberry Pi Zero 2W at US$15. Not that expensive, hoping that it is more affordable.
@martinlewis645
@martinlewis645 Рік тому
@paulmcwhorter
@paulmcwhorter Рік тому
LEGEND!
@ronwatkins2507
@ronwatkins2507 5 місяців тому
I've ordered the sun founder package and it's supposed to be delivered.
@ActualRandy
@ActualRandy 11 місяців тому
Hi Paul - thanks again for providing these materials, they are much more pleasant than reading dry tutorials! Would you be able to check my computations below? I'm trying to figure out how to select the correct resistor. According to my internet research (probably reliable but who knows): * 3.3 volts is the amounted provided by GPIO pins * 1.8 is the voltage drop for the red/green/yellow LEDs in our kit * 8 milliamps is the default max amperage on a GPIO pin * R = (VS - VD) / I, where R = Resistance, VS=voltage supplied, VD = Voltage Drop, I = current So by my calculation and research, the lowest resistor value meeting the 8 milliamp max should be: R = (3.3 - 1.8) / .008 = 187 ohm I.e., we should have at least a 187 ohm resistor to avoid sending too much current through the pin. Am I correct? Thanks in advance
@tezza3733
@tezza3733 10 місяців тому
Voltage drop across a diode is 0.6v not 1.2v
@sachinkumar-eb9mt
@sachinkumar-eb9mt 3 місяці тому
Hi Sir, I am very thankful that you are doing this series. I am using Pi5 and at 35:00 i am getting the error as Traceback (most recent call last): File "", line 1, in RuntimeError: Cannot determine SOC peripheral base address please help me! Thanks in Advanced
@SPADMI
@SPADMI 2 роки тому
Does it matter if I put the resistor on the short leg (cathode) instead of connecting it to the long leg (anode) of the LED?
@paulmcwhorter
@paulmcwhorter 2 роки тому
Can go on either side of the LED. Just needs to be in series with it.
@greatscott36
@greatscott36 6 місяців тому
Is it possible to write in others instead of Phython?
@Dinesh-nb6td
@Dinesh-nb6td 3 місяці тому
in which simulation we can make above simulation?
@user-gg3wn2ic1e
@user-gg3wn2ic1e Місяць тому
Tinkercad
@tarekhk
@tarekhk 3 місяці тому
Hey Paul, I got the RPi 5 and a SunFounder kit but when I try to setup GPIO.OUT I get : "RuntimeError: Cannot determine SOC peripheral base address". My understanding is that the new RPi 5 has a new chip and I cannot use the GPIO library so can't follow your lessons. I have been able to interact with the LED through GPIOD however I don't believe I can follow your lessons as it's very different code lines. What is the best way to follow the lessons? would a cheap Pico be able to use the GPIO library? I can't justify buying an older RPi 4 now as gpio library has been deprecated.
@paulmcwhorter
@paulmcwhorter 3 місяці тому
This class is probably better suited for an earlier version of the pi.
@waltmetcalf5354
@waltmetcalf5354 2 роки тому
import time import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) red=11 GPIO.setup(red,GPIO.OUT) while true: blink_num=int(input("How Many Blinks? ")) for i in range (0,blink_num): GPIO.output(red,True) time.sleep(.25) GPIO.output(red,False) time.sleep(.25) GPIO.cleanup() Homework Lesson 4
@VivekAnandJ
@VivekAnandJ 6 місяців тому
Sir in the GPIO pin out you've shown in the beginning (10:40), you've shown pin 6 as TX. However Google images shows it as Ground for Raspberry Pi 4, Model B. Is this for a different model? Thank you in advance for clarifying. 😊🙏
@AdolfZcoder
@AdolfZcoder Рік тому
Hi paul, I just wanted to ask before i buy the kit. Is the raspberry pi included in the kit itself? Or the kit only has components without the raspberry pi. Is the raspberry pi included in the Sunfounder kit? The one you have in the video
@paulmcwhorter
@paulmcwhorter Рік тому
No you need to have the pi, it is not included
@AdolfZcoder
@AdolfZcoder Рік тому
@@paulmcwhorter Ow ok thanks you, Any suggestions on where i can get a complete Kit and not seperate?
@rzaheer007
@rzaheer007 Рік тому
The circuit diagram shows a 5v battery. Does the command 'GPIO.output(11,True)' set pin 11 at 5V by default? Can we set the voltage at any desired level using the output function?
@paulmcwhorter
@paulmcwhorter Рік тому
Yes
@imastered9021
@imastered9021 9 днів тому
Hi Paul, I'm running into an issue when I run the line "GPIO.setup(11,GPIO.OUT)" It is giving me an error saying, "RuntimeError: Cannot determine SOC peripheral base address." Do you have any ideas why? Thanks for everything so far, really enjoying your course!
@halcyonramirez6469
@halcyonramirez6469 7 днів тому
It's cuz the raspberry pi 5 changed. use the gpiozero library instead
@arjunsaibo
@arjunsaibo 2 роки тому
Dear Sir please upload early.. Please release today only, lec4 and lec5
@keithlohmeyer
@keithlohmeyer 2 роки тому
Homework number 3 for this lesson ukposts.info/have/v-deo/enRenZ-wna96knk.html Paul suggested you could blink multiple LEDs independently without using threading. I took the challenge.
@RobVollmar
@RobVollmar Рік тому
It wasn't easy but I AM LEGEND!
@paulmcwhorter
@paulmcwhorter Рік тому
LEGEND!
@maddogmaz1576
@maddogmaz1576 2 місяці тому
The drawing said 5V but didn't you put it to the 3V?
@TheCourtoh
@TheCourtoh Рік тому
I am legend!
@bxmusic9104
@bxmusic9104 Рік тому
I wish you were my Physics Teacher
@goku64100
@goku64100 8 місяців тому
no one's been killed with an led YET
@TheUnofficialMaker
@TheUnofficialMaker 2 роки тому
link: ukposts.info/have/v-deo/oIeIqal9p4ur24U.html for the homework. This was fun..had to keep playing with it.
@paulmcwhorter
@paulmcwhorter 2 роки тому
A+
@maddogmaz1576
@maddogmaz1576 2 місяці тому
True turns mine off
@karliskide2460
@karliskide2460 Рік тому
Thank you for the lesson! Starting series on Raspberry Pi as well. So here is my homework solution for this one: ukposts.info/have/v-deo/smV7a62Gjo-Lqas.html
@paulmcwhorter
@paulmcwhorter Рік тому
LEGEND!
@tkklein
@tkklein 2 роки тому
How's your church plant going??
@paulmcwhorter
@paulmcwhorter 2 роки тому
Slow, but progressing. Purchasing property is a challenge right now.
@tkklein
@tkklein 2 роки тому
@@paulmcwhorter I see, do you need more donations?
@paulmcwhorter
@paulmcwhorter 2 роки тому
Thank you for your kind thoughts. Actually I dont get donations or support for the work I do here. I support it from the work I do on this channel. So, supporting the channel supports the work I do here. The problem with property purchase is one of finding the right spot at the right price. Also, most property here does not have a title, and then issues of easements and other things make it a challenge. So, we continue to try and work through all those issues. Thanks for asking.
@tkklein
@tkklein 2 роки тому
@@paulmcwhorter Ok, makes sense. I will be praying!
@vaclavkasal3875
@vaclavkasal3875 Рік тому
boom
@albertwu8244
@albertwu8244 Рік тому
This is my Homework link: ukposts.info/have/v-deo/ZZmoi42aqp9jmYk.html
@paulmcwhorter
@paulmcwhorter Рік тому
EXCELLENT!
@davidschnider1297
@davidschnider1297 Рік тому
Hello Paul. thank you for another exciting and challenging lesson. Here is my homework assignment... please forgive the untidy desk...thankful to have found the SunFounder Kit and though the kit.. I found YOU. God bless you, Brother Paul. oh.. here is the link to my homework video ukposts.info/have/v-deo/kIiedYSMsYFn0ps.html
@paulmcwhorter
@paulmcwhorter Рік тому
Excellent!
@lorisrobots
@lorisrobots 2 роки тому
Thanks for the great lesson - I have been traveling in my RV lately so I am a bit behind in the lessons. Trying to catch up while I still have internet. Here is my homework video: ukposts.info/have/v-deo/oJKgiYRrnG5y1WQ.html
@paulmcwhorter
@paulmcwhorter 2 роки тому
LEGEND! Nice build, good work.
@Wythaneye
@Wythaneye 2 роки тому
Lesson 4 uploaded: ukposts.info/have/v-deo/eqOHYYCRhIZjmp8.html
@paulmcwhorter
@paulmcwhorter 2 роки тому
Brian the link seems to go to Lesson 3 solution.
@Wythaneye
@Wythaneye 2 роки тому
@@paulmcwhorter Good catch, link is fixed.
@roguedan6076
@roguedan6076 2 роки тому
Thank you for this series, really enjoying it. My homework is here: ukposts.info/have/v-deo/fJFmgIB4gKyhlmw.html
@captainprototype187
@captainprototype187 2 роки тому
ok, my fist 10 minutes done. Will return later for the next 10 minutes..
@Greebstreebling
@Greebstreebling 5 місяців тому
sorry, took too long to get into it....:) :)
@karenjackson2887
@karenjackson2887 Рік тому
I'm a gal
@drmonkr
@drmonkr 2 місяці тому
Not working for GPIO.setup(11,GPIO.OUT)
@SPADMI
@SPADMI 2 роки тому
my homework submission: drive.google.com/file/d/157jwlQiHmHkj4bUsIvJZOopQ19Hsg-GT/view?usp=sharing
@paulmcwhorter
@paulmcwhorter 2 роки тому
Can you add to youtube . . . most people wont click on google drive links
Raspberry Pi LESSON 5 HOMEWORK SOLUTION: Understanding Binary Numbers
1:01:47
ASGI Fundamentals: Asynchronous Web Apps in Python
15:30
mCoding
Переглядів 6 тис.
Raspberry Pi LESSON 29: Using GPIO pins as Inputs and Reading them in Python
13:40
Arduino vs Pico - Which is the Best Microcontroller For You?
20:38
Gary Explains
Переглядів 277 тис.
Raspberry Pi LESSON 4 HOMEWORK SOLUTION: Understanding and Using GPIO Pins
17:56
Raspberry Pi GPIO - Getting Started with gpiozero
48:40
DroneBot Workshop
Переглядів 428 тис.
I Can Save You Money! - Raspberry Pi Alternatives
15:04
Linus Tech Tips
Переглядів 3,2 млн
the Raspberry Pi 5
17:57
NetworkChuck
Переглядів 1 млн
Complete Raspberry Pi Pins Overview GPIO Header
15:19
Robotics Back-End
Переглядів 10 тис.
Fixing the biggest flaws of the Raspberry Pi 4
14:43
AnotherMaker
Переглядів 15 тис.
The new Raspberry Pi Pico W is just $6
7:56
Jeff Geerling
Переглядів 423 тис.
План хакера 🤯 #shorts #фильмы
0:59
BruuHub
Переглядів 993 тис.
КУПИЛ SAMSUNG GALAXY S24 ULTRA ЗА 88000 РУБЛЕЙ!
27:29
DimaViper
Переглядів 47 тис.
Я Создал Новый Айфон!
0:59
FLV
Переглядів 1,7 млн
Как должен стоять ПК?
1:00
CompShop Shorts
Переглядів 643 тис.