part · Level 1 · Light · input

How a slide switch works

Slide switch — Opens or closes the loop. On means the loop is complete.

What it is

A switch is the simplest part in electronics: a piece of metal that either bridges a gap or does not. Closed, the loop is complete and current flows. Open, the loop is broken and everything stops — no matter how much voltage the battery has.

Your slide switch has three legs. The middle leg is the common: the slider always connects it to one of the two outer legs. Push the knob one way, middle joins the left leg; push it the other way, middle joins the right leg. Engineers call this SPDT — single pole, double throw — one input, two possible outputs.

For an on/off switch you use only two legs: the middle and either outer one. The third leg just sits there. For a "choose A or B" switch you use all three.

How it works

A switch does not use up any voltage or current — it is either a wire (a few milliohms, practically 0 Ω) or an air gap (billions of ohms, practically infinite). That makes the maths trivial and the position flexible: anywhere in the loop breaks the same loop.

Take First Light: battery + → switch → 220 Ω → red LED → battery −. Switch closed: the loop is 220 Ω plus the LED, so current is (4.5 − 2.0) ÷ 220 ≈ 11 mA. Switch open: the resistance is effectively infinite, so 0 mA, and the pack loses nothing while it waits.

The three-leg version becomes useful in the Traffic Light: the common leg on + and one LED on each outer leg means only one lane can be lit at a time — the slider picks. Either way the current through whichever lane is chosen is still 11 mA with its own 220 Ω.

Switches only pass a limited current before their contacts wear — small slide switches are typically rated around 0.3 A at low voltage — but your projects draw 30 mA at most, so that is never a problem here.

The numbers

Legs3 — middle = common; outer = the two positions
TypeSPDT — single pole, double throw
Resistance closed≈ 0 Ω
Resistance open — no current, no drain
Contact rating (typical)≈ 0.3 A — far above any project here

See it working

The First Light circuit, simulated live. Open it on the Workbench to change anything.

simulating…

🔧 Open this circuit in the Workbench →

Mistakes everyone makes

  • Using the two outer legs. They are never connected to each other, so the switch is always "off". Fix: middle leg plus one outer leg.
  • Battery + on one outer leg and − on the other. Sliding to the middle position is fine, but the common now shorts the pack in one position if it is wired to a rail. Fix: put the common on the side that feeds the circuit, not directly across the battery.
  • Legs too far apart for the breadboard. Some switches are 2 mm pitch. Fix: bend the legs gently or use short jumpers from each pin.
  • "It only works in one position". That is correct — it is a switch. If you wanted both positions to do something, wire both outer legs.

Questions people ask

Which pins of a slide switch do I use?
The middle pin (common) and one of the outer pins. The slider connects the middle to whichever outer pin it is pushed toward.
Does it matter where the switch goes in the circuit?
No. A loop broken anywhere is broken everywhere, so the switch can sit before or after the LED with exactly the same result.
What does SPDT mean?
Single pole, double throw: one input that can be connected to either of two outputs. Using just one output makes it a plain on/off switch.

Projects that use this part

  • 🔦 First Light — Build a real flashlight circuit and learn why every circuit is a loop. L1 · 15 min
  • 🎈 Twin Reds — Two red LEDs on one loop — same current, half the leftover push, and a lesson in how voltages stack when parts sit end to end. L1 · 15 min
  • 🚦 Tabletop Traffic Light — Three LEDs on three parallel lanes, all lit by one switch — build a tabletop traffic light and discover parallel circuits. L1 · 25 min
  • 🚪 Do Not Disturb Sign — A green "chill" LED plus a switched red "leave me alone" LED — two lanes on one battery, and a switch that only touches one of them. L1 · 20 min
  • 🤝 Handhold Chain — Three switches in a line — the LED only lights when all three are closed at once. AND, one step past The Vault. L1 · 15 min
  • 🚪 Two-Door Signal — Two slide switches in parallel, one shared LED — either switch alone lights the lamp. The OR gate, at Level 1. L1 · 15 min
  • 🚨 Signal Light — A slide switch and a push button in parallel — the slide is the steady beacon, the button is the extra flash. Either lights the lamp. L1 · 15 min
  • 🛟 Escape Hatch — The Vault with a big red emergency button wired around both locks — turn BOTH keys, or hit the button, and the light comes on. L1 · 20 min
  • 📻 Dial-a-Buzz — Dial-a-Brightness for sound — one knob rides the buzzer between full alarm and library silence, with no button in the way. L2 · 15 min
  • 🚨 Arm & Ring — A doorbell that ignores you unless a hidden slide switch is armed first — series-AND with sound, plus an 'armed' LED that shows the state. L2 · 20 min
  • 🔔 Twin Bells — One doorbell button rings two buzzers in parallel — one in your room, one in the kitchen — with a slide switch that mutes just the bedroom bell at night. L2 · 20 min
  • 🔕 Silent Alarm — Three panic buttons wired in parallel, all inside an armed lane — any one of them fires the buzzer, and a small LED tells you the alarm is watching. L2 · 25 min
  • 🪤 Trip Wire Alarm — A thin wire across a doorway holds the alarm silent. Break the wire and the buzzer screams — until you connect it back. L3 · 25 min
  • 🏝️ Vacation Nightlight — The Automatic Night Light with a manual override — flip the slide switch off and the lamp stays dark even in a pitch-black room. L3 · 25 min
  • 📚 Study Lamp — The Automatic Night Light with a force-on override — flip the slide switch and the lamp stays lit even in daylight, ignoring the sensor. L3 · 25 min
  • 🌀 First Spin — Your first motor. A switch, a coil, and a diode that catches the voltage kick when the current stops. L4 · 15 min
  • 🕸️ Trip Wire Fan — Trip Wire Alarm's brain wearing a motor. The wire is intact — the fan is silent. Snap it — the fan spins as the alarm. L4 · 25 min

verified against: SparkFun — Switch Basics · SparkFun — What is a Circuit?