Sunteți pe pagina 1din 41

This project aims to develop a device that informs the control station if the vehicle in which the device

is fitted, met with a severe accident. This project is implemented using an accelerometer sensor, which works using MEMS technology along with GSM .

The device has a micro controller connected to an Accelerometer sensor, GSM module. The software that is embedded in the microcontroller controls the various operations of the device.The micro controller monitors the waveform from the accelerometer sensor..

The device monitors the vibrations due to impact from the sensors that are received as analog values. The user can feed the tolerance level of impact. If the level is above the tolerance level (in case of accident), the device sends alert messages (SMS)along with the location data control using the GSM module.The control station or hospital receives the message from the vehicle through the GSM module, which helps to initiate the appropriate action

HARDWARE REQUIREMENTS
Hardware requirements includes, An accelerometer sensor to detect the occurrence of the accident. A GSM modem to transmit the message to the rescuers handset. A microcontroller which controls the overall working of the device incorporating all these components.

OVERVIEW
The device monitors the vibrations due to impact from the sensors that are received as analog values. The response level of the systems developed using MEMS technology is very high say a few milliseconds.

The tolerance level of impact can be fed by the user to the system. If the level is above the tolerance level (in case of accidents),the device sends alert messages (SMS) along GSM module The control station or hospital receives the message from the vehicle through the GSM module which helps to initiate the appropriate action

We are witnessing several accidents and severe injuries and deaths taking place on road accidents in our day to day life. Most deaths due to accidents are caused by the unavailability of sufficient treatments and medicine at the right time. If the vehicle is got accident on a place where sufficient communication devices and resources are not available, the problem will become more serious .

If we are able to inform the accident at the right time to right persons we may save many valuable lives. There comes the importance of this project accident messaging system,which detects the accident and informs it to the right person with sufficient details about the place where accident occurred

ROM External

Program Counter
Bus interface Logic RAM External Display Registers.
Peripheral Controller External

ALU

i/ps

EXTERNAL INTRRUPTS

INTERRUPT CONTROL

ON-CHIP ROM FOR PROGRAM CODE

TIMER0

ON-CHIP RAM

TIMER1

CPU

OSC

BUS CONTROL

4 I/O PORTS

SERIAL PORT

P0

P1 P2 P3

TXD

RXD

Microprocessor :
CPU is stand-alone, RAM, ROM, I/O, timer are separate Designer can decide on the amount of ROM, RAM and I/O ports. Expensive

Versatility
General-purpose

Microcontroller:
CPU, RAM, ROM, I/O and timer are all on a single chip
Fix amount of on-chip ROM, RAM, I/O ports For applications in which cost, power and space are critical

Single-purpose

8051 is a 8-bit micro controller ,it is introduced by Intel corporation.8051 is the original member of the 8051 family. Other members of 8051 family 8052 and 8031 are the other family members of 8051. The following table gives comparison of 8051 family members Feature ROM(on-chip program space in bytes) 8051 4K 8052 8K 8031 0K

RAM(bytes)
Timers 1/O pins Serial Port Interrupt sources

128
2 32 1 6

256
3 32 1 8

128
2 32 1 6

8051 PIN description


P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 RST (RXD) P3.0 (TXD) P3.1 (INT0) P3.2 (INT1) P3.3 1 2 3 4 5 6 35 7 8 9 10 11 12 13 40 39 Vcc P0.0 (AD0) P0.1 (AD1) P0.2 (AD2) P0.3 (AD3) P0.4 (AD4) P0.5 (AD5)

38
37 36

8051

34 33 32 31 30 29 28 27 26 25 24 23 22 21

P0.6 (AD6)
P0.7 (AD7) EA/VPP ALE/PROG PSEN P2.7 (A15) P2.6 (A14) P2.5 (A13) P2.4 (A12) P2.3 (A11) P2.2 (A10) P2.1 (A9) P2.0 (A8)

(T0) P3.4
(T1) P3.5 (WR) P3.6 (RD) P3.7 XTAL2 XTAL1 GND

14
15 16 17 18 19 20

CPU can work only in binary,it can do so at a very high speed ,but its slow and tedious for humans to deal with 0s and 1s I.e with machine language. Assembly language were developed which provided mnemonics for the machine code instructions, plus other features which made programming faster and less prone to error. Assembler is a program which converts assembly language into machine level language Assembly language is referred to as a low level language because it deals directly with the internal structure of the CPU High level languages are translated into machine code by a program called a complier

- In the CPU ,registers are used to store information temporarily. - In 8051 there is only one data type : 8 bits.
D7 D6 D5 D4 D3 D2 D1 D0

