You are on page 1of 23

Accelerometer Based Tilt

Sensor for Controlling Wheel


Chair
A Project Report

Technology Edition
by Shahzad Saeed
Table of content
Abstract ......................................................................................................................................................... 2
Introduction .................................................................................................................................................. 2
Embedded system ................................................................................................................................. 2
Photographs .................................................................................................................................................. 3
BLOCK DIAGRAM ........................................................................................................................................... 5
Literature Review .......................................................................................................................................... 5
PIC Microcontroller(16F877)................................................................................................................. 5
Features ................................................................................................................................................ 5
Temperature Sensor ..................................................................................................................................... 7
Tilt Sensor ..................................................................................................................................................... 8
BASIC BLOCK DIAGRAM ................................................................................................................................ 9
Relay............................................................................................................................................................ 10
DC MOTOR .................................................................................................................................................. 11
DC MOTOR FORWARD REVERSE BIASED CIRCUIT....................................................................................... 12
OVERALL CIRCUIT ........................................................................................................................................ 14
Battery......................................................................................................................................................... 14
Software ...................................................................................................................................................... 15
Program....................................................................................................................................................... 15
Applications and merits .............................................................................................................................. 20
Result .......................................................................................................................................................... 21
Conclusion ................................................................................................................................................... 21
Behind the Book .......................................................................................................................................... 22

TechnologyEdition.blogspot.com Page 1
Abstract
 The objective of the project is to control a certain object with the
help of the movement of the palm.

 The design has a microcontroller, temperature sensor,


accelerometer, driver circuits, LED Display along with motor and
wheel chair

 The movement represents different operations such as forward,


reverse, left and right.

 By using this mechanism we move a wheel chair here by the


movement of the palm.

Introduction
 The machine is loaded with several units such as microcontroller,
TILT Sensor, Temperature Sensor, relay and driver circuits.

 Microcontroller is the heart of the device.

 The microcontroller used is PIC 16F877 microcontroller.

 It is a flash type reprogrammable memory.

 It also provides sufficient power to inbuilt peripheral devices.

Embedded system
 The system used here is embedded systems.

TechnologyEdition.blogspot.com Page 2
 The application of this system makes user friendly cheaper
solutions and enables to add features otherwise impossible to
provide other means.

 The software used for the embedded system is called firmware.

 The languages used can be C or C++.

They need no or minimal inputs from the user, hence the


interface like keyboard may be minimal

Photographs

Figure 1: Wheel Chair using Tilt Sensor

TechnologyEdition.blogspot.com Page 3
Figure 2: Tilt Sensor

TechnologyEdition.blogspot.com Page 4
BLOCK DIAGRAM

Literature Review
PIC Microcontroller(16F877)
 The PIC microcontroller is the first RISC based microcontroller
fabricated in CMOS that uses separate bus for the instruction and
data allowing simultaneous access of program and data memory.

Features
 All single cycle instructions for program branches which are two
cycle.

TechnologyEdition.blogspot.com Page 5
 Eight level deep hardware stack.

Direct, Indirect and relative addressing modes

 Programmable code protection

 Power saving sleeping mode

 Low power, High Speed CMOS

 Only single 5V source needed dor programming capability.

 Wide operating voltage.

TechnologyEdition.blogspot.com Page 6
Temperature Sensor
 The thermistor is a type of resistor varies with temperature. The
word when split gives thermal and resistor.

 The thermistors are unlike the Resistance Temperature Detectors


because the material used are pure metals rather than ceramic or
polymers.

 Moreover the temperature response is also different because


RTD’s are inefficient at low temperatures.

 The relationship between resistance and temperature is linear.

ΔR = kΔT

Where

ΔR = change in resistance

ΔT = change in temperature

k = first-order temperature coefficient of


resistance.

Based on this the thermistors are divided in two types.

 Positive temperature coefficient(PTC) thermistor

 Negative temperature coefficient(NTC) thermistor

In PTC the resistance decreases with increasing temperature and vice-


versa in NTC.

TechnologyEdition.blogspot.com Page 7
Tilt Sensor
 A tilt sensor can measure the tilting in often two axes of a
reference.

 The tilt angle is measured with reference to the earths ground


plane, which uses an Accelerometer.

 Accelerometer measures proper acceleration related to freefall.

 When held fixed in a gravitational field by, for example, applying a


ground reaction force or an equivalent upward thrust, the

TechnologyEdition.blogspot.com Page 8
reference for an accelerometer accelerates upwards with respect
to a free-falling reference frame.

 The acceleration is quantified in SI units meters per second per


second(m/s²)

 Conceptually, an accelerometer behaves as a damped mass on a


spring. When the accelerometer experiences an acceleration, the
mass is displaced to the point the spring is able to accelerate the
mass at the same rate ad the casing.

BASIC BLOCK DIAGRAM

TechnologyEdition.blogspot.com Page 9
Relay
 A relay is an electrical switch and opens closes under the control
of another circuit. The relay actually uses an electromagnet to
open or close.

 When a current flows through the coil, the resulting magnetic


field attracts an armature that is mechanically linked to a moving
contact which leads to the switching ON and OFF the device.

 Relays allow one circuit to switch a second circuit which can be


completely separate from the first.

