Pull Up Resistor Tutorial | AddOhms #15

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I'm trying to use a push button with a launch pad to turn an LED on and off. When I push it the LED sometimes doesn't work! Heck sometimes the LED randomly turns on! So what's going on here? Is it because the pin is broken? this is a launch pad and not an Arduino? No... they both do the same thing! In this episode of AddOhms we're going to take a look at how to use pull-up resistors. [Music Playing] We will start by just looking at the microcontroller board by itself. Now with nothing connected we'll use this multimeter to measure the value of this pin, which is set to input. And we see zero volts, or right about zero volts. Okay. Now let's write a quick program to print the value over serial. What the heck?! Why is it changing randomly from low to high?? We call this pin, with nothing connected, a "Floating Pin." Instead of a multimeter, let's see the signal of the pin using an oscilloscope. Oh Wow! Check that out there is a big signal here. Even if you can't read an oscilloscope screen yet, you can guess that this does not look right. Adding a frequency measurement, we can see that the signal is 60 Hertz Here in my lab, I'm surrounded by EMI radiating at 60 Hertz, This energy finds its way into the i/o pins on the LaunchPad or Arduino or Raspberry Pi or Beagle Bone. Okay you get the point. The energy finds its way into the I/O pins and causes the pin to see noise. Guess what! The same thing is a problem when we connect a button to our micrcontroller. Let me draw a schematic of this simple circuit. Notice what the schematic shows when the button isn't pushed. We left the pin floating, all this EMI noise bombard the pin; pushing it around. which turns into a random high and low. Adding a 10k resistor from the pin to 5 volts fixes this problem. We call this type of resistor a "pull-up resistor." It "pulls up" the pin to 5 volts when nothing else happens. When we push the button down there is now a path from the other side of the resistor to ground. Going back to our scope and multimeter we can see the button responds by being 5 volts when not pressed and 0 volts when press NOTE: This inverted logic tends to trip people up when you push the button the microcontroller sees 0 volts which is typically a low and when the button is not pushed your microcontroller sees 5 volts or a high. Just keep that in mind, when you're writing your code. Microcontrollers like the Launch Pad or Arduino already have built-in pull-up resistors. They are simple to use: all you have to do is change the code from input to input pull up and the button will be stable. Have questions about pull-up resistors? Leave them with this video for show notes visit addohms.com/ep15. If you'd like to help support AddOhms in addition to sharing this video with others visit addohms.com/support where you can either buy a DVD or take part in our new patreon. Thank you for watching another AddOhms tutorial!
Info
Channel: AddOhms
Views: 230,316
Rating: undefined out of 5
Keywords: Electronics, Pull-up Resistor, Electronics Tutorial, Arduino (Brand), MSP430, Resistor (Invention), AddOhms, resistor, pullup resistor, pull up resistor explained, what is pull up resistor, arduino pull up resistor, pull up resistors, pull up, electronics tutorial series, why pull up resistors are used, use of pull up resistor, pull up resistor, pull up resistors explained, pull up resistor in microcontroller, pull up resistor tutorial, what is pull up resistor arduino
Id: wxjerCHCEMg
Channel Id: undefined
Length: 3min 52sec (232 seconds)
Published: Sun Aug 09 2015
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.