Vous êtes sur la page 1sur 28

COLLISION DETECTION AND WARNING SYSTEM

USING IR SENSOR
A PROJECT REPORT
Submitted in partial fulfillment of the Requirements
For the degree of

BACHELOR OF ENGINEERING
IN
ELECTRONICS AND TELECOMMUNICATION
Submitted by

Achala Shukla
Ankit Francis
Bobby Nelson
Sonika Singh
Under Guidance of
Prof. Lakhwinder Kaur

Department of Electronics & Telecommunication Engineering

Rungta College of Engineering & Technology, Bhilai (India)


(Recognized by A.I.C.T.E New Delhi, Accredited by N.B.A., New Delhi)
Nov-Dec 2013

DEPARTMENT OF ELECTRONICS &


TELECOMMUNICATION
Rungta College of Engineering & Technology,
Bhilai(India)
Date :

CERTIFICATE
Certified that the contents of the project report entitled, "Collision Detection
& Warning system Using IR sensor" is a bonafide work carried out under
my guidance by Achala Shukla, Ankit Francis, Bobby Nelson, Sonika Singh
in partial fulfillment of the requirements for the degree of Bachelor of
Engineering in Electronics & Telecommunication.

SIGNATURE:

SIGNATURE:

Prof.L.P. Bhaiya
H.O.D

SIGNATURE:
Prof. Lakhwinder Kaur

External

Project Guide

ACKNOWLEDGEMENT

We are pleased to express our sincere gratitude to our project guide Prof.
Lakhwinder Kaur for her noble support and guidance in the development of the project
and our project incharge Prof. Nitin Naiyar for his timely monitoring and for mentoring
throuhout the various stages of project development.
We wish to express our special thanks to Prof. Lalit Kumar P. Bhaiya,
Associate Professor and Head, Department of Electronics and Telecommunication
Engineering, for all his active co-operation and kind consideration throughout the period.
We gratefully acknowledge Dr. S. M. Prasanna Kumar, Director, RCET,
Bhilai and Prof. S. B. Burje, Associate Professor and Vice-Principal, RCET, Bhilai and
all management personalities who have helped me indirectly.
We express cordial thanks to Mr. Arun Kumar and all helping faculties for their
valuable guidance, suggestion and help during the development of the project.
Finally, we wish to express our deepest sense of gratitude to our Families as their
wishes have always inspired us.

-Group Members
Achala Shukla
Ankit Francis
Bobby Nelson
Sonika Singh

ABSTRACT

The aim of the project has been to develop an embedded system capable
of detecting any obstacle when it comes within the pre-determined range of the system.
Furthermore, the system has to alert the user about the obstacle ahead of the system.
There are many devices that fit the criteria for the detection of a remote
object. In our project, the Infrared detection mechanism is used. An IR transmitter is used
for transmitting the said IR rays and these radiations are reflected back from the far off
obstacle to be detected by an IR sensing module. The system shall have a Controller that
can monitor the operation of these sensors and then alert the user by any audio or visual
aid about the impending collision so that user may then abort it or use this information as
required.

CONTENTS
CHAPTER 1
CHAPTER 2

INTRODUCTION
THEORY

7
9

2.1 Project Requirements


2.2 Power Supply Circuit & its working
2.3 Project Circuit Description
2.4 Component Details
2.5 PCB Layouts
CHAPTER 3

CODE DEVELOPMENT

24

3.1 Flow-chart of the process


3.2 Assembly Code

CHAPTER 4

CONCLUSION

27

CHAPTER 5

FUTURE EXPANSION

28

LIST OF TABLES
S.No. Table no.
1
2

2.1
2.2

Table name

Page no.

Absolute maximum ratings


Electrical & Optical characteristics

20
20

LIST OF FIGURES
S.No. Figure
no.
1
2
3
4
5
6
7
8
9
10
11
12
13

2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
2.10
2.11
2.11
3.1

Figure name

Page
no.

Power supply
Project Circuit diagram
8051 Internal Architecture
Microcontroller block diagram
Schematic & Features
Pin Diagram
TSOP31238
Block diagram of TSOP
Application Schematic
Working of TSOP
Artwork PCB layout
Real World PCB layout
Process Flow Chart

11
12
14
15
16
18
19
20
20
21
22
22
25

CHAPTER 1
INTRODUCTION

AIM & SCOPE OF PROJECT:

