Raspberry Pi LESSON 6: Understanding GPIO Inputs, Pull Up and Pull Down Resistors

  Рет қаралды 30,402

Paul McWhorter

Paul McWhorter

Күн бұрын

Пікірлер: 127
@BibleConversationswithBros
@BibleConversationswithBros 4 ай бұрын
Really appreciate your emphasis on long term learning rather than getting to the point. This video is great and I truly feel like I am learning and starting to conceptually understand the intricacies of the Raspberry Pi System.
@danstachelski9185
@danstachelski9185 2 жыл бұрын
Great, clear explanation of pull up and pull down resistor usage. Keep up the good work!
@tpobrienjr
@tpobrienjr 2 жыл бұрын
Paul, your teaching approach is great - When you're done, both head and hands understand.
@wasdaletimelapse7658
@wasdaletimelapse7658 Жыл бұрын
Hi Paul, i would just like to say thank you very much for helping me with a challenge that has been beating me for two and a half days. After watching this video i was able to make some adaptations and achieve my goal. Your very basic approach to what you explain is just what I needed. I find that a lot of youtubers assume too much knowledge and miss the really basic explanations. I am now a subscriber to your channel and will certainly be watching a lot more of your content. Thanks for sharing.
@SirSurreal
@SirSurreal Жыл бұрын
Thank you. A nice reminder of how electrical theory factor in with programming. The "penny drop" moment was started at 18:50.
@AlexGW95
@AlexGW95 Жыл бұрын
Hey Paul, first of all, great tutorial series! Been following you from lesson 1 and moving strong. Just wanted to point out, after lots of research, my understanding of the pull-up resistor is as follows: there is constant current flow between 3.3V and GPIO pin, but it is extremely small since the pin itself has tremendous impendance-resistance. Thus, 3.3V flows to the pin, giving a value of 1, but the current is so small that it is difficult to measure.
@josephrusso4837
@josephrusso4837 4 ай бұрын
Thanks so much Professor Paul! I'm having a great time with the lessons, challenging yet so rewarding. I'm truly looking forward to mastering the art and to always keep practicing!
@amarbakshi2839
@amarbakshi2839 Жыл бұрын
Thank you Paul. Its today, after watching your tutorial, I am clear what pull up and pull down resister is.. Very helpful tutorials. Thanks again
@ThatRandumbGuy-z6s
@ThatRandumbGuy-z6s 11 күн бұрын
Can't Belive that I Got to Episode 6 Without Skipping! Exept For Watching at 1.25 Speed. Great Videos Anyway!
@anrew1000
@anrew1000 2 жыл бұрын
Hey there Mr.McWhorter! Jusy wanted to say a huge thank you for being such a blessing in expanding my understanding and knowledge of coding. I’m still on my learning journey, but I would be a lot further behind without your incredible explanations. Thank you again, and God bless.
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Be blessed!
@anwarzebkhan
@anwarzebkhan 2 жыл бұрын
This lesson completly cleared my concept about pull up and pull down resister. Thank you sir.
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Excellent!
@DavidValle-ej8es
@DavidValle-ej8es 4 ай бұрын
Best EE teacher on youtube
@danielsaenz5570
@danielsaenz5570 2 жыл бұрын
Hello Paul, I will rewatch the video since I was in the chat for most of it 😬😬. I will hopefully have a homework solution later today or tomorrow. Thanks Paul! 😀
@orange_robot
@orange_robot Жыл бұрын
Nobody could have explained it better than you.
@joshandsarahstallings7708
@joshandsarahstallings7708 8 ай бұрын
I grab my coffee before watching any of your videos...
@joshrittich1843
@joshrittich1843 Жыл бұрын
Nicely Done as usual!!! I did my homework... And it worked on my 1st try!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Excellent!
@RCWalletVacuum
@RCWalletVacuum Жыл бұрын
What an excellent series of videos!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Glad you like them!
@charlotteswift
@charlotteswift 2 жыл бұрын
Here are 2 videos and their code. The first uses a physical resistor kzbin.info/www/bejne/qnu3omp_ZsyHZ5Y The second uses the built in pull up pull down resistor kzbin.info/www/bejne/aGjXo2eprdWXY5I
@oflanagain
@oflanagain 2 жыл бұрын
Great video and have learnt' something I've not heard of before and actually understand it. Great feeling
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Isnt it funny how good it feels to understand something, and then be able to make something work. It is like a little happy buzz. Many seek that same feeling through drugs or alcohol but there is nothing like the feeling of trying something hard, and accomplishing it. Well done!
@anwar6971
@anwar6971 2 жыл бұрын
Another great explanation on pull up and pull down resistors.
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Glad it was helpful!
@PhG1961
@PhG1961 2 жыл бұрын
At some point... "What do we expect... ?!" Well, sometimes I get back something completely unexpected... like smoke signals... ;-)
@aman-sood
@aman-sood 2 жыл бұрын
Had to rewatch the video since I was chatting during the premiere. I will have my solution by today evening or even afternoon.
@heinrichdutoit695
@heinrichdutoit695 Жыл бұрын
Hi Paul! 👋 Thank you for all the great videos. I learned to program the Through your Arduino course and back now for the Raspberry Pi. I have one question on this video... Are you able to do the same on the Raspberry Pi as on the Arduino, where you write to the pin and read the value, not needing to use the 10K resistor? Hope you have a great day further! 🙂
@joca86
@joca86 Жыл бұрын
Izuzetna prezentacija, ja sam odusevljen, sve sam shvatio i bez velikog znanja jezika. vi bi trebali da budete profesor na fakultetu 🤗
@rockymountainfacet5958
@rockymountainfacet5958 Жыл бұрын
You are a God send.
@ion4497
@ion4497 Ай бұрын
great class thanks
@paulmcwhorter
@paulmcwhorter Ай бұрын
Glad you liked it!
@wendygrant2735
@wendygrant2735 2 жыл бұрын
Well explained once again.
@CapnTrashBoat
@CapnTrashBoat 5 ай бұрын
Not sure if I missed it but I always see the 10k resistor used but never the reason that rating specifically. Whats the min/max allowed power to not trigger a float?
@sl4807
@sl4807 2 жыл бұрын
thank you for the tutorial really helped me understand!
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Glad to hear that!
@jessekloberdanz246
@jessekloberdanz246 2 жыл бұрын
Fun to finally see your studio shot! What are you using for your production software? Looks kinda like Adobe Premier Pro? Appreciate the videos
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
I use wirecast as it allows live streaming very easily, and it integrates nicely with youtube.
@ShinesMonkey1
@ShinesMonkey1 Жыл бұрын
Great lesson Paul!! - I know the Arduino boards have internal pull-up resistors; does the Pi 4 have this feature? Thanks
@shakeelshakeel8286
@shakeelshakeel8286 5 ай бұрын
It was really a good explanation Mr. Paul. But I didn't understand one thing. When switch is OFF, no current flows then why pin 40 is getting input? Means pin 40 is getting flow of electrons? But there is no current so how it detects value.... When switch is ON it goes to 0 why?
@mattantonelli4273
@mattantonelli4273 2 жыл бұрын
Thank you Paul perfect
@hello81642
@hello81642 Жыл бұрын
Why did you pick this specific resistor? Could higher and lower oms do the job?
@meghanarprakash7862
@meghanarprakash7862 Жыл бұрын
what should be the current that is safe to read from gpio pin?
@Lehibob
@Lehibob 2 жыл бұрын
Okay... Now I am SHEEPISH. I started viewing the homework solution from Paul and realized I had done exactly what he feared. I simply created a circuit that read input and turned on the LED with the switch rather than via a programmed output pin. I immediately switched off his video and redid my circuit and program. This is documented in the video at : kzbin.info/www/bejne/bJnFq3ebesitaNE I deleted my earlier video showing the INCORRECT solution to the lesson even though it did show how to use a pull up down resistor and read the status of the switch. It even illuminated the LED, but as I say it was done solely by the switch button press. I was gratified to see he and I chose the same pins for the programmed output. At least I'm sort of on the same page.
@waltmetcalf5354
@waltmetcalf5354 2 жыл бұрын
Hi Paul, what app do you use for the sketch pad?
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Using autodesk sketchbook on an ipad
@thebestusernameevr
@thebestusernameevr Жыл бұрын
Hi Paul! Thanks for the videos! I've tried to submit my assignment in the comment a few times, but it keeps getting removed. (I'm wondering if it's because the comment contains a link?) Oh well. Anyways, I've been enjoying the series. I'm doing a master's in computer science and I'm thinking I want to go into embedded software engineering. You've also got me drinking coffee again! Have a good one.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
If you post to your youtube video, it should work. Please try again.
@farazahmed1668
@farazahmed1668 2 жыл бұрын
Thank you so much sir
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
All the best
@mbaker82
@mbaker82 Жыл бұрын
Great video! Question. what is the function of the resistor? is it to prevent a short-circuit condition here?. I understand that a resistor either lowers the current, divides the current, or blocks the current all together. basically what i interpret is you just connected pin 1(3.3v) straight to pin 39 (gnd) which i would think would let the smoke out... lol is the 10k what is stopping this from occuring?
@heinrichdutoit695
@heinrichdutoit695 Жыл бұрын
the idea, as far as I have it, is that the 10k resistor will bring the value of the current down so much, that it reads as zero. When you take I=V/R you will find that I = 3.3V / 10 000ohm This means that I = 0.00033Amps Rounded off, this will be close enough to zero, meaning the pin will read zero, which will give you the desired result.
@larryplatzek9017
@larryplatzek9017 2 жыл бұрын
Paul I think you need to change your comment on what we are doing in this lesson. 'In this lesson I will show how to build a 5 bit binary counter. We do this with the Raspberry Pi, and 5 LED. The LED blink in Binary count order between 0 and 31. '
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
I am confused . . . this lesson was not the binary counter lesson?
@larryplatzek9017
@larryplatzek9017 2 жыл бұрын
Paul the lesson was about pull_up and pull_down resistors and your comment about binary counter was in your written infomation about what the lesson is about. AM I wrong?
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
I now understand what you are saying and have corrected the description. I thought you were talking about the title at first.
@danielsaenz5570
@danielsaenz5570 2 жыл бұрын
Here is my Homework solution: kzbin.info/www/bejne/i2azpXuEqcqWl5Y Hope you enjoy!
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Nice build! Love the kittyLitterBox
@suelingsusu1339
@suelingsusu1339 2 жыл бұрын
Very well done....👌👌👌👌🙏🙏🙏🙏🖖🖖🖖
@TonyMobily
@TonyMobily 2 жыл бұрын
Thanks for the awesome videos. At mark 25.45, you say "When the switch is open, there is no current through this lower leg and therefore there is no current through this 10K resistor". Did you mean to say "there is no current DROP through this 10K resistor"? I am not trying to correct you! I am just checking that I am understanding this right!
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
There is no such thing as a current drop. Current is the flow of electrons. Voltage drops across a resistor, not current.
@TonyMobily
@TonyMobily 2 жыл бұрын
@@paulmcwhorter As I suspected, my understanding is flawed. Sorry... My understanding was that if the switch is open, there is no current going through the lower leg, and therefore there _is_ current through the 10K resistor. But obviously I am missing something... Hum time for me to get back to more basic electricity tutorials. Sorry!
@Wythaneye
@Wythaneye 2 жыл бұрын
Here's my video on resistor sorting. May not work for everyone, but it's my new favorite way. kzbin.info/www/bejne/aIKvqK2vabaaeM0
@Concan77
@Concan77 2 жыл бұрын
I'm still confused about the need for the 10K resistor on the pull-up resistor. What not just use the button switch? If the switch is open, the 3.3 V flows into the pin, and not ground, and if the switch is closed, then the current would branch off into the two paths of ground and the pin...right, based on where the resistor is. So, in summary, I don't know why the resistor is where it is on pull-up resistor.
@JohnnyOshika
@JohnnyOshika Жыл бұрын
I wouldn't try that. Connecting the 3.3v pin directly to ground will cause excessive current to flow and may fry your Pi.
@alberttalkstech
@alberttalkstech Жыл бұрын
There was an ant on your breadboard at 33:58.
@yrtang3538
@yrtang3538 2 жыл бұрын
why do we use 10k resistor ,not 100k 1k or any random one?
@jmg.garcia
@jmg.garcia Жыл бұрын
Hi Paul. This is the video for the 2nd homework. kzbin.info/www/bejne/e5eaiaaZiZqraNE. I also learned something interesting (at least for me 😅). If I shared the grounds for both circuits, the pull-down circuit falls into an undefined state where it can be 0 or 1.
@daveflatters4981
@daveflatters4981 2 жыл бұрын
What is that app you use that has the graph paper on ?
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
sketchpad by autodesk. It is free.
@daveflatters4981
@daveflatters4981 2 жыл бұрын
@@paulmcwhorter is that on an iPad ?
@itsmeintorrespain2714
@itsmeintorrespain2714 2 жыл бұрын
Homework published :- kzbin.info/www/bejne/bJ-3qqF4qbVgq68
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
A+
@farshidowrang2762
@farshidowrang2762 2 жыл бұрын
Takk!
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Really appreciate it! Thank you so much for all the help.
@tonysolar284
@tonysolar284 Жыл бұрын
29:20 Ant checking out your pi.
@junjie325
@junjie325 Жыл бұрын
23:32 "There's no current. There's no way for current to flow, so PIn 40 is going to directly see the 3.3 volts. It's going to read 1". I am so confused. How can there be no current and if there is no current, how is it going to see the 3.3 volts?
@notdecraw
@notdecraw Жыл бұрын
Hiya @junjie325, let me give it a shot. First off, don't think of pin 40 as part of the circuit; think of it as a test point. (When we set up pin 40 as an input, I expect it becomes a very high resistance part of the circuit through which a negligible amount of current flows.) With the switch open, the voltage drop across the entire circuit from voltage source to ground must the full 3.3V. In this circuit, that means that the voltage drop across the open switch (remember, open switch means no current is flowing) is also 3.3V which means that our test point sees 3.3V relative to ground (which means it returns a value of True, right?) Now close the switch: pin 40 is now connected directly to ground, which means that no matter whatever else is happening in the circuit, pin 40 is at the same potential as ground (another way of saying the voltage between pin 40 and ground is 0,) which means we read a value of False. Hope this helps.
@junjie325
@junjie325 Жыл бұрын
Thanks@@notdecraw​. Appreciate the response. You said "With the switch open, the voltage drop across the entire circuit from voltage source to ground must the full 3.3V.". But when the switch is open, how is the voltage source connected to ground? When the switch is open, shouldn't there be no voltage drop?
@BuzzKiller23
@BuzzKiller23 17 күн бұрын
34:51 ANT!!
@tamirthenoscopertamir224
@tamirthenoscopertamir224 2 жыл бұрын
ant on top left corner of table at 35:28
@FushigiMigi
@FushigiMigi Жыл бұрын
kzbin.info/www/bejne/f4G4qoWhg6p5ZqM I'm an industrial electrician. Most manufacturers of PLCs, etc. must handle the discharge of energy on the inputs on the card level so that we don't have to worry about it when wiring in new input devices. I'm thinking you can use a switch with a normally closed contact on it which will disconnect the resistor from the circuit when voltage is applied to the input. Also, in this case, I wonder if you could use any resistor since you wouldn't be connected to voltage (+) and need to reduce current to near zero. The reason I suggest this is because I don't like the idea of any amps (3.3v/10,000ohms = 0.00033a) going through the resistor to ground. I'm assuming the reason why we have to do the raspberry pi is because it is a multi purpose pin. If it were only used as an input for a certain voltage, this resistor could be permanently imbedded. Loved the video.
@addohm
@addohm Жыл бұрын
If I had a dollar for every time you repeat yourself If I had a dollar for every time you repeat yourself
@carolinedion5126
@carolinedion5126 2 жыл бұрын
Here is my homework video: kzbin.info/www/bejne/n3KXq3lpn9Ggpdk
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
LEGEND!
@michaelschweizer2115
@michaelschweizer2115 2 жыл бұрын
This was a short one. My video is here: kzbin.info/www/bejne/nnrMaJJma9qpfqM
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
LEGEND!
@denniserickson2135
@denniserickson2135 2 жыл бұрын
You said pull up & pull down give same result. Not true. PU give a 0 when switch is pressed. PD give a 1 when pressed.
@bobweiram6321
@bobweiram6321 Жыл бұрын
People prefer to fry their pi in the south.
@samueltheprogrammer6145
@samueltheprogrammer6145 2 жыл бұрын
This is my homework for this lesson kzbin.info/www/bejne/kJS8gaNvfq52msU
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
LEGEND!
@Wythaneye
@Wythaneye 2 жыл бұрын
A day late, a dollar short, but my lesson 6 homework is finally filmed and posted. kzbin.info/www/bejne/sIabop2wrN1jia8
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
LEGEND!
@harrison4687
@harrison4687 Жыл бұрын
Used the pull down resistor configuration. Works but not sure if this is the correct configuratation. kzbin.info/www/bejne/e525q5aQfretn9k This is wrong I'll have to re do it.
@karliskide2460
@karliskide2460 Жыл бұрын
Thank you for the lesson! Here is my homework assignment for this: kzbin.info/www/bejne/b3KnppKwiamEkLs
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@johnlittle3410
@johnlittle3410 8 ай бұрын
can you have to only print on a change of state so you don't get 0 0 0 0 0 0 1 1 1 1...?
@checkmykayd
@checkmykayd Жыл бұрын
drunk phrasing into gptChat spit out this: import RPi.GPIO as GPIO # Set up the GPIO pins GPIO.setmode(GPIO.BOARD) GPIO.setup(40, GPIO.IN) GPIO.setup(1, GPIO.IN) # Read the state of the pins pin_40_state = GPIO.input(40) pin_1_state = GPIO.input(1) # Check if the female-to-female jumper cable is connected if pin_40_state == 1 and pin_1_state == 1: print("Female-to-female jumper cable is connected") else: print("Female-to-female jumper cable is not connected") # Check if the ground pin is connected if pin_40_state == 0 and pin_1_state == 0: print("Ground pin is connected") else: print("Ground pin is not connected") # Clean up the GPIO resources GPIO.cleanup()
Raspberry Pi LESSON 4 : Understanding and Using GPIO Pins
45:45
Paul McWhorter
Рет қаралды 59 М.
Accompanying my daughter to practice dance is so annoying #funny #cute#comedy
00:17
Funny daughter's daily life
Рет қаралды 20 МЛН
Can You Find Hulk's True Love? Real vs Fake Girlfriend Challenge | Roblox 3D
00:24
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,1 МЛН
Raspberry Pi LESSON 7: GPIO Inputs from Button Switch
24:52
Paul McWhorter
Рет қаралды 19 М.
Raspberry Pi: Using GPIO Inputs
18:41
ExplainingComputers
Рет қаралды 584 М.
6 Great Raspberry Pi 5 Projects to try in 2024!
5:20
ToP Projects Compilation
Рет қаралды 62 М.
Raspberry Pi Tutorial (Model B+) - Using a Breadboard and LED’s
14:05
5 REAL Alternatives to Raspberry Pi
5:44
Hardware.ai
Рет қаралды 6 М.
The Raspberry Pi Pico WAS Overrated! But that changed!
10:18
GreatScott!
Рет қаралды 618 М.
Unboxing the Raspberry Pi CM5 Development Kit
11:36
Level 2 Jeff
Рет қаралды 15 М.
Accompanying my daughter to practice dance is so annoying #funny #cute#comedy
00:17
Funny daughter's daily life
Рет қаралды 20 МЛН