Professional Documents
Culture Documents
Project Report
On
Department of Instrumentation
UNIVERSITY OF DELHI
1
INDEX
Acknowledgement 4
Problem Abstract 5
List of Figures 6
Workload Matrix 7
Chapter 6: Conclusions 43
References 44
2
CERTIFICATE
This is to certify that following students have submitted their project on “AUTOMATIC
CAR SPEED CONTROL USING RFID” for the partial fulfillment of the B.Tech.
Degree in Instrumentation. They have successfully completed the project in the given
deadline period under the supervision of Dr. Anil Kumar in Department of
Instrumentation, Bhaskaracharya College of Applied Sciences.
3
ACKNOWLEDGEMENT
Before I get into thick of things, I would like to add a few words of appreciation for the
people who have been a part of this project right from its inception. The writing of this
project has been one of the significant academic challenges I have faced and without the
support, patience, and guidance of the people involved, this task would not have been
completed. It is to them I owe my deepest gratitude.
It gives me immense pleasure in presenting this project report on “AUTOMATIC CAR
SPEED CONTROL USING RFID”. It has been my privilege to have a team of project
guide who have assisted me from the commencement of this project. The success of this
project is a result of sheer hard work, and determination put in by me with the help of my
project guide. I hereby take this opportunity to add a special note of thanks for Mr. Anil
Kumar, who undertook to act as my mentor despite his many other academic and
professional commitments. His wisdom, knowledge, and commitment to the highest
standards inspired and motivated me. Without his insight, support, and energy, this
project wouldn’t have kick-started and neither would have reached fruitfulness.
My thanks and appreciations also go to my colleague in developing the project and
people who have willingly helped me out with their abilities.
Ruchi Singh
4
PROBLEM ABSTRACT
Nowadays the drivers drive vehicles at high speed even in speed limited areas without
considering the safety of the public.The traffic police are not able to control them with
full effect. Also it is not practical to monitor these areas throughout. This project paves
way for controlling the speed of the vehicles within certain limit in restricted zones
without interruption of the drivers. An RFID is used for this purpose. The RFID reader is
attached along with the vehicle and the RFID Tag with these Zones. These tags are
programmed to send a coded signal when the reader comes in proximity. Whenever the
vehicles enter into these zones their receivers will receive this code and the speed of the
vehicles is controlled automatically with the help of the micro controller unit present
inside the vehicle. The tags are placed at the beginning and the end of the regions for
which the speed should be reduced.
Hence, this project aims at automatically controlling the speed of vehicles at speed
restricted areas such as schools, hospital zones etc.
5
List of Figures
6
Workload Matrix
7
CHAPTER 1
Most of the road accidents in India occur due to over speed and rash driving of
vehicles on public roads. Even after seeing the speed limit on the sign boards
some drivers hardly care about that. This problem increase even more in night.
The rate of accidents has increased as more vehicles come on to ground. To
control and monitor the speed of vehicle on public roads the respective
departments of government has taken necessary step. But it is not doing enough.
So if a driver is not following the rules, what if in a world which is becoming
highly automated we take help of these technologies to solve this issue. By
increasing sensors on road and vehicle and using the concepts of automatic
driving controls, chances to improve safety will be better. This is exactly what we
plan to achieve through our project. By using a mechanism which could control
the speed of vehicle when a driver over speeds on a particular zone where RFID
tags are present with specific speed limit values, this mechanism could help solve
the problem of over speeding.
Using this concept not only will prevent road accidents due to over speeding but
will also help in solving the issues which are faced with using conventional
technology. Through this project we plan to solve these problems :
1. Using conventional technology, someone has to be there with the device to keep
check on over speeding but using Radio Frequency for controlling speed solves
this issue.
Moreover, this technology does not demand the presence of a person, instead it
can automatically monitor and control speed.
2. Conventional laser technology can monitor only single vehicle at once but using
Radio Frequency we can monitor all vehicles in the speed limit zone at once. IR
as an alternative and can also be used but ‘Line Of Sight’ communication needs to
be maintained. So Radio Frequency seems to be the optimum choice.
8
3. Radio frequency is the cheapest technology as compared to laser which is costly.
Also we can keep the speed limit zone under surveillance 24*7 while with laser
technology its working will depend on the duty time of the traffic police officer.
What is RFID
A scanning antenna
A transceiver with a decoder to interpret the data
A transponder - the RFID tag - that has been programmed with information.
The scanning antenna puts out radio-frequency signals in a relatively short range. The RF
radiation does two things:
It provides a means of communicating with the transponder (the RFID tag) AND
It provides the RFID tag with the energy to communicate (in the case of passive
RFID tags).
9
This is an absolutely key part of the technology; RFID tags do not need to contain
batteries, and can therefore remain usable for very long periods of time (maybe decades).
The scanning antennas can be permanently affixed to a surface; handheld antennas are
also available. They can take whatever shape you need; for example, you could build
them into a door frame to accept data from persons or objects passing through. When an
RFID tag passes through the field of the scanning antenna, it detects the activation signal
from the antenna. That "wakes up" the RFID chip, and it transmits the information on its
microchip to be picked up by the scanning antenna.
Active RFID tags have their own power source; the advantage of these tags is that the
reader can be much farther away and still get the signal. Even though some of these
devices are built to have up to a 10 year life span, they have limited life spans. Passive
RFID tags, however, do not require batteries, and can be much smaller and have a
virtually unlimited life span. RFID tags can be read in a wide variety of circumstances,
where barcodes or other optically read technologies are useless.
The tag need not be on the surface of the object (and is therefore not subject to
wear)
The read time is typically less than 100 milliseconds
Large numbers of tags can be read at once rather than item by item.
10
CHAPTER 2
Literature Review
In this project we show that how we control the speed of any car up to set value. Once the
upper limit is set then it’s not possible to increase the speed of vehicle. THIS SET
code to car, as the car receive a code then car maximum speed limit is set. Now car driver
cannot exceed the speed limit. As the car is out of range then car speed can be changed.
In this project we use two circuits. One is transmitter and second is receiver circuit. In
both circuit we use 89s51 controller. In receiver circuit we use 89s51 with ADC and LCD
display. LCD display the value of speed of accelerometer. In receiver circuit we use
HT12D as a decoder to receive the RF frequency signal. In receiver circuit we use 433
MHz receiver and at the transmitter circuit we use 433 MHz transmitter circuit. In
transmitter circuit we use HT12E as an encoder component. With the help of two up
down switch we can set the limits such as 20,30,40,50 and 60 as maximum set value.
For vehicle we use small DC gear motor. When we on the circuit then default value of the
motor speed is 20, not we change the setting of maximum speed limit.
Now we use variable resistor to change the value of accelerometer. This variable resistor
is connected to the input of ADC circuit. When we vary the variable resistor value then
11
In this project we use 0804 ADC to check the value of input resistor. This ADC is 8 bit
ADC. Output of the ADC is connected to the microcontroller port p1. ADC converts the
input voltage and deliver it to the microcontroller. Input variable resistor actually varies
the 5 volt DC. When we vary the input voltage then ADC converts the input voltage to
Output of ADC is hex code, microcontroller coverts the hex data in ASCII code and
display into the LCD module. Microcontroller gets the value and save the same in the
ram content of the microcontroller. Controller continues vary the output of the DC motor
via varying the duty cycle. Controller compares the change with the set value. When
input value is equal to the set value then microcontroller stop to increasing the speed of
the DC motor.
12
CHAPTER 3
Every analysis is properly carried out only if we have right amount of components for
2. Crystal Oscillator
3. LCD 16 X 2
4. DC gear motor
6. Diode
7. Resistance
8. Capacitors
9. Transistors
Every component has its own particular property which is used to manipulate the
13
Circuit Diagrams = Following diagram is the main circuit diagram used in our
An ADC (ADC0804) is used for conversion. This will give a digital data
corresponding to the change in resistance. This data tells us the current
speed of vehicle we wish to have.
Since our maximum speed is 100, we need to convert the data in scale of 0-100.
The procedure to convert it is as follows:
The maximum resolution of ADC is 0-255 where 0 and 255 corresponds 0km/h
and 100 km/h respectively. We use the formula ((digital output*100/255)] to
scale in range of 0-100 km/h.
For ex: if we wish to change the speed by rotating potentiometer such that output
of ADC is 51.
Then the speed of vehicle will be [(51*100)/255] = 20 km/hr.
We have used two variables ‘value’ (to store current speed) and ‘limit’ (to store
the allowed speed). Since transmitter is not used yet limit is fixed to maximum
speed of vehicle which is 100.
Suppose the vehicle is running at 20 km/h. In that case:-
Value = 20;
Limit = 100;
16
If (value>limit)
Value=limit;
Using this data a PWM waveform can be generated as follows;
Motor= 1;
For (i=0; i<value; i++)
Delay();
Motor=0;
For(i=0;i<100-value;i++)
Delay();
This means that power will be delivered to the motor depending upon the value of
initial speed and power would be cut for the rest of time. This implies that only
some portion of power from battery is being supplied to the motor to rotate and
hence motor speed is adjusted accordingly.
Value = 60;
Limit = 40;
If (value>limit)
Value=limit; /*Now value=40*/
Using this data a PWM waveform can be generated as follows;
Motor= 1;
For (i=0; i<value; i++)
Delay();
Motor=0;
For(i=0;i<100-value;i++)
Delay();
17
CHAPTER 4
ADC:
Analog to digital converters are among the most widely used devices for data acquisition.
Digital computers use binary values, but in the physical world everything is analog.
Temperature, pressure (wind or Liquid), humidity, and velocity are a few examples of
physical quantities that we deal with every day. A physical quantity is converted to
electrical (voltage, current) signals using a device called a transducer. Transducers are
also referred to as sensors. Although there are sensors for temperature, velocity, pressure,
light, and many other natural quantities, they produce an output that is voltage (or
current). Therefore, we need an analog to digital converter to translate the analog signals
to digital numbers so that the microcontroller can read them, a widely used ADC chip is
the ADC0804.
18
. Chip
Fig 2: ADC0804
The ADC0804 IC is an analog to digital converter in the family of the ADC800 series
works with +5 volts and has a resolution of 8 bits. In addition to resolution, conversion
time is another major factor in judging and ADC. Conversion time is defined as the time
19
it takes the ADC to convert the analog input to a digital number. In the ADC0804, the
conversion time varies depending on the clocking signals applied to the CLK R and CLK
CS
Chip select is an active low input used to activate the ADC804 chip. To access the
RD (read)
This is an input signal and is active low. The ADC converts the analog input to its binary
equivalent and holds it in an internal register. RD is used to get the converted data out of
the ADC 0804 chip. When CS = 0, if a high to low pulse is applied to the RD pin, the 8
bit digital output shows up at the D0-D7 data pins. The RD pin is also referred to as
output enable.
WR (Start conversion)
This is an active low input used to inform the ADC 804 to start the conversion process. If
the CS = 0 when WR makes a low to high transition, ADC 804 starts converting the
analogue input value of Vin to an 8 bit digital number. The amount of time it takes to
convert varies depending on the CLK IN and CLK R values explained below. When the
data conversion is complete, the INTR pin is forced low by the ADC804.
used for timing. However, the 804 has an internal clock generator. To use the internal
clock generator (also called self-clocking) of the ADC804 the CLK IN and CLKR pins
are connected to a capacitor and a resistor, as shown in the fig. In that case the clock
F = 1/ 1.1RC
20
Typical values are R = 10 k ohms and C = 150pf, Substituting in the above equation, we
get f = 606 kHz. In that case, the conversion time is 110 microsecond.
This is an output pin and is active low, it is normal high pin and when the conversion is
finished, it goes low to signal the CPU that the converted data is ready to be picked up.
After INTR goes low, we make CS = 0 and send a high to low pulse to the RD pin to get
VIN ( + ) AND V in ( -)
These are the differential analog inputs where Vin = Vin(+) – Vin (-) Often the Vin ( -)
pin is connected to ground and the Vin ( +) pin is used as the analog to be converted to
digital.
Vcc
This is the +5 volt power supply. It is also used as a reference voltage when the Vref/2
Vref/2
Pin 9 is an input voltage used for the reference voltage. If the pin is open (not connected
), the analog input voltage for the ADC804 is in the range of 0 to 5 volts 9 the same as the
Vcc pin ). However, there are many applications where the analog input applied to vin
needs to be other than the 0 to +5v range. Vref/2 is used to implement analog input
21
voltages other than 0-5volt, For example, if the analog input range needs to be 0 to 4
D0-D7
D0-DT (where D7 is the MSB, D0 the LSB) are the digital data output pins. These are tri-
state buffered and the converted data is accessed only when CS = 0 and RD is forced low.
Where Dout = digital data output (in decimal ), Vin = analog input voltage, and step size
( resolution ) is the smallest change, which is ( 2 x Vref/2) / 256 for an 8 bit ADC.
These are the input pins providing the ground for both the analog signal and the digital
signal. Analog ground is connected to the ground of the analog Vin while digital ground
is connected to the ground of the Vcc pin. The reason that we have two ground pins is to
isolate the analog Vin signal from transient voltages caused by digital switching of the
output D0-D7, such isolation contributes to the accuracy of the digital data output. In our
discussion, both are connected to the same ground; however, in the real world of data
POWER SUPPLY:
A portable DC battery is used as a Power Supply.
22
7805 Regulator:
Reset Circuitry:
Pin no 9 of the controller is connected to the reset circuit. On the circuit we connect one
As soon as you give the power supply the 8051 doesn’t start. You need to restart for the
the reset pin at least for the 2 clock pulses. So it is good to go for a small circuit which
23
This is not a big circuit we are just using a capacitor to charge the microcontroller and
circuit.
Crystals provide the synchronization of the internal function and to the peripherals.
Whenever ever we are using crystals we need to put the capacitor behind it to make it
24
We can also resonators instead of costly crystal which are low cost and external capacitor
can be avoided.
But the frequency of the resonators varies a lot. And it is strictly not advised when used
The 8051 doesn’t have any special feature than other microcontroller. The only feature is
that it is easy to learn. Architecture makes us to know about the hardware features of the
microcontroller. The features of the 8051 are:
25
128 x 8-Bit Internal RAM
Fully Static Operation: 1 MHz to 24 MHz
32 Programmable I/O Lines
Two 16-Bit Timer/Counters
Six Interrupt Sources (5 Vectored)
Programmable Serial Channel
Low Power Idle and Power Down Modes
The 8051 has a 8-Bit CPU that means it is able to process 8 bit of data at a time. 8051 has
235 instructions. Let’s elaborate the characteristics and functions of 8051:
Most of the transactions within the microcontroller are carried out through the ‘A’
register, also known as the Accumulator. In addition all arithmetic functions are carried
out generally in the ‘A’ register. There is another register known as the ‘B’ register,
which is used exclusively for multiplication and division.
Thus an 8-bit notation would indicate that the maximum value that can be input into these
registers is ‘11111111’. Puzzled?
The value is not decimal 111, 11,111! It represents a binary number, having an equivalent
value of ‘FF’ in Hexadecimal and a value of 255 in decimal.
We shall read in more detail on the different numbering systems namely the Binary and
Hexadecimal system in our next module.
2. 4K on-chip ROM
Once you have written out the instructions for the microcontroller, where do you put
these instructions?
Obviously you would like these instructions to be safe, and not get deleted or changed
during execution. Hence you would load it into the ‘ROM’
The size of the program you write is bound to vary depending on the application, and the
number of lines. The 8051 microcontroller gives you space to load up to 4K of program
size into the internal ROM.
26
4K, that’s all? Well just wait. You would be surprised at the amount of stuff you can load
in this 4K of space.
Of course you could always extend the space by connecting to 64K of external ROM if
required.
This is the space provided for executing the program in terms of moving data, storing
data etc.
4. 32 I/O lines. (Four- 8 bit ports, labeled P0, P1, P2, P3)
In our bulb example, we used the notation p1.0. This means bit zero of port one. One bit
controls one bulb.
Thus port one would have 8 bits. There are a total of four ports named p0, p1, p2, p3,
giving a total of 32 lines. These lines can be used both as input or output.
The manufacturers have provided a solution, by providing two timers. These timers
execute in the background independent of the main program. Once the required time has
been reached, (remember the time calculations described above?), they can trigger a
branch in the main program.
These timers can also be used as counters, so that they can count the number of events,
and on reaching the required count, can cause a branch in the main program.
The 8051 microcontroller is capable of communicating with external devices like the PC
etc. Here data is sent in the form of bytes, at predefined speeds, also known as baud rates.
27
The transmission is serial, in the sense, one bit at a time
7. 5- Interrupt sources with two priority levels (Two external and three internal)
During the discussion on the timers, we had indicated that the timers can trigger a branch
in the main program. However, what would we do in case we would like the
microcontroller to take the branch, and then return back to the main program, without
having to constantly check whether the required time / count has been reached?
This is where the interrupts come into play. These can be set to either the timers, or to
some external events. Whenever the background program has reached the required
criteria in terms of time or count or an external event, the branch is taken, and on
completion of the branch, the control returns to the main program.
Priority levels indicate which interrupt is more important, and needs to be executed first
in case two interrupts occur at the same time.
This represents the oscillator circuits within the microcontroller. Thus the hardware is
reduced to just simply connecting an external crystal, to achieve the required pulsing rate.
Supply =pin of this IC is pin no 40. Normally we apply a 5 volt regulated dc power
supply to this pin. For this purpose either we use step down transformer power supply
or we use 9 volt battery with 7805 regulator.
Ground =pin of this IC is pin no 20. Pin no 20 is normally connected to the ground pin
(normally negative point of the power supply.
XTAL =It is connected to the pin no 18 and pin no 19 of this IC. The quartz crystal
oscillator connected to XTAL1 and XTAL2 PIN. These pins also needs two capacitors
of 30 pf value. One side of each capacitor is connected to crystal and other pins is
connected to the ground point. Normally we connect a 12 MHz or 11.0592 MHz crystal
with this IC. But we use crystal up to 20 MHz to this pins
28
RESET Pin =Pin no 9 is the reset pin of this ic.. It is an active high pin. On applying a
high pulse to this pin, the micro controller will reset and terminate all activities. This is
often referred to as a power on reset. The high pulse must be high for a minimum of 2
machine cycles before it is allowed to go low.
PORT0 =Port 0 occupies a total of 8 pins. Pin no 32 to pin no 39. It can be used for
input or output. We connect all the pins of the port 0 with the pull-up resistor (10 k ohm)
externally. This is due to fact that port 0 is an open drain mode. It is just like an open
collector transistor.
PORT1=ALL the ports in microcontroller is 8 bit wide pin no 1 to pin no 8 because it is
a 8 bit controller. All the main register and SFR all is mainly 8 bit wide. Port 1 is also
occupies a 8 pins. But there is no need of pull up resistor in this port. Upon reset port 1
act as a input port. Upon reset all the ports act as a input port
PORT2 = Port 2 also have a 8 pins. It can be used as a input or output. There is no need
of any pull up resistor to this pin.
PORT 3 = Port3 occupies a total 8 pins from pin no 10 to pin no 17. It can be used as
input or output. Port 3 does not require any pull up resistor. The same as port 1 and port2.
Port 3 is configured as an output port on reset. Port 3 has the additional function of
providing some important signals such as interrupts. Port 3 also use for serial
communication.
ALE =ALE is an output pin and is active high. When connecting an 8031 to external
memory, port 0 provides both address and data. In other words, the 8031
multiplexesaddress and data through port 0 to save pins. The ALE pin is used for
demultiplexing the address and data by connecting to the IC 74ls373 chip.
PSEN =PSEN stands for program store enable. In an 8031 based system in which an
external ROM holds the program code, this pin is connected to the OE pin of the rom.
EA.EA. In 89c51 8751 or any other family member of the ATMEL 89c51 series all come
with on-chip ROM to store programs, in such cases the EA pin is connected to the Vcc.
For family member 8031 and 8032 is which there is no on chip ROM, code is stored in
external memory and this is fetched by 8031. In that case EA pin must be connected to
GND pin to indicate that the code is stored externally.
29
LCD:
We use 5 volt regulated supply for the LCD display and max 232 ic. For this purpose we
use 7805 regulator with filter capacitor to provide a ripple free regulated voltage to
We use MAX232 driver IC to provide a interface between GSM modem and controller.
MAX 232 IC convert the rs232 logic to TTL logic. Output of the max 232 is directly
30
Pin no 18 and 19 of the microcontroller is connected to external crystal oscillator to
provide a external clock to microcontroller by which we set the machine cycle of the
controller
PIN NO 4 RS RS = 0 TO SELECT
31
Frequently, an 8051 program must interact with the outside world using input and output
devices that communicate directly with a human being. One of the most common devices
attached to an 8051 is an LCD display. Some of the most common LCDs connected to
the 8051 are 16x2 and 20x2 displays. This means 16 characters per line by 2 lines and 20
characters per line by 2 lines, respectively.
In the transmitter circuit we use one RF module to send the data serially via radio
frequency . Here in this project we use 433 Mhtz radio frequency module o send the data
serially. Modulating frequency of the project is 433Mhtz and modulation type is ASK.
RF TRANSMITTER
433 MHtz
ASK MODULATION
ANT
GND
+VCC
DATA
ENCODER
DATA
32
When ever we want to send a data we use encoder ic to convert the parallel data into
serial. This serial data is transmitting by the radio frequency module in air. For selecting
a data base we use DIP switches. In actual practice we use internal data base. But in this
project we use external data base to selection. Here we use four bit data with the help of
DIP switches. Data is to be converted into serial with the help of the encoder IC. Here we
use HT 12E encoder IC. HT12E encoder IC convert the parallel data into serial data.
Pin no 1to 8 is address pin. Pin no 9 is ground pin. Pin no 10,11,12,13 is data insertion
pin. We provide a 0 bit on the entire address pin. But it is not necessary. We select the
address line pins as our requirement. For providing a data to data pins either we provide a
4 bit data from microcontroller or any other digital circuit or we connect DIP switches
Dip switches are connected with the pin no 10,11,12,13 . Pin no 14 is transmit control
33
pin. We control the pin no 14 by connecting a pin no 14 to ground pin. When this pin is
ground then only, data is to be transmit from the IC . Pin no 15 and 16 is the oscillator pin
of the encoder IC . On this pin we connect a 1 M ohm resistor. Pin no 17 is data output
pin. Data from this pin is connected to the input of transmitter module.
Data receive by the radio frequency receiver module. This receiver module is same as the
frequency of transmitter module. Output from radio frequency module is further decoded
by the decoder IC. Output of the decoder IC is further converted into parallel and
proceeds to the microcontroller for further process. Or we get the data from decoder
directly.
The TWS-434 and RWS-434 are extremely small, and are excellent for applICations
requiring short-range RF remote controls. The transmitter module is only 1/3 the size of
a standard postage stamp, and can easily be placed inside a small plastic enclosure.
34
range of approximately 400 foot (open area) outdoors. Indoors, the range is
approximately 200 foot, and will go through most walls.....
TWS-434A
The TWS-434 transmitter accepts both linear and digital inputs, can operate from 1.5 to
12 Volts-DC, and makes building a miniature hand-held RF transmitter very easy. The
TWS-434 is approximately the size of a standard postage stamp.
35
Fig.10: Sample Transmitter
Application Circuit
RWS-434: The receiver also operates at 433.92MHz, and has a sensitivity of 3uV. The
RWS-434 receiver operates from 4.5 to 5.5 volts-DC, and has both linear and digital
outputs.
RWS-434 Receiver
36
Fig.11: RWS-434 Pin Diagram
37
The example above shows the receiver section using the HT-12D decoder IC for a 4-bit
RF remote control system. The transmitter and receiver can also use the Holtek 8-bit HT-
640/HT-648L remote control encoder/decoder combination for an 8-bit RF remote
control system. Here are the schematics for an 8-bit RF remote control system:
38
Chapter 5
Software Implementation
1 #include<reg51.h>
2
3 #define input P1
4
5 sbit wr=P2^3;
6 sbit rd=P2^4;
7 sbit intr=P2^2;
8
9 sbit motor=P2^7;
10
11
12 #define lcd P0
13
14 sbit rs=P2^0;
15 sbit en=P2^1;
16
17 sbit d1=P3^7;
18 sbit d2=P3^6;
19 sbit d3=P3^5;
20 sbit d4=P3^4;
21
22 void delay(unsigned int a)
23 { while(a--); }
24
25 void lcdinit();
26 void command(unsigned char x);
27 void data1(unsigned char x);
28 void lcd_write(char *s,unsigned char x);
29
30 void main()
39
31 {
32 1
33 1 unsigned int value,i,limit;
34 1
35 1 TMOD=0x01;
36 1
37 1
38 1 lcdinit();
39 1 lcd_write("Acc: Lim:",0x80);
40 1 lcd_write("FinalSpeed :",0xc0);
41 1
42 1 while(1)
43 1 {
44 2
45 2 wr=0;
46 2 delay(100);
47 2 wr=1;
48 2 delay(1000);
49 2 rd=0;
50 2
51 2 value=((P1*100)/255);
52 2 intr=1;
53 2 rd=1;
54 2 command(0x84);
55 2 data1( (value/100) +48);
56 2 data1( (value/10)%10 +48);
57 2 data1( (value%10) +48);
58 2
59 2 limit=100;
60 2 if(d1==0)
61 2 limit=20;
62 2 else if(d2==0)
63 2 limit=40;
64 2 else if(d3==0)
65 2 limit=60;
66 2 else if(d4==0)
67 2 limit=80;
68 2
69 2 if(limit!=100)
40
70 2 {
71 3 command(0x8d);
72 3 data1( (limit/100) +48);
73 3 data1( (limit/10)%10 +48);
74 3 data1( (limit%10) +48);
75 3 }
76 2 else
77 2 {
78 3 command(0x8d);
79 3 data1(' ');
80 3 data1('-');
81 3 data1(' ');
82 3 }
83 2
84 2 if(limit<value)
85 2 value=limit;
86 2
87 2 command(0xcd);
88 2 data1( (value/100) +48);
89 2 data1( (value/10)%10 +48);
90 2 data1( (value%10) +48);
91 2
92 2 motor=0;
93 2 for(i=0;i<value;i++)
94 2 {
95 3 TH0=0xff;
96 3 TL0=0x20;
97 3 TR0=1;
98 3 while(TF0==0);
99 3 TR0=0;
100 3 TF0=0;
101 3 }
102 2 motor=1;
103 2 for(i=0;i<100-value;i++)
104 2 {
105 3 TH0=0xff;
106 3 TL0=0x80;
107 3 TR0=1;
108 3 while(TF0==0);
41
109 3 TR0=0;
110 3 TF0=0;
111 3 }
112 2
113 2 }
114 1
115 1 }
116
117
118
119 void lcdinit()
120 {
121 1 delay(100);
122 1
123 1 command(0x01);// clear display screen
124 1 delay(500);
125 1
126 1 command(0x38);// 2 lines, 5X7 matrix
127 1 delay(500);
128 1
129 1 command(0x06);// increment cursor
130 1 delay(500);
131 1
132 1 command(0x0c);// display on, cursor off
133 1 delay(500);
134 1 delay(500);
135 1 delay(500);
136 1 }
137
138 void command(unsigned char x) // to send command
139
140 {
141 1 lcd=x;
142 1 rs=0;
143 1 en=1;
144 1 delay(20);
145 1 en=0;
146 1 delay(100);
147 1 }
42
148
149 void data1(unsigned char x) // to write a char.
150 {
151 1 lcd=x;
152 1 rs=1;
153 1 en=1;
154 1 delay(10);
155 1 en=0;
156 1 delay(100);
157 1 }
158
159 void lcd_write(char *p,unsigned char x)
160 {
161 1 int hj=0;
162 1 if(x!='0')
163 1 command(x);
164 1
165 1 while(p[hj]!='\0')
166 1 {
167 2
168 2 data1(p[hj]);
169 2 hj++;
170 2 }
171 1 }
43
CHAPTER 6
In the last semester, we made a successful prototype of a vehicle in which we can vary
the speed of the vehicle using the potentiometer that is connected to the input of an ADC
chip. The changing values of potentiometer were taken as speed of the vehicle. The
corresponding digital output is given to the micro-controller and this current speed of the
vehicle is compared with the maximum speed of the vehicle i.e. 100km/h (assumption).
Then after the comparison, the appropriate PWM was generated through pin 28 of 89S51
chip which manipulates the connection between power source and dc motor. So after this,
the corresponding duty cycle generated which made the dc motor to rotate accordingly.
The after comparison value is given to the LCD display too for displaying the
acceleration/deceleration of the vehicle.
In this semester, we implemented the transmitter and receiver circuit to control the speed
of the vehicle according to the speed limits set by us. The transmitter uses the RF signal
to communicate with the receiving decoder circuit situated in the vehicle.
The results suggest that an automatic intelligent speed control system can be used to
prevent any unexpected traffic circumstance and improve the safety of the occupants of
the vehicle. It will lessen the work of traffic police and moreover it will increase the
safety of people on specific zones such as hospitals, schools etc.
44
References
2. Joshué Pérez *, Fernando Seco, Vicente Milanés, Antonio Jiménez, Julio C. Díaz And
Teresa De Pedro, “An RFID-Based Intelligent Vehicle Speed Controller Using Active
Traffic Signals”.
3. Preeti, Sandeep Dogra, Rashmi Jain, “DC Drives: Microcontroller Based Control”.
4. www.youtube.com
45
46
47