Trying to understand pull up and pull down resistors
Вставка
- Опубліковано 19 сер 2024
- Trying to figure out why certain values are used for pull up and pull down resistors in digital circuits.
-- Links
Breadboard kit: amzn.to/3MYwfho
Multimeter: amzn.to/49PUg45
TTL ICs: amzn.to/40WH75c
Power supply: amzn.to/3uAYxIE
Antistatic mat: amzn.to/49RhcQi
My Wife's Books: amzn.to/47yt9Ji
(Maybe you and/or someone you know will like them!)
About the current limiting resistor for LEDs, they are used to drop the supply voltage enough for the LEDs. Most LEDs have a voltage drop between 2V and 3.5V, so using the same resistor just means a little bit less or more current depending on the LED's voltage drop. Supposing you have a 5V supply and a 3V drop LED, you have to drop 5V-3V=2V across the resistor. You then divide this 2V figure by the current that you want to be flowing. To have 10mA flowing through the LED, you need a resistance equal to 2V/10mA = 200ohm. If instead you have a 2V drop LED and you still want 10mA to be flowing, then it's (5V-2V)/10mA = 300ohm.
These are Kirchhoff's voltage law and Ohm's law applied.
Hi, I think the things is. The inputs of the integrated have internal pullup resistors and that’s the reason to have voltage in these inputs when you energyce the integrated. Then, I think you must connect the switchs direct to ground, without resistors. This way, the switch open, maintain 0 (open = connected to ground) and the switch closed maintain the 1 (thanks to the internal pullup resistor). It make sense? I’m a hobbyist too, learning each day.
I like your videos, Thank you.
Regarding the floating stuff: chips come in different "logic families" (for example, "74LS") based on how the gates are constructed. This determines things like what the thresholds for 0 and 1 are, and their speed and power consumption. For hobbyists like us, they're mostly interchangeable, and the logic is the same whether I have a 74LS86 or a 74HCT86. But some of the details matter when it comes to not what they do on purpose, but what they do as a side effect of how they're made. Inputs on 74LS chips, for example, "float high" -- that is, if you leave them unconnected, they tend toward a 1 (not that you should rely on this behavior).
Tying this all together somewhat: to provide a logic 0 to a TTL input, the chip is actually going to provide some current, and you need to "sink" enough of it to pull the voltage down below the low input threshold (V(IL) = 0.7V in the data sheet). Now we have enough to calculate the resistor value. The datasheet also gives the input current I(IL) max value of 0.8mA. So what value of resistor connected to ground will bring the voltage down to 0.7V if the chip sources 0.8mA? R = V/I = 0.7/0.0008 = 875Ω. So to follow the spec, your pulldown resistor should be 875Ω or less. Of course, that's calculating the worst-case value, and in the real world things tend to still work way out of their specifications.
Ooooooh... hmmm.. this helps, I think.
I figured Ohm's law could be used somehow to compute the right values for these resistors, but I couldn't decide where the "missing" current variable was supposed to come from in order to do the math.
There are a lot of values on these data sheets and I'm realizing I have no idea which ones are important for which things. I've been sitting here for 20 minutes trying to figure out which number I'd use to do this same calculation for an ideal(?) pull-up resistor instead and am confused again. :P
@@bigzaphodFor the pull-up, you need to get the input pin at or above 2V (VIH). Since the supply voltage is 5V, that means you want the resistor to drop 3V or less. The data sheet says IIH is 20uA, so plug in R = V/I = 3/0.00002 = 150kΩ (or less). So as you can see, TTL logic is "easier" to pull up than down.
I don't want to confuse things too much, but this might be a good point to add that if this *had* been a 74HCT86, the situation would be quite different. While they implement the same behavior and have TTL-compatible logic levels, they are CMOS-based chips using MOSFETs, and have high-impedance inputs. Generally when I hear high-impedance, I think of an input that's kind of "passive" -- it has such a large resistance that if I connect something to it, it's just going to sit there without pulling much current. And that's the case with 74HCT parts, you can look at the gate funny and it turns on. Literally waving your hand around near the chip will do it. This is also why it becomes so important to connect all the unused inputs to VCC or GND, because otherwise they'll be switching randomly due to noise and stray capacitance, and switching like that causes them to draw power as well as potentially introduce instability in the chip. Anyway, I digress...
Not what I would call 'correct' but maybe just a way to help get your head around it.
Think of what you are doing with the switches. One side is connected to the supply voltage and the other is connected to ground. When you flick the switch you are essentially shorting the supply to ground.
One side of the switch is trying to pull the voltage up to the supply level and the other is trying to pull it down to ground. So you get kinda of a battle.
When you put in a pull (up/down) resistor, you are adding resistance to one side of the battle.
In your case you were putting the resistance on the supply side (pull up) so the larger the resistor the more you are hindering the supply from pulling up the ground voltage. This then results in a smaller voltage being measured at the switch.
The floating voltage depends on the type of circuit you use. Many IC have in. ternal weak pull up resistors other don't. You can induce floating voltage by statisc electricity. Intuition will come once you understand the relations between Voltage Current Resistance Just keep experimenting. It's like learning to go on a byke, in the biginning you focus too much after a while it will come naturally. Practice practice practice. Keep up the good work .
I think once the circuit becomes a complete circuit on 'both' leads. You have to think about this in terms of a voltage splitter. I'm curious what the voltage looks like on the 'on' side when you change the 'off' side of this circuit.
That might help think about what's actually happening here.
I just saw a Big Clive video (ua-cam.com/video/M5IS8FCh1yM/v-deo.htmlsi=dx1FHx66zg8p-JB7) where he was talking about different resistors for different LEDs, and it reminded me I meant to comment here, so I figured I'd leave that pointer as well.
I'm not an EE and have only a hobbyist understanding of these things, but I think there are a small number of concepts that give 90% of the value for reasoning about circuits like this. Ohm's law and the power law, of course. And Kirchoff's laws, or at least the most important aspects of series and parallel circuits: in series, the current through all elements is the same and the voltage drops across each add up to the total voltage; in parallel, the voltage is the same across all elements and the currents through them sum up. And with those, you can understand a voltage divider, which is what happens when you have two resistors in series and by changing their values, you can adjust the voltage between them. (That is what you are measuring with your pull-down resistor.)
I find the water analogies to be more confusing than helpful, but that's how my brain is wired. I'm not good with analogies because I always get distracted by the edge cases where they break down. Speaking of edge cases, though, that's something I do find useful for developing an intuition for situations like you had with increasing or decreasing the resistor.
In this case, to represent it in bad ASCII art, you have: GND--R--^--...--5V (R = resistor, ^ = your probe, ... = other stuff in the circuit), you could consider the limits: what happens if you have a 0 ohm resistor? In that case, R is just a wire, so your probe is connected directly to ground and you would expect it to read 0 volts. Now think about the other extreme: as the resistance goes to infinity, it acts more like an open connection, your probe gets "further away" from ground, and the voltage you're measuring is dominated by the 5V side so it goes up. Or to look at it from a math angle, is that the voltage drop across a resistor is proportional to its resistance (V=IR), so the higher the resistance, the greater the voltage difference across it. In this case, one side is 0, so when the resistance goes up, the voltage on the probe side goes up. Either way, this explains why higher-valued resistors are "weak" pull-downs (or ups). They don't pull as hard toward the rail.
Thanks! There's a lot to digest here and I really appreciate it.
(btw, it seems like something got confused with the video link, though, because that appears to just link to my video here. I'll have to search a bit to see if I can find the video you're referencing.)
@@bigzaphodSorry about that, the link I wanted was ua-cam.com/video/M5IS8FCh1yM/v-deo.htmlsi=dx1FHx66zg8p-JB7. The something that got confused was me.
To say what was unsaid in the Big Clive video: LEDs, being diodes, have (close enough to) a constant voltage drop (which varies by color/chemistry). When you put a resistor in series with it to control the current, you can calculate the value this way. You know you're starting with, e.g. 4.5V (3x1.5V batteries). You can look on your LED data sheet (say, www.farnell.com/datasheets/1498852.pdf) and see it has a forward voltage of 2V. Subtract that from 4.5. That leaves 2.5V for the resistor to take care of. Now pick a current (more current = more brighter). The data sheet says 20mA maximum continuous current - that's about typical for a red LED and one of the few numbers I can remember. As far as we care, the LED acts like it has no resistance, so it's up to the resistor to limit the current (and remember, they're in series, so the current though the resistor and the LED are equal). Now we're back to Ohm's law where we have 2 out of 3 variables. R = V/I = 2.5V/0.020A = 125Ω. So 125Ω for maximum brightness - of that Farnell red LED, in this circuit, with a 4.5V supply. If you go by the data sheet.
So you can see why Clive says they have abused the LEDs. They're pushing 106mA through the red one. As I said in my other comment, things tend to work beyond their stated operating range, but this is surely not good for it.
Now I'm confused too🤣 But anyway YT is a place for gaining knowledge, learning other people expirience. But the best way to gain knowlefge (sometimes new questions or just more confusion) is to perform own experiments with simple thought: 'You can trick other people, you can trick yourself, but ypu can not trickthe laws of physics'
In input resistance of a typical DMM in voltage mode is very high, usually 10 megohms (10 million ohms). With such high input resistance it takes only a tiny current to produce a non-zero voltage. This is a simple Ohm's law matter.
If a current of 10 nanoamperes (10 x 10^-9) flows through 10 x 10^6 ohms, the voltage across the resistor will be 0.1 volts Unshielded test leads can easily have such low currents made to flow in them due to electrical "noise" radiated from all manner of things, not the least of which is AC power wires. If you short the test leads together, both inputs of the meter are kept at the same voltage so the display will stay at zero. Typically the circuit you will be measuring has much lower resistance than that of the meter (if it doesn't large errors will be present in the value displayed by the meter). These noise currents will therefore mostly flow in parts of the circuit you're measuring. That same 10 nA through a resistance of, say 10 k ohms, will only produce a voltage of 100 µV. Sometimes you have to resort to shielded meter leads.
Fully describing all of the details would take many pages. I haven't looked for such things for many years, but I suspect you can find some very good information on using meters and the problems that can arise from companies like John Fluke, Keysight and Keithly.
A couple of other comments have covered floating inputs and why pull up/down is needed, but I don't think anyone has really covered what happens when you change the value of the resistor. You seem confused by the fact that in the case of a pull down resistor, decreasing the resistance decreased the resulting voltage and vice versa. The easiest and most intuitive way to think about it for me, is that the chip is actively trying to drive the line to 5v, with a very small amount of current. The pull down provides a path to ground for this current, resulting in very little voltage (as most or all of the charge has a path to ground, no charge builds up). By using a resistor, you are effectively limiting how much of this current can be dissipated, and as a result some amount of charge and hence voltage builds up. As resistance increases, less charge can be dissipated resulting in a higher voltage. As resistance decreases, power finds a path to ground more easily, resulting in lower voltage.
In theory you could accomplish the same task just with a jumper wire to ground. The only reason a resistor is used is to prevent the pull down from just being a short circuit, which would run the risk of causing excessive current flow and resulting damage to the IC. In reality for something like a simple XOR it would probably be fine, but a small resistor to limit the current offers cheap insurance against burning out chips.
The reason you use pull up/down resistors is because any type of transistor output will create a connection to ground when it turns on. So if you are using that to send a high or low signal to another device, you use a resistor to create the "high" level because the voltage on both sides of the resistor will show the same voltage as long as there is little to no current flowing. So when the transistor output of a chip is off, you will see the high voltage and when the output turns on( creates a connection to ground) you will get your "low" signal and the resistor prevents the positive side from shorting directly to ground through the transistor. The reason you keep confusing yourself is you are overthinking it.
Thanks! Overthinking things is basically what I do best... 😛
@@bigzaphod Overthinking, for better or worse, the story of my life!
Not true!
It is quite common for a transistor to be used to switch a node to "ground" but it is equally possible to use a transistor to switch a node to the positive supply rail. In the vast majority of logic devices, output are actively switched to the supply rail when HIGH and ground when LOW. The output does not always swing fully to the positive supply rail, especially with TTL devices.
Sometimes outputs are "open drain" or "open collector" (much ore rarely open source or open emitter). With OD or OC outputs, a FET or bipolar transistor switches the output to "ground." When the transitor is off, there is, barring external circuitry, no means by which a proper logic HIGH can be established. In that case a pullup resistor is used. OD and OC outputs are often used in so-called "wired-OR" circuits (which are more properly wired-AND since all drivies must be HIGH for the node to be HIGH).
usually you pull down to ground (-) and you pull up to positive (+) you cant pull down to positive which you are doing in the video
The fact that you had about 500 mV with a pulldown told me you were using ICs in a TTL family, even before you showed a datasheet.
The requirements for logic HIGH and LOW voltage absolutely do influence the value of pulling resistors than can be used.
TTL is more "difficult' in terms of pullups and pulldowns than any other logic family in common use.
In order to get a TTL to a LOW condition, you must "sink" "conventional current" from the input to ground. "Conventional current," unlike electron current, is considered to flow from positive to negative.
Each TTL family has different specs for the magnitude of current. With LS TTL it is specified (iil - normally upper case I for current, subscript IL for Input Low)) as 0.4 milliamperes. You need to be sure that input is kept at less than 0.8 V (or as recommended in your datasheet, less than 0.7 V) to be interpreted as a proper LOW. While most TTL specs in terms of input currents and voltages are consistent among manufacturers, it is worth checking the datasheet to be sure. I found one in which iil for an LS86 was spec'd as 0.8 mA, another at 0.6 mA).
Using 0.7 volts as our target and 0.4 mA as the current we must sink to ground to get down to 0.7 volts, we calculate the pull-down
R = V/I (or E/I) = 0.7 V / 0.0004 A = 1750 ohms
That is the MAXIMUM resistance we can use *for a single input.*
In your added you are certainly driving more than one input so we have an amount of current equal to that for one times the number of inputs. You are probably driving two, assuming a pretty typical adder, so you have twice as much current and therefore require half the resistance (back to Ohm's law with 0.0008 A). I'd actually aim for no more than 0.5 V.
You can use lower resistor values than you calculate but remember that when your switches are ON, the resistor is connected directly between Vcc and ground. I'd probably use a 470 ohm (a very common value) as the pulldown for two inputs. If the parts were original TTL, the input current would be 1.6 mA, so for two inputs you'd need 220 ohms to just barely meet the 0.7 V target.
Usually with TTL you don't use passive pull-down except in unusual circumstance. You would instead use the switch to connect the input to ground for LOW. With CMOS passive pullups and pulldowns are easier since the steady-state input current is essentially zero.
This guy has some advanced , mainly laptop repair videos where he teaches the logic of what usually goes wrong on a laptop and ways of fixing it. Also he made several well thought out videos systematically going through basic, teaching his wife, who is absolute beginer in this field, and if you can handle his rough English, he is the teacher i wish i had in school.. it's hard to explain this stuff once you understand it and he manages it anyway .
ua-cam.com/play/PL1VPLHW2WUgvjvJrNW4vhTymQ5YRsH0Ct.html
OMG that series is delightful! So patient and zen. I love it.
I would recommend avoiding Sorin like the plague if you want to learn things. He is terrible and spouts a lot of utter nonsense. I've watched quite a few electronics videos on UA-cam, just to see how good they are in terms of accuracy of information, and some of his are hands down the worst I've seen. Particularly stay away from this witchmode power conversion stuff.
@d614gakadoug9, could you please be more specific about what you find inaccurate about his teachings? I personally feel like he is often dealing with complex circuits without schematics and obscure, poorly documented components. If he offers a warranty on his repairs, I trust he wouldn't use methods that wouldn't hold up. In some cases, the "dodgy" methods he uses might be necessary due to limited parts availability and repair costs. Sometimes, a factory-standard repair just isn't feasible due to time and budget constraints. As long as the functionality isn't compromised and the customer is happy, I think that's all that matters.