top of page

Interfacing Tilt Sensor with Arduino Uno

Updated: Feb 12

Tilt sensors are one of the main components used in the construction of buildings and structures. Tilt sensors measure the angle of tilt or inclination with respect to the vertical plane. In a structure that is being constructed, the tilt sensors are used to check if the plane does not have any imbalances.

So let us know more about the sensor and its basics by building a project with Arduino to observe the working with small inputs. We shall begin with the Hardware requirements.

Hardware Requirements

All the components required
All the components required
  1. Arduino UNO

Develop a stronger concept in Arduino through this article:- What is Arduino?

Arduino UNO
Arduino UNO

Arduino board is a microcontroller that is used to accept inputs from sensors connected and provide an output action on the desired device connected to it. The sensor inputs can be that from light-detecting sensors, flame sensors, temperature sensors, etc. The output function done by the devices can be turning on an LED, the sound of a buzzer, or a Serial monitor display.

Buy Arduino UNO from here.

2. Piezo Buzzer

Piezo Buzzer
Piezo Buzzer

It is an electrical component that generates a beep sound on receiving an input. It works on the principle of #piezo crystal.

Buy Piezo buzzer from here.

3. LED


Light Emitting Diode is a commonly used light source. It is a semiconductor that emits light when current flows through it.

Buy LED from here.

4. Tilt Sensor

Tilt Sensor
Tilt Sensor

A tilt sensor is a device used to measure the #inclination and give digital output based on the angle of tilt. The sensor gives digital HIGH value when there is a tilt in the surface it is attached to. The original value of the sensor will be 0 (LOW).

Buy Tilt Sensor from here.

5. Jumper Wires

Jumper Wires
Jumper Wires

These are the main components that are used to establish the connections between different devices of the circuit.

Buy Jumper Wires from here.

6. Breadboard


The breadboard is the basic component of any circuit building process. All components, be it input sensors or output display devices are connected to the power supply, microcontroller using wired connections through a breadboard. The holes in the breadboard are in series. There are various sizes like full-sized, half-sized, and mini breadboard.

Buy breadboard from here.

7. Resistor

220 Ohm Resistor
220 Ohm Resistor

Resistors are passive devices that restrict the flow of current or divide the voltage through the circuit. The input power passes through these resistors and then to the sensors to avoid damage.

Buy Resistors from here.

Circuit Connections

Circuit Diagram
Circuit Diagram

The circuit connections are as follows.

Firstly, the Ground pin and 5V power supply pin of the Arduino are connected to two separate lines of the breadboard.

The #Tilt sensor has three terminals. The Ground terminal of the sensor is connected to the ground line of the breadboard. The second terminal is connected to the Digital PIN 4 of the Arduino. The VCC terminal of the sensor is connected to the power supply line on the breadboard.

The #buzzer has two terminals. The negative terminal of the buzzer is connected to the ground line of the breadboard and the positive terminal of the buzzer is connected to the Digital PIN 3 of the Arduino board.

The LED has two terminals. The negative terminal o the #LED is connected to the ground line on the #breadboard. The positive terminal of the LED is connected to the Digital PIN 2 of the Arduino by connecting the 220 Ohm resistor in series with the LED.

The #Arduino is connected to the Computer system interfaced through the USB cable and the code is uploaded.

Code :

Note: Please change the file format to .ino(Arduino IDE) format before you upload the code to the Arduino board.


Circuit when Power supply is given
Circuit when Power supply is given

The Tilt sensor is the Input device for this circuit. The sensor output is given as input to the circuit in terms of 0 and 1. Usually, the value '0' is assigned to the sensor. When there is an inclination in the surface to which the sensor is attached, the sensor value goes HIGH.

The change in this value is given to the LED and Buzzer which glows and gives a tone respectively when there is a change in the output from the #sensor. The status of the LED and the buzzer come back to normal, i.e. becomes LOW when there is no inclination in the surface and when the Tilt sensor output doesn't give the value 1.

Video By - Kaushik Ram Selvaraj

A tilt sensor can also be used as a Tilt #switch in a few circuits that can trigger other devices and give output. For example, if we consider a Servo motor connected to a fan that is further connected to the circuit to maintain a temperature of a device and when there is a tilt in the surface where the particular device is kept, the tilt sensor acts as a switch and might trigger the motor and fan to switch ON.

This is just an example. There are various circuits in which the Tilt sensor can be used. Start exploring by #designing your own circuit.



176 views2 comments

Related Posts

See All
bottom of page