Motion Detection: The Tilt Sensor
The Tilt Sensor Alarm is a simple yet effective security project. It uses a small mechanical switch to detect when an object is moved or tilted, making it ideal for protecting discrete items or creating an earthquake detector.

How It Works: The Mechanical Ball
Inside a standard tilt sensor (like the SW-520D), there is a small metal ball (or mercury in older models).
- Vertical: When the sensor is upright, the ball bridges two contacts, completing a circuit.
- Tilted: When tipped over 15-45 degrees, the ball moves away, breaking the circuit.
- The Trigger: The Arduino detects this digital "break" and triggers a buzzer or an LED instantly.
Components Needed
- Arduino Uno/Nano: The logic brain.
- SW-520D Tilt Sensor: The mechanical motion trigger.
- Piezo Buzzer: For the alarm sound.
- LED and 220-ohm Resistor: For visual alerts.

Practical Use
This type of sensor is commonly found in industrial equipment (to detect if a machine has fallen) and in children's toys to trigger sound effects when the toy is picked up. It's a great introduction to digital inputs and mechanical switch logic.