Professional Documents
Culture Documents
CHAPTER 1
INTRODUCTION
1
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
1.1 Description
Automatic Toll Collection (ATC) is a technology that allows for electronic
payment of tolls. An ATC system is able to determine if a car is registered in a toll
payment program, alerts enforcers of toll payment violations, and debits the
participating account. With ATC, these transactions can be performed while vehicles
travel at near highway cruising speed. ATC is fast becoming a globally accepted
method of toll collection, ATC systems are an improvement over conventional toll
collection techniques. Some of the benefits for drivers include:
Fewer and shorter queues at toll plazas by increasing toll booth service rates;
Faster and more efficient service—the customer does not need to stop or have toll fees
on hand;
The ability to pay by keeping a balance on the customer’s account or charging a
registered credit card;
Mailed toll statements—the customer no longer has to request a receipt.
Some of the benefits for toll operators include:
• Lowered toll collection costs;
• Better audit control by centralized user accounts;
• Expanded capacity without being required to build more infrastructures.
• For everyone, some of the benefits of ETC include:
• Fuel savings;
• Reduced mobile emissions by reducing or eliminating deceleration, waiting
times, and acceleration;
• Possible reduced drain on public monies, if the system is more self-sustaining
or if the system was built/run via a public-private partnership arrangement.
1.2 Operation:
Present project is designed using PIC microcontroller to avoid long queues at
toll plazas and also saves the time consumed during manual payment of the toll tax.
This project utilizes RFID module to read the smart card. And optocoupler is used to
sence the presence of vehicle . As the optocoupler senses the presence of vehicle
“ENTER YOUR CARD” will be displayed on LCD . Then driver will have to punch
card on RFID module . Then RFID module will scan the card . Here different cards
2
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
are used for heavy and light vehicle depending upon the size of vehicle . As the card
will be punched on RFID module it will show the present balance, amount deducted
and current balance on LCD. Then stepper motor will open the gate. In this
ULN2004 IC is also used to drive the stepper motor to open the gate. And after this
payment the gate will get opened for few seconds and then get closed automatically.
The corresponding details regarding the whole operation will get displayed on the
LCD. Whenever someone punches the card in a wrong manner “INVALID USER”
will be displayed on the LCD.
3
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
4
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
5
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
CHAPTER 2
LITERATURE: A REVIEW
6
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
7
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
Digital Circuits
Decoder, latches
etc.
Printed Electro-
Circuit mechanical
Boards Motors,
(PCB’s) Valves etc.
Machine
Language
Embedded C,
C++
2.2 MICROCONTROLLER
8
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
Thirty two input/output pins arranged as four 6-bit ports: P0-P3.Two 16-bit
timer/counters: T0 and T1.Full duplex serial data receiver/Transmitter: SBUF.
Control register: TCON, TMOD, SCON, PCON, IP, and One-Two external and three
internal interrupt sources. Oscillator and clock circuits Microcontroller is a single chip
computer.
9
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
4 – Bit microcontroller
8 – Bit microcontroller
16 – Bit microcontroller
32 – Bit microcontroller
64 – Bit microcontroller
• 6 – bit word size adequate for many computing tasks and control or
monitoring applications.
10
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
11
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
12
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
13
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
cycle rate.
RA2/AN2/VREF 4
RA2 I/O TTL Digital I/O.
AN2 I ANALOG Analog input 2.
VREF- A/D Reference Voltage (Low) input.
RA3/AN3/VREF+ 5
RA3 I/O TTL Digital I/O.
AN3 I ANALOG Analog input 3.
VREF+ I A/D Reference Voltage (High) input.
RA4/T0CKI 6
RA4 I TTL Digital I/O.
T0CKI ST Timer0 external clock input
RA5/AN4/SS/HLVDIN 7 I/O
RA5 I TTL Digital I/O.
AN4 I ANALOG Analog input 4.
SS I TTL SPI™ Slave Select input.
HLVDIN ANALOG High/Low-Voltage Detect input.
I/O
14
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
RB1/INT1/AN6 34
RB1 I/O TTL Digital I/O.
INT1 I ST External interrupt 1.
AN6 I ANALOG Analog input 6.
RB2/INT2/CANTX 35
RB2 I/O TTL Digital I/O.
INT2 I ST External interrupt 2.
CANTX O TTL CAN bus TX
RB3/CANRX 36
RB3 I/O TTL Digital I/O.
CANRX I TTL CAN bus RX.
RB4/KBI0/AN9 37
15
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
16
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
Digital I/O.
RC3/SCK/SCL Synchronous serial clock input/output
RC3 I/O ST for SPI™ mode.
SCK I/O ST Synchronous serial clock input/output
SCL 23 I/O ST for I2C™ mode.
CK I/O ST
Digital I/O.
EUSART asynchronous receive.
RC7/RX/DT EUSART synchronous data (see
RC7 ST related TX/CK).
RX ST
DT ST
RE3 See MCLR/VPP/RE3 pin.
VSS 12,31 Ground reference for logic and I/O
pins.
VDD 11,32 Positive supply for logic and I/O pins
PORTD is a bidirectional I/O port or
17
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
a Parallel Slave
Port (PSP) for interfacing to a
microprocessor port. These pins have
TTL input buffers when PSP module
enabled.
RD0/PSP0/C1IN+ 19
RD0 Digital I/O.
PSP0 I/O Parallel Slave Port data.
C1IN+ I/O Comparator 1 input (+).
I ST
RD1/PSP1/C1IN 20 TTL
RD1 ANALOG Digital I/O.
PSP1 I/O Parallel Slave Port data.
C1IN- I/O Comparator 1 input (-)
I ST
RD2/PSP2/C2IN+ 21 TTL
RD2 ANALOG Digital I/O.
PSP2 I/O Parallel Slave Port data.
C2IN+ I/O Comparator 2 input (+).
I ST
RD3/PSP3/C2IN TTL
RD3 22 ANALOG Digital I/O.
PSP3 I/O Parallel Slave Port data.
C2IN- I/O Comparator 2 input (-).
I ST
RD4/PSP4/ECCP1/ 27 TTL
P1A ANALOG Digital I/O.
RD4 I/O Parallel Slave Port data.
PSP4 I/O Capture2 input/Compare 2
ECCP1 I/O output/PWM2 output.
P1A I/O ECCP1 PWM output A.
O
RD5/PSP5/P1B
18
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
RD7/PSP7/P1D
RD7 30 Digital I/O.
PSP7 Parallel Slave Port data.
P1D ECCP1 PWM output D.
19
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
Comparator 2 output.
AN7 I/O
C2OUT I
1. Contain no on chip ram, rom, i/o, timer, 1. Contain on chip ram, rom, i/o, timer, serial
serial port. port.
2. used in general purpose application 2. used in specific purpose application
20
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
CHAPTER 3
COMPONENT LIST
AND
DETAILS
• PIC microcontroller
• ULN2004
• U-Shape opto-coupler
• Capacitors
• Resistances
• Transformer
21
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
• Crystal oscillator
• LED
• Diode
• LCD
• IC 7805CV voltage regulator
• Stepper motor
• Power supply
• CCB
• RFID module
• Switches
• Potentiometer
• 2 & 5 pin connector (male)
22
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
3.2.2 Opto-Couplers
Description
The MCT2XXX series opt isolators consist of a gallium arsenide infrared
emitting diode driving a silicon phototransistor in a 6-pin dual in-line package.
23
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
1. CERAMIC CAPACITOR:
In this project, 0.01 microfarad capacitor is a ceramic capacitor.
The basis of the ceramic material is mainly barium titan ate or a similar material, but
other ceramic substance including hydrous silicate of magnesia or talc are also used.
The electrodes are applied in the form of silver which is either spread or plated on to
the opposite faces of a thin tube, wafer or disc made from the ceramic material.
24
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
Connecting wires are then soldered to this deposit and the whole capacitor dipped in
for a suitable coating. The two conducting places separated by an insulating material
(called dielectric) forms a capacitor. The basic purpose of a capacitor is to store the
charge. The capacity of a capacitor to store charge per unit potential difference is
called capacitance which is measured in Farads but the practical units are
micro/nano/pico farads. The capacitor also offers low impedance to AC but very high
impedance to DC. The applications include coupling, bypassing and filtering for AC
signal. Capacitors are of various types that include paper, Mica, Ceramic &
Electrolytic. The capacitors can also be of either variable or fixed type. The capacitors
used in the project are fixed: ceramic or electrolytic type.
25
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
3.2.4 Transformer:
A Transformer is a static piece of apparatus by means of which electric power
in one circuit is transformer in to electric power of the same frequency in another
circuit. It a raise or lower the voltage in a circuit decrease or increase in current. The
physical basis of a Transformer is natural induction between tow circuits linked by a
common magnetic flux. According to construction there are two type of Transformer
know as:-
a. Core Type Transformer: The coil used is form wound and is of the cylindercal
type. The general form of these coil may be circular or over all rectangular. In small
size core type Transformer a simple rectangular core is used with cylinder cal coil is
used which are so wound as to fit over a cruciform core sections.
b .Shell Type Transformer: In shell type Transformer the coil are form wound but
are multi layer disc type usually wound in the form of pancakes. The different layers
of such multi layer disc are insulated form each other by paper. The completed
winding consists of takes disc with insulation space between the coils.
A 1
D1 D3
AC
3 Load 4
Supply
+ -
D4 D2
B 2
26
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
The transistor could be a general purpose type with a Ft of at least 150 MHz for HF
use. A typical example would be a 2N2222A. The turn’s ratio on the tuned circuit
depicts an anticipated nominal load of 50 ohms. This allows theoretical 2K5 ohms on
the collector. If it is followed by a buffer amplifier (highly recommended) I would
simply maintain the typical 7:1 turn’s ratio. I have included a formula for determining
L and C in the tuned circuits of crystal oscillators in case you have forgotten earlier
tutorials.
3.2.7 LED:
27
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
LED falls within the family of P-N junction devices. The light emitting diode
(LED) is a diode that will give off visible light when it is energized. In any forward
biased P-N junction there is, within the structure and primarily close to the junction, a
recombination of holes and electrons. This recombination requires that the energy
possessed by the unbound free electron be transferred to another state. The process of
giving off light by applying an electrical source of energy is called
electroluminescence. As shown in fig., with its graphic symbol, the conducting
surface connected to the P-material is much smaller, to permit the emergence of the
maximum number of photons of light energy. Note in the figure that the
recombination of the injected carriers due to the forward-biased junction results in
emitted light at the site of recombination. There may, of course, be some absorption
of the packages of photon energy in the structure itself, but a very large percentage are
able to leave, as shown in the figure.
28
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
If a P-region is made positive with respect to the N-region by an external circuit then
junction is forward biased and junction has a very low resistance to the flow of
current. Holes in the positive P-type material are attracted across the junction to the
negative side and the free electrons in the N-type material are like wise attracted to
the opposite side. If a positive voltage is applied to N-zone with respect to the P-zone
terminal, the P-N junction is reverse biased.
3.2.9 LCD
A liquid crystal display (LCD) is a thin, flat display device made up of number
of colors and monochrome pixels arrayed in front of a light source or reflector. It is
often utilized in battery powered electronic devices because it uses small amount of
electric power.
TYPES OF LCD:
LCD can break into two groups
a. Graphics LCD:
• Easy to use
• Work in most microcontrollers
• Idle for moving display
• Inexpensively priced
b. Character LCD
• Standard type
• Use HD 44780 controller
29
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
LCD Pins:
• 8 Data Pins D0-D7: Bidirectional data/command pins. Alphanumeric
characters are send in ASCII format.
• RS: Register Select: RS=0 implies command register is selected.
RS=1 implies data register is selected
• R/W: Read Or Write: 0-> Write, 1-> Read
3.2.10 IC-7805
78XX Series are three terminal +ve fixed voltage regulators these are available with
seven output options i.e. (5v, 6v, 7v, 12,15v & 24v) and 79xx series are terminal fixed
voltage negative regulators.
Characteristics
• Vo- The regulated out put voltage is fixed at a value which is specified by
manufactures and it is indicated by the IC number.
• Vin- The unregulated input must be at least 2v more than regulated out put
voltage.
• Io max- The out put current on the load may vary from zero to maximum out
put current and to protect it from thermal breakdown heat sinks are used.
• Thermal Shut Down-There is internal temperature sensors which turn OFF
the IC when it becomes too hot. The IC again starts working when it is cooling
up to given specified level.
30
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
A 1 7805
D1 D3
1000 µF + +
AC
3 4
Supply - -
D4 D2
B 2
31
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
The RFID technology is a means of gathering data about a certain item without the
need of touch-ing or seeing the data carrier, through the use of inductive coupling or
(together called transponder or tag), the latter enabling the chip to transmit
information to a reader (or transceiver) within a given range, which can forward the
information to a host computer. The middleware (software for reading and writing
tags) and the tag can be enhanced by data encryption for security-critical application
at an extra cost, and anti-collision algorithms may be implemented for the tags if
One important feature enabling RFID for tracking objects is its capability to provide
unique identification. One possible approach to item identification is the EPC
(Electronic Product Code) , pro-viding a standardized number in the EPC global
Network, with an Object Name Service (ONS) pro-viding the adequate Internet
addresses to access or update instance-specific data. However, currently, ONS cannot
be used in a global environment, and since it is a proprietary service, its use is
relatively expensive, especially for participants with limited resources such as SMEs.
As an alter-native, researchers from the Helsinki University have proposed the
notation ID@URI, where ID stands for an identity code, and URI stands for a
corresponding Internet address. This allows several partners to use the system and still
guarantee unique identification.
32
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
Semi-passive
- uses a battery to maintain memory in the tag
or power the elec-tronics that enable the tag to
modulate the reflected signal
- communicates in the same method, as the
other passive tags
Active
- powered by an internal battery, used to run
the microchip’s cir-cuitry and to broadcast a
signal to the reader
- generally ensures a longer read range than
passive tags
- more expensive than passive tags (especial
because usually are read/write)
- the batteries must be replaced periodically
Read-write
- can be as well read as written into
- its data can be dynamically altered
- can store a larger amount of data, typically
ranging from 32 kBytes to 128 kbBytes
- being more expensive than read-only chips,
is impractical for tracking inexpensive items
By the method of wireless signal used for communication between the tag and reader
Induction - Close proximity electromagnetic, or
inductive coupling—near field
- Generally use. LF and HF frequency bands
Propagation - Propagating electromagnetic waves—far
field
- Operate in the UHF and microwaves
frequency bands
33
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
CHAPTER 4
PCB LAYOUT
AND
34
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
PREPRATION
35
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
The entire circuit can be easily assembled on a general purpose PCB board
respectively. Layout of desired diagram and preparation is first and most important
operation in any printed circuit board manufacturing process. First of all layout of
component side is to be made in accordance with available components dimensions.
The following points are to be observed while forming the layout of PCB.
• Between two components, sufficient space should be maintained.
• High voltage/max dissipated components should be mounted at sufficient
distance from semiconductors and electrolytic capacitors.
• The most important points are that the component layout is making proper
compromise with copper side circuit layout.
• Printed circuit boards (PCBs) are used to avoid most of all the disadvantages
of conventional breadboard. These also avoid the use of thin wires for
connecting the components; they are small in size and efficient in
performance.
4.2.1 Etching:
The removal of excess of copper on the plate apart from the printed circuit is
known as etching. From this process the copper clad board with printed circuit is
placed in the solution of FeCl with 3-4 drops of HCl in it and is kept so for about 10
to 15 minutes and is taken out when all the excess copper is removed from the PCB.
After etching, the PCB is kept in clean water for about half an hour in order to get
PCB away from acidic field, which may cause poor performance of the circuit. After
the PCB has been thoroughly washed, paint is removed by soft piece of cloth dipped
36
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
in thinner or turbine. Then PCB is checked as per the layout, now the PCB is ready
for use.
4.2.2 Drilling:
After completion of painting work, holes of 1/23 inch (1 mm) diameter are drilled at
desired points where we have to fix the components
4.2.3 Soldering:
Soldering is the process of joining two metallic conductors the joint where two metal
conductors are to be joined or fused is heated with a device called soldering iron and
then as allow of tin and lead called solder is applied which melts and converse the
joint. The solder cools and solidifies quickly to ensure is good and durable connection
between the jointed metal converting the joint solder also present oxidation.
37
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
between PCB & leads of components. Allow heat flow between component, joining
elements & PCB.Retain adequate strength with temperature variation.
38
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
CHAPTER 5
39
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
40
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
41
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
CHAPTER 6
FUTURE SCOPE
LIMITATION AND CONCLUSION
42
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
6.2 Conclusion
6.2.1 General
With the theoretical inclination of our syllabus it become very essential to take
the utmost advantage of any opportunity of gaining practical experience that come
along .The construction of this project was one of these oppurtunities.It gave us the
requisite practical knowledge to supplement the already taught theoretical concept
thus making us more complement as an electronic engineer The project title
“AUTOMATIC TOLL TAX SYSTEM” as presented in this project report has been
designed for the electronic collection of toll at various places. Among so many types,
we have deliberately chosen the Optocoupler based one because if needed, with
relatively minor modifications, we can convert this into other type. This is one of the
easy and time saving methods for toll collection. This method also saves a lot of
manual power. This is also a cheap method for toll collection.
43
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
Target User
Large scale version can be implemented in both small &medium scale.
6.2.4 Advantages
• Less power consuming
• Reduce the miss happening
• Work automatically
• Easy to operate
• Simple construction
• Work easily where environmental conditions are not suitable for man
• Higher efficiency
6.2.5 Limitations
• Need regular check up
• Once problem occur hard to remove
• Resolving problem is time consuming
• Once microcontroller fails than whole system fails
• If any obstacle comes in between the opto coupler, it will read as smart card.
44
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
Reference
• A Single Phase Microcontroller Based Energy Meter, PAV Loss, MM
Lamengo, JLF, Vieira, IEEE Instrumentation and measurement technology
conference, USA, May 18-21 1998.
• Circuit Land Web Page, http://www.uoguelph.ca/~antoon/circ/circuits.htm
• Smart meter, customer choice and profitable time-of-use rate option Energy,
Volume 24, Issue 10, October 1999, Pages 895-903 Rob Hart way, Smaller
Price and C. K. Woo
45
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
Chapter-8
APPENDIX
SOURCE CODE
46
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
#include<pic.h>
//-----------------------------------------------
//-------------------------------------------------
/*
=============================================================
======================
RFID CARD LAST DIGIT
=============================================================
======================*/
/*
=============================================================
======================
TYPEDEF DECLARATION
=============================================================
======================*/
47
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
/*
=============================================================
======================
INTERRUPT FUNCATION
=============================================================
======================*/
bufferin[irx]=RCREG;
if(irx==11)
{
irx=0;
ReceiverFlag=1;
}
irx++;
RCIF=0;
}
//----------------------------------
void main(void)
{
TRISC=0X8F;
TRISB=0x00;
TRISD=0x00;
lcd_cmd_send(0x38);
lcd_cmd_send(0x01);
lcd_cmd_send(0x0C);
lcd_cmd_send(0x80);
//-----------------------
TXSTA=0x24; //TRASMITER
RCSTA=0x90; //RECIVER
SPBRG= 25; // BAUD RATE 9600
GIE=1;
PEIE=1;
48
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
RCIE=1;
RCIF=0;
lcd_cmd_send(0x01);
lcd_display("WELCOME",1,0);
//---------------------------------
while(1)
{
if(OPTO==0)
{
lcd_display("INSERT YOUR CARD",2,0);
}
rfid();
if(KEY1==0)
{
while(KEY1==0);
delay(1000);
amount1=amount1+100;
lcd_display("H BALANCE= ",2,0);
lcd_num_dis(amount1,0xCC);
delay(65000);
lcd_display("INSERT YOUR CARD",2,0);
}
else if(KEY2==0)
{
while(KEY2==0);
delay(1000);
amount2=amount2+100;
lcd_display("L BALANCE= ",2,0);
lcd_num_dis(amount2,0xCC);
delay(65000);
lcd_display("INSERT YOUR CARD",2,0);
delay(5000);
}
if(CardFlag==1)
{
delay(5000);
lcd_display("HEAVY VEHICLE ",2,0);
delay(65000);
49
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
if(amount1<=9)
{
delay(5000);
lcd_display("RS. 20 DEDUCTED ",2,0);
delay(65000);
amount1=amount1-20;
delay(65000);
lcd_display(" BALANCE= ",2,0);
lcd_num_dis(amount1,0xCC);
motor();
delay(65000);
rev();
lcd_display(" THANK YOU ! ",2,0);
CardFlag=0;
delay(5000);
if(CardFlag==2)
{
delay(5000);
lcd_display("LIGHT VEHICLE ",2,0);
delay(65000);
lcd_display(" BALANCE= ",2,0);
lcd_num_dis(amount2,0xCC);
delay(90000);
if(amount2<=9)
{
50
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
delay(65000);
delay(65000);
lcd_display("INSERT YOUR CARD",2,0);
delay(65000);
break;
}
delay(5000);
lcd_display("RS. 10 DEDUCTED ",2,0);
delay(65000);
amount2=amount2-10;
delay(65000);
lcd_display(" BALANCE= ",2,0);
lcd_num_dis(amount2,0xCC);
motor();
delay(65000);
rev();
lcd_display(" THANK YOU ! ",2,0);
CardFlag=0;
delay(5000);
//---------------------------------
void delay(unsigned long int mdelay)
{
while(mdelay--);
}
void lcd_cmd_send(unsigned char mcmd)
{
LCD=mcmd;
RS=0;
EN=1;
delay(25);
EN=0;
delay(100);
}
void lcd_char_send(unsigned char mchar)
{
LCD=mchar;
51
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
RS=1;
EN=1;
delay(25);
EN=0;
delay(100);
}
void lcd_display(unsigned char *slcd,unsigned char lcd_line,unsigned char lcd_posi)
{ unsigned char ilcd=0;
if(lcd_line==1)
{
lcd_cmd_send(0x80+lcd_posi);
}
if(lcd_line==2)
{
lcd_cmd_send(0xC0+lcd_posi);
}
while(slcd[ilcd]!='\0')
{
lcd_char_send(slcd[ilcd]);
ilcd++;
}
}
lcd_char_send(lunit+0x30);
void rfid()
{
if(ReceiverFlag==1)
{
irx=0;
52
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
ReceiverFlag=0;
for(int i=0;i<12;i++)
{
bufferin[i]=0;
}
irx=0;
}
else if(bufferin[8]=='3' && bufferin[9]=='8' &&
bufferin[10]=='0')
{
delay(3000);
CardFlag=2;
for(int i=0;i<12;i++)
{
bufferin[i]=0;
}
irx=0;
}
else
{
delay(5000);
for(int i=0;i<12;i++)
{
bufferin[i]=0;
}
irx=0;
}
}
53
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
void motor()
{
MOTOR11=1;
MOTOR12=0;
MOTOR21=0;
MOTOR22=0;
delay(30000);
MOTOR11=0;
MOTOR12=1;
MOTOR21=0;
MOTOR22=0;
delay(30000);
MOTOR11=0;
MOTOR12=0;
MOTOR21=1;
MOTOR22=0;
delay(30000);
MOTOR11=0;
MOTOR12=0;
MOTOR21=0;
MOTOR22=1;
delay(30000);
}
void rev()
{
MOTOR11=0;
MOTOR12=0;
MOTOR21=0;
MOTOR22=1;
delay(30000);
MOTOR11=0;
MOTOR12=0;
MOTOR21=1;
MOTOR22=0;
delay(30000);
54
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)
MAJOR PROJECT REPORT AUTOMATIC TOLL TAX
MOTOR11=0;
MOTOR12=1;
MOTOR21=0;
MOTOR22=0;
delay(30000);
MOTOR11=1;
MOTOR12=0;
MOTOR21=0;
MOTOR22=0;
delay(30000);
//---------------------------------
55
Neeraj.vlsi@gmail.com (NEERAJ SHARMA)