BE Project
BE Project
ABSTRACT
This project deals with the design and testing of a prototype model of a RADAR
using Ultrasonic waves.
The ultrasonic transmitter will transmit the signals in the 360-degree circle, these
signals will reflect back to the receiver when the object is detected in transmitting line.
The stepper motor gives the direction, which is sent to the microcontroller, which in turn
sends to the LCD. Microcontroller sends the direction and the distance to the LCD. In
LCD we can see the plot distance between and object and the sensor and the direction
with respect to the initial position of the module. A torch is used as a countering
equipment in this prototype.
This project has been completed successfully and tested for displaying location of
the object i,e. distance and direction. The programs have been developed using Embedded
C language and performance of the device was also tested. The system works
satisfactorily and confirm with repeated operations.
Dept E & C
PESCE,Mandya.
CHAPTER 1
INTRODUCTION
AIM:
The main aim of the project is to implement RADAR using ultrasonic waves.
The ultrasonic transmitter will transmit the signals in the 360-degree circle, these
signals will reflect back to the receiver when the object is detected in transmitting line.
The stepper motor gives the direction, which is sent to the microcontroller, which in turn
sends to the LCD. The distance sensor gives the distance of the object from the module
and communicates serially with the microcontroller. Microcontroller sends the direction
and the distance to the LCD. In LCD we can see the plot distance between and object and
the sensor and the direction with respect to the initial position of the module.
In an ultrasonic detection and ranging system, a constant, high frequency acoustic
signal is transmitted by a transducers. The ultrasound waves flood the protected area.
Receiving transducers monitor the ultrasound reflected by objects in the protected zone. If
anything moves, it produces a change in the phase of some of the reflected waves. This
phase change is detected by sensitive electronic circuits, which send signals to the
microcontroller.
In military they are many restricted area where common people are restricted to
enter the place due to security reasons and when an object is detected in that region then
the radar will detect and inform it to the base station along with the direction and
necessary action will be taken.
Dept E & C
PESCE,Mandya.
Transmitter:
The radar transmitter produces microwave signal, which is typically short duration
high-power RF- pulses of energy for a pulsed radar.
Duplexer:
Duplexer acts as a switch; it switches the antenna between the transmitter and
receiver. This obviates the need for separate transmitting and receiving antennas.
Duplexer prevents high power energy to go into receiver (high power pulses can damage
the receiver) while transmission and prevents reflected signal to be fed to the transmitter
during reception.
Antenna:
The transmitting antenna radiates the transmitting energy to signals in space, in
desired directions. The radiated energy propagates with constant velocity. When it finds
the target, the energy is scattered, a part of which is reflected towards the transmitting
antenna. The antenna receives the reflected energy and feed it to the duplexer. The
duplexer directs this energy towards the receiver.
Receiver:
Dept E & C
PESCE,Mandya.
Display:
The receiver sends the output to display, which shows the analyzed signal in an
easily understandable user friendly manner.
Pulse RADAR
Pulse Radar sends out signals in short (few millionths of a second) but powerful
bursts or pulses. Pulse Radar determines distance (range) by measuring the time it takes a
radar wave to get to the target object and to come back (time of flight) and then divides
that time in two (distance to the target). Since all radio waves travel at the same speed of
light, this known speed multiplied by the time of flight can be used to determine distance.
By continuing to track an object with a pulse radar the speed of the object can also be
determined.
Continuous-Wave Radar sends out a continuous signal instead of short bursts. There
are two types of Continuous Wave Radar:
A) Doppler Radar
B) Frequency Modulated (FM radar)
Doppler Radar is used mostly to make precise speed measurements and is most
often utilized by police traffic radars. Doppler Radar transmits a continuous wave of a
constant frequency. When this frequency strikes a moving object the frequency is
changed and the new frequency returning to the radar is used to determine the speed
of the moving target. Examples of Doppler Radar - Decatur Police Radar Guns. A lot
of sports radar guns, such as Bushnell Velocity Speed Gun, are Doppler Radars as
well.
Dept E & C
PESCE,Mandya.
1.2
MCS-51 in 1981. This microcontroller was also referred as system on a chip because it
has 128 bytes of RAM, 4Kbytes of ROM, 2 Timers, 1 Serial port, and four ports on a
single chip. The CPU can work for only 8bits of data at a time because 8051 is an 8-bit
processor. In case the data is larger than 8 bits then it has to be broken into parts so that
the CPU can process conveniently. Most manufacturers have put 4Kbytes of ROM even
though the quantity of ROM can be exceeded upto 64 K bytes.Intel permitted other
manufacturers to fabricate different versions of 8051 but with the limitation that code
compatibility should be maintained. This has added advantage that if the program is
written then it can be used for any version of 8051 despite of manufacturer.
As years passed by, the quality of technology surpassed the expectation of the
greatest minds, with gadgets becoming smaller, sleeker and more efficient.
Microcontrollers were seen as the answer to the requirements raised in advanced
electronics. This is the reason why manufacturers have now focused their production
around the following main developmental aspects:
i.
Ease-of-use
ii.
Market availability
iii.
Dept E & C
PESCE,Mandya.
v.
vi.
1.2.1 ARCHITECTURE:
This microcontroller is also called as System on a chip because it has all the
features on
a single chip. The Block Diagram of 8051 Microcontroller is as shown in Figure 1.2.1
1.2.2 FEATURES:
The main features of 8051 microcontroller are:
i. RAM 128 Bytes (Data memory)
ii. ROM 4Kbytes (ROM signify the on chip program space)
Dept E & C
PESCE,Mandya.
1.3
ULTRASONIC SENSORS:
Ultrasonic
sensors
are
devices
that
use
electricalmechanical
energy
transformation, the mechanical energy being in the form of ultrasonic waves, to measure
distance from the sensor to the target object. Depending on the type of application, the
range of frequencies has been broadly categorized as shown in the figure below:
PESCE,Mandya.
Dept E & C
PESCE,Mandya.
Dept E & C
PESCE,Mandya.
CHAPTER 2
BLOCK DIAGRAM
LCD (Display)
Ultrasonic
Transducers
LCD
Driver
LCD
Glass
Transducer
Micro
stepper motor
Controller
Driver(U
LN2003)
(P89V51RD2)
Power Supply
Trans
former
Rectifier
Regulator
(7805)
Filter
(7805)
Dept E & C
10
PESCE,Mandya.
Dept E & C
11
PESCE,Mandya.
2.3 Microcontroller:
Here
we
are
using
8051
flavoured
microcontroller
manufactured
by
Philips(P89V51RD2).This is the heart of the project and it controls all the components
shown in the diagram above.
Features of Philips 89V51RD2 are:
2.5 LCD:
LCD is used in our project to display direction and distance of the object.This is
connected to port 2 of the microcontroller.It makes use of 3 more pins for control
signals.This is provided by pin port 1 of the controller(P1.0-P1.2).The control signals are,
RS(Register Select)
R/W(Read or Write)
Enable
Dept E & C
12
PESCE,Mandya.
Dept E & C
13
PESCE,Mandya.
CHAPTER 3
HARDWARE
3.1.1 Features:
Dept E & C
14
PESCE,Mandya.
Four 8-bit I/O ports with three high-current Port 1 pins (16 mA each)
Dept E & C
15
PESCE,Mandya.
Pinning detail
Dept E & C
16
PESCE,Mandya.
ULN2003
HIGH VOLTAGE AND HIGH CURRENT
DARLINGTON TRANSISTOR ARRAY
3.3.1 DESCRIPTION :
The ULN2003 is a monolithic high voltage and high curren Darlington transistor
arrays. It consists of seven NPN darlington pairs that features high-voltage outputs with
common-cathode clamp diode for switching inductive loads. The collector-curren rating
of a single darlington pair is 500mA. The darlington pairs may be parrlleled for higher
current capability.
Applications include relay drivers,hammer drivers, lampdrivers,display drivers(LED gas
discharge),line drivers, and logic buffers. The ULN2003 has a 2.7k series base resistor
for each darlington pair for operation directly with TTL or 5V CMOS devices.
Dept E & C
17
PESCE,Mandya.
Dept E & C
18
PESCE,Mandya.
S.No
Item
MAX232 IC
Capacitors
Value
Qty
1uF
10uF
Some Wires
Dept E & C
19
PESCE,Mandya.
Dept E & C
20
PESCE,Mandya.
The MAX232 is an integrated circuit that converts signals from an RS-232 serial port
to signals suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual
driver/receiver and typically converts the RX, TX, CTS and RTS signals.
The drivers provide RS-232 voltage level outputs (approx. 7.5 V) from a single + 5 V
supply via on-chip charge pumps and external capacitors. This makes it useful for
implementing RS-232 in devices that otherwise do not need any voltages outside the 0 V
to + 5 V range, as power supply design does not need to be made more complicated just
for driving the RS-232 in this case.
The receivers reduce RS-232 inputs (which may be as high as 25 V), to standard
5 V TTL levels. These receivers have a typical threshold of 1.3 V, and a
typical hysteresis of 0.5 V.
The later MAX232A is backwards compatible with the original MAX232 but may
operate at higher baud rates and can use smaller external capacitors 0.1 F in place of
the 1.0 F capacitors used with the original device.
The newer MAX3232 is also backwards compatible, but operates at a broader voltage
range, from 3 to 5.5 V. Pin to pin compatible: ICL232, ST232, ADM232, HIN232.
Dept E & C
21
PESCE,Mandya.
+3 V to +15 V
0V
-3 V to -15 V
5V
5V
0V
Table 3.4.1
Dept E & C
22
PESCE,Mandya.
3.5 RELAY
A relay is an electrically operated switch. Current flowing through the coil of the
relay creates a magnetic field which attracts a lever and changes the switch contacts. The
coil current can be on or off so relays have two switch positions and most have double
throw (changeover) switch contacts as shown in the diagram.
Relays allow one circuit to switch a second circuit which can be completely
separate from the first. For example a low voltage battery circuit can use a relay to switch
a 230V AC mains circuit. There is no electrical connection inside the relay between the
two circuits, the link is magnetic and mechanical.
The coil of a relay passes a relatively large current, typically 30mA for a 12V
relay, but it can be as much as 100mA for relays designed to operate from lower voltages.
Most ICs (chips) cannot provide this current and a transistor is usually used to amplify the
small IC current to the larger value required for the relay coil. The maximum output
current for the popular 555 timer IC is 200mA so these devices can supply relay coils
directly without amplification.
Relays are usually SPDT or DPDT but they can have many more sets of switch
contacts, for example relays with 4 sets of changeover contacts are readily available. For
further information about switch contacts and the terms used to describe them please see
the page on switches.
Most relays are designed for PCB mounting but you can solder wires directly to
the pins providing you take care to avoid melting the plastic case of the relay.
The supplier's catalogue should show you the relay's connections. The coil will be
obvious and it may be connected either way round. Relay coils produce brief high voltage
'spikes' when they are switched off and this can destroy transistors and ICs in the circuit.
To prevent damage you must connect a protection diode across the relay coil.
Dept E & C
23
PESCE,Mandya.
3.5.2 Features:
Low On-resistance
Optically Coupled
3.5.3 Applications:
Power Distribution/Switching
Solenoid Driver
Heater Switching
SPST Single Pole Single Throw. These have two terminals which can be connected
or disconnected. Including two for the coil, such a relay has four terminals in total. It is
Dept E & C
24
PESCE,Mandya.
3.5.4 DPST:
Double Pole Single Throw. These have two pairs of terminals. Equivalent to two
SPST switches or relays actuated by a single coil. Including two for the coil, such a relay
has six terminals in total. The poles may be Form A or Form B (or one of each).
Dept E & C
25
PESCE,Mandya.
3.6 LCD
3.6.1 FEATURES
5 x 8 dots with cursor
Built-in controller (KS 0066 or Equivalent)
+ 5V power supply (Also available for + 3V)
1/16 duty cycle
B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K (LED)
N.V. optional for + 3V power supply
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 LCD.The reasons being: LCDs are economical.
Dept E & C
26
PESCE,Mandya.
Pin Description:
Pin
No
1
2
3
Function
Name
Ground (0V)
Supply voltage; 5V (4.7V 5.3V)
Contrast adjustment; through a variable resistor
Ground
Vcc
VEE
Register
Select
Read/write
6
7
8
9
10
11
12
13
14
15
16
Enable
DB0
DB1
DB2
DB3
DB4
DB5
DB6
DB7
Led+
Led-
Table 3.6.1
Dept E & C
27
PESCE,Mandya.
28
PESCE,Mandya.
type
employs
internal
current
limiting,thermal
shut
down
29
PESCE,Mandya.
Dept E & C
30
PESCE,Mandya.
CHAPTER 4
SOFTWARE
The software design of our project is done using Embedded-C program using Keil
microvision IDE with which microcontroller is programmed to run the stepper motor,
communicating serially with the distance sensor, lighting the torch and displaying
distance and direction in the LCD. It is converted to HEX file which is machine readable
form so as to load it into the microcontroller. For loading the HEX file into the micro
controller Flash magic utility is used.
31
PESCE,Mandya.
Dept E & C
32
PESCE,Mandya.
Dept E & C
33
PESCE,Mandya.
Dept E & C
34
PESCE,Mandya.
CHAPTER 5
FLOWCHART
5.1 Flowchart for the project:
Start
IS object
detected(P
3.2)?
Dept E & C
35
PESCE,Mandya.
Dept E & C
36
PESCE,Mandya.
CHAPTER 6
IMPLEMENTATION
The figure 6.1 shows the Ultrasonic transducers and the torch. This is mounted on
a stepper motor and the motor is rotated to provide 360 degree surveillance.
Dept E & C
37
PESCE,Mandya.
Dept E & C
38
PESCE,Mandya.
Dept E & C
39
PESCE,Mandya.
CHAPTER 7
CONCLUSION
This project has been implemented successfully and found that it works as per our
expectations. Thus it fulfills the objective and provides 360 degree surveillance and
provides monitoring during night. However some merits and demerits of the system
implemented
7.1 Merits
1. This system provides accurate distance and direction of the object within it its range
of
operation.
7.2 Demerits
1.
The system cannot provide distance of randomly moving objects but gives the
Dept E & C
40
PESCE,Mandya.
Dept E & C
41
PESCE,Mandya.
CHAPTER 8
APPENDIX A
8.1 Circuit Diagram:
Dept E & C
42
PESCE,Mandya.
43
PESCE,Mandya.
44
PESCE,Mandya.
45
PESCE,Mandya.
x = p - 3;
dectoascii(p);
for(i=0;i<6;i++)
{
P0=0x03;
delay();
P0=0x06;
delay();
P0=0x0c;
delay();
P0=0x09;
delay();
}
}
if(flag1 == 0 && flag2 == 1)
{
//
y = q - 3;
//
y = 50 - q;
dectoascii(q);
for(i=0;i<4;i++)
{
P0=0x09;
Dept E & C
46
PESCE,Mandya.
/* main function */
void main()
{
relay = 0;
flag3 = 0;
intr=0;
TMOD=0x20;
SCON=0x50;
TH1=0xfd;
TR1=1;
flag1 = 0;
flag2 = 0;
IE = 0x83;
IT0 = 1;
Dept E & C
47
PESCE,Mandya.
lcd_intialise();
lcd_string("....WELCOME....");
delay();
flag3 = 1;
while(1)
{
flag1 = 1;
flag2 = 0;
for(p=0; p<50; p++)
{
P0=0x03;
delay();
P0=0x06;
delay();
P0=0x0c;
delay();
P0=0x09;
delay();
flag4 = 1;
}
flag1 = 0;
flag2 = 1;
for(q=0; q<50; q++)
{
P0=0x09;
delay();
Dept E & C
48
PESCE,Mandya.
/* delay function */
void delay()
{
unsigned int i,m;
for(i=0;i<100;i++)
for(m=0;m<50;m++);
}
/* intialising lcd */
void lcd_intialise()
{
unsigned char i,a[]={0x38,0x0e,0x01,0x06,0x80};
for(i=0;i<5;i++)
{
lcd_cmd(a[i]);
delay();
Dept E & C
49
PESCE,Mandya.
50
PESCE,Mandya.
51
PESCE,Mandya.
Dept E & C
52
PESCE,Mandya.
10.Bibiliography
1. Muhammad Ali Mazidi and Janice Gillepsie Mazidi, The 8051 Microcontroller and
Embedded Systems using Assembly and C,3e Pearson Education-2006
2. Kenneth Ayala, The 8051 Microcontroller,3e,Thomas Delmar Learning-2005
3. www.keil.Com
4. www.DatasheetCatalog.com
5. www.iec.com
Dept E & C
53
PESCE,Mandya.