Analog tilt sensors

An acceleromteter measures acceleration, including the constant 32 ft/s2 acceleration due to the earth's gravity. You'll have to do a bit of math, but a three axis accelerometer will tell you lots about orientation of the device.

-j