The tilt sensor is used to determine the position in space.
Principle of operation
The tilt sensor is a cylinder with a conductive ball rolling inside and equipped with two conductive elements (contacts) at the bottom. When the sensor is fully upright, the ball falls to the bottom of the cylinder and closes the contacts. When the sensor is tilted, the ball does not touch the contacts, the circuit opens and current does not flow. In this way, the tilt sensor works like a switch that turns on and off depending on the vertical orientation. It will transmit a digital signal to an Arduino device: HIGH or LOW.