Professional Documents
Culture Documents
Group Members:
Names Roll No
Muazzam Ali
Muhammad Asif
Muhammad Shahid Rafiq
Amir
Toseef
DEPARTMENT OF PHYSICS
ALLAMA IQBAL OPEN UNIVERSITY
5
ABSTRACT
It is a fact that the maximum death ratio is due to the road accidents and the
reason of so many road accident is over speeding of the vehicles. Therefore to
reduce the death ratio of the road accidents we must compel the drivers to follow
the speed limits notified by the government’s agencies for different areas and
roads.
Our final year project is addressing the same problem and we have tried
to design a speed detection system for roads and highways. This system will
automatically measure the speed of the vehicle passing the speed detection
area. And display the speed of vehicle on the LCD display. Whenever any vehicle
will violate the speed limits, the system will display the message on the screen
and also send an SMS to the highway police check post, so that the vehicle
violating the speed limits must be properly fined.
5
CHAPTER 1
INTRODUCTION
(PROJECT RELATED)
Chapter 1
INTRODUCTION
1.1 Back ground
1.1 Nowadays almost everywhere the electronic gadgets are being used by the
individuals as well as by the different organizations. So we should also use the
electronic technology for the safety of human lives and other purposes. In our
final year project we have designed a speed detection system for highways and
motorways, as it is the need of the day to provide safety to the human lives.
As we have mentioned earlier in the abstract that the maximum death ratio
is due to the road accidents and the reason of so many road accident is over
speeding of the vehicles. Therefore to reduce the death ratio of the road
accidents we must compel the drivers to follow the speed limits notified by the
government’s agencies for different areas and roads.
Our final year project is addressing the same problem and we have tried
to design a speed detection system for roads and highways. This system will
automatically measure the speed of the vehicle passing the speed detection
area. And display the speed of vehicle on the LCD display. Whenever any vehicle
will violate the speed limits, the system will display the message on the screen
and also send an SMS to the highway police check post, so that the vehicle
violating the speed limits must be properly fined.
1.2 Description
Our project is concentrated on the speed detection of the vehicles on the
roads and highways. This system uses the IR sensors to determine the speed of
moving vehicle on a highway. And with the help of microcontroller the speed is
measured and displayed on the LCD. If any speed limits are violated the system
automatically sends an SMS to toward the Highway Police.
1.3 Objectives
➢ Schematic Design
➢ Project circuits simulation.
➢ Designing of hardware, to detect the vehicle speed.
➢ Interfacing of LCD with microcontroller.
➢ Interfacing of GSM Module with Microcontroller
➢ Interfacing of all circuitry with microcontroller.
1.5 Scope
The scope of this project is very wide, because the speed detection is the need
of all the governments and other organization, where they want to reduce death
ratio due to the road accidents.
In the above block diagram it can be easily seen, that an infrared transmitter will
continuously transmit the Infrared radiation toward the Infrared receiver, both of
them are fixed at opposite sides of the road. When there is no car passing at that
point the infrared light will be put on the surface of infrared receiver, and the
sensor will provide high level voltage to the microcontroller. But as a vehicle will
pass through that point the infrared wave will be interrupted and Low level
voltage will be given to the microcontroller. The software inside the
microcontroller will check the change in status of the voltage. When the first
sensor will be interrupted the microcontroller will start counting the time and
when the second sensor will be interrupted it will stop time counting. Since the
distance between both pair of sensors is fixed and microcontroller has also got
the time. So now its very easy to find the speed of this vehicle. The speed is
displayed on the LCD and if there is speed violation, the SMS is sent toward the
Highway Police.
25
CHAPTER 2
HARDWARE DESIGN
25
Here in the figure below we have given the architecture of the entire system.
The device which control all the operation or all function of a system are called micro
controller. Like CPU which control all the function of computer. Microcontroller have
ROM, RAM and many number of I/O ports.
Because of these advantages Microcontroller are used for so many applications in which
cost and space are critical. It is necessary to be noted that some of the microcontroller
manufacture have gone as far as integrating on ADC [10].
Figure 2- 2 Micro controller 89S51-2 1
D7 D6 D5 D4 D3 D2 D1 D0
This is the most important register in microcontroller which is used for the counting of
next executing or upcoming instructions. The starting address of the executing instruction
is 0000H and the ending address is FFFFH [11].
2.3.3 ROM
ROM is stand for ‘Read Only Memory’, It is located inside the AT89S52 microcontroller
chip, while in microprocessor it is connected externally. In this microcontroller chip the
ROM may be of 4kb, 8kb, 32kb and 64kb. With 64kb of ROM this microcontroller can
access more op code than any other microcontroller of this family.
2.3.4 RAM
RAM is the abbreviation of “Random Access Memory”. This microcontroller has 128
bytes of RAM which can gain address from 00 to 7FH. It can be accessed directly or as
by memory location.
This is the basic configuration of the microcontroller due to this proper circuitry this can
be initialized to work with. Without externally connected clock oscillator we cannot
provide any pulse or frequency so in this situation the microcontroller will not
functioning.
Data which is displaying can be entered in different location in LCD. Different address
location is shown below.
0 0 1 A A A A A A A
Here
AAAAAAA=0000000 to 0100111 for line one and
AAAAAAA=1000000 to 1100111 for line two.
GSM is a mobile communication network device which stands for Global System Mobile
communication networks. In the early days of mobile communicational analog
communication is introduced which is known as first generation of mobile
communication network. But that was analog communication and because of very low
band width it was not possible to use GSM every man of the world commonly and
subscriber can connect through. For the 1G problems solution and presently new digital
system is achieved that is now a day’s everyone use GSM commonly. So many features
like GPRS, vice call, text etc are include in it but the internet and more people assessing
through the vice connection is still not too many but some thousand is possible like
communication is possible in 2G. But presently its advance generation is so much better
than first in which the video calls and more internet speed is achieved which is known as
3G. Presently in some countries only 2G use but in some countries its working range are
in 4G and 5G. These ad vans generations are very high speed communication for so many
large numbers of users.
There are so many different frequencies ranges just like in 2G GSM network the
operating frequency bandwidth lies between 900 MHz to 1800MHz. But it is different in
other countries and in Pakistan this bandwidth is lies from 850 MHz to 1900 MHz and
the power rate for 850 to 900 MHz cell phone is 2 watt and the power rate for 1800 to
1900 MHz is 1 watt.
2.5.3 SIM
One of the most commend part of GSM technology is SIM which is abbreviation of
Subscriber identity module. SIM is smart card which contains the information about the
subscriber and its memory also has a specific phone numbers. It’s save also text. By help
of this SIM the subscriber location can be find and also its phone model and its company.
2.6.1 Introduction
As the name represents, this project measures the speed of vehicles passing on the
highway and displays the speed value on the LCD display. If the vehicle is doing some
violation of the speed limits it will automatically send an SMS to the Highway Police and
inform them about this violation.
The GSM module used is SIM900A, which is a very powerful GSM module
having all the features of working on GSM network.
Chapter 3
SOFTWARE DESIGN
/**********************************************************/
/**********************************************************/
void delay(unsigned int x) //x*0.14MS
{
for(i=0;i<1000;i++)
for (j = 0; j<x; j++);
}
/**********************************************************/
//**************************************************************
// Function to check the status of keys
//**************************************************************
void initserial(void)
{
SCON = 0x52; //9600BPS
TH1 = -3;
TR1 = 1;
}
void sendmsg()
{
sendstr("AT+CMGS=03006003057"); //Asif No.
delay(100);
sendstr("The Vehicle has voilated the speed rules!!!!");
delay(100);
}
main()
{
float tval;
float dist = 20;
float speed;
initserial(); //Will Initialize the GSM Module
LCD_init(); / /Will Initialize the LCD
LCD_position(1,1);
LCD_puts("Speed Detection ");
LCD_position(2,1);
LCD_puts("System with SMS ");
delay(250);
delay(100);
LCD_command(0x01);
LCD_puts("By: Asif, Shahid");
LCD_position(2,1);
LCD_puts(" Muazzam & Amir ");
delay(250);
delay(100);
LCD_command(0x01);
LCD_puts(" Supervised By: ");
LCD_position(2,1);
LCD_puts("Mr. Shakib Ahmed");
delay(250);
delay(100);
while(1)
{
LCD_command(0x01); /* Clear */
LCD_position(1,1);
LCD_puts("Waiting for CAR");
while(sensor1);
LCD_command(0x01); /* Clear */
// LCD_position(1,1);
LCD_puts("!!Car Detected!!");
while(sensor2 == 0);
speed = dist / tval;
sprintf(buffer,"Speed =%5.2fKM/H",speed);
LCD_position(2,1);
LCD_puts(buffer);
delay(delayval);
delay(250);
}
}
25
CHAPTER 4
RESULTS AND
DISCUSSIONS
25
Chapter 4
RESULTS AND DISCUSSIONS
4.1 RESULTS
This project having concentration to detect speed of vehicles can be used in every place
where gas are used and should be implemented in existing everywhere, without any
change in place infrastructure. It allows all users to find the speed of vehicles
automatically.
The status of the system at any instant will be available to user through LCD. The
solenoid valve will be ON/OFF through microcontroller in response to these two sensors
reading.
4.2 Limitations
• Continuous power is required all the time.
• Mobil will keep always on.
25