Professional Documents
Culture Documents
i
DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM USING
RFID AND GSM MODULE
ii
iii
CANDIDATE’S DECLARATION
I hereby declare that this project or any part of it has not been submitted elsewhere for the
_________________________________________
iv
ACKNOWLEDGEMENT
I would like to express my gratitude and profound indebtedness to my supervisor Dr. Md.
Monirul Kabir, Professor, Department of Electrical and Electronic Engineering of Dhaka
University of Engineering & Technology (DUET), Gazipur, Bangladesh, under his guidance,
inspiration and helpful support throughout my project work. Without the help and support that
could not be completed.
v
ABSTRACT
In this thesis, an automated toll plaza system using RFID and GSM modules has been
proposed, called as DATPS. The key aspect of this work is to deduct money from the vehicle
in the toll plaza automatically from the vehicle owner’s DBBL rocket account. The proposed
DATPS formulated by the RFID and GSM modules, which are controlled by the
microcontroller-based database control module. Particularly, in DATPS, RFID receiver is
interfaced with the microcontroller. Here, RFID receiver and RFID tags act as active and
passive components, respectively. The receiver is fixed constantly at the toll plaza for
searching the RFID tags. As soon as the tag comes in to the range of the receiver, the unique
code from the tag is identified by the RFID receiver and transmitted that information serially
to the microcontroller. When a vehicle comes into the range, the RFID receiver sensor
identifies the vehicle first by checking all the information from the database. If the checking
status is positive, the toll amount is deducted automatically from the owner’s DBBL account.
In this system, IR senses the vehicle motion for controlling the opening and closing of the
gate.
In order to evaluate the proposed model, a prototype DATPS was implemented using RFID
and GSM modules combined with microcontroller. In the experiments, when a small car
attached with RFID tag was passing through the toll plaza, it was found that the car was
received the entry permission and released from the toll plaza gate within 30 sec. and
successfully deducted money from the owner’s DBBL rocket account. On the other hand,
other cars among which the first one having no registration did not allow entering the toll
plaza gate, the second one having registration but no balance at the rocket account received no
permission entering the toll plaza gate. These both cars entered the toll plaza in the alternative
path. Thus, the experiment results confirmed that the proposed model works well significantly
and very promising to solve the conventional manual toll plaza system in the highways of
Bangladesh.
vi
Contents
Chapter 1 Introduction
1.1 Background and Problem Statement 1
1.2 Objectives 2
1.3 Significance of Development of an Automated Toll Plaza System 3
1.4 Advantages of DATPS 3
1.5 Organizations 4
vii
Chapter 3 Software Part of DATPS
4.1 Introduction 34
4.2 Observation 35
4.2.1 Hardware Setup 36
4.2.2 Observation for Registered Vehicle 37
4.2.3 Observation for Unregistered Vehicle 40
4.2.4 Observation for Insufficient Balance Vehicle 41
4.3 Cost-Effectiveness Analysis of the Proposed DATPS 43
Chapter 5 Conclusion
5.1 Conclusion 45
Reference 47
Appendix 48
viii
LIST OF FIGURES
ix
Fig.4.10: Barricade is Open Shown on Main Controller Display 39
Fig.4.11: Tracking of Unregistered Vehicle Shown in LCD Main Display 40
Fig.4.12: Tracking of Unregistered Vehicle Shown in LCD Controller Display 40
Fig.4.13: Passing of Unregistered Vehicle Using the By-Pass Road in the Toll
Plaza Area 41
Fig.4.14: Insufficient Balance Shown in LCD Main Display 41
Fig.4.15: Requesting Recharge Immediately Shown in LCD Display 42
Fig.4.16: SMS Sent to the Owner’s Mobile Number of Insufficient Balanced
Vehicle 42
Fig.4.17: Passing of Insufficient Balanced Vehicle Using the By-Pass Road
in the Toll Plaza Area 42
LIST OF TABLES
Table 4.1 Detail about the Specific Vehicles Passing Through the
Toll Plaza System 35
Table 4.4 The System Cost Analysis Between Manual Toll Plaza System
And DATPS 44
x
Nomenclature
xi
Chapter 1
Introduction
This chapter describes about the introductory concept of digital toll collection system using by
RFID and GSM module, its motivation, purposes of this work, and so on.
In Bangladesh, usually the vehicles are stopped at the toll plaza behind the entry points of the
highways or, river bridges where the toll is being paid manually with the exchange of
computerized receipt or, token. In case of collecting the toll manually, this system usually
takes more time than the automatic system. On the other hand, during paying money at the toll
plaza, the vehicles are generally kept waiting 3-5 minutes for getting the serial at the queue.
Eventually, it increases the queues and causes traffic jam that being taken lots of valuable
time.
1
Chapter1: Introduction
Nowadays, the existing toll collection system in Bangladesh is nearly under corruption. It is
frequently happening that, the manual toll collection system collecting money without proving
the receipts.It is noted that, there is no central controlling system for the toll collection, all the
information regarding payments and vehicles are not saving in a database or, website. As a
result, corruption is happening and government is not getting all the toll money properlythat
results a huge amount of losses of the government revenue.Not only that the owner (or, driver)
also suffers by this system in sense of time cost.
In order to solve the above problems of the existing toll collection system in Bangladesh, an
automatic system is very much necessary. Therefore, in this project work, Development of an
automated toll plaza system (DATPS) using RFID and GSM module has been proposed.
These two modules are controlled by the microcontroller based database control module. Such
kind of systems has already been established in different corner of the world [1] [2]. In the
proposed DATPS, RFID receiver [3] [4] will be interfaced with the microcontroller. Here, the
RFID receiver and RFID tags act as active and passive, respectively. The receiver will be
fixed at the toll plaza constantly for searching the tags. As soon as the tag will come in to the
range of the receiver, the unique code from the tag will be identified by the receiver and
transmitted that information serially to the microcontroller. When a vehicle comes into the
range, the RFID receiver sensor tags the vehicle first by checking all the information from the
database. If the checking status is positive, the toll amount will be deducted automatically
from the owner’s DBBL account. In this system, IR senses the vehicle motion for controlling
the opening and closing of the gate.
After the implementation of the proposed system, DATPS,it can provide the entrance of the
vehicles into the highways or, river bridges automatically by avoiding the rush in the queue.
Furthermore, it requires very shortest time to the entrance of vehicles. Thus, huge amount of
cost for the time and fuel purposes might be reduced by this proposed DATPS.
1.2 Objectives
The proposedDATPS is highlighted on basis of the following objectives:
i) To implement an automatic toll plaza system using RFID system and GSM
module.
ii) To implement the money deduction system from the user’s DBBL rocket account.
iii) To find out the economic benefits of introducing Automatic Toll Collection.
2
Chapter1: Introduction
The significant aspects of Development of an Automated Toll Plaza System, which are
mentioned below:
First, it allows any kind of GSM-based mobile phone networks available in Bangladesh in
order to communicate with the RFID reader.
Second, no expert human resources is required to collect the toll, it is deducted money
automatically.
Third, when the vehicles passing thorough the Toll Plaza the money deducted automatically
from the user’s DBBL rocket account and barricade is automatically open and cashless
operation is made.
Fourth, In addition, we can eliminate any possible discrepancies in the system. Internet
banking as well as SMS banking can be used for recharging the account of the user to make it
convenient
RFID system does not need Line Of Sight (LOS) unlike bar-codes or image
processing based system. Thus it can be installed inside the car from where it is
not visible, which saves tampering with the process in case of theft.
High speed of vehicles is possible for automated system.
Wastage of fuel is substantially reduced.
Traffic jams are avoided to a great extent.
Security is an added advantage - The location of a stolen car can be notified to
the concerned owner through the GSM module.
The owner will also be informed about the amount deducted and the remaining
balance which will help him to maintain a sufficient balance in his account
Microcontroller based control system.
Time saving is most efficient in this system.
Very Easy to making the circuit and automatic toll collection by users DBBL
rocket account.
Design is efficient and of low cost.
Can be used any GSM operator supported SIM card.
3
Chapter1: Introduction
This system can be used to collect the toll money automatically in any Toll Plaza
collection system in Bangladesh.
1.5 Organizations
This project report is organized by five chapters that are mentioned as follows:
Chapter 1 is the introductory chapter which gives an overall idea of the project, discussion
regarding previous works, objectives of my project work, significance of the Automated Toll
collection using RFID and GSM module.
Chapter 2in brief, shows theDevelopment of an Automated Toll Plaza System (DATPS), its
block diagram, step by step working procedure with flowchart and advantages of DATPS.
Chapter 3describes highly about the software part of DATPS that has been used in its
working processes.
Chapter 4presents the detailed experimental studies of DATPS including the observation of
Automated Toll collection.
Chapter 5finally concludes the discussion of DATPS with some future directions.
4
Chapter 2: Development of an Automated Toll Plaza System
Chapter 2
ProposedDevelopment of an
Automated Toll Plaza System-DATPS
This chapter presents the detail of proposed system-DATPSincluding the block diagram and
flow chart. For hardware implementation, the required electrical components are also
discussed here.
2.1Proposed System-DATPS
An automatic toll plaza system provides a secured environment for toll collection and
automatic control of thevehicle movements at the toll stations. Generally, different models
have been introduced to be served the automatic toll collections using different electronic
modules, such as, ETP [], RFID reader [], and so on. These modules are attached with
microcontroller [], where the toll money is being deducted through VISA card [], online bank
account [], and so on. Unfortunately, there is no such automatic system available in
Bangladesh that results huge time cost for passing the vehicles under the manual system of
highways.
In order to solve the above problems of the existing toll collection systems in Bangladesh, an
automated toll plaza system has been designed and implemented (i.e., DATPS) in this project
work. However, in order to understand clearly about the proposed DATPS, the block diagram,
circuit diagramand flow charts are presented in Figs. 2.1-2.3, respectively.
The overall system information of DATPS is presented in Fig. 2.1, which is composed by two
sections: (i) transmitter and (ii) receiver, whereas, receiver section is divided by four units,
such as, microcontroller, GSM modem, LCD display, and MG90S metal gear servo motor.
Specifically, rests of three units among the four are connected with microcontroller. On the
other hand, there are two kinds of display facilities in the display unit of the proposed DATPS
that instantaneously provides the current status of the vehicles. Among them, one is SMS-
based and another one is LCD-based. The SMS-based display unit performs the task using
5
Chapter 2: Development of an Automated Toll Plaza System
SIM908-C GSM modem withthe help of microcontroller rregarding toll money transfer and
vehicles information, whereas, the second one just connected with microcontroller and
displays the toll money transfer and vehicles information. Furthermore, the controlling of
MG90S metal gear servo drive system for opening or, closing the barricade of toll gate system
is performed by the microcontroller.
The total configuration of the automatic toll plaza system is figure out by these circuits
diagram in Fig 2.2. The microcontroller of this system plays the vital role and connected with
all others-GSM module, LCD, RFID reader etc.
Regulator Power
Transmitter supply
unit Receiver
GSM DC Source, AC
Mobile Supply230
Module 12VDC
V/50Hz
MCU (U1)
LCD
Display Microcontrolle
r PIC16F877A
Reset Option
6
Chapter 2: Development of an Automated Toll Plaza System
For more comprehensibility about DATPS, the different steps of the flowchart shown in Fig.
2.3 are described in detail stated as follows:
7
Chapter 2: Development of an Automated Toll Plaza System
Start
No
Tag Detected?
Yes
No
Dose the tag match?
Yes
END
8
Chapter 2: Development of an Automated Toll Plaza System
Step-1: At first, a power supply was made using a 220/12-volt AC transformer that has been
converted in to 12V DC using a bridge rectifier. For achieving pure DC supply, 1000µF
capacitor was used. To activate the microcontroller circuit, 5V DC supply is necessary.
Thereby, a voltage regulator LM7805 IC was used for supplying 5V DC continuously to the
microcontroller circuit.
Step-2: Initialize the system with making the connection of RFID, LCD display and GSM
module to the microcontroller.
Step-3: In this step, the RFID reader search the RFID tag and transmitted the data to main
controller database system (MCU), the controller matches the unique code to the central
Database and check if the owner vehicles tag is match then it is going to searching the network
of GSM module otherwise if the tag is not match with the central database then LCD display
shown that is not registered vehicles.
Step-4: In thisstep, the network is check and connected the GSM module. The toll money
will be deducted from his BBBL rocket account.Hence, a complete cashless operation is
possible. Then a SMS will be sent to the owner by the GSM module about how much money
has been debited from his account. Two times DBBL rocket account tries to transfertoll
money, if the owner has insufficient DBBL rocket balance or not registered vehicles then the
vehicle is ordered to go bypass way.
Step-5: In this step, ifthe vehicles owner’s account matches with main database then toll
amount automatically deducted from owner’s account and a SMS will be send to hismobile
about the amount status. If the toll money transfers successfully to main server of DBBL
rocket account, then the barricade will be open automatically.
Step-6: Inthis step, the barricade is open until the vehicle is passed the toll gate. After passing
the vehicle the barricade automatically takes its previous states. This update data is store main
database system.
It is now clear that, the proposed system-DATPS is simpler in hardware architecture and cost-
effective for implementation. The operating process is not so difficult and easy for handling
the total system.
9
Chapter 2: Development of an Automated Toll Plaza System
The serial data transmission used in DATPS is USART that stands for Universal Synchronous
Asynchronous Receiver Transmitter. It is sometimes called the Serial Communications
Interface or SCI. Synchronous operation uses a clock and data line while there is no separate
clockaccompanying the data for asynchronous transmission. Since there is no clock signal in
asynchronous operation, one pin can be used for transmission and another pin can be used for
reception. Both transmission and reception can occur at the same time, called as full duplex
operation. Transmission and reception can be independently enabled. However, when the
serial port is enabled, the USART will control both pins and one cannot be used for general
purpose I/O when the other is being used for transmission or, reception. The USART is most
commonly used in the asynchronous mode. In this context, we deal exclusively with
asynchronous operation. The most common use of the USART in asynchronous mode is to
communicate to a PC serial port using the RS-232 protocol. It is noted that a driver is required
to interface to RS-232 voltage levels and the PIC microcontrollerMCU should not be directly
connected to RS-232 signals. Thus, USART can both transmit and receive, and we now briefly
discuss at how this is implemented in the USART.
The USART outputs and inputs logic level signals on the TX and RX pins of thePIC
microcontroller MCU. The signal is high when no transmission or reception is in progress and
goes low when the transmission starts. This low going transition is used by the receiver to
synchronize to the incoming data. The signal stays low for the duration of the start bit and is
followed by the data bits, least significant bit first. In the case of an eight-bit transfer, there are
eight data bits and the last data bit is followed by the stop bit which is high. The transmission
therefore ends with the pin high. After the stop bit has completed, the start bit of the next
transmission can occur as shown by the dotted lines. There are several things to note about this
waveform, which represents the signal on the TX or RX pins of the microcontroller. The start
bit is a zero and the stop bit is a one. The data is sent least significant bit first so the bit pattern
looks backwards incomparison to the way it appears when written as a binary number. The
data is not inverted even though RS-232 uses negative voltages to represent a logic one.
Generally, when using the USART for RS-232 communications, the signals must be inverted
and level shifted through a transceiver chip of some sort.
10
Chapter 2: Development of an Automated Toll Plaza System
2.2List of Components
In order to implement an automated toll plazasystem in a hardware module, the following
electrical devices are required:
In DATPS, the description of the used electrical components for the hardware implementation
is stated below:
11
Chapter 2: Development of an Automated Toll Plaza System
2.3.1Microcontroller (PIC16F877A)
Inthe proposed DATPS, microcontroller (MCU) is a vital part, where the model of
PIC16F877A has been used to automate the system. In this regard, the study of internal
architecture of MCU is necessary. That’s why, this section represents the detailed pin diagram
of PIC16F877A MCU shown in Fig. 2.4 as well as the discussion of different pins is
mentioned in Table 2.1.
PIC16F877A MCU is a 40-pin 8-bit CMOS FLASH microcontroller from microchip. The core
architecture is high-performance RISC CPU with only 35 single word instructions. Since, it
follows the RISC architecture, all single cycle instructions take only one instruction cycle. For
program branches, which take two cycles 16F877A comes with 3 operating speeds with 4, 8,
or 20 MHz clock input [7]. Since each instruction cycle takes four operating clock cycles, each
instruction takes 0.2 μs when 20MHz oscillator is used. It has two types of internal memories:
program memory and data memory. Program memory is provided by 8K words (or 8K*14
bits) of FLASH Memory, and data memory has two sources. One type of data memory is a
368-byte RAM (random access memory) and the other is256-byte EEPROM (Electrically
erasable programmable ROM). The core feature includes interrupt capability up to 14 sources,
power saving SLEEP mode, and single 5V In-Circuit Serial Programming (ICSP) capability.
The sink/source current, which indicates a driving power from I/O port, is high with 25mA.
Power consumption is less than 2mA in 5V operating condition [7].
The overall information is presented of MCU in Fig.2.5 that are composed by Input/output
port, timer, RAM and ALU etc. and PINOUT are described in Table 2.2.
12
Chapter 2: Development of an Automated Toll Plaza System
Pin Pin
Pin Name Description Pin Name Description
No. No.
1 MCLR/VPP Master Clock Reset 21 RD2 PORTD.2
2 RA0/AN0 PORTA.0/Analog Channel 0 22 RD3 PORTD.3
SDA PORTC.4/SDI (for
3 RA1/AN1 PORTA.1 /Analog Channel 1 23 RC4/SD1/SDA
SPI)/SDA (for I2C
4 RA2/AN2 PORTA.2/Analog Channel 2 24 RC5/SD0 PORTC.5/SDO (FOR SPI)
5 RA3/AN3 PORTA.3/Analog Channel 3 25 RC6/TX PORTC.6/TX
6 RA4/TOCK1 PORTA.4 26 RC7/RX PORTC.7/RX
7 RA5/AN4 PORTA.5 27 RD4 PORTD.4
8 RE0/AN5 PORTE.0 28 RD5 PORTD.5
9 RE1/AN6 PORTE.1 29 RD6 PORTD.6
10 RE2/AN7 PORTE.2 30 RD7 PORTD.7
11 Vdd +3 TO+5v 31 Vss GND
12 Vss GND 32 Vdd +3 TO+5V
PORTB.O/EX.
13 OSC1/CLKIN OSCILLATOR CON. 33 RB0/INT
INTERRUPT
14 OSC2/CLKOUT OSCILLATOR CON. 34 RB1 PORTB.1
15 RC0/TICK1 PORTC.0 35 RB2/PGM PORTB.2
16 RC1/CCP2 PORTC.1/CCP2 36 RB3 PORTB.3
18 RC2/CCP1 PORTC.2/CCP1 37 RB4 PORTB.4
18 RC3/SCK/SCL PORTC.3/SCK 38 RB5 PORTB.5
19 RD0 PORTD.0 39 RB6/PGC PORTB.6/ICSP
20 RD1 PORTD.1 40 RB7/PGD PORTB.7/ICSP
13
Chapter 2: Development of an Automated Toll Plaza System
14
Chapter 2: Development of an Automated Toll Plaza System
2.3.2.1RFID Tag
Amodule of RFID Tagshown in Fig. 2.6 consisted by asilicon microchip attached with a small
antenna and both mounted on a substrate, which is encapsulated in different materials like
plastic or glass veil. The Tag consists of an adhesive on its back side which enables easy
attachment to objects.
2.3.2.2RFID Reader
An RFID reader is a network operated device which acts as an interface between the RFID tag
and the system software utilizing data from the tag. It consists of an RF transceiver module
along with antennas to transmit and receive information. It basically interrogates RFID tags
irrespective of the distance from them. A module of RFID reader is shown in Fig.2.7.
15
Chapter 2: Development of an Automated Toll Plaza System
16
Chapter 2: Development of an Automated Toll Plaza System
17
Chapter 2: Development of an Automated Toll Plaza System
18
Chapter 2: Development of an Automated Toll Plaza System
GSM module operated voltage 3.9 V and MCU (Microcontroller) operated voltage 5 V. GSM
modules digital “1” means 3.9 V and MCU digital “1” means 5 V. Digital voltage level “1” is
not same in GSM module and MCU. For this reason, Q4 & Q5 transistors amplifier are used
for increasing the module digital voltage level from 3.9 V to 5 V. It can be possible by using
only one amplifier for voltage conversion in this circuit but this circuit used two transistors for
non-inverting. R7 &R11 resistor used in transistor base biasing, R10 & R12 resistor are used
in transistor collector biasing and R13 resistor is used for current limitation.
19
Chapter 2: Development of an Automated Toll Plaza System
2.3.3.2 NETLIGHT
GSM module has a current limitation in I/O port. To avoid this current limitation, we used to
transistor amplifier circuit for NET-LED. In this circuit Q1 transistor use as an amplifier
circuit, R2& R3 resistor used for base biasing, D2 diode used for noise protection and R1
resistor used for collector biasing.
2.3.3.3 Turn on SIM 908C using the Power Key Pin (Power on)
One can power on SIM908C by pulling down the POWERKEY pin for at least 1 second and
release. This pin is already pulled up to 3V in the module internal, so external pull is not
necessary. Reference circuit is shown as Fig.2.11.Q3 transistor amplifire is ues for swithching
circuit. This circuit is used for GSM module power key pin “0”. We need the power on of
GSM module, press the power key SW1 one second. Though the MCU given the pulse is one
second here.
Power on status circuit in GSM module can be seen in Fig. 2.12. GSM module has a current
limitation in I/O port. To avoid this current limitation, we used transistor amplifier circuit for
LED-YELLOW. In this circuit, Q6 transistor used as an amplifier circuit, R21& R22 resistor
used for base biasing, D7 diode used for noise protection and R20 resistor used for collector
biasing.
20
Chapter 2: Development of an Automated Toll Plaza System
2.3.3.5SIM_Card Interface
The SIM interface complies with the GSM phase1 specification and the new GSM Phase 2+
specification for FAST 64 kbps SIM card. Both 1.8 V and 3.0 V SIM card are supported. The
SIM interface is powered from an internal regulator in the module. The pull up resistor
(15KΩ) on the SIM_DATA line is already added in the module 8-pin SIM card holder is
illustrated in the following Fig. 2.13. The SIM_PRESENCE pin is used for detection of the
SIM card hot plug in, User can select the 8-pin SIM card holder to implement SIM card
detection function. AT command “AT+CSDT” is used to enable or disable SIM card detection
function.
21
Chapter 2: Development of an Automated Toll Plaza System
In embedded systems, it is difficult to find status and errors generated by system software
running inside of microcontroller. It is also necessary in so many other applications where we
have to show results to users so that they can use system effectively. So, there is a need of a
display unit. There is more than one way of displaying status or results of the system and LCD
shown in Fig. 2.14 & Fig. 2.15 is one of these ways.
In this system, the used LCD having 16 columns and 2 rows. This is based on LM016L LCD
controller. LM016L is a generic dot matrix LCD controller made by Hitachi. This controller is
installed on other sizes of LCDs like 16×1, 16×2, 16x4, 20×2, 20×4,40×4, etc. [13]. The
interfacing between LCD and PIC16F877A microcontroller is shown in Fig. 2.15.
22
Chapter 2: Development of an Automated Toll Plaza System
Proteus is an easy-to-use project and business intelligence environment. Its main features are
as follows:
i) A modern COTS/NDI solution that is built on .NET technology that uses OLE DB or
other similar technology to access, integrate and extend disparate data sources into
useful intelligence for more effective management and control of program
management information.
ii) Possesses the ability to integrate information both horizontally and vertically, organize
data by user role and content and allow access to that data in accordance with position
in the organization, user role and need to know.
iii) Reduces life-cycle and support costs associated with business intelligence through an
easy-to-use template-based configuration that eliminates the need for specialized
development or hard-coding, allowing for rapid deployment and almost immediate
ROI.
iv) Integrates data from disparate systems into a consolidated view that can be aggregated
at all levels for all stakeholders within and across the program team and the enterprise.
The stakeholders can drill down into the data and summarize the data at will to quickly
identify problems and trends.
v) Provides virtually unlimited tailored views and reports to program specific needs using
the configurable user interface and business logic that interfaces with any existing
OLE DB-compatible table structure.
vi) Transforms data from any OLE DB compatible data source or format and be able to
transform that data for use without having to rekey the data. Data from different
sources should be easily compared to find mismatches and disparities.
vii) Organizes previously stove-piped information in a cohesive and intelligent manner.
For example, users need to be able to create integrated views of cost, schedule, risk,
financial and any other relevant program related data at any level of detail. Views
should be saved and used across the organization, a subunit of the organization or
solely for a specific user or set of users.
23
Chapter 3: Software Part of DATPS
Chapter 3
This chapter describes the detailed software part of DATPS, where two software tools were used,
such as, Proteus professional simulation tool and Proton IDE (Integrated development
environment) programming tool.
The Proteus professional simulation tool, that is to say, Proteus Design Suite (PDS) is wholly
unique in offering the ability to co-simulate both high and low level micro-controller codes in the
context of a mixed-mode SPICE circuit simulation. Using this virtual system modeling facility,
any kind of microcontroller based system model can be simulated with its real time data in order
to design and implement the system practically with lower costs.
Usually, simulation of a designed model using PDS tool provides huge advantages for the future
implementations in setting hardware. The reason is that, PDS always works on the real time data
of the different electrical components, in which the simulation outcome of the PDS of a designed
model is closed to similar to the original one. On the other hand, the PDS outcome can be varied
with varying the PDS design of a desired model within a very short time. Designing a hardware
model that is to say, physical setup of a hardware model is always expensive in cost which might
be increased if the proper electrical components with ratings are not determined. In this case, PDS
tool may provide optimistic solution that resulting an economical hardware designing of a desired
model. In addition, PDS combines mixed mode SPICE circuit simulation, animatedcomponents
and microprocessor models to facilitate co-simulation of complete microcontroller baseddesigns.
For the first time ever, it is possible to develop and test such designs before a physicalprototype is
constructed.This is possible because PDS can easily interact with the designing of screen based
24
Chapter 3: Software Part of DATPS
indicators, such as, LED and LCD displays and actuators, such as, switches and buttons. The
simulationtakes place in real time: a 1GMHz Pentium III can simulate a basic
PIC16F877Asystem clocking at over 16MHz. PDS also provides extensive debugging facilities
includingbreakpoints, single stepping and variable display for both assembly code and high-level
languagesource.
Initially, starting the program that can be possible by clicking on the ISIS Professional v7.10 icon
from desktop of personal computer. Thus, starting interface is appeared according to the Fig. 3.1.
25
Chapter 3: Software Part of DATPS
Prior to circuit construction, it is necessary to identify first the required components in the circuit.
For example, in executing an 8-bit running light, the components needed are:
i. PIC16F877
ii. LED
iii. Resistor
iv. Capacitor
v. Power Supply Terminals / Grounding.
26
Chapter 3: Software Part of DATPS
After defining all the various parameters in the PIC and the other components and also loading
the hex file in the controller, we can start the simulation by clicking the PLAY button on the
bottom panel of the PDS.
27
Chapter 3: Software Part of DATPS
Proton IDE is a professional and powerful visual Integrated Development Environment (IDE)
designed specifically for the Proton Plus compiler. Proton IDE is designed to accelerate product
development in a comfortable user development environment without compromising
performance, flexibility or control.
The PROTON+ compiler was written with simplicity and flexibility in mind. Using BASIC,
which is almost certainly the easiest programming language around, you can now produce
extremely powerful applications for your PICmicrotm without having to learn the relative
complexity of assembler, or wade through the gibberish that is C.
28
Chapter 3: Software Part of DATPS
Feature
Possibly the most advanced code explorer for PIC based development on the market.
Quickly navigate your program code and device Special Function Registers (SFRs).
Provides information about the device used the amount of code and data used, the version
number of the project and also date and time. You can also use the results window to jump
to compilation errors.
The Proton IDE enables you to start your preferred programming software from within the
development environment. This enables you to compile and then program your
microcontroller with just a few mouse clicks
29
Chapter 3: Software Part of DATPS
30
Chapter 3: Software Part of DATPS
3.4 AT Command
These commands are used to control MODEMs. AT is the abbreviation for Attention,
thesecommands come from Hayes commandsthat were used by the Hayes smart modems. The
Hayes commands started with AT to indicate the attention from the MODEM. The dial up and
wireless MODEMs (devices that involve machine to machine communication) need AT
commands to interact with a computer. These include the Hayes command set as a subset, along
with other extended ATcommands.
1. Information and configuration pertaining to mobile device or MODEM and SIM card.
2. SMS services
3. MMS services
4. Fax services
5. Data and Voice link over mobile network.
31
Chapter 3: Software Part of DATPS
There are four types of AT commands, which are presented in Fig. 3.7.
1. Test commands- used to check whether a command is supported or not by the MODEM.
SYNTAX: AT<command name>=?
For example: ATD=?
2. Read command - used to get mobile phone or MODEM settings for an operation.
SYNTAX: AT<command name>?
For example: AT+CBC?
3. Set commands- used to modify mobile phone or MODEM settings for an operation.
SYNTAX: AT<command name>=value1, value2… valueN
Some values in set commands can be optional.
4. Execution commands- used to carry out an operation.
SYNTAX: AT<command name>=parameter1, parameter2…, parameterN
The read commands are not available to get value of last parameter assigned in execution
commandsbecause parameters of execution commands are not stored.
32
Chapter 3: Software Part of DATPS
33
Chapter 4: Practically Implementation
Chapter 4
Hardware Implementation
This chapter presents hardware implementation of DATPS including a set of different
observed experimental results.
4.1 Introduction
In this context, the proposed DATPS has been implemented practically using mainly
microcontroller(PIC16F877A), GSM module, photoelectric proximity sensor, servomotor, and
RFID reader. Particularly, microcontroller (MCU) plays a vital role for this project that needs
several connectivity with other components. However, to implement the whole system, part by
part implementation was observed first shown in Fig. 4.1. When the observations were found
successful according to the specific objectives, the final hardware implementation was done
with some decorations shown in Fig. 4.2.
Proximity Sensor
RFID Reader
GSM Module
LCD -1 Microcontroller
LCD-2
34
Chapter 4: Practically Implementation
Module Box
Garden
RFID
Car
4.2 Observations
In this context, a set of experiments was carried out for evaluating the proposed DATPS how
works well. It should be noted that, in DATPS, RFID reader reads the tag of vehicle. The
vehicle information is stored in the database system of MCU based on the TAG number. If
vehicle information matches the microcontroller data base system, the barricade automatically
opened and toll money deducted from the owner’s DBBL rocket account. Then, vehicle’s toll
information is sent through GSM modem to the owner’s mobile phone. The status of the
vehicle isdisplayed in the LCD.In this regard, 10 vehicles are listed to complete the
observations including vehicles unique code and associated toll amount shown in Table 4.1.
Table4.1: Details about the specific vehicles passing through the toll plaza system.
35
Chapter 4: Practically Implementation
However, the total observations are made into three ways: (i) Observation for registered
vehicles, (ii) Observation for unregistered vehicles, and (iii) Observation for insufficient
balanced vehicles. To perform the observations, following hardware set is considered.
After the completion of all connections, a prototype DATPS module was implemented shown
in Fig. 4.2. When, the power being ON, GSM module searches the mobile network to be
connected. Thus, the system is ready for working mode that can be seen in the LCD display
shown in Fig. 4.3.
36
Chapter 4: Practically Implementation
37
Chapter 4: Practically Implementation
38
Chapter 4: Practically Implementation
Fig.4.8: Deducted amount addedto the toll plaza server DBBL account.
39
Chapter 4: Practically Implementation
Fig. 4.12: Tracking of unregistered vehicle shown in LCD main controller display.
40
Chapter 4: Practically Implementation
Fig.4.13: Passing of unregistered vehicle using the By-Pass Road in the toll plaza area.
41
Chapter 4: Practically Implementation
Fig.4.16: SMS sent to the owner’s mobile number of insufficient balanced vehicle.
v
42
Chapter 4: Practically Implementation
Table 4.4: The system cost analysis between Manual toll plaza system and DATPS
Toll Average no. Time required Fuel required for Fuel cost for Salary of
43
Chapter 4: Practically Implementation
In difference of these two systems specially for passing 4927500 number of vehicles per year,
it is foundthat in comparison of the manual toll plaza system (i) DATPStakes less time that is
24637.5 hours, (ii) fuel requiredin DATPS that is the reduced amount of 30,796.87 litres, (iii)
reduced fuel cost of 27, 71,718.30/= BDT, and (iv) reduced salary of booth operators in
DATPS of 79, 20,000/= BDT. However, it can be concluded in such a way that, the manual
toll plaza system demands more manpower with high salaries as well as requires more
maintenance cost and having less transparencies in all sides. On the other hand, DATPS is the
lessexpensive system, faster and more transparent in all sides.
44
Chapter 5: Conclusion
Chapter 5
Conclusion
5.1 Conclusion
In this report, the automated toll plaza system (DATPS) is an innovative method to reduce
congestion in toll gates and automatically toll collection in highways from the vehicles and its
owner’s DBBL rocket account. In this proposed system, a prototype DATPS was involved
using RFID and GSM modules combined with microcontroller. A RFID tag is fixed on the car
and it’s come in to the receiver area, then the reader senses the tag and it’s identifies the
vehicles unique code from the database. If the unique code is found, the toll amount is
automatically deducted from the owner’s DBBL rocket account and sends message to the
owner’s using GSM technology. Otherwise for insufficient balance vehicle and unregistered
vehicle are not permission in toll gate, it has another alternative path. In this system, IR senses
the vehicle motion for controlling the opening and closing of the gate.
This system is supposed to provide a solution for all the traffic and toll gate problems.
Reduction of congestion and inconveniences in manual payment are main goal of this
technology. DATPS is very helpful procedure to implement in Bangladesh to overcome the
conventional manual toll plaza system in the highway. DATPS is required time only 30
second to complete the operation per vehicles to passing the toll gate. If the transition
producers are fulfill in an authorization bank, then DATPS time is required only 10 second.
45
Chapter 5: Conclusion
Implementation of image processing for data recording: In our present concept we are using
the RFID system for toll collection. So we can extend the scope for centralize data recording.
For that purpose we can use the Infra Re courting at the entry gate. This is followed by the
Camera which will be continuing image capturing of the vehicles entering into the toll plaza.
Then the RFID is collecting the vehicle number.
46
References
[1] PriyankaChhoriya et al., “Image processing based automatic toll booth in Indian
conditions”, International Journal of Emerging Technology and Advanced Engineering,
vol. 3, no. 4, pp. 410-414, 2013.
[3] AungMyint Win, “RFID based automated toll plaza system”, International Journal of
Scientific and Research Publications, vol. 4, Issue 6, pp. 1-7, June 2014.
[4] SachinBhosele, “Automated toll plaza system using RFID”, International Journal of
Science, Engineering and Technology Research (IJSETR), vol., 2, no. 1, pp. 455-460,
2013.
[5] https://www.electronicshub.org/understanding-7805-ic-voltage-regulator/
[8]https://en.wikipedia.org/wiki/Crystal_oscillator
[9] https://www.electricaltechnology.org/wp-content/uploads/2017/09/RFID-Reader-
300x200.jpg
[10] http://www.sim.com
[11] www.st.com
[13] https://embeddedcenter.wordpress.com/ece-study-centre/display-module/lcd-16x2-
lm016l/
[14]http://www.protonbasic.co.uk/che
[15] https://www.resumesbyascript.com/assets/view/download-proteus-7.8-professional.htm
47
Appendix
Device=16F877A
XTAL=16
Config HS_OSC , WDT_ON , PWRTE_ON , BODEN_ON , LVP_OFF , CP_OFF , CPD_ON , DEBUG_OFF
LCD_DTPIN = PORTB.4
LCD_RSPIN = PORTB.2
LCD_ENPIN = PORTB.3
LCD_INTERFACE = 4
LCD_LINES = 4
LCD_TYPE = 0
ALL_DIGITAL TRUE
SERIAL_BAUD = 9600
Baud con 84
Symbol PowerKeyPORTC.4
Symbol TXD PORTC.7
Symbol RXD PORTC.6
Symbol TXD_DispPORTE.0
TRISA = %00011110
TRISC = %01000000
TRISE = %000
PORTC = %00000000
PORTA = %00010000
Input PORTD.2
'Variable Define
'Dim ST As STRING * 20
48
Appendix
Dim i As Byte
Dim Servo_PositionAs Word
Dim J As Byte
Dim taka As Byte
Card#1[0] = "0"
Card#1[1] = "2"
Card#1[2] = "0"
Card#1[3] = "0"
Card#1[4] = "7"
Card#1[5] = "2"
Card#1[6] = "A"
Card#1[7] = "1"
Card#1[8] = "F"
Card#1[9] = "5"
Card#1[10] = "2"
Card#1[11] = "4"
Card#2[0] = "0"
Card#2[1] = "2"
Card#2[2] = "0"
Card#2[3] = "0"
Card#2[4] = "7"
Card#2[5] = "2"
Card#2[6] = "F"
Card#2[7] = "9"
Card#2[8] = "B"
Card#2[9] = "1"
Card#2[10] = "3"
Card#2[11] = "8"
Card#3[0] = "0"
Card#3[1] = "2"
Card#3[2] = "0"
Card#3[3] = "0"
Card#3[4] = "4"
Card#3[5] = "1"
Card#3[6] = "D"
Card#3[7] = "4"
Card#3[8] = "B"
Card#3[9] = "F"
Card#3[10] = "2"
Card#3[11] = "8"
Card#4[0] = "0"
Card#4[1] = "2"
Card#4[2] = "0"
Card#4[3] = "0"
Card#4[4] = "4"
Card#4[5] = "2"
Card#4[6] = "A"
Card#4[7] = "C"
Card#4[8] = "B"
Card#4[9] = "D"
Card#4[10] = "5"
Card#4[11] = "1"
Card#5[0] = "0"
49
Appendix
Card#5[1] = "2"
Card#5[2] = "0"
Card#5[3] = "0"
Card#5[4] = "7"
Card#5[5] = "3"
Card#5[6] = "2"
Card#5[7] = "B"
Card#5[8] = "1"
Card#5[9] = "A"
Card#5[10] = "4"
Card#5[11] = "0"
Card#6[0] = "0"
Card#6[1] = "2"
Card#6[2] = "0"
Card#6[3] = "0"
Card#6[4] = "4"
Card#6[5] = "2"
Card#6[6] = "8"
Card#6[7] = "2"
Card#6[8] = "1"
Card#6[9] = "5"
Card#6[10] = "D"
Card#6[11] = "7"
Card#7[0] = "0"
Card#7[1] = "2"
Card#7[2] = "0"
Card#7[3] = "0"
Card#7[4] = "4"
Card#7[5] = "1"
Card#7[6] = "D"
Card#7[7] = "7"
Card#7[8] = "6"
Card#7[9] = "4"
Card#7[10] = "F"
Card#7[11] = "0"
Card#8[0] = "0"
Card#8[1] = "2"
Card#8[2] = "0"
Card#8[3] = "0"
Card#8[4] = "4"
Card#8[5] = "2"
Card#8[6] = "E"
Card#8[7] = "C"
Card#8[8] = "C"
Card#8[9] = "2"
Card#8[10] = "6"
Card#8[11] = "E"
Card#9[0] = "0"
Card#9[1] = "2"
Card#9[2] = "0"
Card#9[3] = "0"
Card#9[4] = "7"
Card#9[5] = "1"
Card#9[6] = "2"
Card#9[7] = "9"
Card#9[8] = "2"
50
Appendix
Card#9[9] = "D"
Card#9[10] = "7"
Card#9[11] = "7"
Card#10[0] = "0"
Card#10[1] = "1"
Card#10[2] = "0"
Card#10[3] = "0"
Card#10[4] = "8"
Card#10[5] = "F"
Card#10[6] = "A"
Card#10[7] = "B"
Card#10[8] = "9"
Card#10[9] = "9"
Card#10[10] = "B"
Card#10[11] = "C"
Card#11[0] = "0"
Card#11[1] = "2"
Card#11[2] = "0"
Card#11[3] = "0"
Card#11[4] = "4"
Card#11[5] = "2"
Card#11[6] = "D"
Card#11[7] = "8"
Card#11[8] = "B"
Card#11[9] = "C"
Card#11[10] = "2"
Card#11[11] = "4"
Card#12[0] = "0"
Card#12[1] = "2"
Card#12[2] = "0"
Card#12[3] = "0"
Card#12[4] = "4"
Card#12[5] = "3"
Card#12[6] = "F"
Card#12[7] = "A"
Card#12[8] = "E"
Card#12[9] = "9"
Card#12[10] = "5"
Card#12[11] = "2"
Card#13[0] = "0"
Card#13[1] = "2"
Card#13[2] = "0"
Card#13[3] = "0"
Card#13[4] = "4"
Card#13[5] = "3"
Card#13[6] = "E"
Card#13[7] = "D"
Card#13[8] = "2"
Card#13[9] = "F"
Card#13[10] = "8"
Card#13[11] = "3"
inphone[0] = "0"
inphone[1] = "1"
inphone[2] = "9"
inphone[3] = "1"
51
Appendix
inphone[4] = "1"
inphone[5] = "9"
inphone[6] = "2"
inphone[7] = "1"
inphone[8] = "5"
inphone[9] = "2"
inphone[10] = "6"
amount[0] = "0"
amount[1] = "0"
IdNumber[0] = "0"
IdNumber[1] = "0"
Servo_Position = 1550
J=0
Symbol FromPCPORTA.4
Symbol servo_motorPORTA.5
Symbol Sensor PORTD.2
taka = 10
sms_no=0
Output servo_motor
Clear servo_motor
GoSubInitialization
clrwdt
DelayMS500
clrwdt
DelayMS500
Cls
Print At 1,1,"READY TO"
Print At 2,1,"GO"
DelayMS1000
52
Appendix
PowerKey = 1
DelayMS500
clrwdt
DelayMS500
PowerKey = 0
DelayMS1000
SerOutTXD,Baud,[127,13]
GoSubnetsearch
GoSubconnected
GoSubtext_on
GoSubdelete_sms
main:
Print At 1,1," TOLL PLAZA "
Print At 2,1," = CONTROLLER ="
Cls
Print At 1,1,StrBuffer
DelayMS2000
For i=0 To 11
If Buffer[i] != Card#1[i] Then
GoTocard2
EndIf
Next i
Print At 1,1," CAR "
Print At 2,1,"DM: GHA-235452 "
amount[0] = "1"
amount[1] = "0"
SerOutTXD_Disp,Baud,[1]
GoToAuthorised
card2:
For i=0 To 11
If Buffer[i] != Card#2[i] Then
GoTocard3
EndIf
Next i
Print At 1,1," SMALL BUS "
Print At 2,1,"DM: BA-148512 "
amount[0] = "1"
amount[1] = "5"
SerOutTXD_Disp,Baud,[2]
GoToAuthorised
card3:
For i=0 To 11
If Buffer[i] != Card#3[i] Then
GoTocard4
EndIf
Next i
Print At 1,1," LARGE BUS "
Print At 2,1,"DM: CHA-542382 "
amount[0] = "2"
53
Appendix
amount[1] = "0"
SerOutTXD_Disp,Baud,[3]
GoToAuthorised
card4:
For i=0 To 11
If Buffer[i] != Card#4[i] Then
GoTocard5
EndIf
Next i
Print At 1,1," SMALL TRUCK "
Print At 2,1,"DM: THA-231187 "
amount[0] = "3"
amount[1] = "0"
SerOutTXD_Disp,Baud,[4]
GoToAuthorised
card5:
For i=0 To 11
If Buffer[i] != Card#5[i] Then
GoTocard6
EndIf
Next i
Print At 1,1," MEDIUM TRUCK "
Print At 2,1,"DM: JA-113657 "
amount[0] = "4"
amount[1] = "0"
SerOutTXD_Disp,Baud,[5]
GoToAuthorised
card6:
For i=0 To 11
If Buffer[i] != Card#6[i] Then
GoTocard7
EndIf
Next i
Print At 1,1," LARGE TRUCK "
Print At 2,1,"DM: NA-513262 "
amount[0] = "5"
amount[1] = "0"
SerOutTXD_Disp,Baud,[6]
GoToAuthorised
card7:
For i=0 To 11
If Buffer[i] != Card#7[i] Then
GoTocard8
EndIf
Next i
Print At 1,1," TRAILERS "
Print At 2,1,"DM: CHA-218302 "
amount[0] = "5"
amount[1] = "0"
SerOutTXD_Disp,Baud,[7]
GoToAuthorised
card8:
For i=0 To 11
If Buffer[i] != Card#8[i] Then
GoTocard9
54
Appendix
EndIf
Next i
Print At 1,1," TAXI "
Print At 2,1,"DM: KHA-5225117 "
amount[0] = "1"
amount[1] = "0"
SerOutTXD_Disp,Baud,[8]
GoToAuthorised
card9:
For i=0 To 11
If Buffer[i] != Card#9[i] Then
GoTocard10
EndIf
Next i
Print At 1,1," CNG "
Print At 2,1,"DM: THA-142127 "
amount[0] = "1"
amount[1] = "0"
SerOutTXD_Disp,Baud,[9]
GoToAuthorised
card10:
For i=0 To 11
If Buffer[i] != Card#10[i] Then
GoTocard11
EndIf
Next i
Print At 1,1," MOTOR BIKE "
Print At 2,1,"DM: HA-142115 "
amount[0] = "1"
amount[1] = "1"
SerOutTXD_Disp,Baud,[10]
GoToAuthorised
card11:
For i=0 To 11
If Buffer[i] != Card#11[i] Then
GoTocard12
EndIf
Next i
Print At 1,1," LARGE TRUCK "
Print At 2,1,"DM: NA-513266 "
DelayMS2000
Print At 1,1," INSUFFICIENT "
Print At 2,1," BALANCED "
amount[0] = "0"
amount[1] = "0"
SerOutTXD_Disp,Baud,[11]
DelayMS2000
GoSubsend_sms_insufficient_balance
GoTomain
card12:
Print At 1,1," UNREGISTERED "
Print At 2,1," *** "
amount[0] = "0"
amount[1] = "0"
SerOutTXD_Disp,Baud,[12]
DelayMS2000
55
Appendix
GoTomain
card13:
Authorised:
DelayMS2000
GoSubnetsearch
GoSubconnected
GoSubtext_on
GoSubRocket_account
GoSubsend_sms
'GoSub motor
GoTomain
netsearch:
Cls
SerOutTXD,Baud,["AT",13]
SerInRXD,Baud,2000,E_RROR,[Wait("OK")]
Print At 1,1," Network "
Print At 2,1," Searching...."
DelayMS1000
Return
connected:
Cls
SerOutTXD,Baud,["AT+CFUN?",13]
SerInRXD,Baud,2000,E_RROR,[Wait("OK")]
Print At 1,1," CONNECTED"
Print At 2,1," OK"
DelayMS1000
Return
text_on:
Cls
SerOutTXD,Baud,["AT+CMGF=1",13]
SerInRXD,Baud,2000,E_RROR,[Wait("OK")]
Print At 1,1," TEXT ON"
Print At 2,1," OK"
DelayMS1000
Return
Rocket_account:
Cls
Print At 1,1,"Rocket dial"
SerOutTXD,Baud,["AT+CUSD=1,",34,"*322#",34,13]
SerInRXD,Baud,5000,Rocket_account,[Wait("Payment")]
DelayMS300
AAA:
56
Appendix
Cls
Print At 1,1,"Send Money"
SerOutTXD,Baud,["AT+CUSD=1,",34,"2",34,13]
SerInRXD,Baud,5000,AAA,[Wait("Enter Mobile")]
DelayMS300
BBB:
Cls
Print At 1,1,"Mobile number"
SerOutTXD,Baud,["AT+CUSD=1,",34,"017861760964",34,13]
SerInRXD,Baud,5000,BBB,[Wait("Enter Amount")]
DelayMS300
CCC:
Cls
Print At 1,1,"Amount = ",Str amount," TAKA"
SerOutTXD,Baud,["AT+CUSD=1,",34,Str amount,34,13]
'SerOutToPC,Baud,["AT+CUSD=1,",34,Str amount,34,13]
SerInRXD,Baud,5000,CCC,[Wait("Enter Your PIN")]
DelayMS300
Cls
Print At 1,1,"PIN ***"
SerOutTXD,Baud,["AT+CUSD=1,",34,"7661",34,13]
SerInRXD,Baud,10000,rocket_fail,[Wait("017861760964 Success")]
DelayMS1000
motor:
Cls
Print At 1,1,"successful"
DelayMS1000
Print At 1,1," OPEN THE "
Print At 2,1," BARRIER "
SerOutTXD_Disp,Baud,[13]
test:
If Sensor = 1 Then
loop:
If Sensor = 0 Then
DelayMS1000
SerOutTXD_Disp,Baud,[14]
For i=0 To 100
Servo_Position = 1550
Servo servo_motor ,Servo_Position
DelayMS2
Next i
Return
Else
GoToloop
EndIf
Else
GoTotest
EndIf
Return
57
Appendix
send_sms:
Cls
Print At 1,1," SENDING SMS"
SerOutTXD,Baud,["AT+CMGS=",34,"01911921526",34,13]
SerInRXD,Baud,2000,E_RROR,[Wait(">")]
SerOutTXD,Baud,["Dear Valued Card Holder Tk ",Str amount," has been debited from account",26]
SerInRXD,Baud,4000,E_RROR,[Wait("OK")]
Cls
Print At 1,1,"SENDING "
Print At 2,1,"OK"
DelayMS2000
Return
send_sms_insufficient_balance:
Cls
Print At 1,1," SENDING SMS"
SerOutTXD,Baud,["AT+CMGS=",34,"01911921526",34,13]
SerInRXD,Baud,2000,E_RROR,[Wait(">")]
Cls
Print At 1,1,"SENDING "
Print At 2,1,"OK"
DelayMS2000
Return
delete_sms:
Cls
Print At 1,1,"DELETEING SMS "
DelayMS2000
SerOutTXD,Baud,["AT+CMGDA=",34,"DEL ALL",34,13]
SerInRXD,Baud,2000,E_RROR,[Wait("OK")]
Cls
Print At 1,1,"SMS DELETE "
Print At 2,1," OK"
DelayMS2000
Return
E_RROR:
Cls
Print At 1,1, "ERROR"
DelayMS1000
GoTomain
rocket_fail:
Cls
58
Appendix
ON_INTERRUPT Int_Sub
Int_Sub:
GIE = 0
TMR1_Enable = 0
TMR1_Overflow = 0
IncWDT_Reset_Timer
If WDT_Reset_Timer>= 30 Then
clrwdt
Clear WDT_Reset_Timer
Toggle PORTA.0
EndIf
Timer1 = TMR1_Val
TMR1_Enable = 1
GIE = 1
Context Restore
Initialization:
TMR1_Enable = 0
INTCON.6 = 1
T1CON.1 = 0
T1CON.2 = 1
T1CON.4 = 1
T1CON.5 = 0
Timer1 = TMR1_Val
TMR1_Enable = 1
TMR1_On = 1
GIE = 1
Return
Stop
Device=16F877A
XTAL=16
59
Appendix
LCD_DTPIN = PORTB.0
LCD_RSPIN = PORTB.4
LCD_ENPIN = PORTB.6
LCD_INTERFACE = 4
LCD_LINES = 4
LCD_TYPE = 0
ALL_DIGITAL TRUE
SERIAL_BAUD = 9600
Baud con 84
Output PORTB.5
PORTB.5=0
Clear Digit_Cal
Clear i
Clear test
Clear Receive_Data
Clear check
Cls
Print At 1,1,"READY TO"
Print At 2,1,"GO"
DelayMS500
Cls
main:
clrwdt
Print At 1,1,"WELCOME TO AUTOMATED"
Print At 2,1," TOLL PLAZA "
Print At 3,1,"Vehicle Amount "
GoSubAcrolling
SerInRXD,Baud,400,main,[Receive_Data]
Disp_Selection = Receive_Data
Clear Receive_Data
GoSubDisplay
loop:
If check = 1 Then
60
Appendix
SerInRXD,Baud,400,loop,[Receive_Data]
Disp_Selection = Receive_Data
Clear Receive_Data
GoSubDisplay
loopp:
If check = 2 Then
SerInRXD,Baud,400,loopp,[Receive_Data]
Disp_Selection = Receive_Data
Clear Receive_Data
GoSubDisplay
EndIf
EndIf
GoTomain
Acrolling:
For i= 0 To 19
Disp[i] = LookUpDigit,[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ",_
"*","*","*"," ","C","a","r","s"," ","-"," ","1","0","T","K",","," ",_
"S","m","a","l","l"," ","B","u","s"," ","-"," ","1","5","T","K",","," ",_
"L","a","r","g","e"," ","B","u","s"," ","-"," ","2","0","T","K",","," ",_
"S","m","a","l","l"," ","T","r","u","c","k"," ","-"," ","3","0","T","K",","," ",_
"M","e","d","i","u","m"," ","T","r","u","c","k"," ","-"," ","4","0","T","K",","," ",_
"L","a","r","g","e"," ","T","r","u","c","k"," ","-"," ","5","0","T","K",","," ",_
"T","r","a","i","l","e","r","s"," ","-"," ","5","0","T","K",","," ",_
"T","a","x","i"," ","-"," ","1","0","T","K",","," ",_
"C","N","G"," ","-"," ","1","0","T","K",","," ",_
"M","o","t","o","r"," ","B","i","k","e"," ","-"," ","1","0","T","K"," ","#","#","#",_
" "," "," "," "," "," "," "," "," "," "," "," "," "]
Inc Digit
Next i
IncDigit_Cal
If Digit_Cal>= 197 Then Clear Digit_Cal
Digit = Digit_Cal
Print At 4,1,StrDisp
' Print At 3,16,DEC3 Digit_Cal
Return
Display:
If Disp_Selection = 1 Then
Print At 1,1,"Deducted amount 10TK"
Print At 2,1,"for Car "
Print At 3,1,"DM: GHA-235452 "
Print At 4,1," "
check = 1
DelayMS1000
ElseIfDisp_Selection = 2 Then
Print At 1,1,"Deducted amount 15TK"
Print At 2,1,"for SMALL BUS "
Print At 3,1,"DM: BA-148512 "
Print At 4,1," "
check = 1
61
Appendix
DelayMS1000
ElseIfDisp_Selection = 3 Then
Print At 1,1,"Deducted amount 20TK"
Print At 2,1,"for LARGE BUS "
Print At 3,1,"DM: CHA-542382 "
Print At 4,1," "
check = 1
DelayMS1000
ElseIfDisp_Selection = 4 Then
Print At 1,1,"Deducted amount 30TK"
Print At 2,1,"for SMALL TRUCK "
Print At 3,1,"DM: THA-231187 "
Print At 4,1," "
check = 1
DelayMS1000
ElseIfDisp_Selection = 5 Then
Print At 1,1,"Deducted amount 40TK"
Print At 2,1,"for MEDIUM TRUCK "
Print At 3,1,"DM: JA-113657 "
Print At 4,1," "
check = 1
DelayMS1000
ElseIfDisp_Selection = 6 Then
Print At 1,1,"Deducted amount 50TK"
Print At 2,1,"for LARGE TRUCK "
Print At 3,1,"DM: NA-513262 "
Print At 4,1," "
check = 1
DelayMS1000
ElseIfDisp_Selection = 7 Then
Print At 1,1,"Deducted amount 50TK"
Print At 2,1,"for TRAILERS "
Print At 3,1,"DM: CHA-218302 "
Print At 4,1," "
check = 1
DelayMS1000
ElseIfDisp_Selection = 8 Then
Print At 1,1,"Deducted amount 10TK"
Print At 2,1,"for TAXI "
Print At 3,1,"DM: KHA-5225117 "
Print At 4,1," "
check = 1
DelayMS1000
ElseIfDisp_Selection = 9 Then
Print At 1,1,"Deducted amount 10TK"
Print At 2,1,"for CNG "
Print At 3,1,"DM: THA-142127 "
Print At 4,1," "
check = 1
DelayMS1000
ElseIfDisp_Selection = 10 Then
Print At 1,1,"Deducted amount 10TK"
62
Appendix
ElseIfDisp_Selection = 11 Then
Print At 1,1,"INSUFFICIENT BALANCE"
Print At 2,1,"LARGE TRUCK "
Print At 3,1,"DM: NA-513266 "
Print At 4,1," "
DelayMS4000
Print At 1,1,"Please Recharge "
Print At 2,1,"Immediately and goto"
Print At 3,1,"bypass road "
Print At 4,1," "
check = 0
DelayMS4000
ElseIfDisp_Selection = 12 Then
Print At 1,1,"Unregistered Vehicle"
Print At 2,1,"Please goto bypass "
Print At 3,1,"road "
Print At 4,1," "
check = 0
DelayMS4000
ElseIfDisp_Selection = 13 Then
Print At 1,1," Open the Toll "
Print At 2,1," barricade. "
Print At 3,1," Please pass... "
Print At 4,1," "
check = 2
DelayMS1000
ElseIfDisp_Selection = 14 Then
Print At 1,1," Close the Toll "
Print At 2,1," barricade. "
Print At 3,1," Don't Move "
Print At 4,1," "
check = 0
DelayMS4000
EndIf
Return
63