top of page

Interfacing Tilt Sensor with Arduino UNO

Updated: May 8, 2022

A tilt sensor is a device that produces an electrical signal which is proportional to the angular movement. Orientation or Inclination can be detected using these sensors. They are sometimes referred as "mercury switches", "rolling ball sensors", "tilt switches", "inclinometer", "accelerometer". Tilt sensors are used in various fields like robotics, aviation, vehicle secular systems, portable computers.


Hardware List:


The components required to implement the circuit are as follows:


1.Arduino Board


Arduino Board
Arduino Board


Arduino is an open-source microcontroller board. Analog or digital signals from different sensors can be read by Arduino. An Arduino Integrated Development Environment (IDE) software is available to write and upload the code to the physical Arduino board.


2.Tilt Switch ball



Tilt Switch Ball
Tilt Switch Ball

A tilt Switch ball is a sensor that measures orientation or inclination. It is the component used to detect any inclination or orientation.


3.Bread Board


Breadboard


Bread Board is the basic component that is required to design any circuit. Electrical connections can be established between electronic components using a breadboard. It can be used to test the circuits before being soldered permanently.



4.Jumper Wires



Jumper Wires



Jumper wires are the wires that are used in connecting pins of Arduino to the breadboard. In this project male to male jumper wires are used that connects the female header pin of Arduino to the breadboard.



5.Resistor

220 ohms Resistor


Resistors are the components that limit the flow of current in an electronic circuit. The resistor used in this project is 220 ohms. The 4-band color of this resistor is Red, Red, Brown, Gold.


6. LEDs



LED



Light Emitting Diode (LED) is a semiconductor light source used as an indicator lamp. LED in this project indicates the tilt by Arduino.


Circuit:


The connections of the circuit are shown in the circuit diagram below.


Circuit Diagram


Jumper Wires are used to connect Arduino with Breadboard. Anode of LED is connected to pin 9, Cathode of LED is connected to ground (GND) through 220-ohm resistor. One end of the Tilt Sensor is connected to pin 8 and the other end connected to the ground (GND).


Code:



Working:


A tilt sensor is a switch that turns on or off when it oriented at a certain angle. In this project, a roller-based tilt switch is used. To open or close a switch in roller-based tilt switch one or two metal balls are used. The switch is closed when the sensor is upright. The metal ball will be in contact with the two terminals when the sensor is upright making the switch to be closed. When the sensor is tilted at an angle the connection between the terminals is lost as the metal ball moves and loses contact with the terminals making the switch open. The working of the Tilt sensor is illustrated in the following figure.



After all the circuit connections are made and before powering ON the circuit is as shown below.




After interfacing the Arduino and uploading the code and the circuit works as per the instructions given in the code and the orientation is detected and is indicated by LED.


The circuit below shows the output when the roller ball switch is upright.




The video below explains the circuit connections, working of the circuit, working of the code, and LED indication i.e., observing the output.


Video By :- Anupama Koley



See Also-

  1. Object Detection using Ultrasonic sensor.

  2. Arduino DIY Calculator using Keypad.



303 views0 comments

Related Posts

See All
bottom of page