Sie sind auf Seite 1von 33

PROJECT REPORT ON

Distance measurement using InfraRed sensor with ADC0804


& 8051 microcontroller (AT89C51)
Submitted by

UNDER THE GUIDANCE OF

DEPARTMENT OF ELECTRONICS ENGINEERING

PROJECT CERTIFICATE
This is to certify that, the project title,
Distance measurement using InfraRed sensor with ADC0804 & 8051 microcontroller
(AT89C51)
.

IS SUCCESSFULLY COMPLETED BY

In partial fulfillment of degree course in TE. ELECTRONICS ENGINEERING as


Prescribed by MUMBAI UNIVERSITY DURING ACADEMIC YEAR 2014-2015
UNDER THE GUIDANCE OF
PROF .

DATE OF SUBMISSION _______________________________________

PROJECT GUIDE
(

HEAD OF DEPARTMENT

PRINCIPAL
(

INTERNAL EXAMINER

EXTERNAL EXAMINER

PREFACE
We take an opportunity to present this project report on
Distance measurement using InfraRed sensor with ADC0804 & 8051
microcontroller (AT89C51) & put before readers some information
regarding our project.
We have made sincere attempts & taken every care to present
this matter in precise & compact form, the language being as simple as
possible.

We are sure that the information contained in this volume


would certainly prove useful for better insight in the scope and dimension of
this project in its true perspective.

The task of completion of this project through being difficult was


made quite simple, interesting & successful due to deep involvement &
complete dedication of our group members.

CONTENTS
.

Sr.No

Topics
.

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.

Page No.
.

Acknowledgement
Introduction To The Project
Block diagram
Working
Components Required
Methodology
PCB Layout
Troubleshooting
Advantages
Disadvantages
Application
Conclusion
Bibliography

5
6
8
13
17
18
20
21
22
23
24
25
26

ACKNOWLEDGEMENT
It is indeed a matter of great pleasure and proud privilege to be
able to present this project on Distance measurement using InfraRed
sensor with ADC0804 & 8051 microcontroller (AT89C51) .

The completion of this project work is a milestone in students life


and its execution is inevitable in the hands of guide. We are highly indebted
the project guide
for her invaluable guidance & appreciation for
giving form and substance to this report. It is due to her enduring efforts,
patience & enthusiasm, which has given a sense of direction and
purposefulness to this project and ultimately made it success.

We would like to tender our sincere thanks to the staff members


for their co-operation.

We would also like to express our deep regards and gratitude to


the Principle Prof.
.

We would wish to thank the non-teaching staff and our friends who
have helped us all the time in one way or other.

Really it is highly impossible to repay the debt of all the people


who have directly or indirectly helped us for performing the project.

INTRODUCTION TO THE PROJECT

Infrared sensors find numerous applications in electronic systems.


Commonly used as obstacle detector, their output is used in digital form
(high & low logic) by employing a comparator. This topic explains a way to
use the sensors output in its original analog form. Thus, along with
detecting an obstacle, its exact distance can also be obtained. This is
achieved by processing the output of IR sensor through an ADC0804
(analog to digital converter). The ADC is calibrated to get almost accurate
distance measurement.
The measured distance is also displayed on an LCD screen. The
ADC0804 and LCD are interfaced with 8051 microcontroller (AT89C51) to
perform these operations. The major drawback of IR based sensors is their
capability of detecting short distances.

BLOCK DIAGRAM

IR led
An IR LED, also known as IR transmitter, is a special purpose LED that
transmits infrared rays in the range of 760 nm wavelength. Such LEDs are
usually made of gallium arsenide or aluminium gallium arsenide. They,
along with IR receivers, are commonly used as sensors.
The appearance is same as a common LED. Since the human eye cannot
see the infrared radiations, it is not possible for a person to identify whether
the IR LED is working or not, unlike a common LED. To overcome this
problem, the camera on a cellphone can be used. The camera can show us
the IR rays being emanated from the IR LED in a circuit.

Pin Diagram:

Preset

A preset is a three legged electronic component which can be made to offer


varying resistance in a circuit. The resistance is varied by adjusting the
rotary control over it. The adjustment can be done by using a small screw
driver or a similar tool. The resistance does not vary linearly but rather
varies in exponential or logarithmic manner. Such variable resistors are
commonly used for adjusting sensitivity along with a sensor.
The variable resistance is obtained across the single terminal at front and
one of the two other terminals. The two legs at back offer fixed resistance
which is divided by the front leg. So whenever only the back terminals are
used, a preset acts as a fixed resistor. Presets are specified by their fixed
value resistance

Pin Diagram:

10

Lcd
LCD (Liquid Crystal Display) screen is an electronic display module and
find a wide range of applications. A 16x2 LCD display is very basic module
and is very commonly used in various devices and circuits. These modules
are preferred over seven segments and other multi segment LEDs. The
reasons being: LCDs are economical; easily programmable; have no
limitation of displaying special & even custom characters (unlike in seven
segments), animations and so on.
A 16x2 LCD means it can display 16 characters per line and there are 2
such lines. In this LCD each character is displayed in 5x7 pixel matrix. This
LCD has two registers, namely, Command and Data.

The command register stores the command instructions given to the LCD.
A command is an instruction given to LCD to do a predefined task like
initializing it, clearing its screen, setting the cursor position, controlling
display etc. The data register stores the data to be displayed on the LCD.
The data is the ASCII value of the character to be displayed on the LCD.

11

Pin Diagram:

12

Pin Description:

Pin
No
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

Function

Name

Ground (0V)
Supply voltage; 5V (4.7V 5.3V)
Contrast adjustment; through a variable resistor
Selects command register when low; and data
register when high
Low to write to the register; High to read from the
register
Sends data to data pins when a high to low pulse is
given

Ground
Vcc
VEE
Register
Select

8-bit data pins

Backlight VCC (5V)


Backlight Ground (0V)

Read/write
Enable
DB0
DB1
DB2
DB3
DB4
DB5
DB6
DB7
Led+
Led13

AT89C51
AT89C51 is an 8-bit microcontroller and belongs to Atmel's 8051 family.
ATMEL 89C51 has 4KB of Flash programmable and erasable read only
memory (PEROM) and 128 bytes of RAM. It can be erased and program to
a maximum of 1000 times.

In 40 pin AT89C51, there are four ports designated as P 1, P2, P3 and P0. All
these ports are 8-bit bi-directional ports, i.e., they can be used as both input
and output ports. Except P 0 which needs external pull-ups, rest of the ports
have internal pull-ups. When 1s are written to these port pins, they are
pulled high by the internal pull-ups and can be used as inputs. These ports
are also bit addressable and so their bits can also be accessed individually.
14

Port P0 and P2 are also used to provide low byte and high byte addresses,
respectively, when connected to an external memory. Port 3 has
multiplexed pins for special functions like serial communication, hardware
interrupts, timer inputs and read/write operation from external
memory. AT89C51 has an inbuilt UART for serial communication. It can be
programmed to operate at different baud rates. Including two timers &
hardware interrupts, it has a total of six interrupts.

Pin Diagram:

15

Pin Description:

16

Pin
No

Function

Name

P1.0

P1.1

P1.2

P1.3

8 bit input/output port (P1) pins

P1.4

P1.5

P1.6

P1.7

Reset pin; Active high

10

Input (receiver) for serial


communication

RxD

P3.0

11

Output (transmitter) for


serial communication

TxD

P3.1

12

External interrupt 1

Int0

P3.2

13

External interrupt 2

Int1

14

Timer1 external input

T0

15

Timer2 external input

T1

16

Write to external data


memory

Write

P3.6

17

Read from external data


memory

Read

P3.7

18
19
20

Reset

8 bit
input/output P3.3
port (P3)
P3.4
pins
P3.5

Quartz crystal oscillator (up to 24 MHz)


Ground (0V)

Crystal 2
Crystal 1
Ground

21

P2.0/ A8

22

P2.1/ A9

17

ADC0804
Analog to digital converters find huge application as an intermediate device
to convert the signals from analog to digital form. These digital signals are
used for further processing by the digital processors. Various sensors like
temperature, pressure, force etc. convert the physical characteristics into
electrical signals that are analog in nature.
ADC0804 is a very commonly used 8-bit analog to digital convertor. It is a
single channel IC, i.e., it can take only one analog signal as input. The
digital outputs vary from 0 to a maximum of 255. The step size can be
adjusted by setting the reference voltage at pin9. When this pin is not
connected, the default reference voltage is the operating voltage, i.e., Vcc.
The step size at 5V is 19.53mV (5V/255), i.e., for every 19.53mV rise in the
analog input, the output varies by 1 unit. To set a particular voltage level as
18

the reference value, this pin is connected to half the voltage. For example,
to set a reference of 4V (Vref), pin9 is connected to 2V (Vref/2), thereby
reducing the step size to 15.62mV (4V/255).
ADC0804 needs a clock to operate. The time taken to convert the analog
value to digital value is dependent on this clock source. An external clock
can be given at the Clock IN pin. ADC 0804 also has an inbuilt clock which
can be used in absence of external clock. A suitable RC circuit is connected
between the Clock IN and Clock R pins to use the internal clock.

Pin Diagram:

19

Pin Description:

20

Pin
No
1

Function

Name
Chip select

3
4
5
6
7

Activates ADC; Active low


Input pin; High to low pulse brings the data from internal
registers to the output pins after conversion
Input pin; Low to high pulse is given to start the conversion
Clock Input pin; to give external clock.
Output pin; Goes low when conversion is complete
Analog non-inverting input
Analog inverting Input; normally ground

Ground(0V)

9
10
11
12
13
14
15
16
17
18
19
20

Input pin; sets the reference voltage for analog input


Ground(0V)

8 bit digital output pins

Used with Clock IN pin when internal clock source is used


Supply voltage; 5V

Read
Write
Clock IN
Interrupt
Vin(+)
Vin(-)
Analog
Ground
Vref/2
Digital Ground
D7
D6
D5
D4
D3
D2
D1
D0
Clock R
Vcc

WORKING

21

This project mainly consists of three units:


A sensor unit,
22

ADC component
LCD module.

The IR receiver detects the IR radiations transmitted by an IR LED. The


output voltage level of this IR sensor depends upon the intensity of IR
rays received by the receiver. The intensity, in turn, depends on the
distance between the sensor module and the obstacle. When the
distance between IR pair and obstacle is lesser, more IR radiations fall
on the receiver, and vice versa. The receiver along with a resistor forms
a voltage divider whose output is supplied as the input for ADC0804.

23

COMPONENTS REQUIRED

RESISTORS (+5% CARBON,1/4W)


R1
R2
R3
R4
VR1
(PRESET) H

1K
4.7K
10K
47K
100K

1NOS
1NOS
1NOS
1NOS
1NOS

0.01F
100 F/
16V

2NOS
1NOS

1C555
BC548
2 8E
SPK/.
1N4148
GER DIODE

1NOS
1NOS

CAPACITORS
C1,2
C3

MISC
IC1
T1
LS
D1

1NOS
1NOS

24

METHODOLOGY

Design your circuit board. Use PCB Wizard software to draw your
circuit board. You can also use a perforated board that has pre-drilled
holes in it to help you see how your circuit board's components would
be placed and work in reality.
Buy a plain board that is coated with a fine layer of copper on one
side from a retailer.
Scrub the board with a scouring pad and water to make sure the
copper is clean. Let the board dry.
Print your circuit board's design onto the dull side of a sheet of blue
transfer paper. Make sure the design is oriented correctly for transfer.
Place the blue transfer paper on the board with the circuit board's
printed design against the copper.
Lay a sheet of ordinary white paper over the blue paper. Following
the transfer paper's instructions, iron over the white and blue paper to
transfer the design onto the copper board. Iron every design detail
that appears near an edge or corner of the board with the tip of the
iron.
Let the board and blue paper cool. Peel the blue paper slowly away
from the board to see the transferred design.

25

Examine the transfer paper to check for any black toner from the
printed design that failed to transfer to the copper board. Make sure
the board's design is oriented correctly.
Replace any missing toner on the board with ink from a black
permanent marker. Allow the ink to dry for a few hours.
Remove exposed parts of the copper from the board using ferric
chloride in a process called etching.

Wash all the etching equipment and the circuit board thoroughly with
plenty of running water.
Drill 0.03 inch (0.8 mm) lead component holes into your circuit board
with high-speed steel or carbide drill bits. Wear safety goggles and a
protective mask to protect your eyes and lungs while you drill.
Scrub the board clean with a scouring pad and running water. Add
your board's electrical components and solder them into place.

26

PCB LAYOUT

27

TROUBLESHOOTING
After building up the entire project we came to know that our project was
not working, this condition was havoc for us.

After Troubleshooting the circuit we came across following faults:-

Two of the IC pins were short circuited.


This problem was solved by desoldering those pins, & again soldering them
back to the PCB with care.
A wrong diode was installed instead of 1n4148 germanium diode.
This time we replaced that diode with a 1n4148 germanium diode and
observed whether the circuit is working or not.
Transistor was faulty.

28

After checking the hfe of the transistor we came to a conclusion that we


have to change the transistor as it was damage due to use of improper
soldering techniques.ADVANTAGES

1. Early Warning
Many fires occur at night or in a room or section that no one may
be in at the time. The audible alert from the fire alarm can wake
individuals up who may otherwise sleep while inhaling smoke. The
alert can also provide an early signal during the day to individuals
who, if not for the alarm, would not have the time needed to
escape the home or building before the fire spreads out of control.
2. Flexibility to place them in specific rooms and areas of your
choice.
3. Low Cost
A fire system that is remotely monitored on a continuous basis is
normally part of an agreement with an alarm company that also
includes burglar alarms.

29

DISADVANTAGES

1. Susceptible to nuisance alarms if placed too close to cooking.

2. May be slow to respond slow smoldering fires.

3. None what so ever!!! They are there to save lives- whatever they
do. Although they could be a nuisance if they do cause false
activations by themselves.

30

APPLICATION
1. Fire alarms can be used in any place like parks,
theaters, HOTELS, restaurants, boats, ships, etc.
2. Fire alarms can be also used as temperature sensors in some
applications, when the temperature goes up abruptly it can inform.

3. Fire alarm can be used in our home for safety purpose and it is a
very good precautionary measure.

31

CONCLUSION

A fire alarm is a device that detects the presence of fire and atmospheric
changes relating tosmoke. In some cases, a firm alarm is a part of a
complete security system, in addition to aburglary protection system. The
fire alarm operates to alert people to evacuate a location inwhich a fire
or smoke accumulation is present.

When functioning properly, a fire alarm will sound to notify people of an


immediate fireemergency. Fire alarms can be found in homes, schools,
churches and businesses, andfunction as the catalyst to saving lives. For
most fire alarms, when sounded, a beep, bell orhorn noise is made. This
distinct sound exists to allow the notification to be heard The fire alarm
constructed by this project work is reliable at low cost.

32

BIBLIOGRAPHY

CIRCUITS AND NETWORKS


A SUDHAKAR, SHYAMMOHAN.PILLAI
OP-AMPS AND LINEAR INTEGRATED CIRCUITS
RAMAKANT A.GAYAKWAD
www.nfpa.org
en.wikipedia.org
www.ask.com

33

Das könnte Ihnen auch gefallen