Skip to content

Demo 2.1: Pull-up and Pull-down Resistors

Every other demonstration in this module treats a conductor as carrying a 0 or a 1. That is the right way to think while you are designing logic, and it is the wrong way to think while you are building it.

A real conductor carries a voltage. A real input draws a current, small but not zero, and the direction it draws it in depends on the family of chip you picked out of the drawer. And a conductor connected to nothing at all carries neither a 0 nor a 1, which is a state the truth tables have no row for.

Three mistakes follow from forgetting that, and between them they account for most of the circuits that do not work on a first laboratory afternoon. This demonstration is about all three, and it is worth working through before you wire anything.

The first is an LED wired straight to a supply. An LED is a diode, and a diode does not obey Ohm’s law: past its forward voltage the current rises almost vertically, so a tenth of a volt more is not ten per cent more current, it is several times more current. Connect one directly across a supply and it takes everything the supply is willing to give, which is far more than it can survive.

The second is a button wired between an input and ground, with nothing else. Pressed, the input is held at 0 V and everything is fine. Released, the input is connected to a piece of wire and the air. What that reads as depends on the family: a TTL input will report a 1, which is the most dangerous outcome because the circuit appears to work, and a CMOS input will report whatever the room decides while the chip quietly draws current it was not designed to draw.

The third is the fix for the second, applied incorrectly, so that pressing the button connects the supply directly to ground.

Why the LED needs a resistor lets you choose the supply, the LED colour and the series resistor, and shows the current and the two voltages that must add up to the supply. Set the resistor to none and read what happens.

A floating input puts the same unconnected input on a 74LS00 and a 74HC00 side by side, with a bar showing where the voltage sits relative to each part’s thresholds. The CMOS one drifts, because that is what a floating CMOS input does.

Pull-up and pull-down is the correct circuit in both of its arrangements. Change the chip and the resistor value and watch the voltage at the input pin, which is worked out from the data sheet rather than assumed to be a clean rail. On the TTL part that calculation has to include the current the input itself pushes out, and a table works every combination out at once.

Ways to get it wrong is four wiring mistakes, including the one that shorts the supply.

Pull-up and Pull-down Resistors

What a wire connected to nothing is actually doing, and the three mistakes that follow from not asking.

An LED does not set its own current.

  • A resistor obeys Ohm's law: double the voltage across it and the current doubles.
  • A diode does not. Past its forward voltage the current rises almost vertically, so a small change in voltage is an enormous change in current.
  • Connect an LED straight across a supply and it takes everything the supply will give.
  • The series resistor is what decides the current instead, and that is its only job here.
  • Change the colour, the supply and the resistor below, and watch which of them the current actually depends on.
Supply
LED colour

VF = 2.0 V

Series resistor
5 V220ΩV(R) = 3.00 VV(LED) = 2.00 VRed LED3.00 V + 2.00 V = 5.00 V13.64 mAcurrent
13.6 mA is a sensible operating current
  • Comfortably inside the rating, with margin to spare.
  • Easily bright enough to read across a room.
  • Most indicator LEDs are run somewhere in this range rather than at their maximum.
The calculation, in full

I = (VSVF) / R = (5.0 − 2.0) / 220 = 13.64 mA

PR = I²R = 40.9 mW

Choosing the resistor
  • Choose the resistor from the current you want, not the other way round.
  • Pick a sensible current first, usually somewhere between 5 and 15 mA.
  • Rearrange to R = (VS VF) / I.
  • Round up to the nearest value in the box, never down. Rounding up is deliberate, because a larger resistor lowers the current.
  • PR matters when the current is high: a quarter-watt resistor is the usual part, and 5 mm LED circuits stay well inside that.
Try the blue LED on 3.3 volts
  • It stays dark, and no amount of changing the resistor will help.
  • A blue LED needs about 3.2 V across it before it conducts at all.
  • A 3.3 V rail leaves a tenth of a volt for the resistor, which cannot set any useful current.
  • This catches people out constantly when a circuit is moved from a 5 V board to a 3.3 V one.
  • It is a property of the semiconductor, not a fault: the wider band gap that makes the light blue is the same one that raises VF.
