Electronics 201: Pull-Up and Pull-Down Resistors
Vložit
- čas přidán 4. 09. 2024
- In this Electronics 201 lecture, we talk about the useful tool that is the pull-up and pull-down resistor. We also go over the concept that is the tri-state buffer.
I'm looking for suggestions for future videos, so if you have any topics, just put them in the comments below.
As usual you can check out my blog at
8bitprojects.bl...
I've watched other's, yours explain everything, doesn't take many things for granted, it's complete and clear as well
Finally, a "complete" explanation which made sense, thank you
Thanks! I had looked up the definition of pull up and pull down resistors several times without it making sense - now I see it was because I wasn't thinking about impedance.
Im really happy how you talked about in detail the floating state in the beginning, a lot of other videos dont talk about that and why anyone would want a pull up or down resistor. Thank you for helping us!
key take aways 1. floating is bad 2. current is lazy , takes the path of least resistance 3. Impedance is your friend. thanks for the clear explanation
One of rare youtube videos I let commercials roll (muted).
hHD, your work is appreciated. thanks
Thanks a million! I am kind of playing with basic electronics for three years and thanks to you now I really know what is going on inside.
Simply GREAT!
Thanks for talking about impedence. Finally makes sence to me. I've tried to wrap my head around this for a while, never thinking of that the mcu has a resistance.
Well done, very useful
Value R of Pull-Up
just wanted to point out that in the Pull-Up case, the value of the Pull-Up resistor has to limit the current flowing to the input pin and ground. it is preferred to be 10 times less than the impedance of the pin otherwise, a loading effect will be present as a result of the voltage divider, hence it is better to have the Pull up resistance Value R as 10 times less the impedance of input pin.
Good point, Ali H. Input impedance is desired to be high while output impedance is desired to be low.
Excellent description, this is perhaps the least head-hurty description of why a pullup/dn resistor works, and more importantly, why a given value is chosen.
I thought Wikipedia's entry on this subject was concise and explained the concept really clearly, hope it helps someone:
"A pull-up resistor weakly "pulls" the voltage of the wire it is connected to towards its voltage source level when the other components on the line are inactive. When all other connections on the line are inactive, they are high-impedance and act like they are disconnected.
Since the other components act as though they are disconnected, the circuit acts as though it is disconnected, and the pull-up resistor brings the wire up to the high logic level.
When another component on the line goes active, it will override the high logic level set by the pull-up resistor.
The pull-up resistor ensures that the wire is at a defined logic level even if no active devices are connected to it.
A pull-down resistor works in the same way but is connected to ground. It holds the logic signal near zero volts when no other active device is connected."
As a beginner, I can tell that it's not explained well.
I need to read it a couple times, but that makes sense to me😎
Excellent tutorial, thanks!
Floating = bad? That's not why my swimming instructor said...
What did he say?
dad's joke
That was a great video! I learned a lot quickly. Greetings from Arizona.
Thanks heaps for the unique way of explaining the concept pull-up and pull-down resistors - it's the easiest to understand so far!
Thank you for this video, it thoroughly explained that logic is not on and off, but High and low. I had then misconception that it was High and off, but this video helped me realize that off can not be a logic state as there is an absence of info.
Thanks for the video friend, I really learned a lot about "philosophies in creating circuits" and electricity in general because of the ways you displayed this information! THANK YOU! it's rare to find such clear and concise conveyance of information on this subject
best explanation even in 2021
Hi there, I think you meant to say that pull up resistor should be 1/10th or 10% of pin. In the case of pull up with V+ at 5V, 10kohm resistor vs 1kohm pin means that by simple voltage division, you actually have 0.45V at microcontroller pin which defeats the whole purpose.
Pull-up and pull-down resistors well explained, thank you !
Thank you Great explanation. I thought I was the only one not able to understand the concept by the comments below
Always was a source of confusion for me. Thanks for making it clear now.
Now this is a more or less decent explanation, though not perfect. I had watched a few other videos on pull-up/down resistors and this is the first video I liked. Thanks. Now FINALLY it makes sense to me why and how it works.
I think of a pull up or pull down resistor like a mechanical spring. Since the symbol for a resistor looks somewhat like a spring it is easy to remember. With a pull up resistor it is like a spring which tries to keep the voltage level at the level of the pull up source. Using a switch to ground "stretches" the spring down to Ground. Once the switch is released the "spring" returns the voltage to the higher voltage of the pull up source. With a pulldown resistor, the spring is trying to hold the voltage level down but can be stretched upward when the button is pushed.
Excellent tutorial. Best explanation I could find.
This makes so much more sense now...Thanks for the tutorial!
Aspiring computer/mechanical engineer here - this was VERY helpful!
likewise brah. g/l for the both of us! ;]
Fantastic video - allowed me to explain the concepts better to my electronics club!
Excellent tutorial. This subject was a always a bit fuzzy to me but not now!
201 = You Are The Best.
Pull up is active low - when button is "active" pin is low.
Pull down is active high - when button is "active" pin is high.
'current is lazy' :) good one.. easy to remember the concept.thanks
Even if it's kinda confusing cause of the used words, it's still a very good video and better than the other ones available for pull-up and pull-down resistors.
Very clear. Champion tutorial mate. 10/10 would watch again.
Thanks for a great tutorial! There is something that i still do not understand, and i see others with the same query, however the responses seem to be addressing different issues:
In a PULL DOWN scenario, when the switch is OPEN, why wouldn't the 'stray voltage' still choose to go to the path of least resistance to the micro controller [with the lower built in resistor], than go straight to ground [with the higher pull down resistor], which was the whole point - to stop the stray voltage entering the pin...
i have no idea either. Did you ever figure this out?
Dude, amazing video, I have no idea about electronic circuits, but this helped me understands some of these Arduino demo projects i'm building. Thanks heaps mate.
Finally, one video to answer all!! This is a GOOOOOOD VIDEO!!!
Best video on the subject out there
Thank you so much for this video, i watched so many videos but they are all confusing except for yours. I just got started with the official arduino starter kit and i completed the project number 02 and also completed project 03 but i was still stuck at project 02 as to why there was a 10k resistor after the switch. I knew it was a pull down but a co worker today just confused the heck out of me and it turns out you confirmed i was right from the beginning. I'm so happy to learn my logic is healthy lol, there is nothing i hate more than thinking logically and be wrong and have no clue why. I can finally move on because of you. You're the best!!! And... I subscirbed to your channel, there seem to be a few good videos to watch laters, i just dont know how many but cant wait to find out.
Excellent video. I would just like to point out that while floating pins on _inputs_ are generally considered bad, a floating pin on an _output_ is either doesn't matter, or is required like with multiple outputs on a buss configuration. The floating output would (obviously) be a separate video, but it should be stressed on this video that the "bad" label is applicable here only because this video is dealing with inputs.
Thanks for the video! Quick and clear explanation.
Dude, very good instructional videos on electronics basics. I have watched three so far and plan to view more. Man, you should do many more of these on more electronics topics. How about one on H-Bridge motor controllers. Keep up the great work.
Who the fuck would dislike this. This is better than Kahn ac..
Thanks for this! I was having some trouble grasping what each type did but this seemed to help.
Pull-up resistors are built into the Arduino's GPIOs. To use them, you would make a pin an input then write high to that pin.But you wouldn't connect the switch to 5v, you would connect it to ground.
7:45 why would any current gets pulled straight to ground when the resistance of the pull down resistor is larger than the mcu, isn't it suppose to go to the mcu instead because it has lower resistance ?
Very educational video! I clearly understood pull up finally. You should do lectures on Polish school. Cheers!
Fantastic explanation - Great video. Thank you!
Great tutorial, answered a lot of questions for me. Thanks!
really your lecture helped me a lot in understanding that concept...thanks brother...
Awesome video!!!! Thnx for the explanation were learning about this in automotive engine performance/diagnostics
Great lecture. Made it crystal clear.
Excellent explained.
I'm beginning to realize why explanations of pull-up and pull-down resistors have kept me confused. You, and others, say that the pull-up is necessary to prevent a floating state when the switch is open, however contradict that statement by saying that it is only there to prevent a short circuit when the switch is closed. Here is what you say from around 6:30 to 7:00:
“Now this resistor here serves *another* point. If this resistor *weren’t* here, it would have the *same* effect. Except that when you close the switch, you would be connecting your 5V supply directly to ground and that is called a ... short circuit. So that resistor *also* serves to limit the drain on this when it gets pulled to ground.”
You say that the pull-up is needed to avoid floating, then in the next breath say that things would work just the same without the pull-up and that the resistor is really only there to prevent a short when the switch is closed. But still imply that it has a dual role with words like “another” and “also”.
If you put a multimeter or oscilloscope on the Vout with respect to ground (that which would go into the microcontroller) it seems that the resistor is necessary for the case where the switch is closed to pull the output down to close to 0V otherwise, Vout will just stay at 5V. The addition of the resistor doesn’t seem to have anything to do with keeping the output (in to the microcontroller) from “floating”.
Testing on an Arduino Uno, a pull-up is *not* needed when the switch is open - the output is high and the Arduino input consistently reads HIGH - just as you said. When the switch is closed a resistor is needed to avoid a short (otherwise the Arduino seems to get the power sucked out of it - maybe a maximum current rating is exceeded, I don’t know). Placing a resistor between ground and the switch accomplishes this, but the output doesn’t change, it stays HIGH when read on the Arduino pin. Placing it in “pull-up” position, the short is avoided, the output goes low and the Arduino consistently reads LOW. So it would seem the “pull-up” plays more of a role in pulling down, but still doesn’t seem to have anything to do with pulling a “floating” value anywhere since there doesn’t seem to be any floating going on here. (I didn’t use the internal pull-ups, which I believe would be contrary to connecting the input to 5V with an external pull-up, and in fact didn’t even bother setting the pinMode() since they default to INPUT anyway.)
Is there a reason why there aren’t better examples for which the so-called “pull-up” resistor is actually doing what its name implies? This video is basically an echo of every web site or youtube video I come across (albeit done better than others).
When the switch is closed, it seems one can possibly think of it as a resistor voltage divider circuit with R1 equal to the value of the "pull-up" and R2 equal to 0.
Vout = Vin * (R2 / (R1 + R2)) = Vin * (0 / (R1 + 0)) = Vin * 0 = 0
With the resistor before the switch and after Vout, just to avoid the short:
Vout = Vin * (R2 / (0 + R2)) = Vin * (R2/R2) = Vin * 1 = Vin
So the resistor has be in "pull-up" position in order for the voltage to be read as low when the switch is closed.
100% agree. Came across "pull up resistor" concept yesterday and had to understand it, came to the exact same conclusion as you. That it is only there to avoid shorting at logic low voltage. And that the resistor is given meaning it doesn't have, making it harder for people learning about "floating" issue to understand how that was resolved.
It's similar to the TV-Signals on an Analog TV
On: TV is on and Tuned - Picture is shown
Off: TV is off - Nothing on Screen
Float: TV is on but is not tuned to a station - You get Noise (snow).
Very good description!
Thank you buddy....really saved me a lot of time.....thank you....
Great stuff, man! Thanks. I need to translate this from your switch example to interfacing a microcontroller (output) to an LDO voltage regulator chip that has a handy extra pin to control on/off. I'll think on it a bit...
This never made sense to me until now cheers
Great explanation man!
See teachers in Universities around the globe? Why is it so difficult to say it with simple words?
thanks for the explanation. It's very clear
Great video, man. Very informative, thanks a lot!
On 7:38, lets say that µc has an impendance of 10Ω, which means that the resistor should have 100Ω, correct?
Why is the floating current choosing ground over the microcontroller when ground has a resistance of 100Ω and the microcontroller has a resistance of 10Ω?
He applied the one tenth value to the wrong resistor.... Your question is justified.
From another website: The general rule is to use a pull-up resistor that is an order of magnitude (1/10th) LESS than the input impedance of the input pin (10k-100k). An input pin on a microcontroller has an impedance that can vary from 100k-1MΩ
In case of pull down resistor. When the switch is open why the current would not choose the MC path because it has less resistor?
Thank you
+MrACG66 Yes, he explains that concept in reverse for the pull-up.
Thank you, very useful video
Brilliant! You made me understand this. Many thanks
Thanks for this, the explanation and analogies were excellent! It really helped a lot!
Great! Very good explanation of the idea
Thanks, cleared things up a little for me.
Woa I know pull up and down resistors.
Thanks for the great explanation!
There will still be some current flow toward ground. Enough to ensure that there isn't a floating-pin issue.
Great video, the only thing i'm still confused is in the voltage that the microcontroller 'sees' (in the pull-up), i guess is less than 5 volts due to the resistor??
In that scenario when the switch is closed, the current would rather flow to ground and not the pin. With the resistor connected to ground, more of the current can flow to the pin, rather than to ground.
This even works in analog circuits like pulsing a 555 timer with another 555 timer. Pull pin 4 down to turn off/reset with a 1k resistor, and pin 3 of the other IC to pin 4 so it turns on and off.
Now that I think of it, it might work without the resistor since when the other 555 timer goes low, pin 4 on the subject one knows that (simple way of explaining that bit in little words, lol).
It all depends. Yes, many reset pins on many chips are low active, so you would want to use the pull-up resistor technique. But, this is only true if you are using a common NO switch (normally open). If for some reason you are using a NC switch (normally closed) then you would want to use the pull-down resistor technique because pressing the button would _open_ the switch.
very good teaching ...
No. There would only be voltage drop if the voltage entering the controller in any way flowed to ground. What happens that voltage is used to trigger with a transistor.
Good tutorial!! Easy to understand. Great job!Thanks!
nice video, but would be nice if you could use voice reduction for your mic. For example , you could use VB audiocable and Noisegator
The pull-down resistor seems to be easier to work with since it doesn`t use "inverting logic". But it seems to waste some energy, because when the line is truly powered, there is a little current drained to ground all the time. Is there a more power efficient circuit that can be used for that? Maybe using a PNP transistor?
Amazing explanation!! Thankyou so much!!!
An MCU GPIO responds to voltage not current. Because of that high impedance, the GPIO won't draw a lot of current from the source, and thus won't diminish the voltage to the pin.
It's about voltage more than current. By tying the pin to ground, it pulls the pin to 0 volts.
Great tutorial, would be helpful if the bits around the resistor : impedance ratio were corrected else this can really confuse people.
I FINALLY understood this
conceptually, would it be better to have a pull up resistor as this saves power in a microcontroller? instead of constantly letting it run to GND with a pull down.
Thanks for posting this its been very helpful. I still have two questions though.
1. With the Pull-Down Resistor, if you select a resistor with 10x the impedance of the micro controller pin, then when the switch is closed, why does the current still flow to ground since the resistor to ground is now 10x larger than the impedance. It seems like it would trap the current in the micro controller. I'm wanting to think of the pull down resistor as a small office in a fluid piping system for instance. When the switch or valve is open the water will flow into the micro controller who has a much smaller orifice than the pull down resistor. When the switch closes, any residual pressure left in the micro controller can slowly drain through the pull down resistor. But since the pull down resistor is so large it would take a long time. Isn't' this problematic to the micro controller since don't we essentially need the pin to go immediately to ground rather than slowly trickle to ground. Sorry if this is a dumb question, this stuff is all new to me.
2. With the pull up resistor, you mentioned the micro controller is constantly seeing 5 volts until the switch connects and it drains current to ground. So I typically think of a voltage drop being associated with a resistor. Is there no voltage drop since its not connected to ground (i.e. the pin of the micro controller is not connected internally to ground so there is no current path and no current flowing. the pin just "sees" 5 volts)
Anyone that could help I'd appreciate it. Would really like to learn this for hobby use. Thanks
MrGuitarfreak132 1. Of course some current is flowing in the direction of the ground, but most of it enters the micro controller. It works like a fluid piping system so that when the switch is closed the fluid can flow two ways. Through a big hole and a small hole. Some fluid will drain through the small hole, but mainly through the big one. :)
Resistors alone won't delay current in any way from flowing. You have to have some inductors or caps to do that.
The most important effect the pull down gives is that the micro controller does not sense any high voltages on the pin from floating voltages in the circuit. First when the switch is closed the voltage is able to go high enough to be registered as a high state.
2. You are partially right. It may not see 5.000V due to a possible voltage drop, but the micro controller will not se anything that resembles close to 0 V. And therefore the micro controller sees a high signal until the port is pulled to the ground and a 0 V is registered as a low state. If the micro controller does not draw current in the pulled up state then of course the voltage drop over the pull-up resistor is zero and the micro controller sees 5 V.
The whole point with using pull-up and pull-down resistors are to avoid accidental floating voltages to be registered as low/high. Luckily we don't need exactly 0 V and 5 V to set the different states. Usually there is a good range that is accepted as LOW and HIGH.
nice work.... can u talk about the difference between clock and oscillator !??
won't pull up resistor drain battery because all the current is flowing to the ground
Great vid. How do you measure the input impedance?
Thank you for the nice tutorial...
Nice tutorial, was a confusing topic for me to with all the way over analyzed descriptions out there. Question though on the Pull-Down.
Assuming you want R = 10*(Impedance of pin), and if current takes the path of least resistance, then: When switch is closed it will go to the pin because its smaller impedance than the R to ground, that's good.
BUT when its open, wouldn't it still flow to the same lower impedance path? GND may be on the other side of the resistor, but its still higher Z no?
Well done!
hot!!
I would be more than happy to.
In the floating state, for there to be a "stray signal on the pin" that means that the micro controller also has a ground in addition to the main ground. The stray electrical signal would flow to micro controller's ground. Is that a true statement? If not why?
Nice tutorial, you're very clear, thank you !
very nice explanation
Hi-
Using the Amtel 1284P. Trying to send a signal to the CLEAR pin on a MAX16054 for the purpose of auto-shutdown via software.
The setup is like the first example in the MAX16054 datasheet. Need to calculate the value of the pull-down on the CLEAR line.
Tried to include links to the datasheets, but CZcams wouldn't let me. Sorry
Thanks!
I think you explained the pull-up-restistor wrong. You have said that because of the resistor the current will float to ground and not to the mc but the current doesn't matter. It is the voltage that lets read the mc the signels wether it is a high (5V) or a low (0V). Because of the resistor the complete voltage drops on it and thats why there is a 0V input on the input of the mc.
But in the case of pull'down resistor noise signal would also go to MCU (since it has lower impedance) instead of the ground?
Thanks a lot! Very helpful...