Skip to content
Electrical engineering · grades 6–12

How the switches in your house really work.

Two switches, one stairway light: a 3-way circuit. Three or more switches: add 4-ways. CometCraft shows exactly which screw each wire lands on and where the current flows, in 3D, then moves on to designing a printed circuit board.

⚠️ Safety first.
  • Turn off the breaker for the circuit, then check with a voltage tester that every wire in the box is dead. Test the tester on a circuit you know is live, before and after.
  • In many places, house wiring must be done by a licensed electrician or needs a permit and inspection. Check your local rules.
  • This is educational. Real installations must follow your local electrical code and the instructions that come with the switch.
Try it

Flip the switches.

Drag to orbit, pinch or scroll to zoom, and tap a switch on the wall. The diagram next to it is the same circuit. Use the menus to switch between single-pole, 3-way and 4-way, and between power at the switch and power at the light.

House wiring in 3D
The light is off
from breaker3-way switch 13-way switch 2LightBare groundBare groundBare groundLine (hot) to the common screw — live, no currentNeutralTraveler (black) — live, no currentTraveler (red)Neutral (spliced through)Switched hot from common to the lightNeutral to the lightUPCOMT1T2DOWNCOMT1T2HN
BlackRedWhiteRe-marked white (taped)Bare groundCurrent pathLive, no current

No complete path, so the light is off. 2 wires are still live up to the open switch.

Off is not safe. With the light off, the red-dashed wires are still connected to the breaker. Only turning off the breaker (and testing) makes them safe to touch.

House power is AC: the current reverses 60 times a second in North America (50 in many other countries). The moving dots show the path, not one fixed direction.

3-way switches

Two switches, one light.

Quick Short · The 3-way switch1/8 · ~56s
🪜Two switches, one light

A 3-way circuit turns one light on or off from two places, like the top and bottom of a stairway.

How a 3-way switch circuit is wired

Two 3-way switches control one light from two places. Here is what each screw and wire does, in the order an electrician thinks about them.

⚠️ Safety first.
  • Turn off the breaker for the circuit, then check with a voltage tester that every wire in the box is dead. Test the tester on a circuit you know is live, before and after.
  • In many places, house wiring must be done by a licensed electrician or needs a permit and inspection. Check your local rules.
  • This is educational. Real installations must follow your local electrical code and the instructions that come with the switch.
  1. Know the switch

    A 3-way switch has three screws plus a green ground screw. The common screw is the darker one (usually black or dark bronze). The two traveler screws are lighter (usually brass). The toggle has no ON or OFF printed on it, because either position can be on.

  2. Know the cables

    Between the two switches runs a 3-wire cable: black, red, white and a bare ground. In the common "power at the first switch" layout, the black and red are the two travelers and the white is the neutral, passing through.

  3. Line to the first common

    The hot (line) wire from the breaker lands on the common screw of switch 1. That is the only place the line goes.

  4. Travelers on the traveler screws

    At each switch, the two travelers go on the two traveler screws. Which traveler goes on which traveler screw does not matter; the circuit works either way.

  5. Second common feeds the light

    The common screw of switch 2 connects to the black wire going to the light. That wire is the switched hot, also called the load.

  6. Neutrals and grounds

    Neutrals (white) never go on a switch. In each box they are joined together with a wire connector and continue to the light. All the grounds are joined too, and connect to each switch’s green screw (and to the box if it is metal).

  7. The "power at the light" variation

    Sometimes the line comes into the light box first. Then a white wire may be used as a traveler or hot; it must be re-marked with black or red tape at both ends. Current codes usually also want a neutral in every switch box, so newer work often uses 4-wire cable.

  8. Test every combination

    With the breaker back on, try all four combinations: up-up, up-down, down-up, down-down. Every single flip, at either switch, should change the light.

  9. If it only works sometimes

    If the light works from one switch only, or only in some positions, the line or the load is almost always on a traveler screw instead of the common. Before removing an old switch, mark which wire is on its common screw.

Line to one common, load from the other common, travelers in between, neutrals never switched.

4-way switches

Three or more switches.

Quick Short · The 4-way switch1/8 · ~55s
🏠Three or more switches

To control one light from three or more places, put 4-way switches between the two 3-ways.

How a 4-way switch circuit is wired

For three or more switch locations, 4-way switches go between the two 3-ways and swap the travelers.

⚠️ Safety first.
  • Turn off the breaker for the circuit, then check with a voltage tester that every wire in the box is dead. Test the tester on a circuit you know is live, before and after.
  • In many places, house wiring must be done by a licensed electrician or needs a permit and inspection. Check your local rules.
  • This is educational. Real installations must follow your local electrical code and the instructions that come with the switch.
  1. Where 4-ways go

    A circuit always starts and ends with a 3-way switch. Every switch location in between is a 4-way. Three locations: two 3-ways and one 4-way. Four locations: two 3-ways and two 4-ways.

  2. Know the switch

    A 4-way switch has four screws plus a green ground screw. The screws come in two pairs, usually told apart by color (for example two brass and two darker). There is no common screw.

  3. Straight or crossed

    In one position the switch connects each incoming traveler straight to an outgoing traveler. In the other position it crosses them, so the travelers swap.

  4. One cable per pair

    The two travelers coming from one side land on one pair of screws. The two travelers going to the other side land on the other pair. Which screws form a pair varies by brand, so read the markings or the instructions.

  5. Neutral and ground pass through

    The white neutral is spliced straight through the 4-way box and never touches the switch. The grounds are joined and connected to the green screw.

  6. Why it works

    Crossing the travelers changes which traveler reaches the far 3-way. So flipping the 4-way has the same effect as flipping one of the 3-ways: the light changes.

  7. Test and troubleshoot

    Try every switch from every combination. If a 4-way only works in some positions, a traveler from one cable is probably on the wrong pair: the two wires from the same cable belong on the same pair.

