Circuits / Getting started
Tilt switch alarm
Upright, the closed switch takes the resistor's current past the LED; tilted, it opens and the LED gets it

Tap a part to see its voltages and currents. It is a model, not a measurement.
What do you need?
- Resistor 330 ΩSearch on Amazon
- Tilt switch SW520DSearch on Amazon
- Red LEDSearch on Amazon
- Jumper wires × 3Search on Amazon
- BreadboardSearch on Amazon
How does a tilt switch light an LED?
Inside an SW-520D tilt switch, small metal balls roll in a tube. Upright, they rest on the two contacts and close them; tipped over, they roll away and the contact opens. The switch sits across the LED, not in series with it, and that is the trick. Upright, it is a short around the LED: the 5 V rail pushes about 14.7 mA through R1 (330 Ω) and the switch, and only about 0.15 V is left across the LED, far too little to light it. Tip it and that path disappears, so the current has to go through the LED: about 9.8 mA, now that the LED takes 1.8 V. Note the cost: at rest the circuit draws more current than when the alarm is on, so on a battery it would run down while nothing is happening. An alarm can avoid that by putting the switch on the input of a microcontroller that sleeps; an awake board like an UNO draws far more than this circuit.
Values from the Protoboard ISO simulation: a model, not a bench measurement.
Hear about the next circuit
One email when a new circuit is out, about twice a month. Nothing else.