Registers
A

Most significant bit

Least significant bit

R0

R1

R2

R3

R4

R5

R6

R7

8- bit Registers of the 8051 DPTR PC DPH DPL 16-bit register 16-bit register

PC(Program counter)

An assembly language program consists of series of assembly language instructions . An assembly language instruction consists of a mnemonic , optionally followed by one or more operands. The operands are the data items being manipulated , and the mnemonics are the commands to the CPU, telling it what to do with those items.

Example:
ORG 00h ; start at location 0 MOV R5,#25h ; load 25h into R5 MOV A, #0 ;load 0 into A ADD A,R5 ;add contents of R5 to A ; now A =A +R5 END ; end of the asm source file

The following diagram shows steps to create an executable assembly language program Editor Program
Myfile.asm

Assembler Program
Myfile.lst
Myfile.obj Other obj files

Linker Program
Myfile.abs

OH Program
Myfile.hex

Data Type 8051 micro controller has only one data type.It is of 8-bits,and the size of each register is also 8 bits. DB(Define byte) DB directive is used to define data, the numbers can be in decimal,binary,hex,or ASCII formats. Examples: DATA1: DB 28 ;Decimal(1C in hex) DATA2: DB 00110101B ;Binary (35 in hex) DATA3: DB 39h ;hex ORG 510H DATA4: DB My name is MIC ;ASCII characters

ORG(origin) The ORG directive is used to indicate the beginning of the address EQU(equate)
ORG 025h ;starts at the 25th address
This is used to define a constant without occupying a memory location.The EQU directive does not set aside storage for data item but associates a constant value with a data label so that when the label appears in the program,its constant value will be substituted for the label. COUNT EQU 25 MOV R3 , #COUNT ;R3 becomes 25 here This indicates to the assembler the end of the source(asm) file.Anything after the END directive is ignored by the assembler.

Following are the more widely used directives of the 8051

END Directive

The flag register in the 8051 is called the Program Status Word (PSW) register.It is used to indicate arithmetic conditions such as a carry but. PSW(Program status word) Register: The PSW register is an 8-bit register but only 6 bits of it are used by the 8051 . The two unused bits are user-definable flags. Four of the flags are conditional flags meaning that they indicate some conditions that resulted after an instruction was executed. These are CY,AC,P,OV. The bits PSW.3 and PSW.4 are designated as RS0 and RS1 ,and are used to change the bank registers. The PSW.5 and PSW.1 bits are general-purpose status flag bits and can be used by the programmer for any purpose

CY

AC

F0

RS1

RS0

OV

----

CY

PSW.7

Carry flag

AC
-RS1 RS0 OV

PSW.6
PSW.5 PSW.4 PSW.3 PSW.2

Auxiliary carry flag


Available to the user for general purpose Register bank selector bit 1 Register bank selector bit 0 Overflow flag

-P

PSW.1
PSW.0

User definable bit


Parity flag.Set/Cleared by hardware each instruction cycle to indicate an odd/even number of bits in the accumulator

RS1
0 0

RS0
0 1

Register Bank
0 1

Address
00H - 07H 08H 0FH

1
1

0
1

2
3

10H 17H
18H 1FH

Example: Show the status of the CY,AC and P flags after the addition of 38H and 2Fh in the following instructions MOV A,#38h ADD A,#2FH Solution: 38 00111000

2F
67

00101111
01100111

CY = 0 since there is no carry beyond D& bit AC = 1 Since there is no carry from D3 to the D4 bit P = 1 Since the accumulator has an odd number of 1s

Instruction ADD ADDC

CY X X

OV X X

AC X X

SUBB
MUL DIV DA RRC RLC SETB C CLR C CPL C ANL C,bit ANL C,/bit

X
0 0 X X X 1 0 X X X

X
X X

CJNE

RAM Allocation in 8051


7F Scratch pad RAM 30 2F 20 1F 18 17 10 0F 08 07 Register Bank 0 00 Bit Addressable RAM Register Bank 3 Register Bank 2 Register Bank 1(stack)

128 Bytes of Internal RAM


7F 30 2F 7F 7E 7D General purpose RAM 7C 7B 7A 79 78

Bit

. . . . .
23 1F 17 0F 07 1E 16 0E 06 1D 15 0D 05 1C 14 0C 04 Bank3 1B 13 0B 03 1A 12 0A 02 19 11 09 01 18 10 08 00

Addressable
Locations

22
21 20

1F 18 17 10 0F 08 07 00

Bank2
Bank1 Default register bank for R0-R7

Special function registers


