PAGE 061 OF 150 · DRIVING WITH SWITCHES & TRANSISTORS
Switching an LED with a Push Button
A button simply completes or breaks the circuit.
LED SYMBOLTriangle points from anode to cathode; the arrows show light leaving the part.
The basic circuit
A push button placed in series with the LED and its resistor lights the LED only while the button is pressed. This kind is called momentary and normally open.
Using four-pin buttons
Small tactile buttons have four legs, with each pair joined inside. Wire across opposite corners so the button actually breaks the circuit when not pressed.
- Supply positive, then button, resistor, LED, then ground.
- Use the same resistor value you would without the button.
With microcontrollers, mechanical buttons bounce for a few milliseconds, so add a small delay or debounce circuit.
REMEMBER
A transistor lets a tiny signal control a much larger LED current.Try it yourself
Sketch the circuit on paper first, calculate the values, then build it on a solderless breadboard using a low-voltage supply. Measure with a multimeter before you make anything permanent.
Explore LED clocks, stopwatches and electronics at cosycom.com.