Tilt sensor
A tilt sensor is just a small metal can with two internal contacts and a ball-bearing. As the orientation of the sensor is changes the ball-bearing is either in contact giving an ON reading, or not in contact giving an OFF reading - simple really, and very cheap!
Tilt sensors are used in a wide variety of devices: tamper switches, pedometers and shock detection are common applications. Tamper switches are often used to indicate that an object that should be in a fixed position has been moved.