3-way at each end, 4-ways in the middle, each cable’s travelers on one matching pair.

Circuit boards

Design your first PCB.

The parts are placed. Route the traces, then make all three checks pass.

PCB designer
Tap a pad to start, tap points to bend, tap a pad to finish. Esc cancels.
+BT1 9VSW1 onR1 470ΩAKD1 red12345678

Will it work?

There is no complete loop from + back to −, so no current can flow. Check for missing traces.

Design-rule check

  1. 1. BT1 pin + is not connected to anything yet.
  2. 2. BT1 pin - is not connected to anything yet.
  3. 3. SW1 pin 1 is not connected to anything yet.
  4. 4. SW1 pin 2 is not connected to anything yet.
  5. 5. R1 pin 1 is not connected to anything yet.
  6. 6. R1 pin 2 is not connected to anything yet.
  7. 7. D1 pin A is not connected to anything yet.
  8. 8. D1 pin K is not connected to anything yet.
  • Every pin is connected (no "not connected" warnings)
  • The design-rule check finds no errors
  • "Will it work?" says yes: LED current at or under 20 mA
Quick Short · Design your first PCB1/8 · ~56s
🟩Your first circuit board

A printed circuit board holds parts and connects them with thin copper paths instead of loose wires.

Design your first PCB

A battery, a switch, a resistor and an LED: the classic first board, from schematic to a finished, working circuit.

  1. Draw the schematic

    The schematic shows what connects to what, using symbols. Free tools such as KiCad run on Windows, macOS and Linux and handle every step in this guide. Draw: battery + → switch → resistor → LED anode; LED cathode → battery −.

  2. Pick footprints

    A footprint is the copper pattern a real part is soldered to. Through-hole parts use holes on a 0.1 inch (2.54 mm) grid. An LED’s two legs are 0.1 inch apart; a small resistor’s are often 0.4 inch apart.

  3. Place the parts

    Put the battery connector near an edge, the LED where it can be seen, and parts that connect close together. Short connections are easier to route.

  4. Route the traces

    Traces are the copper paths between pads. About 0.25 mm is a common width for small signals; power traces are often made wider. Traces on the same layer must not cross or touch unless they are meant to connect.

  5. Use both layers

    Most simple boards have copper on the top and bottom. When two traces need to cross, put one on the bottom layer. A via is a small plated hole that connects a trace from one layer to the other.

  6. Add the silkscreen

    The silkscreen is the printed white text. Label each part (R1, D1, SW1), mark the LED’s cathode (its flat side) and the + of the battery, so whoever solders the board puts parts in the right way.

  7. Run the design-rule check

    The DRC compares your board to the rules your board maker can build: minimum trace width, minimum gap between copper, and missing or accidental connections. Fix every error before ordering.

  8. Check the LED current

    An LED needs a resistor to limit its current. Resistor = (battery voltage − LED voltage) ÷ current. For 9 V, a 2 V red LED and 20 mA: (9 − 2) ÷ 0.020 = 350 Ω. Round up to a standard value like 390 Ω or 470 Ω.

  9. Export and order

    Export Gerber files (one per layer) and a drill file, open them in a Gerber viewer to double-check, then upload them to a board maker. They etch the copper, add the colored solder mask and print the silkscreen.

  10. Solder and test

    Solder the shortest parts first. Check the LED and battery direction before soldering. Then connect the battery and flip the switch.

Schematic → footprints → place → route → DRC → Gerbers → solder → test.

What is inside

Tools in the Electrical Lab.

3D house wiring

A room with real switch boxes, cables in the wall and a ceiling light. Flip any switch and watch the current path; orbit, zoom and turn on x-ray, live-wire and label overlays.

Wiring diagram

The same circuit as a 2D diagram with every screw named: common, travelers, neutral splices and grounds. Single-pole, 3-way and 4-way, with power at the switch or at the light.

PCB designer

Place a battery connector, switch, resistor, LED and an 8-pin chip on a 0.1 inch grid, route traces on two copper layers and add vias.

Design-rule check

Catches traces that are too thin or too close, crossings on one layer, unconnected pins, shorts and an LED with no resistor, with a plain explanation for each.

"Will it work?"

Runs Ohm’s law on the loop through the LED: I = (V − V LED) ÷ R. Flags too much current, a backwards LED, an open switch or an overheating resistor.

Quick Shorts + guides

Each topic starts with an animated explainer of under a minute, followed by a detailed step-by-step guide.

The lessons

9 lessons, from the breaker to the board.

Each lesson mixes short explanations, sourced facts, questions with worked answers and the interactive tools above. Every number a lesson asks for is checked by automated tests against the same code the tools run on.

  • Power in your house (from grade 6)
  • The single-pole switch (from grade 6)
  • The 3-way switch (from grade 6)
  • Wiring layouts in 3D (from grade 7)
  • The 4-way switch (from grade 7)
  • Safety around house wiring (from grade 6)
  • What is a PCB? (from grade 6)
  • Ohm’s law for LEDs (from grade 7)
  • Design your first PCB (from grade 7)

Open the Electrical Lab.

Sign in with an email link, open Learn, and start with Power in your house. No password, no card.