It sounds like you are looking for an accelerometer. When still, the accelerometer gives you X, Y, and Z components of the force of gravity. So when perfectly level, Z will be 1g (well.... -1g since it's pointing down) and X/Y should be 0g. When tilted, the X/Y components will increase.

If this sounds like it would work for your application then Googling for accelerometers to work with Arduino will lead to lots of information.