Automtic Vehicle Over Speed Monitoring and Parking
Automtic Vehicle Over Speed Monitoring and Parking
Automtic Vehicle Over Speed Monitoring and Parking
In recent times, number of accidents has been increasing mainly due to the over-
speeding of the vehicles and the carelessness of the driver, an automation system is
designed to control the vehicle speed and limit accidents and it is “Automatic
signals to the receiver which initiate the control operation and the microcontroller
sends command to control the speed of the vehicle. When driver falls asleep or
feels drowsy, the eye blink sensor senses the eye blinks and initiates the
Viii
LIST OF ABBREVIATIONS
RF - Radio Frequency
FM - Frequency Modulation
AT - Atmel
TX - Transmitter
INT - Interrupt
IP - Interrupt Priority
IC - Integrated circuits
GND – Ground ix
LIST OF FIGURES
7.3 RF Module 38
8.1b Optocoupler 40
x
CHAPTER 1
INTRODUCTION
A Transmitter and Receiver module are used in this project to monitor and
control the vehicles over speed in particular areas like school zones, curves or
with vehicle module. When the RF signal is received by the RF receiver, the
The eye blink sensor is another added feature which is used for sensing the
driver’s consciousness; this sensor is used for sensing whether the user feels
asleep or drowsy. It senses the eye blink of the user and it makes a count. If the
count is less than twenty five, the signal is intimated to microcontroller and the
1
1.1 PROJECT MODULE
1. Hardware Module
2. Software Module
Transmitter Module
Receiver Module
Eye Blink Sensor
Vehicle Module using Stepper Motor
Transmitter Module
Receiver Module
Eye Blink Sensor is used in vehicle which senses the eye blinking count of a user.
When the user falls asleep or feels drowsy, the eye blink sensor tracks the eye lids
and initiates the microcontroller and the vehicle is stopped.
2
1.1.2 SOFTWARE MODULE
Embedded “C”
Keil µvision Software
HARDWARE COMPONENT:
Atmel 89s52
RF Receiver and Transmitter
LCD for display
Eye Blink Sensor
Power Supply in RF Transmitter and Receiver
SOFTWARE COMPONENT:
Keil
C
3
CHAPTER 2
INTRODUCTION OF MICROCONTROLLER
ROM, RAM, parallel I/O, serial I/O, Counters and a clock circuits.
Microcontroller models vary in data size from 4 to 32 bits. Four-bit units are
produced in huge volumes for very simple applications, and 8-bit units are
the most versatile. 16 and 32-bit units are used in high-speed control and
signal processing applications.
4
2.1 MICROCONTROLLERS VS MICROPROCESSORS
5
CHAPTER 3
EMBEDDED SYSTEMS
3.1 INTRODUCTION
Embedded systems are computer systems in the widest sense. They include
all computers other than those specifically intended as general-purpose
computers. Examples of embedded systems range from portable music
players to real-time controls for systems like the space shuttle.
6
It is difficult to characterize embedded systems by speed or cost, but for high
volume systems, cost usually dominates the system design. Often many parts
of an embedded system need low performance compared to the primary
mission of the system. This allows an embedded system to be intentionally
simplified to lower costs compared to a general-purpose computer
accomplishing the same task, by using a CPU that is just ‘good enough’ for
these secondary functions.
7
In addition, the embedded system may be outside the reach of humans
(down an oil well borehole, launched into outer space, etc.,) so the
embedded system must be able to restart itself even if catastrophic data
corruption has taken place.
8
3.2 CHOOSING MICROCONTROLLER – WHY 8051?
There are four major 8-bit microcontrollers. They are Motorola’s 68xx,
Intel’s 805x, Zilog’s Z8, and PIC 16x from Microchip Technologies. Each
of these has a unique instruction set and register set, therefore not
compatible with each other. Programs written for one will not run on the
others. There are also 16-bit and 32-bit microcontrollers made by various
makers.
The first and foremost criterion is that it must meet the task at hand
efficiently and cost effectively. Here we choose between 8/16/32 bit
microcontrollers according to our need. Various other considerations are
Speed, Power consumption, amount of on-chip RAM and ROM, no of I/O
ports available, cost etc. The availability and ease of development are some
other considerations.
Considering all these, one of the best choices before us was to select Atmel
Corporation’s AT89s52 microcontroller, which was readily available in the
market and cheaper in cost. The major manufacturers of 8051 are AMD,
Atmel, Intel, Matra, OKI, Philips, Siemens, SMC, SSI etc.
9
CHAPTER 4
4.1 INTRODUCTION
8051 micro controller was introduced by Intel Corporation in the year 1981.
It is an 8-bit microcontroller with Harvard Architecture manufactured by
advanced CMOS processes. It has 128 bytes of on chip RAM, 4k bytes of on
chip ROM, two 16 bit timers/counters, four 8-bit ports of which one is a
serial port, etc. There are 6 interrupt sources.
Since this is an 8-bit micro controller, the CPU can work on only 8 bits of
data at a time. Data larger than 8 bits has to be broken down to 8 bit pieces.
Though it has an addressing capability of 64 Kbytes, only 4k bytes have
been provided on chip.
11
There are also OTP (One Time Programmable) versions of the 8051
available from different sources. Flash and NV-RAM versions are typically
used for product development. When a product is designed and finalized, the
OTP version of the 8051 is used for mass production since it is much
cheaper in terms of price per unit.
There are two other members in the 8051 family of microcontrollers. They
are the 8052 and the 8031.The 8052 has all the standard features of the 8051
in addition to an extra 128 bytes of RAM, an extra timer, extra 4K bytes of
on chip ROM, and two more interrupt sources. Therefore all programs
written for 8051 will run on 8052, but the reverse is not true.
12
4.2 FEATURES OF 8051 MICROCONTROLLER
13
CHAPTER 5
AT89S52 MICROCONTROLLER
14
5.1 PIN DIAGRAM OF AT89s52 MICROCONTROLLER
16
5.3 AT89S52 ARCHITECTURE
17
5.3.1 Pin Description
VCC
Supply voltage.
GND
Ground.
Port 0
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each
pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins
can be used as high impedance inputs.
Port 0 also receives the code bytes during Flash programming and outputs
the code bytes during program verification. External pull ups are required
during program verification.
Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pull ups. The Port 1
output buffers can sink/source four TTL inputs. When 1s are written to Port
1 pins, they are pulled high by the internal pull ups and can be used as
inputs. As inputs, Port 1 pins that are externally being pulled low will source
current (IIL) because of the internal pull ups.
Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull ups. The Port 2
output buffers can sink/source four TTL inputs. When 1s are written to Port
2 pins, they are pulled high by the internal pull ups and can be used as
inputs. As inputs, Port 2 pins that are externally being pulled low will source
current (IIL) because of the internal pull ups.
Port 2 emits the high-order address byte during fetches from external
program memory and during accesses to external data memory that uses 16-
bit addresses (MOVX @DPTR). In this application, Port 2 uses strong
internal pull ups when emitting 1s. During accesses to external data memory
that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2
Special Function Register.
Port 2 also receives the high-order address bits and some control signals
during Flash programming and verification.
19
Port 3
Port 3 is an 8-bit bidirectional I/O port with internal pull ups. The Port 3
output buffers can sink/source four TTL inputs. When 1s are written to Port
3 pins, they are pulled high by the internal pull ups and can be used as
inputs. As inputs, Port 3 pins that are externally being pulled low will source
current (IIL) because of the pull ups.
Port 3 also serves the functions of various special features of the AT89S52,
as shown in the following table. Port 3 also receives some control signals for
Flash programming and verification.
RST
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device. This pin drives High for 96 oscillator periods after
the Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can
be used to disable this feature. In the default state of bit DISRTO, the
RESET HIGH out feature is enabled.
20
ALE/PROG
Address Latch Enable (ALE) is an output pulse for latching the low byte of
the address during accesses to external memory. This pin is also the program
pulse input (PROG) during Flash programming.
PSEN
EA/VPP
21
Note, however, that if lock bit 1 is programmed, EA will be internally
latched on reset. EA should be strapped to VCC for internal program
executions. This pin also receives the 12-volt programming enable voltage
(VPP) during Flash programming.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL2
A map of the on-chip memory area called the Special Function Register
(SFR) space is shown in Table 1.
Note that not all of the addresses are occupied, and unoccupied addresses
may not be implemented on the chip. Read accesses to these addresses will
in general return random data, and write accesses will have an indeterminate
effect.
User software should not write 1s to these unlisted locations, since they may
be used in future products to invoke new features. In that case, the reset or
inactive values of the new bits will always be 0.
Timer 2 Registers:
Control and status bits are contained in registers T2CON (shown in Table 2)
and T2MOD (shown in Table 3) for Timer 2. The register pair (RCAP2H,
RCAP2L) are the Capture/Reload registers for Timer 2 in 16-bit capture
mode or 16-bit auto-reload mode.
22
Interrupt Registers:
The individual interrupt enable bits are in the IE register. Two priorities can
be set for each of the six interrupt sources in the IP register.
To facilitate accessing both internal and external data memory, two banks of
16-bit Data Pointer Registers are provided: DP0 at SFR address locations
82H-83H and DP1 at 84H-85H. Bit DPS = 0 in SFR AUXR1 selects DP0
and DPS = 1 selects DP1. The user should always initialize the DPS bit to t
appropriate value before accessing the respective Data Pointer Register.
The Power off Flag (POF) is located at bit 4 (PCON.4) in the PCON SFR.
POF is set to “1” during power up. It can be set and rest under software
control and is not affected by reset.
Memory Organization
MCS-51 devices have a separate address space for Program and Data
Memory. Up to 64K bytes each of external Program and Data Memory can
be addressed.
Program Memory
23
Data Memory
The AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes
occupy a parallel address space to the Special Function Registers. This
means that the upper 128 bytes have the same addresses as the SFR space
but are physically separate from SFR space.
For example, the following direct addressing instruction accesses the SFR at
location 0A0H (which is P2). MOV 0A0H, #data
Instructions that use indirect addressing access the upper 128 bytes of RAM.
For example, the following indirect addressing instruction, where R0
contains 0A0H, accesses the data byte at address 0A0H, rather than P2
(whose address is 0A0H). MOV @R0, #data
Note that stack operations are examples of indirect addressing, so the upper
128 bytes of data RAM are available as stack space.
24
CHAPTER 6
6. TRANSMITTER MODULE
TRANSMITTER SCHEMATIC
BRIDGE RECTIFIER
RF TRANSMITTER
26
As illustrated in the figure, the first section is the TRANSFORMER.
The transformer steps up or steps down the input line voltage and
isolates the power supply from the power line.
The RECTIFIER section converts the alternating current input signal
to a pulsating direct current.
A FILTER section is used to convert pulsating dc to a purer, more
desirable form of dc voltage.
The final section, the REGULATOR, does just what the name
implies. It maintains the output of the power supply at a constant level
in spite of large changes in load current or input line voltages.
The most common part numbers start with the numbers 78 and finish with
two digits indicating the output voltage. The number 78 represents positive
voltage. The 7805 series of voltage regulators are designed for positive
input.
Examples:
5V DC Regulator Name: LM7805 or MC7805
The transformer drops the 240 volts 'main' voltage to 8.5 volts. The diode
'bridge' rectifies the 8.5 volts AC from the output side of the power
transformer into DC. The 2500μF capacitor helps to maintain a constant
input into the regulator.
28
Voltage regulators are very robust. They can withstand over-current draw
due to short circuits and also over-heating. In both cases the regulator will
shut down before damage occurs. The only way to destroy a regulator is to
apply reverse voltage to its input.
All of the interfaces described on this site have protection diodes connected
into the power supply circuit to prevent damage due to incorrect polarity.
Generally a 1N4004, 1 amp power diode is connected in series with the
power supply. If the supply is connected the wrong way around, the
regulator will be protected from damage.
As a general rule the input voltage should be limited to 2 to 3 volts above the
output voltage. The LM78XX series can handle up to 30 volts input, but the
power difference between the input voltage/current ratio and output
voltage/current ratio appears as heat. If the input voltage is unnecessarily
high the regulator will get very hot.
29
If R1 is replaced with a suitable variable resistor ("potentiometer") it is
possible to make a simple 'variable' power supply.
The interfaces described on this site are based on either 5 volt, or 12 volt
integrated circuits. They use either LM7805, or LM7812 regulators.
First power and ground are connected to the upper right and lower left pins
respectively. Next, a crystal is connected to the XTAL pins to provide
stimulus for the internal oscillator as shown in the figure 6.4. When using a
crystal, a buffering capacitor of 10 to 40pf is connected from each pin to
ground. The crystal frequency ranges from 3 to over 50 MHz However, the
choice of frequency is often determined by outside connections. For
example, serial communications requires rather unusual frequencies such as
11.059 MHz If an oscillator is used, XTAL1 is the input to the oscillator
amplifier and the input to the internal clock. XTAL2 is the output from the
inverting oscillator amplifier. An 11.059 MHz crystal will provide good
performance and excellent communications.
31
Crystal oscillator is an electronic circuit that uses the mechanical resonance
of a vibrating crystal of piezoelectric material to create an electrical signal
with a very precise frequency. This frequency is commonly used to keep
track of time (as in quartz wristwatches), to provide a stable clock signal for
digital integrated circuits, and to stabilize frequencies for radio transmitters.
Almost any object made of an elastic material could be used like a crystal,
with appropriate transducers, since all objects have natural resonant
frequencies of vibration. For example, steel is very elastic and has a high
speed of sound. It was often used in mechanical filters before quartz. The
resonant frequency depends on size, shape, elasticity and the speed of sound
in the material. High-frequency crystals are typically cut in the shape of a
simple, rectangular plate. Low-frequency crystals, such as those used in
digital watches, are typically cut in the shape of a tuning fork. For
applications not needing very precise timing, a low-cost ceramic resonator is
often used in place of a quartz crystal. When a crystal of quartz is properly
cut and mounted, it can be made to bend in an electric field, by applying a
voltage to an electrode near or on the crystal. This property is known as
piezoelectricity.
When the field is removed, the quartz will generate an electric field as it
returns to its previous shape, and this can generate a voltage. The result is
that a quartz crystal behaves like a circuit composed of an inductor,
capacitor and resistor, with a precise resonant frequency.
Quartz has the further advantage that its size changes very little with
temperature. Therefore, the resonant frequency of the plate, which depends
on its size, will not change much, either. This means that a quartz clock,
filter or oscillator will remain accurate. For critical applications the quartz
oscillator is mounted in a temperature-controlled container, called a crystal
oven, and can also be mounted on shock absorbers to prevent perturbation
by external mechanical vibrations.
32
Quartz timing crystals are manufactured for frequencies from a few tens of
kilohertz to tens of megahertz. More than two billion (2×109) crystals are
manufactured annually. Most are small devices for consumer devices such as
wristwatches, clocks, radios, computers, and cell phones. Quartz crystals are
also found inside test and measurement equipment, such as counters, signal
generators, and oscilloscopes.
The variable resistor connected at LCD pin 3 (VD) and ground, controls the
LCD display contrast. LCD's with extended temperature range (negative °C)
can need a negative voltage at the VD pin (3), so the variable resistor need to
be connected in a different way - the center tap goes to pin 3 (VD), one side
to +5Vdc, while the other goes to a negative voltage around -3Vdc or more.
To reduce power consume over this trim pot, you can try values higher than
10k ohms. I observed several LCD's that connecting VD to Ground is
enough to result in a good display contrast.
The 230 volts AC supply at the input terminals is rectified using a bridge
rectifier to 12 volts DC. The rectified voltage is fed to the voltage regulator
LM7805 whose function is to generate a regulated 5 volts DC output. The 5
volt DC output for the IC89S52, TX remote and to the Reset circuitry. The
reset circuit consists of the switch, diode IN4007, and a RC circuit. The
function of the diode in the reset circuitry is to allow the use of a PNP or an
NPN microcontroller.
The Reset pin is initially at active low state and whenever a reset action is
required to reset the microcontroller chip the reset switch set to active high
and the 5 volts DC is applied at the pin 9 of the chip which resets the
microcontroller. The crystal oscillator generates a frequency of 11.059 MHz
through XTAL1 and XTAL2, which acts as the clock for the
microcontroller.
33
The microcontroller is programmed to transmit the required data. When the
circuit is turned on, the microcontroller starts transmitting the data through
the TXD pin which turns high and drives the base of the transistor thereby
making it to conduct. As the transistor starts conducting the TX Remote is
connected to the microcontroller through TXD and starts transmitting the
data, at a frequency of 38 KHz continuously.
34
CHAPTER 7
7. RECEIVER MODULE
35
7.1 COMPONENTS OF RECEIVER MODULE:
AT89s52 MICROCONTROLLER
BRIDGE RECTIFIER
LCD DISPLAY
RF MODULE
The Liquid Crystal Display (LCD) was first developed at RCA around 1971.
LCDs are optically passive displays (they do not produce light). As a result,
LCDs require all most no power to operate. Many LCD calculators can
operate from the power of a solar cell; others can operate for years from
small button cell batteries. LCDs work from the ability of liquid crystals
(LC) to rotate polarized light relative to a pair of crossed polarizers
laminated to the outside of the display. There are two main types of LCD
displays used for calculators today: Twisted nematic (TN) and super twisted
Nematic (STN). TN displays twist polarized light to 90 degrees and have a
limited viewing angle. STN displays were developed to twist polarized light
between 180 to 260 degrees resulting in better contrast and a wider viewing
angle.
A LCD consists of two plates of glass, sealed around the perimeter, with a
layer of liquid crystal fluid between them. Transparent, conductive
electrodes are deposited on the inner surfaces of the glass plates.
36
The electrodes define the segments, pixels, or special symbols of the display.
Next a thin polymer layer is applied on top of the electrodes. The polymer is
etched with channels in order to align the twist orientation of the LC's helix
shaped molecules. Finally, polarizing films are laminated to the outer
surfaces of the glass plates at 90 degree angles. Normally, two polarizing
films at 90 degrees should be dark, preventing any transmission of light but
due to the ability of LC to rotate polarized light the display appears clear.
When AC voltage is passed through the LC, the crystals within this field
align so that the polarized light is not twisted. This allows the light to be
blocked by the crossed polarizer’s thus making the activated segment or
symbol to appear dark.
Many other types of LCD displays are being developed for the laptop and
CRT replacement market including full color versions. These include double
and triple twisted pneumatic (DSTN and TSTN) displays and the Active-
matrix Thin-film Twisted Pneumatic and Metal-Insulated-Metal Twisted
Pneumatic (TFT-TN and MIM-TN) displays. Unfortunately these advanced
displays are too expensive for most of the calculator market. TN LCD’s
almost completely dominate today’s calculator market due to their extremely
low power requirements, thin size, and low cost.
37
7.3 RF MODULE
For 433.9 MHz, we wound 14 turns of 22 gauge wire around a 0.25 inch (6
mm) form. When tuned, its length was just less than one inch. The proximity
of this coil to ground makes a big difference in performance. When the coil
runs near and parallel to ground, maximum gain is only -18 dBd. When the
loose end of the coil was pulled away from ground, as shown in the alternate
version drawing, gain increased to -5.5 dBd, and the null became deeper.
39
CHAPTER 8
Stepper Motor is used to drive the vehicle in this vehicle module. Two
stepper motors are used. Stepper motor 1 is used to control the left and right
movement of vehicle and stepper motor 2 is used to control the front and
back movement of vehicle. These two stepper motor s are driven by driver
circuit which has optocoupler, darlington pair transistor.
The Drivers of the stepper motor 1 and stepper motor 2 are connected to
microcontroller. As per the program in microcontroller the driver drives the
stepper motor in high speed which can rotate the wheel of the vehicle
module in 10 rpm. When the radio frequency signal is received then the
40
driver drives the stepper motor in normal speed which can rotate the wheel
of a vehicle module in 5 rpm. Therefore, the speed of the vehicle module is
reduced when the RF Signal is received.
The stepper motor 2 is connected between the two back side wheels to
control the front and down movement of the vehicle module.
ULN2003 is the IC used in unipolar stepper motor to process the signal from
driver circuit which is connected to 89S52 microcontroller. First four pins of
ULN2003 are interfaced to the driver circuit and the fifth pin is grounded.
41
This stepper motor works in 12v power supply and current is 1.5 to 2 amps.
It is 3kg torque stepper motor which can rotate in 27 rpm. It can pull the load
up to 5kg to 6kg. In this vehicle module the gear ratio of stepper motor is
1:3.
Two stepper motors are driven by two separate driver circuit. The driver
circuit of stepper motor 1 is interfaced with microcontroller in port 0. The
driver circuit of stepper motor 2 is interfaced in port 2 of microcontroller.
42
CHAPTER 9
9. BLOCK DIAGRAM
Power supply
AT89S52
Encoder RF Transmitter
Micro controller
Description
Power supply
Micro controller
Eye Blink sensor Stepper driver
Stepper
Motor
Description
For stepper drivers, separate 230V – 12V Step down transformer is used
for power supply. Bridge circuit is used for rectification and filter is used
to remove the AC ripples. By using voltage regulator LM7812, a
constant 12V DC supply is taken as output. The current rating of the
stepper motor is 1.2 to 2 amps, so separate power supply circuit is
applied for stepper drivers.
45
9.3 Automatic Parking
Eye blink sensor is used to sense the eye blinking count of user of the
vehicle. Here we have used the model of eye blink sensor. This sensor is
connected in the head of the user of vehicle.
When the user blinks his eyes, the eye blink sensor takes it as count.
Actual use of the sensor is to make a count whenever the user blinks his
eyes. The count of eye blink sensor is displayed in LCD.
Normally, a vehicle user will blink his eyes twenty five times per minute.
So the eye blink sensor should make twenty five counts in every minute.
If the user of the vehicle falls asleep or feels drowsy then the blinking
count of his eyes will get decrease.
If the eye blink sensor makes a count below twenty five in a minute,
immediately it is intimated to microcontroller. The microcontroller
confirms that the user is drowsy and it changes the signal given to
stepper driver.
46
CHAPTER 10
APPENDICES
10. PROGRAM
10.1 LCD
#include<regx51.h>
#include<intrins.h>
sbit busy=P1^7;
sbit RS=P3^5;
sbit RW=P3^6;
sbit EN=P3^7;
void lcd_initial();
void check();
int a,x,y,z;
a=v%100;
47
x=v/100;
y=a/10;
z=a%10;
data_initial(x+0x30);
data_initial(y+0x30);
data_initial(z+0x30);
void lcd_initial()
command_initial(0x38);
command_initial(0x0c);
command_initial(0x01);
command_initial(0x80);
command_initial(0xc0);
command_initial(0x05);
P1=a;
RS=0;
RW=0;
EN=1;
48
delay(1);
EN=0;
check();
P1=b;
RS=1;
RW=0;
EN=1;
delay(1);
EN=0;
check();
void check()
busy=1;
RS=0;
RW=1;
EN=0;
delay(1);
EN=1;
49
while(busy==1);
while(*s!='\0')
data_initial(*s);
s++;
_nop_();
10.2 RECEIVER
#include <REGX51.H>
#include<intrins.h>
void check();
void lcd_initial();
50
void forward();
void forward1();
void slow();
void uturn();
void stright();
void speed();
void left();
sbit eye=P3^2;
sbit led1=P3^0;
sbit led2=P3^1;
bit timer_flag=0;
//void stop();
int i;
for(i=0;i<=x;i++)
_nop_();
51
void eye_check()interrupt 0
if(eye==0)
eye_count=eye_count+1;
delay(2500);
}while(eye==0);
void eye_time()interrupt 1
TL0=0x00;
TH0=0x00;
count_val=count_val+1;
if(count_val==220)
timer_flag=1;
TR0=0;
TL0=0x00;
count_val=0;
if(timer_flag==1)
if(eye_count<25)
52
{
led1=0;
led2=1;
timer_flag=0;
command_initial(0x01);
command_initial(0x80);
timer_flag=0;
write_lcd("driver drowsy");
left();
eye_count=0;
count_val=0;
led1=0;
led2=0;
while(1);
}//while(eye_count<10);
if(eye_count>25)
eye_count=0;
count_val=0;
timer_flag=0;
command_initial(0x01);
command_initial(0x80);
53
write_lcd("driver normal");
delay(10000);
delay(10000);
delay(10000);
timer_flag=0;
TR0=1;
}while(eye_count>10);
void main()
TMOD=0x01;
TL0=0x00;
TH0=0x00;
IE=0x83;
PX0=1;
PT0=1;
eye=1;
54
P0=0xff;
led1=1;
led2=1;
lcd_initial();
command_initial(0x80);
write_lcd("vechile normal");
command_initial(0xC0);
write_lcd("speed:");
command_initial(0xC6);
lcd_conv(rpm);
command_initial(0xC9);
write_lcd("eye:");
command_initial(0xCd);
lcd_conv(eye_count);
count_val=0;
TR0=1;
while(1)
if(timer_flag==0)
do
55
forward();
command_initial(0xCd);
lcd_conv(eye_count);
}while(P0==0xFF);
if(P0==0xf1)
command_initial(0x01);
command_initial(0x80);
command_initial(0xC0);
write_lcd("speed:");
command_initial(0xC6);
lcd_conv(rpm_school);
command_initial(0xC9);
write_lcd("eye:");
command_initial(0xCd);
lcd_conv(eye_count);
slow();
command_initial(0x01);
command_initial(0x80);
write_lcd("vechile over");
56
command_initial(0xC0);
write_lcd("speed control");
forward();
}while(P0==0xf1);
10.3 VEHICLE
#include <REGX51.H>
#include<intrins.h>
sbit led1=P3^0;
sbit led2=P3^1;
void stop();
sbit buzzer=P3^3;
int j;
57
for(j=0;j<=y;j++)
_nop_();
void forward()
P2=0x0a;
delay(300);
P2=0x09;
delay(300);
P2=0x05;
delay(300);
P2=0x06;
delay(300);
void left()
int val=200;
buzzer=1;
58
do
led1=0;
P2=0xaa;
led1=1;
delay(650);
led1=1;
P2=0x99;
led1=0;
delay(650);
led1=1;
P2=0x55;
led1=0;
delay(650);
led1=1;
P2=0x66;
led1=0;
delay(650);
val--;
}while(val!=0);
P2=0x00;
buzzer=0;
59
delay(65000);delay(65000);
P0=0x00;
void slow()
int count=500;
do
P2=0x0a;
stop(1200);
P2=0x09;
stop(1200);
P2=0x05;
stop(1200);
P2=0x06;
stop(1200);
count--;
}while(count!=0);
void uturn()
60
veh_count=200;
do
P2=0x6a;
delay(450);
P2=0x59;
delay(450);
P2=0x95;
delay(450);
P2=0xa6;
delay(450);
veh_count--;
} while(veh_count!=0);
void stright()
str_count=200;
do
P2=0xaa;
delay(350);
P2=0x99;
61
delay(350);
P2=0x55;
delay(350);
P2=0x66;
delay(350);
str_count--;
}while(str_count!=0);
forward();
void stop()
count_spd=50;
do
P2=0x00;
stop(500);
count_spd--;
}while(count_spd!=0);
62
10.4 CONCLUSION
The method of over speed monitoring and controlling has been discussed in this
project. It is believed that this method offers more security than other methods.
This being a real time project can be implemented in risky areas to save more life
from accidents. The technological advancement in the field of electrical and
electronics has paved the path to this valuable project which plays a major role in
saving the valuable lives of people. At the same time, this project can be enhanced
in various such as wireless techniques which makes more sophisticated, reduces
the accidents. The project can be applied in various areas because of its advantages
namely man power is reduced, automatic control without user interface. It is
simple and easy to implement. Many methods have been put forth but this has
become an effective method.
63
10.5 REFERENCES
64