The aim of the project has been to develop an embedded system capable
of detecting any obstacle when it comes within the pre-determined range of the system.
Furthermore, the system has to alert the user about the obstacle ahead of the system.
There are many devices that fit the criteria for the detection of a remote
object. In our project, the Infrared detection mechanism is used. An IR transmitter is used
for transmitting the said IR rays and these radiations are reflected back from the far off
obstacle to be detected by an IR sensing module. The system shall have a Controller that
can monitor the operation of these sensors and then alert the user by any audio or visual
aid about the impending collision so that user may then abort it or use this information as
required.

CHAPTER-2
THEORY

PROJECT REQUIREMENTS:
1

Power supply Unit:


1. 12V 500mA Transformer
2. Diodes
3. Capacitors (220uf, 10uf, 100uf)
4. Resistor (47ohms)
5. 7805 Voltage Regulator
6. Zero PCB board
7. Wires..etc
2 PCB board
3 Microcontroller (AT89C51)
4 40 pin IC base
5 Crystal (11.0592MHz)
6 IR transmitter LED
7 IR sensor (TSOP31238)
8 Potentiometer(500ohms)
9 Capacitors (33pf,10uf)
10 Resistors(8.2k,330ohms,220ohms)
11 Buzzer
12 Red LED

POWER SUPPLY CIRCUIT & ITS WORKING

Figure 2.1: Power supply Circuit

The cicuit shown above is used for fulfilling the power requirements of the
project. Its working is as follows:
1. The 250V source signal at mains is stepped down by a transfomer to 12V source.
2. The full wave rectifier bridge circuit of diodes then converts into a positive on;y
waveform.
3. The CRC filter shown then filters out the ac components to an extent from the
supply.
4. The regulator then regulates a contant 5V supply at its output.

The circuit used above practically provides a 5.1V dc voltage as seen during final
use.

PROJECT CIRCUIT

Figure 2.2: Project circuit diagram

COMPONENT DETAILS
8051 Microcontroller

A micro controller is an integrated circuit or a chip with a processor and other support
devices like program memory, data memory, I/O ports, serial communication interface
etc integrated together. Unlike a microprocessor (ex: Intel 8085), a microcontroller does
not require any external interfacing of support devices. Intel 8051 is the most popular
microcontroller ever produced in the world market.
Intel first produced a microcontroller in 1976 under the name MCS-48, which was an 8
bit microcontroller. Later in 1980 they released a further improved version (which is also
8 bit), under the name MCS-51. The most popular microcontroller 8051 belongs to the
MCS-51 family of microcontrollers by Intel. Following the success of 8051, many other
semiconductor manufacturers released microcontrollers under their own brand name but
using the MCS-51 core. Global companies and giants in semiconductor industry like
Microchip, Zilog, Atmel, Philips, Siemens released products under their brand name.
The specialty was that all these devices could be programmed using the same MCS-51
instruction sets. They basically differed in support device configurations like improved
memory, presence of an ADC or DAC etc. Intel then released its first 16 bit
microcontroller in 1982, under name MCS-96
8051 Microcontroller Architecture
Its possible to explain microcontroller architecture to a great detail, but we are limiting
scope of this article to internal architecture, pin configuration, program memory
and data memory organization. The basic architecture remains same for the MCS51 family. In general all microcontrollers in MCS- 51 family are represented by
XX51, where XX can take values like 80, 89 etc.
1. Atmel 8051s architecture provides the following useful functions :2. 8-bit ALU, Accumulator and 8-bit Registers; hence it is an 8-bit microcontroller
3. CPU, RAM, ROM, I/O, interrupt logic, timer, etc. in a single package
4. 8-bit data bus It can access 8 bits of data in one operation
5. 16-bit address bus It can access 216 memory locations 64 KB (65536
locations) each of RAM and ROM
6. On-chip RAM 128 bytes (data memory)
7. On-chip ROM 4 kByte (program memory)
8. Four byte bi-directional input/output port

9.

UART (serial port)

10. Two 16-bit Counter/timers


11. Two-level interrupt priority
12. Power saving mode

Figure 2.3: 8051 Internal Architecture

Basic structure of microcontrollers:


Microcontroller is a small (micro) single-chip computer designed to
perform a specific function, and the specific function is to control (controller) objects,
processes or events. It is dedicated to one task, or a set of closely related task. It is similar
to a personal computer, it has similar components built on to a single chip.

Figure 2.4: Controller Block Diagram

