A button and a pull-down
A push button is a gap that closes while you press it. Wire it to an LED and it is a light switch. Wire it to a node that nothing else touches and the node floats, which is why every button circuit needs one resistor that holds it at zero.
You need the first circuit working, one push button, one 10 kΩ resistor and the meter. The button replaces the wire you were touching to the rail.
A button is a gap that closes
A push button has four legs, and inside the body they are joined in two pairs. The two legs of one pair are connected for good. The two pairs are separate until you press the cap, which pushes a metal dome down onto both and joins them.
Which two legs make a pair differs between makers. On most 12 × 12 mm buttons they are the two legs on the same side, but do not trust that: set the meter to continuity, the setting that beeps, and touch two legs with the probes. A beep with the cap released means those two are a pair. A beep only while you press means they are in different pairs.
The first circuit with a button in it
Put the button across the centre channel of the breadboard. On the usual part the legs are about 12.5 mm apart one way and 5 mm the other, so it spans the channel with a leg a hole from the channel on each side. Then wire it from opposite corners: the rail goes to the top-left leg and the resistor to the bottom-right one. Those two legs are in different pairs however the pairs run in your button, so the circuit works on any of them.
This is the first circuit with the button in the loop. The rail reads about 4.8 V on the power module's 5 V side, the red LED takes about 2 V, and 220 Ω in series gives about 13 mA. With the cap released the loop has a gap and the LED is dark; while you press, the gap is closed.
A wire that goes nowhere
Now take the LED and its resistor away and ask a different question: what voltage is at the point on the far side of the button? Pressed, it is the rail. Released, the button is open and that point is connected to nothing at all.
A point connected to nothing has no voltage of its own. It picks up whatever is near: the hum in the room's wiring, your hand, the meter's own leads. It is said to float. It is not at zero, and it is not at the rail; it is at no voltage, and it changes.
A resistor to ground fixes it. With 10 kΩ between the node and the minus rail, the open button leaves the node tied to 0 V through a path that carries almost no current. Pressed, the rail reaches the node through a button that has almost no resistance, so the node goes to the rail. The resistor is called a pull-down: it pulls the node down to ground when nothing else is.
This node is what an input pin on a board sees, which is why every button on a board has one of these resistors on it.
The size matters in two directions. A small resistor holds the node firmly but wastes current whenever the button is down: 1 kΩ takes about 4.8 mA, which is nothing the circuit needed. A large one wastes nothing but holds the node weakly, and a finger near the node can lift it. 10 kΩ takes under half a milliamp and holds well, and it is the usual choice.
Build it
Keep the button where it is. Take out the resistor and LED, and fit the 10 kΩ from the bottom-right leg's strip to the minus rail, with the wire into the rail from the same strip. The leg you use for the node is the one that was the output before.
Measure
Set the meter to DC volts, black lead on the minus rail, red lead on the strip the button's bottom-right leg is in.
- 10 kΩ fitted, cap released: 0.00 V, steady. Touch the strip with a finger while you read it: nothing changes.
- 10 kΩ fitted, cap pressed: about the rail, 4.5 to 4.9 V. It is the same number you read on the rail itself, within a few hundredths.
- 10 kΩ lifted out, cap pressed: about the rail again. Nothing else touches the node, so the button alone sets it.
- 10 kΩ lifted out, cap released: the reading wanders. Do not write a number down. Most meters have an input resistance of about 10 MΩ, which is very high, and a node connected to nothing is easily pushed around by that and by the room. A reading of 0.0 V one moment and 1.3 V the next is the point.
Then put the LED and its resistor back and measure across the 220 Ω with the button pressed. It should read about 2.8 V, which is the rail less the LED's 2 V, and Ohm's law turns it into current: 2.8 V over 220 Ω is about 12.7 mA.
When it does not work
Almost always the button's legs. If the wire and the resistor went to two legs of the same pair, the button joins them already, and pressing changes nothing. Use opposite corners. Then check the LED is the right way round, that the power module is switched to 5 V, and that the rail reads 4.5 to 4.9 V on the meter.
Two legs from different pairs are in the same strip of holes, or the wire and the resistor are on legs of one pair, which are joined for good. Lift the button out and use the meter's continuity mode between the two legs you wired: if it beeps with the cap released, they are one pair.
That is a floating node and it is the right answer to a question with no answer. Fit the 10 kΩ from the node to the minus rail and the reading settles at 0.00 V. A moving number is the circuit telling you that nothing is holding the node.
A few hundredths under is normal. A volt under means the rail itself has sagged: measure the rail with the button pressed and the circuit connected. If it is low there, the supply is the problem, not the button. A tired button can also add resistance, so try pressing harder, or another one.
The legs of a 12 × 12 mm button are thick and stiff. Line all four up over their holes and press the body, not the cap, with even force. If a leg has bent, straighten it with pliers first. Never push on the cap: it is the weakest part.
The button carried the whole LED current here. A transistor lets a much smaller current do the switching.
A transistor as a switch →Edit this page — content/books/estkit/a-button-and-a-pull-down.mdx
Questions about this product
See what other owners have asked, and read their solutions.
Electronics Starter Kit, Breadboard, Power Module and Components
Loading discussions…
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.