Tilt Sensor

It is a device used for knowing the planar movement. Although they are available in various types, their basic function remains the same. Their function is to detect the plane shift from horizontal to vertical and sent of a signal when it happens. There are modules which could sense even small plane shifts.

Working principle

A Tilt switch is similar to a normal switch except that the current flows through it only when it is tilted at a certain angle a blob of mercury is placed in a small glass tube with two metal contacts coming out. When the sensor is held upright, the mercury will make contact with both the terminals and the switch is closed.

When the sensor is tilted in either direction, the mercury goes off contact with the terminals and the switch is open.

Types of Tilt Switch:

Mercury switches

It use a drop of mercury in the tube. The sensor is positioned with respect to gravity forces so that the mercury moves away from the contacts when the switch is open. A change in the orientation of the sensor causes the bead to roll in the tube, touching both the contacts and closing the switch.


  1. Mercury tilt switches are their low cost and ease of use.
  2. Disadvantages include the toxic nature of the material and that they can perform only on/off functions.


 Ball-in-cage switches 

A small metal ball held in a housing unit with two or more contacts. When the housing is tilted the ball shorts the two electrical contacts, turning off the switch. Multiple contacts can be added to this device so that tilt direction can be determined.

An advantage of ball-in-cage switches is that this type of switch can have multiple contacts so that the direction of the tilt can be determined, In addition, ball-in-cage products are less toxic than mercury switches.

 Force balance sensors

 Gravity-referenced sensors often used in tilt meters. The sensor consists of a balance system in which a pendulous mass is suspended between two position detectors. When the mass tries to move in the direction of tilt due to the force of gravity, the position of the mass is detected by the position sensors and induces a current change.


Solid state sensors

Micro-electromechanical systems (MEMs). They are miniature devices with movable proof mass plates that are attached through a mechanical suspension system to a reference frame.


Electrolytic tilt sensors

Capable of producing extremely accurate pitch and roll measurements in a variety of applications. They function by using a glass or ceramic cavity filled with an electrically conductive fluid. As the sensor is rotated an imbalance is created between the electrodes. The imbalance of one of the electrodes is proportional to the angle of rotation.


 Capacitive tilt sensors 

Designed to take noncontact measurements of tilt and inclination. Capacitors can operate both as sensors and switches. Capacitive sensing is independent of the base material and relies on variation of capacitance when the geometry of the capacitor is changing.




  1. Contact Rating: 12V
  2. Contact Resistance: 10M ohm
  3. Capacitance: 5PF




  1. Model number: SW-520D
  2. Type: Ball
  3. Material: Housing and cover: PE heat shrinkable tubing/ Ball: Stainless steel, gold-plated / Guide pin: Brass, gold-plated / Copper tube: Brass
  4. Shape: Round
  5. color: Black / Gray


Link to datasheet:



  1. Always take sensor from sides only.
  2. Read the specifications before using any sensor.



  1. Do not make wrong connections like, power supply to gnd. It may damage the sensor.
  2. Do not put hands of circuit elements, the static energy from your hands can damage the sensor.
  3. Do not excerpt force on sensor.


Storing Instructions:

It must be handle with care, because static energy may damage the sensor.


  1. Switch signals simple, circuit is simple in design.
  2. Economic price.
  3. It is very cost effective. 


  1. Due to small tilt angle, it may give false switching.




Interfacing with Arduino:

Arduino Code:

const int ledPin = 13;

void setup()




digitalWrite(2, HIGH);



void loop()


int digitalVal = digitalRead(2);

if(HIGH == digitalVal)










  1. Robotic Arm
  2. Security System
  3. Construction Equipment




Q1. Does the number of balls in different types of tilt switch vary?

Ans. Yes, it will depends on the manufacturer.


Q2. How many balls are there in SW-520D?

Ans. It has two balls.