As depicted above the basic structure of a microcontroller includes the following


components incorporated on a single chip:
1. Microprocessor/CPU: The CPU core is the 'computer' part of the
Microcontroller. Its job is to run the program supplied by the designer. It does this
by using memory, some registers, and the program memory. It performs the
various arithmetic & logical operations on the data.
2. RAM: RAM means Random Access Memory. It is general purpose memory that
can store data or programs. RAM is 'volatile', which means when the power is
shut off, the contents of the memory is lost. Microcontrollers have a built-in RAM
having a general capacity of around 256 bytes.
3. ROM: ROM is Read Only Memory. This is typically memory that is
programmed at the factory to have certain values. It cannot be changed, but it can
be read as many times as you want. ROM is typically used to store programs and
data that doesn't change over time. Its used for storing the codes & instructional
data.
4. Ports: Ports allow for interfacing of the microcontrollers with other external ICs
and devices.

5. Timer: Provides the microcontroller with an in-built clock component for


synchronizing all the units together.
6. ADC: An analog to digital converter allows the microcontroller to take analogous
quantity as input and perform operations on it.
7. Bus: Finally all microcontrollers have the buses that connect all the units os the
microcontroller together through a path and also provide a path for data
communication with the outside world or external devices. Similar to the
microprocessors the microcontrollers also have three kinds of buse viz. the
address bus, the data bus & the control bus.
Schematic and Features
The general schematic diagram of 8051 microcontroller is shown above. We can see 3
system inputs, 3 control signals and 4 ports (for external interfacing). A Vcc power
supply and ground is also shown. Now lets explain and go through each in detail. System
inputs are necessary to make the micro controller functional. So the first and most
important of this is power, marked as Vcc with a GND (ground potential). Without
proper power supply, no electronic system would work. XTAL 1 and XTAL 2 are for the
system clock inputs from crystal clock circuit. RESET input is required to initialize
microcontroller to default/desired values and to make a new start.
There are 3 control signals, EA,PSEN and ALE. These signals known as External Access
(EA), Program Store Enable(PSEN), and Address Latch Enable(ALE) are used for
external memory interfacing.
Control signals are used for external memory interfacing. If there is no requirement of
external memory interfacing then, EA pin is pulled high (connected to Vcc) and two
others PSEN and ALE are left alone. You can also see a 0.1 micro farad decoupling
capacitor connected to Vcc (to avoid HF oscillations at input).
There are four ports numbered 0,1,2,3 and called as Port 0, Port 1, Port 2 and Port 3
which are used for external interfacing of devices like DAC, ADC, 7 segment display,
LED etc. Each port has 8 I/O lines and they all are bit programmable.

Figure 1.5

8051 Pin Diagram & Description


For describing pin diagram and pin configuration of 8051, we are taking into
consideration a 40 pin DIP (Dual inline package). Now lets go through pin configuration
in detail.
Pin-40 : Named as Vcc is the main power source. Usually its +5V DC.
Pins 32-39: Known as Port 0 (P0.0 to P0.7) In addition to serving as I/O port, lower
order address and data bus signals are multiplexed with this port (to serve the purpose of
external memory interfacing). This is a bi directional I/O port (the only one in 8051) and
external pull up resistors are required to function this port as I/O.
Pin-31:- ALE : Address Latch Enable is used to demultiplex the address-data signal of
port 0 (for external memory interfacing.) 2 ALE pulses are available for each machine
cycle.
Pin-30:- EA/ External Access input is used to enable or disallow external memory
interfacing. If there is no external memory requirement, this pin is pulled high by
connecting it to Vcc.
Pin-29:- PSEN or Program Store Enable is used to read signal from external program
memory.
Pin 21-28:- Known as Port 2 (P 2.0 to P 2.7) in addition to serving as I/O port, higher
order address bus signals are multiplexed with this quasi bi directional port.
Pin 20:- Named as Vss it represents ground (0V) connection.
Pins 18 & 19:- Used for interfacing an external crystal to provide system clock.
Pins 1017:- Known as Port 3. This port also serves some other functions like interrupts,
timer input, control signals for external memory interfacing RD and WR,serial
communication signals RxD and TxD etc. This is a quasi bi directional port with internal
pull up.
Pin 9:- As explained before RESET pin is used to set the 8051 microcontroller to its
initial values, while the microcontroller is working or at the initial start of application.
The RESET pin must be set high for 2 machine cycles.
Pins 18:-Port 1.Unlike other ports, this port does not serve any other functions. Port 1 is
an internally pulled up, quasi bi directional I/O port.

