Build it step by step
0 of 8 doneIdentify the contacts
Use continuity to map each switch.
Wire the toggle
Common to 5 V, two throws to two LEDs.
Wire the latching button
In series with an LED.
Wire the momentary button
In series with an LED.
Power it up
One toggle LED is lit.
Operate each switch
Flick, press and hold.
Fill in the table
Positions, memory and LED.
Answer the questions
Pick the right switch for three jobs.
How do you build a switch types gallery?
Wire a toggle, a latching push button and a momentary button to LED circuits and learn what each type does. You need Toggle switch SPDT (MTS-102), Push button (latching, 7 mm panel), Tactile push button 6 mm, LED 5 mm red × 4, Resistor 330 Ω × 4, 5 V 2 A USB adapter, Jumper wires male to male (40 pcs, 20 cm) and Breadboard 830 Tie Points. It takes 8 steps and about 60 minutes.
- Level
- Beginner
- Time
- About 60 min
- Parts
- 8
Parts list
- SwitchesBuy
- SwitchesBuy
- SwitchesBuy
- SemiconductorsBuyLED 5 mm red × 4
- PassivesBuyResistor 330 Ω × 4
- PowerBuy
- PrototypingBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| 5 V adapter positive | Toggle switch middle (common) terminal | Supply into the changeover switch |
| Toggle terminal 1 | 330 ohm resistor to LED 1 anode | First position |
| Toggle terminal 3 | 330 ohm resistor to LED 2 anode | Second position |
| 5 V adapter positive | Latching push button contact 1 | Supply into the latching switch |
| Latching contact 2 | 330 ohm resistor to LED 3 anode | On or off, it stays where you leave it |
| 5 V adapter positive | Momentary button, then 330 ohm to LED 4 anode | On only while pressed |
| All four LED cathodes | 5 V adapter negative | Common ground |
Code
Switches look simple, but different types behave very differently, and choosing the right one is part of good design. This gallery wires three types to LED circuits so you can see each one. The toggle switch here is single pole double throw, with a common terminal in the middle and two positions. With one LED on each side it acts as a changeover: one LED is always lit and flicking the lever swaps them, which is how a mode selector or a two-way light switch works. The latching push button is a push on, push off switch that holds its state mechanically, so it suits a power button, and the momentary button is on only while pressed, which suits a doorbell or the keys on a keyboard. Each LED has its own resistor to keep the current near 9 milliamps. Before you wire the latching button, test its contacts with the meter on its continuity setting, because the terminal layout is not the same on every maker's part. Write down what each switch does and think about the poles, throws and whether contacts are normally open or normally closed, because these words appear on every switch datasheet. Every switch in this build handles only a few milliamps at 5 volts, which is far below any rating, so no part will be stressed.
Build notes (no code needed for this build) Switch terms: a pole is a moving contact, a throw is a position it can connect to. This toggle is SPDT, single pole double throw: one common terminal and two positions. What each switch does here: Toggle (SPDT) : LED 1 is on in one position and LED 2 is on in the other, so exactly one is lit. It is a changeover switch, not just on and off. Latching button : press once and LED 3 stays on, press again and it goes off. It remembers its state mechanically. Momentary button : LED 4 is on only while you hold it down, and goes off as soon as you let go. Each LED has its own 330 ohm resistor, about 9 mA from 5 V, which is safe for any 5 mm LED. Fill in a table: switch, how many positions, does it stay when released, which LED is lit. Questions to answer: - Which switch would you use for a doorbell, a power switch and a mode selector? - What happens in the toggle's middle moment as you move the lever? (A good switch makes one contact before it breaks the other, or the reverse.) - What is the difference between normally open and normally closed contacts? Try the other pair of terminals on the latching button if it has them. Check the wiring of your latching button with a meter on the continuity setting first, as the pin layout varies between makers.
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Toggle in position one | LED 1 on, LED 2 off |
| Toggle in position two | LED 2 on, LED 1 off |
| Latching button pressed once | LED 3 stays on |
| Latching button pressed again | LED 3 off |
| Momentary button held | LED 4 on, off when released |
If it does not work
No LED lights
Check the LED direction and the supply.
Latching button has no effect
Check which pins are the contacts.
Both toggle LEDs light
The common terminal is on the wrong pin.
LED always on
The switch contacts are bridged on the breadboard.
LED dim
Check the 330 ohm resistor value.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the switch types gallery?
Toggle switch SPDT (MTS-102), Push button (latching, 7 mm panel), Tactile push button 6 mm, LED 5 mm red × 4, Resistor 330 Ω × 4, 5 V 2 A USB adapter, Jumper wires male to male (40 pcs, 20 cm) and Breadboard 830 Tie Points.
How long does the switch types gallery take to build?
About 60 minutes for a beginner maker, in 8 steps.
How do I know the switch types gallery works?
Toggle in position one: LED 1 on, LED 2 off. Toggle in position two: LED 2 on, LED 1 off. Latching button pressed once: LED 3 stays on.
No LED lights: what should I check?
Check the LED direction and the supply.
Latching button has no effect: what should I check?
Check which pins are the contacts.
Both toggle LEDs light: what should I check?
The common terminal is on the wrong pin.
LED always on: what should I check?
The switch contacts are bridged on the breadboard.
