Tilt Switch
A tilt switch is a simple orientation sensor. In this kit it is a ball-type switch with a metal ball inside.
Part images
What it is
A tilt switch is a simple orientation sensor. In this kit it is a ball-type switch with a metal ball inside.
How students use it
Students use it for shake/tilt detection, orientation alarms, countdown games, and simple movement-triggered inputs.
Pins and power
Two switch leads. The circuit opens or closes depending on angle.
Passive switch. Read it as a 3.3V-safe digital input with a pull-up or pull-down.
SunFounder explains that tilting lets the metal ball roll onto the contacts and complete the circuit; returning it away from the contacts opens the circuit.
Voltage and safety
Keep it on a Pico-safe 3.3V input circuit. Do not use it to switch high-current loads.
Treat it as a signal switch only. Power off before moving it on the breadboard.
Module internals
Metal ball, internal contacts, sealed switch body, and two leads.
Datasheet notes
SunFounder links an SW-520D tilt switch datasheet. Use the exact switch marking before relying on mechanical angle or current ratings.
Common libraries
No special library is needed. Use machine.Pin and debounce or sample over time.
Common mistakes
Expecting an exact angle threshold, ignoring contact bounce, mounting it in the wrong orientation, and leaving the GPIO input floating.