TechnologyEdition.blogspot.com Page 10
DC MOTOR
 The motor is used here to rotate the wheels. Actually a set of 2 DC
motors are used here which can move in both forward and
reverse directions.

 The basic mechanism is based on simple electromagnetism.

 Here motors with cores are used because coreless motors are
prone to excess heating.

TechnologyEdition.blogspot.com Page 11
DC MOTOR FORWARD REVERSE BIASED CIRCUIT

TechnologyEdition.blogspot.com Page 12
Figure 3: DC Motor

TechnologyEdition.blogspot.com Page 13
OVERALL CIRCUIT

Battery
 The battery used here is a 12V re-chargeable battery.

 The main use of the battery is to provide electric current for the
functioning of the whole circuit including the DC motors.

 These give a continuous flow in the working of the circuit as well


as the movement of the wheel chair.

TechnologyEdition.blogspot.com Page 14
Software
 The software used here is MICROSIM.

 It is used to program the PIC microcontroller which controls the


functioning of the circuit.

 The compiler used here is KEIL COMPILER. This is used to solve the
problems facing embedded software developers.

 It helps to understand hardware configurations and avoids time


wasted on setup problems.

Program
#include <pic.h>

#include "pic_acce.h"

#include "pic_lcd8.h"

#include "pic_adc.h"

unsigned char x,y,z,h,value;

bit val1,val2,val3,x1,y1,z1;

#define rel1 RB0

#define rel2 RB1

#define rel3 RB2#define rel4 RB3

void main()

{
TechnologyEdition.blogspot.com Page 15
rel1=rel2=rel3=rel4=1;

TRISD=0x00;

TRISC=0xc0;

TRISB=0x00;

ADCON1=0x09;

TRISA=0xff;

Lcd8_Init();

Acc_Init();

Lcd8_Display(0x80,"Acc_meter Based ",16);

Lcd8_Display(0xc0," Tilt sensor ",16);

Delay(65000);Delay(65000);

Lcd8_Display(0x80," X: 000 Y: 000 ",16);

Lcd8_Display(0xc0," Z: 000 T: ",16);

Delay(65000);Delay(65000);

while(1)

value=Adc8_Cha(0);

Lcd8_Decimal3(0xca,value);

Acc_Write(0x07,0x01);Delay(2000)

TechnologyEdition.blogspot.com Page 16
x=Acc_Read(0x00);Delay(1000);

TRISC=0xc0;

if(x>30)

Lcd8_Write(0x83,'-');

x= 63-x;

x1=1;

else

Lcd8_Write(0x83,'+');

x1=0;

Lcd8_Decimal3(0x84,x);

y=Acc_Read(0x01);Delay(1000);

if(y>30)

Lcd8_Write(0x8b,'-');

y=63-y;

y1=1;

TechnologyEdition.blogspot.com Page 17
}

else

Lcd8_Write(0x8b,'+');

y1=0;

Lcd8_Decimal3(0x8c,y);

z=Acc_Read(0x02);Delay(1000);

if(z>30)

Lcd8_Write(0xc3,'-');

z=63-z;

z1=1;

} else

Lcd8_Write(0xc3,'+');

z1=0;

Lcd8_Decimal3(0xc4,z);

if(x1==1&&x>=8&&z<20)

TechnologyEdition.blogspot.com Page 18
{

rel1=rel2=rel3=rel4=1;

rel1=rel3=0;

Lcd8_Write(0xce,'R');

else if(x1==0&&x>=8&&z<20)

rel1=rel2=rel3=rel4=1;

rel2=rel4=0;

Lcd8_Write(0xce,'L');

} else if(y1==1&&y>=7&&z<15)

rel1=rel2=rel3=rel4=1;

rel1=rel4=0;

Lcd8_Write(0xce,'F');

else if(y1==0&&y>=8&&z<15)

rel1=rel2=rel3=rel4=1;

rel2=rel3=0;

TechnologyEdition.blogspot.com Page 19
Lcd8_Write(0xce,'r');

else

rel1=rel2=rel3=rel4=1;

Lcd8_Write(0xce,'S');

Applications and merits


 MERITS

1] Low cost to design the circuit

2] Maintenances of the circuit is good

3] Reliability

4] Compatibility

5] Easy convenience to handle

 APPLICATIONS

This project is very useful for physically challenged.

TechnologyEdition.blogspot.com Page 20
Result
A working model of Accelerometer based Tilt sensor for the movement
of the wheel chair was prepared with the help of a PIC microcontroller,
two DC motors and the necessary equipments which resulted in the
proper movement of the wheel chair in all the four directions.

Conclusion
Tilt sensors have a secure place in the movement of equipment based
on actions done. The system can be made free from challenges and will
be cost effective in the near future.

TechnologyEdition.blogspot.com Page 21
Behind the Book
Thank you for reading the book. The book
you’ve now read is the part of series ‘low cost
mini-project edition’ of
technologyedition.blogspot.com.

Click here to get more on ‘How to make mini-


projects’.

Download now:
How to make an electronic stethoscope?
How to make a burglar alarm?
Meet me:
http://TechnologyEdition.blogspot.com
Follow me:
http://twitter.com/@shahzadsaeed
TechnologyEdition.blogspot.com Page 22

You might also like