99 SBUF SCON P1 E0 E7 E6 8D
Not bit addressable Not bit addressable Not bit addressable Not bit addressable E5 E4 E3 E2 E1 E0 ACC

Not bit addressable 9F 9E 9D 9C 9B 97 96 95 94 9A 99 91 98 90

FF F0 F7 F6 F5 F4
F3 F2 F1 F0

98
90

93 92

8C
8B 8A 89 88 87 84 82 81 80
87 86

TH1 TH0 TL1 TLO


89 88

D0 D7 D6 D5 D4

D3

D2 D1 D0

PSW

Not bit addressable 8F 8E 8D 8C 8B 8A Not bit addressable

TMOD TCON PCON DPH DPL SP

B8

-- -- --

BC BB BA B9 B8

IP

B0 B7
Not bit addressable Not bit addressable Not bit addressable

B6

B5

B4

B2

B1

B0 A8

P3 IE

A8 AF -- -- AC AB AA A9

A0 A7 A6 A5 A4 A3 A2 A1 A0

P2

85

84

83

82

81

80

P0

Push operation
MOV R6,#25h PUSH 6
0B 0B

MOV R1,#12h PUSH 1


0B

MOV R4,#0F3h PUSH 4


0B

0A

0A

0A

0A

F3 12 25

09 08

09 08

09

12

09 08

25

08

25

After PUSH 6 Start SP 07 SP 08

After PUSH 1 SP 09

After PUSH 4 SP 0A

POP 3 POP 5 POP 2

; POP stack into R3 ; POP stack into R5 ; POP stack into R2

After POP 3
0B

After POP 5
0B 0B

After POP 2

54
F9 76 6C
0B

0B

0A

0A

F9 76 6C SP
0A

0A

0A

09 08

09 08

09 08

76

09 08

6C
SP
09

6C SP
08

Start SP

LCD pin descriptions:


Pin
1 2

symbol
Vss Vcc .. ..

I/O

description

Ground +5V power supply

3
4 5

VEE
RS R/W

..
I I

Power supply to control contrast


RS=0 to select command register, RS=1 to select data register R/W=0 for write, R/W=1 for read

6
7 8 9

E
DBO DB1 DB2

I/O
I/O I/O I/O

Enable
The 8-bit data bus The 8-bit data bus The 8-bit data bus

10
11 12 13

DB3
DB4 DB5 DB6

I/O
I/O I/O I/O

The 8-bit data bus


The 8-bit data bus The 8-bit data bus The 8-bit data bus

14

DB7

I/O

The 8-bit data bus

LCD CONNECTION
8051
P 0.0 P 0.1 P 0.2 P 0.3 P 0.4 P 0.5 P 0.6 P 0.7

LCD
D0
Vcc Vee

10K
POT

RS D7

R/W

Vss

P 1.5 P 1.6 P 1.7

The Global System for Mobile Communications (GSM) is the most popular standard for Mobile phones in the world. GSM service is used by over 1.5 billion people across more than 210 countries and territories. The ubiquity of the GSM standard makes international roaming very common between mobile phone operators, enabling subscribers to use their phones in many parts of the world.

. GSM differs significantly from its predecessors in that both signaling and speech channels are digital, which means that it is considered a second generation (2G) mobile phone system. This fact has also meant that data communication was built into the system from very early on. GSM is an open standard which is currently developed by the 3GPP

INTRODUCTION TO MEMS TECHNOLOGY Micro-Electro-Mechanical Systems (MEMS) is the integration of mechanical elements, sensors, actuators, and electronics on a common silicon substrate through ASIET, Kalady Page 27 of 73 Dept. of Electronics and Communication Engg. Accident Alert System Micro fabrication technology..

While the electronics are fabricated using integrated circuit(IC) process sequences (e.g., CMOS, Bipolar, or BICMOS processes), the micromechanical components are fabricated using compatible "micromachining" processes that selectively etch away parts of the silicon wafer or add new structural layers to form the mechanical and electromechanical devices..

MEMS promises to revolutionize nearly every product category by bringing together siliconbased microelectronics with micromachining technology, making possible the realization of complete systems-on-a-chip. MEMS is an enabling technology allowing the development of smart products, augmenting the computational ability of microelectronics with the perception and control capabilities of micro sensors and micro actuators and expanding the space of possible designs and applications.

This accident messaging system is a very important accessory to sense the accidents at the time of occurrence. Now a day we can see that lot of life spoil in every accidents. By using our system we can start rescue operations within a few minutes. Thus we can save lot of lives. We may hope that future technologies will bring efficient and reliable operation of the device. We dedicate this project to the people who lost their lives in road accidents.

S-ar putea să vă placă și