Sensor-Arduino Tilt Switch
A mercury tilt switch is a switch which opens and closes an electrical circuit when it is tilted at certain angles. When it is tilted a small amount of the liquid metal mercury makes contact with metal electrodes to close the circuit.
Mercury switches have one or more sets of electrical contacts in a sealed glass envelope which contains a bead of mercury. The envelope may also contain air, an inert gas, or a vacuum. Gravity is constantly pulling the drop of mercury to the lowest point in the envelope. When the switch is tilted in the appropriate direction, the mercury touches a set of contacts, thus completing the electrical circuit through those contacts. Tilting the switch the opposite direction causes the mercury to move away from that set of contacts, thus breaking that circuit. The switch may contain multiple sets of contacts, closing different sets at different angles, allowing, for example, single-pole, double-throw (SPDT) operation.