[ball-type tilt switch]

Arduino: tilt switch

A tilt switch is a simple switch that's closed when it's tilted one way, and open when you tilt it another way.

It's not as sensitive as the accelerometer in your phone, but it's a lot cheaper and easier to program.

The kind we're using have little metal balls inside -- when you tilt the switch, they roll away from the contacts.

[tilt switch wired to Arduino] The leads on these sensors are somewhat delicate, so be careful when you plug them into your breadboard! Try not to bend the leads where they come out of the switch.

Wiring one up is super simple. You don't need any additional resistors or anything ... the current either flows through it or it doesn't, depending on how it's tilted.

So you can wire it up to an Arduino and read it just like a push-button.

Credits: This page uses a circuit image cribbed from LadyAda's detailed tilt sensor tutorial, and that's where I bought the tilt sensors.