You are on page 1of 3

Design and Implementation of Simple Tilt Direction Sensor Based on

Microcontroller
Gautham V,
Final Year EEE, Maha College of Engineering.
gautham.mce@gmail.com

Abstract – In order to monitor the tilt direction of an object a The device provides the following standard
microcontroller based tilt direction sensor is designed. In this
system any 8-bit Atmel microcontroller were used in order to features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines,
determine the direction using tilt algorithm and the tilt Watchdog timer, two data pointers, three 16-bit
parameter is displayed in LCD. The system is composed of
these components: MCU, tilt sensor (STDS), interface unit, timer/counters, a six-vector two-level interrupt architecture,
JHD162A LCD display, motor control and alarm circuit. The
MCU communicates with LCD via interface and displays the a full duplex serial port, on-chip oscillator, and clock circuit.
tilt direction. C language is used to design and compile the B. The A / D converter
software. In this prototype, a copycat tilting platform is
designed to study the dynamicity of the sensor. In the system, the ADC0809 [3] is used as the A/D
Keywords – MCU, JHD162A, Tilt Sensor converter. Its conversion time is 100us. There is a tri-state
flip-latch in the data outputs, which can be directly
I INTRODUCTION
connected with the MCU. There also exists an 8-channel
As we all know, the tilt direction is an important
analog switch, which can control 8-channel analog signals.
parameter in industrial automation. The existing tilt sensors
C. The display module
just sense the tilt but the direction cannot be identified. So to
This module is one of the most distinctive
overcome the direction problem a Simple Tilt Direction
functional modules in the whole system. The use of the
Sensor is designed.
intelligent color LCD makes the system more powerful and
In this paper, according to the needs of the
more convenient to use.
automation platform a simple tilt sensor is designed and
The JHD162A is used for LCD device, which has
implemented. The system will first detect the sensor output
many features such as its small size, low power
and decodes it based on the tilting algorithm and then the
consumption, no radiation, long life, shockproof and so on.
actuators are powered up based on the algorithm which
This LCD supports these display features: 16x2, ASCII
controls a tilting platform. Atmel AT89S52 an 8-bit
characters in the secondary library.
microcontroller is used to implement the tilting algorithm. It
is a two axis sensor which can give the tilt direction among
pitch and roll axis.
The direction of the tilt is displayed in the LCD and
the tilt platform is controlled accordingly to the sensor. Two
types of tilt sensor design are explained in this paper.

II SYSTEM STRUCTURE
The system is mainly composed of MCU, tilt
sensor, LCD display, tilt platform and some other peripheral
components. The structure of the figure is shown in the
Figure 1 Basic Structure of the system
figure 1.
A. The MCU
III HARDWARE DESIGN
This system has the MCU AT89S52 as its core. It
Hardware design and development is the basis and
is a low-power, high-performance CMOS 8-bit
the primary link for the development of the system. In the
microcontroller with 8K bytes of in-system programmable
system design and development process, hardware selection
Flash memory, which provides a highly-flexible and cost-
is of utmost importance. Hardware selection must be met for
effective solution to many embedded control applications.
the stability, compatibility, portability, high performance For a very small sensor, the spring can be a
and low power consumption, and other key elements of the tungsten filament. Tungsten is more flexible and it has good
automation system. electrical characteristics. A small bob can be attached to the
A. Design of Sensor Type-1 spring for better sensitivity. Normal springs can also be used
The type-1 sensor is made up of tungsten spring but they should be more flexible and should have good
arrangement. The typical arrangement of the sensor is electrical conductivity
shown in figure 2. B. Design of Sensor Type -2
This type of sensor is called as disc type sensor.
The typical arrangement of the sensor is shown in the figure
4.

Figure 2 Cross section of the sensor with top plate removed

The STDS has three parts Casing, Contacts and Figure 4 Arrangement of parallel disc sensor
Contactor. The casing is made up of wood or glass for The yellow disc is called as illuminator disk and
providing the insulation. The base plates are 5mm thick and the white disc is called as sensor disk. The red holes
they are connected by pillars are rods like shown in the represent the LDR, where each and every LDR is
diagram. illuminated by the above disk.
There are eight contact plates placed in a circle The two disks are enclosed in a light proof chamber
with reasonable gap between them. The eight contact plates with a small gap between them. A ball bearing is placed in
represent the eight directions (including the NE, SE, SW, that gap. So that if the sensor tilts the ball bearing would rest
NW combinations). These plates can be made up of in the lower position due to the gravity. Due to the
aluminium or copper blocks. All the eight plates are placed interference of light, the LDR changes it resistance which
in perfect intervals. can be sensed by the MCU and tilt algorithm is applied.

Figure 3 Top View of the type-1 sensor


Figure 5 Elevated view of the Type-2 sensor
C. Design of the MCU circuit V. IMPLEMENTATION AND EXPERIMENTS
The MCU is supplied with a clock pulse of On the basis of the design of the hard hardware and
11.99MHz using a crystal oscillator with 5V regulated and software, we have completed the following work step by
smoothed DC supply. The Sensor can be connected via an step: draw the circuit diagram with Protel or OrCAD, make
interface circuit which uses ADC0809 chip. the PCB, and components installation, jointing and
The tilting algorithm is programmed via Parallel debugging.
In-System Programmer. The LCD circuit’s decoding is done There happens some trouble during the installation
with the help of the software itself. and debugging. The calibration of the sensor can be done
with the help of high precision spirit level and null reading
IV SOFTWARE DESIGN method.
Considering the hardware as the system's body, This Tilt Sensor design has the following features:
software is the soul. In the system, software bears the small size, low cost and high reliability. It can be widely
mission that maintaining the stable operation of the sensor, used in the industrial field.
processing the collected data and turning the numeric values
to control signal as you want with certain algorithms and ACKNOWLEDGMENT
data structures. No one has enough good ideas for such a paper. So
Program flow diagram is shown in Figure 6. The here —thanks are due to the people who helped us turn it
whole program mainly includes these subroutines: channel into reality. And also a huge thanks to the Head of the
selection program, data acquisition program, data storage Department and faculty members who gave us this perfect
program, display program and alarming program. opportunity.
REFERENCES

[1] Piero Malcovati, Andrea Baschirotto, Arnaldo D'Amico


Sensors and Microsystems: AISEM 2009 Proceedings

[2] http://en.wikipedia.org/wiki/Tilt_sensor

[3] http://en.wikipedia.org/wiki/Mercury_switch

Figure 6 Program Flow Diagram

You might also like