A gate output is not a power supply
  • The supply in this drawing is a rail, which will give you whatever you ask of it.
  • A logic gate is far weaker: a 74LS output can sink about 8 mA and source only 0.4 mA.
  • A 74HC output manages about 4 mA either way.
  • So an LED that needs 15 mA cannot be driven straight from a gate, whatever the resistor says.
  • Three ways round it: wire the LED between the supply and the output so the gate sinks the current, run it at a current the gate can give, or use a transistor.

Step 1: Find the resistor that gives you the current you want

Section titled “Step 1: Find the resistor that gives you the current you want”

Open the first tab with a 5 V supply, a red LED and 220 Ω.

The current is 13.6 mA, and the two voltages read 3.00 V across the resistor and 2.00 V across the LED. Those add up to the supply, and they have to: there is one loop, so the voltages around it account for every volt the supply provides. The LED takes its forward voltage, which is a property of the semiconductor and barely moves, and the resistor takes whatever is left over.

That is the useful way round to think about it. The resistor does not “protect” the LED in some vague sense. It takes the difference between the supply and the forward voltage, and by taking it across a known resistance it fixes the current.

So size it from the current you want, not the other way round. Choose a current first, usually somewhere between 5 and 15 mA for an indicator, then rearrange:

R = (Vs − Vf) / I

and round up to the nearest value in the box, because rounding up lowers the current and rounding down raises it.

Set the resistor to none.

There is now nothing in the loop to drop the difference between the supply and the forward voltage except the wiring, which is a fraction of an ohm. The current is not calculated because there is nothing to divide by: it is limited only by the supply and by the LED’s own bulk resistance, and it will be hundreds of milliamps through a part rated for twenty.

The LED will light brilliantly and briefly. If it is being driven from a gate output rather than a supply rail, it may take the gate with it.

Switch the supply to 3.3 V and the colour to blue.

The demonstration reports the number and then tells you not to trust it, which is the honest answer. A blue LED needs about 3.2 V before it conducts at all, so a 3.3 V rail leaves a tenth of a volt for the resistor. At that point the simple model has stopped working: the current is set by the steep part of the diode curve rather than by the resistor, so it varies wildly with the individual LED and with the exact supply, and two LEDs from the same bag will not match.

Nothing is broken and nothing is miswired. There is simply not enough voltage. This is worth knowing before you move a circuit from a 5 V board to a 3.3 V one and conclude the LEDs are faulty.

Step 4: Leave an input floating and watch two chips disagree

Section titled “Step 4: Leave an input floating and watch two chips disagree”

Open A floating input and leave the button released.

Both parts have the same input, connected to the same nothing. The 74LS00 reads it as a 1. Put a voltmeter on the pin and you would measure about 1.5 V, which is neither a valid 0 nor a valid 1 by the numbers in the data sheet, and yet the gate reports a 1 because of how a TTL input is built: with nothing pulling it down, no current flows out of the input, and no current out is what the gate interprets as high.

The 74HC00 does something less convenient. Its input is the gate of a MOSFET, which draws essentially no current and therefore holds whatever charge happens to be sitting on it. Watch the marker move. It drifts, because a floating CMOS input follows whatever is near it, and a hand moving past a breadboard is quite enough.

Now look at where the marker sits. While it is in the amber band, the chip is not just reading an ambiguous level, it is dissipating power: both transistors in the output stage are partly on at once, and the supply current can rise from microamps to milliamps. The chip gets warm and the output may oscillate.

Press the button and both parts agree immediately. The fault was never in the pressed state.

Open Pull-up and pull-down.

The resistor gives the input a second path. The button connects it firmly to one rail; the resistor connects it weakly to the other. Press and release the button and watch the drawing: there are always exactly two paths in the circuit, and at every instant at least one of them is deciding the input’s level.

That is the whole idea, and it is worth stating as a rule. The button and the resistor must go to opposite rails. A pull-up resistor goes to the supply and the button goes to ground; a pull-down resistor goes to ground and the button goes to the supply. Both are correct, and which you choose decides whether a pressed button reads as 0 or as 1.

Press the button and look at the current. With 10 kΩ and a 5 V supply, 0.5 mA flows from the supply through the resistor and the button to ground for as long as you hold it. That is the price of the arrangement, and it is why the resistor cannot be too small.

Step 6: Find the upper limit, which depends on the chip

Section titled “Step 6: Find the upper limit, which depends on the chip”

Still on that tab, choose Pull-down, the 74LS00, and 10 kΩ. Release the button.

