0

members

Easy Basics: Project 077a Tilt sensor

of Acoptex.com in UNO

Basics: Project 077a

Project name: Tilt sensor

Tags: Arduino, Arduino Uno, tilt sensor, inclinometer, tilt switch, rolling ball sensor

Attachments: sketch1 or sketch2

In this project, you needed these parts (Dear visitors. You can support our project buy clicking on the links of parts and buying them or donate us to keep this website alive. Thank you):

1.Arduino Uno R3 (you can also use the other version of Arduino)

2. Arduino IDE ( you can download it from here  )

4.Jumper cables F-M, M-M

5. Tilt sensor 1 pc

6. Breadboard 1 pc

7. LED 1 pc (any color)

8. Resistor 1 pc 220 Ohm (optional 1pc 10 KOhm)

General

We will learn how to connect tilt sensor to Arduino board and use it.

Understanding the tilt sensor

A tilt sensor is an instrument that is used for measuring the tilt in multiple axes of a reference plane. Tilt sensors measure the tilting position with reference to gravity and are used in numerous applications. They enable the easy detection of orientation or inclination. Similar to mercury switches, they may also be known as tilt switches or rolling ball sensors.

These instruments have become gradually more popular and are being adapted for increasing numbers of high end applications. For example, the sensor provides valuable information about both the vertical and horizontal inclination of an airplane, which helps the pilot to understand how to tackle obstacles during the flight. By knowing the current orientation of the plane, and the angle at which the plane is inclined to the earth's surface, stunt pilots, i.e. the Red Arrows, can put on a fascinating air show. Tilt sensors are an essential decision-making tool for the pilots.

A tilt sensor is an instrument that is used for measuring the tilt in multiple axes of a reference plane. Tilt sensors measure the tilting position with reference to gravity and are used in numerous applications. They enable the easy detection of orientation or inclination. Similar to mercury switches, they may also be known as tilt switches or rolling ball sensors.

These instruments have become gradually more popular and are being adapted for increasing numbers of high end applications. For example, the sensor provides valuable information about both the vertical and horizontal inclination of an airplane, which helps the pilot to understand how to tackle obstacles during the flight. By knowing the current orientation of the plane, and the angle at which the plane is inclined to the earth's surface, stunt pilots, i.e. the Red Arrows, can put on a fascinating air show. Tilt sensors are an essential decision-making tool for the pilots.

The functionality of tilt sensors is influenced by factors such as gravity, vibration, temperature, zero offset, linearity, cross-axis sensitivity, acceleration/deceleration, shock, clear line of sight between the user and the measured point, and calibration of tilt sensors.

How does it work?

A tilt sensor has a metallic ball that is designed to move the two pins of the instrument from the 'on' to the 'off' position, and vice versa, if the sensor reaches a pre-determined angle (inclination). 

The tilt sensor will give digital information to the Arduino, either a HIGH or a LOW signal.

The key specifications of tilt sensors include:

  • Number of axes: The number of axes is an important factor as it varies from application to application. In robotics, a dual axes tilt sensor is used. In video game controllers and joysticks, a three axes tilt sensor is required. In some smartphones, four axes sensors are used.
  • Resolution: The minimum inclination detected by the sensor.
  • Sensitivity: The sensor's ability to react to small changes. 
  • Measuring range: The range of inclination that can be handled by the sensor. Some sensors are capable of measurements of up to 10° while others can cover a range of up to 60°. 
  • Noise tolerance: Noise tends to cause harmonic distortions in the function of the sensor, resulting in output variation and a reduction of system efficiency. Manufacturer's guidelines regarding noise levels should be adhered to.
  • Vibration: Vibrations can disrupt the sensor's functionality, and hence vibration resistance measures are required, especially when the sensors are used in harsh conditions; for example in off-road vehicles or construction sites.

Features:

  • Compact and simple to use
  • High resolution and accuracy
  • Very cost-effective
  • Low power consumption
  • Can be read by industry standard dataloggers

Application:

  • To monitor the angle at which a mobile phone or tablet is held for the auto-rotate function
  • To detect the position of hand-held game systems and in game controllers
  • To indicate the roll of boats, vehicles and aircraft
  • To measure the angle at which a satellite antenna 'looks' toward a satellite
  • To estimate the height of a tree or building
  • To measure the steepness of a ski slope
  • To provide a warning system for the surface tilt angle of cryogenic liquids during transportation
  • To monitor laser levels and seismic activity

Signals and connections of the tilt sensor

If you connect the tilt sensor with 2 pins (GND and DO) you should use a 10 kOhm pull up resistor in your circuit. Or you can activate the arduino internal pull-up resistor for the digital pin to which your sensor is connected to and do not need to use pull up resistor 10 KOhm in your circuit. The data pin (DO) should be connected to your microcontroller digital pin. GND must be connected to GND.

Some tilt sensors have three pins: VCC (+), GND (-) and DO (S). VCC and GND are used to apply power and the data pin should be connected to your microcontroller digital pin.

Wiring

The following picture shows the needed connections with the Arduino Uno.

1. If you have 3 pins:

 

2. If you have 2 pins:

If you connect the sensor like that you should use a 10 kOhm pull up resistor in your circuit. Or you can activate the arduino internal pull-up resistor for the digital pin to which your sensor is connected to and do not need to use pull up resistor 10 KOhm in your circuit.

3. With internal pull up resistor

Step by Step instruction

  1. Do wiring.
  2. Open Arduino IDE.
  3. Plug your Adruino Uno board into your PC and select the correct board and com port
  4. Open  sketch1 or sketch2, compile and upload the the sketch to your Adruino Uno
  5. Open up serial monitor and set your baud to 115200 baud
  6. LED will be turned off if the sensor is upright, and will be turned on if the sensor is tilted.

Summary

We learnt how to connect tilt sensor to Arduino board and use it.

Libraries:

  • No libraries required

Sketch:

  • See attachment on the begining of this project


Other projects of Acoptex.com
Easy Raspberry basics: Project 26a Raspberry PI Zero W board - Enable SSH of Acoptex.com in Raspberry Pi Zero W 07-01-2019
Easy Raspberry basics: Project 24a Raspberry PI Zero W board - Apache web server of Acoptex.com in Raspberry Pi Zero W 05-01-2019

« Go back to category
Is this project fake? Report it!   
Recommend to a friend
Published at 01-11-2018
Viewed: 60 times