Fig 2.6: Pin Diagram of 8051

IR Receiver Modules (TSOP31238)


DESCRIPTION:
The TSOP312, TSOP314 series are miniaturized receivers for infrared remote control
systems. A PIN diode and a preamplifier are assembled on a lead frame, the epoxy
package acts as an IR filter. The demodulated output signal can be directly decoded by a
microprocessor. The TSOP312.. is compatible with all common IR remote control data
formats. The TSOP314 is optimized to suppress almost all spurious pulses from energy
saving fluorescent lamps but will also suppress some data signals. This component has
not been qualified according to automotive specifications.
FEATURES:
1.
2.
3.
4.
5.
6.
7.

Very low supply current


Photo detector and preamplifier in one package
Internal filter for PCM frequency
Improved shielding against EMI
Supply voltage: 2.5 V to 5.5 V
Improved immunity against ambient light
Insensitive to supply voltage ripple and noise

Figure 2.6: TSOP31238

Pinning:
1 = GND, 2 = Vs, 3 = OUT

BLOCK DIAGRAM:

Figure 2.7

APPLICATION CIRCUIT:

Figure
2.8

ABSOLUTE MAXIMUM RATINGS :

Table 2.1

ELECTRICAL AND OPTICAL CHARACTERISTICS:

Table 2.2

TYPICAL CHARACTERISTICS:

Figure 2.9

SUITABLE DATA FORMAT :


The TSOP312.., TSOP314 series are designed to suppress spurious output pulses due to
noise or disturbance signals. Data and disturbance signals can be distinguished by the
devices according to carrier frequency, burst length and envelope duty cycle. The data
signal should be close to the band-pass center frequency (e.g. 38 kHz) and fulfill the
conditions in the table below. When a data signal is applied to the TSOP312.., TSOP314
in the presence of a disturbance signal, the sensitivity of the receiver is reduced to insure
that no spurious pulses are present at the output. Some examples of disturbance
signals which are suppressed are:
1. DC light (e.g. from tungsten bulb or sunlight)
2. Continuous signals at 38 kHz or at any frequency
3. Strongly or weakly modulated noise from fluorescent lamps with electronic
ballasts.

PCB LAYOUTS

Figure 2.9:Artwork Layout

Figure 2.10: Real world Layout

CHAPTER-3
CODE DEVELOPMENT

FLOW CHART OF THE PROCESS

Figure 3.1: Process Flow chart

ASSEMBLY CODE
ORG 0000H

;initial address

AJMP RESTART ;jump to restart sub routine


ORG 000BH

;timer-0 interrupt routine

CPL P2.0

;complement pin0 of port2

RETI

;return from interrupt routine to main routine

ORG 0030H

;main routine address

RESTART:MOV SP,#2FH

;initialize stack pointer

MOV IE, #82H

;initialize interrupt enable register to enable only t0 interrupt

CLR P2.0

;initialize pin as output

CLR P1.1

;initialize pin as output

CLR P1.2

;initialize pin as output

MOV TMOD, #02H

;initialize tmod register for timer0 in mode2

MOV TH0,#0F4H

;initialize the t0 register with the apt count

SETB TR0

;start timer

AGAIN: JB P3.2,AGAIN

;if pin2 of port3 is set then recheck

CLR P1.1

;led on

CLR P1.2

;buzzer on

REP: JNB P3.2,REP

;if pin2 of port3 is reset then recheck

SETB P1.1

;led off

SETB P1.2

;buzzer off

SJMP AGAIN

;jump back to check at AGAIN

CHAPTER-3
CONCLUSION

The Collision detection and avoidance system using IR sensors has been
constructed as per the norms and found to be working aptly. The system is capable of
detecting an obstacle as it comes in the range of the system and the range can also be
altered by the user. The system also warns the user about the obstacle or the impending
collision via buzzer and led.

CHAPTER-5
FUTURE EXPANSION
Although the system is self-dependent and capable of functioning independently
yet it can be expanded into a part of a larger system in many ways.
The most interesting and quite expected utility of the project would be as a part of
home protection system to monitor the locked states of doors and alarming in case any
intruder breaks into the house.
Another interesting expansion would be the development of a self-calibrating
automated collision detection and warning system working on similar concept.

Vous aimerez peut-être aussi