It fails. The input sits at 1.09 V, which is above the 0.8 V this part accepts as a 0 and below the 2.0 V it demands for a 1. A released button on a pull-down arrangement is supposed to read 0, and instead the pin is in the band where the gate is not obliged to decide anything at all. The circuit diagram colours that net amber for exactly that reason.

The reason is the input current, and it is the most useful thing on this page. A 74LS input is not a passive pin. Inside the chip it sits under a pull-up to the supply, so it pushes about 0.4 mA out of itself when it is being held low, and that current has to flow through whatever you connect. Two data sheet numbers describe the pin completely: left connected to nothing it settles at about 1.5 V, and shorted to ground it delivers 0.4 mA. Seen from outside, then, the input is a 1.5 V source behind

R(int) = 1.5 V / 0.4 mA = 3.75 kΩ

so your pull-down does not merely carry a current, it forms a divider with the chip itself:

V(in) = 1.5 V × 10 kΩ / (10 kΩ + 3.75 kΩ) = 1.09 V

Work that expression backwards and the largest pull-down that still gives a valid 0 is about 4.3 kΩ. Beyond it the pin climbs towards the 1.5 V it would reach with no resistor at all, which is precisely the floating voltage from Step 4. That is the sense in which a pull-down can be too weak: it does not become a slightly worse pull-down, it stops being one.

Now change only the chip, to the 74HC00. The same 10 kΩ works perfectly, because a CMOS input is not a source at all. It leaks a tenth of a microamp, four thousand times less, and 10 kΩ holds it within a millivolt of ground.

So the familiar advice that “10 k is the standard pull resistor” is true for CMOS and only half true for TTL. On a 74LS part a pull-up of 10 kΩ is fine, because the input’s high-level current is only 20 µA and the drop is 0.2 V. A pull-down on the same part has to be a kilohm or less. The table under the drawing works out every value on both chips at once, and the shape of it is the whole point: the CMOS column is correct everywhere and the TTL one runs out.

Open Ways to get it wrong and step through the four.

No resistor at all is Step 4 again: pressed is fine, released is floating.

Button across the rails is the expensive one. The button connects the supply straight to ground with the input tapped off the middle, so releasing it leaves the input floating and pressing it puts the supply across the button and the wire, perhaps a fifth of an ohm in total. A bench supply will current-limit and complain. A battery will not, and something will get hot.

Resistor and button both to the supply damages nothing and achieves nothing. Look at the drawing rather than the label: nothing in it connects to ground at all, and both ends of the button are already at 5 V, so closing it joins two points that were joined anyway. The input is high whichever way the button is. This is the mistake the rule in Step 5 exists to prevent.

Pull-up far too small works. A 100 Ω pull-up holds the input high perfectly well, and draws 50 mA while the button is held, which is a hundred times more than it needs to be and most of a coin cell’s budget.

Quiz
Select 0/1

A red LED with a forward voltage of 2.0 V is to run at about 10 mA from a 5 V supply. Which resistor?

Quiz
Select 0/1

A button is wired from a 74HC00 input to ground, with no other components. What happens when it is released?

Concept Match

Match each arrangement to what it does

Quiz
Select 0/1

Why is a 100 Ω pull-up usually a poor choice, even though the input reads correctly with it?

Five things to take to the bench.

  1. An LED never goes straight across a supply. Choose the current you want, work out R = (Vs − Vf) / I, and round up.
  2. The forward voltage is subtracted before you divide. Forgetting it is the most common arithmetic slip in this topic, and it makes the resistor too large rather than too small, so it hides itself.
  3. An input connected to nothing has no logic level. A TTL part will read a 1 and lull you into thinking the circuit works; a CMOS part will read anything at all and warm up while it does.
  4. A button on its own is never enough. The button and the resistor go to opposite rails, and the input then has a defined level whether the button is pressed or not.
  5. Ten kilohms is a good default and not a law. On a TTL input a pull-down has to be about ten times smaller, because a TTL input pushes current out when it is low and forms a divider with whatever you connect, so a large pull-down leaves the pin sitting near the voltage it would float to anyway.

Everything from here on treats a wire as carrying a 0 or a 1 again, which is a much more comfortable way to think and is entirely justified once the wiring underneath is right. This demonstration is about making it right.