Top Banner
i DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM USING RFID AND GSM MODULE Md. Armanul Haque Department of Electrical and Electronic Engineering Dhaka University of Engineering & Technology, Gazipur. January, 2019
74

DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Nov 24, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

i

DEVELOPMENT OF AN AUTOMATED

TOLL PLAZA SYSTEM USING RFID

AND GSM MODULE

Md. Armanul Haque

Department of Electrical and Electronic Engineering

Dhaka University of Engineering & Technology, Gazipur.

January, 2019

Page 2: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

ii

DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM USING

RFID AND GSM MODULE

A Project Report submitted to the Department of Electrical and Electronic Engineering in

partial fulfillment of the requirements for the degree

Of

MASTER OF ENGINEERING IN ELECTRICAL AND ELECTRONIC ENGINEERING

By

Md. Armanul Haque

Student No: 092217P

Under the supervision of

Dr. Md. Monirul Kabir

Professor

Department of Electrical and Electronic Engineering

Dhaka University of Engineering & Technology

Department of Electrical and Electronic Engineering.

DHAKA UNIVERSITY OF ENGINEERING & TECHNOLOGY,

GAZIPUR – 1707, BANGLADESH

Page 3: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

iii

Page 4: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

iv

CANDIDATE’S DECLARATION

I hereby declare that this project or any part of it has not been submitted elsewhere for the

award of any degree or diploma or publication.

_________________________________________

Md. Armanul Haque

Student ID: 092217P

Page 5: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

v

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.

I would like to thanks librarian of DUET to use library.

Page 6: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

vi

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.

Page 7: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

vii

Contents

Board of Examiners iii

Declaration iv

Acknowledgement v

Abstract vi

List of Figures ix

List of Tables x

Nomenclature xi

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

Chapter 2 Proposed Development of an Automated Toll Plaza System-DATPS

2.1 Proposed System-DATPS 5

2.1.1 Method Used in DATPS: USART 10

2.2 List of Components 11

2.3 Description of Components 11

2.3.1 Microcontroller (PIC16F877A) 12

2.3.2 Radio Frequency Identification (RFID) 14

2.3.2.1 RFID Tag 15

2.3.2.2 RFID Reader 15

2.3.3 GSM Module (SIM 908C) 16

2.3.3.1 GSM Module to MCU and MCU to GSM Module 19

2.3.3.2 NETLIGHT 20

2.3.3.3 Turn on SIM 908C Using the Power Key Pin (Power On) 20

2.3.3.4 Power on LED 21

2.3.3.5 SIM-Card Interface 21

2.4 LCD Display (16X2) 22

2.5 Proteus 7.1 SPO 22

Page 8: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

viii

Chapter 3 Software Part of DATPS

3.1 Description of Proteus 24

3.1.1 Overview of the Proteus Design Suite 25

3.1.2 Circuit Construction and Assembly 26

3.1.3 PIC16F877A Parameter Setting 27

3.1.4 Simulation Some Parts of DATPS 27

3.2 Proteus Layout of DATPS 28

3.3 PROTON+ Compiler Programming Tools 28

3.3.1 Creating a New Project 29

3.3.2 Coding Template of DATPS 30

3.4 AT Command 31

3.4.1 Types of AT Commands 32

Chapter 4 Hardware Implementation

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

5.2 Recommendation for Future Work 46

Reference 47

Appendix 48

Page 9: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

ix

LIST OF FIGURES

Fig.2.1: Block Diagram of the Proposed DATPS 6

Fig.2.2: Circuit Diagram of Proposed DATPS 7

Fig.2.3: Flow Chart of the Proposed System (DATPS) 8

Fig.2.4: Pin Diagram of PIC16F877A Microcontroller, adapted from [7] 13

Fig.2.5: Block Diagram of PIC16F877A Microcontroller, adapted from [7] 14

Fig.2.6: Module of RFID Tag, adapted from [9] 15

Fig.2.7: Module of RFID Reader, adapted from [9] 15

Fig.2.8: Pin Diagram of SIM908C GSM Module 17

Fig.2.9: Module to MCU and MCU to Module Connection Diagram 19

Fig.2.10: Reference Circuit of NETLIGHT 20

Fig.2.11: Power On/ Down Module Using Transistor 20

Fig.2.12: Power On Status Circuit 21

Fig. 2.13: Reference Circuit of the 8-Pin SIM Card Holder 21

Fig.2.14: LCD Display 22

Fig.2.15: LCD Display Interfacing with PIC16F877A 22

Fig. 3.1: Overview of Proteus Software 26

Fig.3.2: PIC Parameter Setting on Proteus. 27

Fig.3.3: DATPS Layout Prepared in Proteous 28

Fig.3.4: New Creating Page for Programing of DATPS 30

Fig.3.5: Coding of DATPS and Built in Condition 31

Fig.3.6: Compiles of DATPS Coding and Built in Condition 32

Fig.3.7: Classifications of AT Commands 33

Fig.4.1: Onboard Implementation of the Proposed DATPS Circuit 34

Fig.4.2: Final Implementation of the Proposed DATPS 35

Fig.4.3: Welcome Status of Toll Plaza Controller in LCD Display 36

Fig.4.4: Passing of Registered Vehicle in Toll Plaza Area 38

Fig.4.5: Rocket dialing for Registered Vehicle 38

Fig.4.6: Deducted Amount Shown in LCD Display 38

Fig.4.7: SMS Sent to the Vehicles Owner Mobile Number 39

Fig.4.8: Deducted Amount Added to the Toll Plaza Server DBBL Account 39

Fig.4.9: Barricade Opening Status Shown in LCD Display 39

Page 10: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

x

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 2.1 Pin Description of PIC16F877A Microcontroller 13

Table 2.2 Operational Characteristics of RFID Reader (ID-12LA) 16

Table 2.3 Pin Description SIM908C Module 17

Table 3.1 AT Commands 33

Table 4.1 Detail about the Specific Vehicles Passing Through the

Toll Plaza System 35

Table 4.2 Statement of Toll Booth in Bangabandhu Bridge 43

Table 4.3 Toll Rate of the Difference Vehicles Bangabandhu Bridge 43

Table 4.4 The System Cost Analysis Between Manual Toll Plaza System

And DATPS 44

Page 11: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

xi

Nomenclature

DATPS Development of an Automated Toll Plaza System

ROM Read Only Memory

RAM Random Access Memory

CPU Central Processing Unit

EEPROM Electrically Erasable Programmable ROM

pF Peko Farad

μF Micro Farad

VSS Ground

MCU Microcontroller

IC Integrated Circuit

PSP Parallel Slave Port

BOR Brown -out Reset

A/D Analogue-to-Digital Converter

VREF Programmable on-chip Voltage Reference

WDT Watch Dog Timer

ICD In-Circuit Debug

CMOS Complementary Metal Oxide Semiconductor

RFID Radio Frequency Identification

SIM Subscriber Identity Module

GSM Global Positioning System

GPRS General Radio Packet Service

LCD Liquid Crystal Display

PIC Peripheral Interface Controller

IDE Integrated Development Environment

C Coulomb

F Farad

VDD DC Power

Page 12: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

1

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.

1.1 Background and Problem Statement

The automatic toll plaza system is a fully digitalize toll collection system which has no need

any manual conjugation at the toll station. In this system all the information of the vehicles of

highway should be stored microcontroller database system including vehicles TAG number.

And ofcoruse the vehicles which are use the highway road and want to pass toll station should

have DBBL rocket account and vehicles TAG number. Again needs RFID reader which works

at the toll station to read the TAG number of the vehicles.

At the toll station any vehicles pass through the toll gate, the RFID reader read the TAG

number of the vehicles. If the vehicles information matched with the microcontroller database

then toll money automatically deducted from vehicles owner rocket account and again the

money automatically transferred to the main toll collection account. In the same time money

deduction information automatically displayed at the LCD of the toll gate and barricade

opened as well.

Furthermore, by interfacing of the microcontroller and GSM module, the information of toll

money deduction from the owner account will be sent as SMS to the vehicles owner mobile

phone.

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.

Page 13: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter1: Introduction

2

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.

Page 14: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter1: Introduction

3

1.3 Significance of Development of an Automated Toll Plaza System

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

1.4 Advantages of DATPS

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.

Page 15: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter1: Introduction

4

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.

Page 16: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

5

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

Page 17: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

6

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.

Fig. 2.1:Block diagram of the proposed DATPS

Transmitter unit Receiver

Metal Gear Servo Motor

Gate Control

GSM Module

LCD Display

Vehicle RFID Tag

RFID Reader

Reset Option

Mobile

MCU (U1) Microcontroller PIC16F877A

DC Source, 12VDC

Regulator Power supply

AC Supply230

V/50Hz

Page 18: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

7

For more comprehensibility about DATPS, the different steps of the flowchart shown in Fig.

2.3 are described in detail stated as follows:

Fig

. 2.2

: C

ircu

it d

iagra

m o

f p

ropo

sed D

AT

PS

Page 19: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

8

Fig. 2.3: Flow chart of the proposed system DATPS

Open the toll Barrier

Dose the tag match?

Two Times try to transfer toll money by DBBL

Rocket

GSM Network Connected and Text on

Sent to Vehicle owner

Transmit the data serially to Microcontroller

Tag Detected?

END

Initialization RFID, LCD and GSM

Search for the Tag

Yes

Yes

Yes

No

No

Compare tag number with database

Start

No

Vehicle Go to Bi-Pass

No

Page 20: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

9

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.

Page 21: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

10

2.1.1Method Used in DATPS: USART

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.

Page 22: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

11

2.2List of Components

In order to implement an automated toll plazasystem in a hardware module, the following

electrical devices are required:

Sl. No.

Component’s Name Required

Component.

Sl. No.

Component’s Name

Required Component.

01 PIC16F877A 02 20 Capacitor 100µF 02

Crystal Oscillator

16MHz 02 21 Capacitor 22pF 03

02 Resistor (1/4-Watt

Carbon Film) 47KΩ 05 22 Capacitor1000µF 01

03 Resistor (1/4-watt

Carbon Film) 4.7KΩ 07 23 Capacitor2200µF 01

04 Resistor (1/4-watt

Carbon Film) 200R 02 24 Capacitor 104pF 05

05 Resistor (1/4-watt

Carbon Film) 10 KΩ 06 25 SIM908C module 01

06 Resistor (1/4-watt

Carbon Film) 1 KΩ 03 26 SIM HOLDER 01

07 Resistor (1/4-watt Carbon Film) 10 Ω

01 27 LM2576 01

08 Resistor (1/4-watt

Carbon Film) 10RΩ 01 28 IC7805 01

09 Resistor (1/4-watt

Carbon Film) 22RΩ 01 29 Transistors 08

10 Resistor (1/4-watt

Carbon Film) 1.2KΩ 01 30

LCD Display 2line 16 digit

02

11 Resistor (1/4-watt

Carbon Film) 2.7 KΩ 01 31 SIM card 03

12 PCB 01 32 Connecting wire As required 13 LED-Yellow 04 33 RFID reader 01 14 1N4148 06 34 RFID tag 12 15 1N4729A 01 35 Servo Motor 01 16 1N4007 01 36 DC socket 01

17 1N5408 01 37 Power supply 12

VDC 01

18 4V2Z 01 38 Mobile Phone 01

19 Toy Car 01 39 Photoelectric

Proximity sensor 01

2.3 Description of Components

In DATPS, the description of the used electrical components for the hardware implementation

is stated below:

Page 23: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

12

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.

Page 24: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

13

Fig. 2.4: Pin diagram of PIC16F877A microcontroller, adapted from [7].

Table 2.1: Pin Description of PIC16F877A Microcontroller

Pin No.

Pin Name Description Pin No.

Pin Name Description

1 MCLR/VPP Master Clock Reset 21 RD2 PORTD.2

2 RA0/AN0 PORTA.0/Analog Channel 0 22 RD3 PORTD.3

3 RA1/AN1 PORTA.1 /Analog Channel 1 23 RC4/SD1/SDA SDA PORTC.4/SDI (for

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

13 OSC1/CLKIN OSCILLATOR CON. 33 RB0/INT PORTB.O/EX. 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

Page 25: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

14

Fig. 2.5: Block diagram of PIC16F877A microcontroller, adapted from [7]

2.3.2 Radio Frequency Identification (RFID)

RFID refers to radio frequencyidentification that is RF technology-based identification system

identifying objects using the tags attached to them.This technology finds its application in

many areas including military, commercial airplanes, keyless entry for car, E-tags, passports,

laptops, i-pods, mobile phones and credit cards. In addition, there are two basic components in

an RFID system apart from the control system unit, as given below:

Page 26: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

15

2.3.2.1RFID Tag

Fig. 2.6: Module of RFID tag, adapted from [9]

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.

Fig. 2.7: Module of RFID reader, adapted from [9]

Page 27: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

16

Table 2.2: Operational characteristics of RFID reader (ID-12LA)

Parameter ID-12LA

Frequency 125 kHz nominal

Card Format EM 4001 or compatible

Read Range ID3 Up to 30 using suitable antenna using ID-Innovations clamshell card @5v Read Range ID13 Up to 12cm using ISO card, up to 18cm using ID-Innovations clamshell card @5v

Read Range ID23 Up to 18cm using ISO card, up to 25cm using ID-Innovations clamshell card @5v

Encoding Manchester 64-bit, modulus 64

Power Requirement +2.8 VDC thru +5 VDC @ 35mA ID-12LA, 45mA ID-20LA

RF I/O Output Current +/- 200mA PKPK

2.3.3 GSM Module (SIM908C)

In DATPS, GSM module is a vital part in our system; therefore, the study of internal

architecture of SIM908CGSM module is necessary. The detailed pin diagram of SIM908C

shown in Fig. 2.8 as well as the discussion of different pins is mentioned in Table 2.3.

SIM908C has a 60-pin DIP connector, provides the following features using hardware

interface combined by module and customers’ boards:

Serial port and debug port can help user easily developing user’s application.

GPS Serial port.

Two audio channels include two audio inputs and two audio outputs. These can be

easily configured by AT command.

Changing interface.

Programmable general-purpose input and output.

The keypad and SPI display interface will give users the flexibility to develop

customized applications.

RF connector interface.

Page 28: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

17

Fig. 2.8:Pin diagram of SIM908C GSM module

Table 2.3: Pin Description SIM908C GSM Module

Pin name Pin Number I/O Description Comments

Power supply VBAT 2,4,6,8 I Power supply 3.2 V~4.8V VRTC 11 I/O Power supply for RTC It is recommended

to connect with a battery or a capacitor (e.g 4.7µF)

GSP_VCC_RF 56 O 2.8 output for GPS active antenna

If it is unused, keep open

GPS_VANT 58 I GPS active antenna power supply

If it is unused, keep open

GND 1,3,5,7 Ground Change interface VCHG 10, 12 I Change input TEMP_BAT 14 I Battery temperature sensor Power on/down POWERKEY 13 I POWERKEY should be

pulled low at least 1 second then release to power on/down the module

Pulled up internally

Audio interface MIC IP 42 I Different audio input If these pins are

unused, keep open MIC IN 44

Page 29: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

18

SKP IP 41 O Different audio output SKP IN 43 MIC2P 46 I Different audio input MIC2N 48 SPK2P 45 O Different audio output SPK2N 47 Status STATUS 20 O Power on status If these pins are

unused, keep open NETLIGHT 16 O Network status LCD interface DISP_CLK 26 O Display interface If these pins are

unused, keep open DISP_DATA 28 I/O DISP_D/C 30 O DISP_CS 24 O GPIOs GPIO0 34 I/O GPIO0 If these pins are

unused, keep open GPIO1 22 GPIO1 Serial port RXD 29 I Receive data If only TXD and

RSD are used, it is suggested to pull down DTR, and other pins can be kept open.

TXD 31 O Transmit data RTS 33 I Request to send CTS 35 O Clear to send DCD 25 O Data carrier delet RI 37 O Rings indicator DTR 27 I Data terminal ready Debug interface DBG_TXD 38 O For debugging and upgrading

firmware If these pins are unused, keep open DBG_RXD 36 I

GPS interface GPS_TX 51 O For GPS NMEA information

output debugging and upgrading firmware

If these pins are unused, keep open GPS_RXD 53 I

SIM interface SIM_VDD 17 O Voltage supply for SIM card,

Support 1.8 V or 3 V SIM card

All signal of SIM interface should be protected againt ESD with TVS diode array

SIM_DATA 21 I/O SIM data input/output SIM_CLK 23 O SIM clock SIM_RST 19 O SIM reset SIM_PRE 15 I SIM detection ADC ADC 9 I Input voltage range: 0V~2.8

V If it is unused, keep open

Buzzer BUZZER 18 O Buzzer output If these pins are

unused, keep open Not connect NC 49, 50, 52, 54,

55, 57, 59, 60 These pins should

be kept open

Page 30: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

19

2.3.3.1 GSM Module to MCU and MCU to GSM Module

The connection diagram of GSM module to microcontroller (MCU) and MCU to GSM

module has been presented in Fig. 2.9.

Fig. 2.9: Module to MCU and MCU to module connection diagram

GSM Module to MCU

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.

MCU to GSM Module

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. To decrease the digital voltage level from 5 V to 3.9 V is

not needed amplifier circuit for MCU (Microcontroller). In this circuit to decrease voltage

level 5 V to 3.9 V uses R14 &R15 resistor and D5 Zener diode.

Page 31: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

20

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.

Fig. 2.10: Referance circuit of NETLIGHT

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.

Fig. 2.11: Power on/down module using transistor 2.3.3.4Power on LED 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.

Page 32: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

21

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.

Fig. 2.12: Power on status circuit

Fig. 2.13: Reference circuit of the 8-pin SIM card holder

Page 33: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

22

2.4 LCD Display (16X2)

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.

Fig. 2.14: LCD display

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.

Fig. 2.15: LCD display interfacing with PIC16F877A

2.5 Proteus 7.1 SP0

The main theme of the Proteus 7.1release [15] is integration. Development has therefore been

focused on taking the various discrete parts of an electronic design and coupling them together

to achieve a better workflow. In order to achieve this, three major architectural changes were

necessary; a unified application framework, a common database and a live enlist

Page 34: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 2: Development of an Automated Toll Plaza System

23

Special Features of Proteus Software

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.

Page 35: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 3: Software Part of DATPS

24

Chapter 3

Software Part of DATPS

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.

3.1 Description of Proteus 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

Page 36: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 3: Software Part of DATPS

25

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.

3.1.1 Overview of the Proteus Design Suite 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.

Page 37: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 3: Software Part of DATPS

26

3.1.2 Circuit Construction and Assembly 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.

Fig. 3.1: Overview of Proteus software

Page 38: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 3: Software Part of DATPS

27

3.1.3PIC16F877A Parameter Setting

The PIC16F877A property panel can be similarly obtained by right clicking the PIC andselecting

“Edit Component”. The PIC parameters like oscillator frequency, program configuration word

and other properties should be appropriately supplied. The program code in hex file should be

loaded in the program file section. The summary of the entire procedure for parameter setting is

shown in Fig. 3.2.

3.1.4 Simulations some Parts 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.

Fig.3.2: PIC parameter setting on Proteus

Page 39: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 3: Software Part of DATPS

28

3.2 Proteus Layout of DATPS

The DATPS layout is presented in the Proteus software that is shown in Fig.3.3.

Fig.3.3: DATPSlayout prepared in Proteus

3.3 PROTON+ Compiler Programming Tools

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.

Page 40: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 3: Software Part of DATPS

29

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

3.3.1 Creating a New Project

To create a new project in Proton Basic IDE for PIC, a new window must be opened that is shown

in Fig.3.4.

Fig. 3.4: New creating page for Programming of DATPS

Page 41: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 3: Software Part of DATPS

30

3.3.2 Coding Template of DATPS

The coding template is shown in Fig. 3.5, where any program can be written. In this template,

program (or, coding) of DATPS has been written successfully. Fig.3.6 shows complies of DATPS

and successfully built in this project.

Fig.3.5: Coding of DATPS and built in condition

Page 42: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 3: Software Part of DATPS

31

Fig.3.6: CompilingDATPScoding and built in condition.

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.

AT commands with a GSM/GPRS MODEM or mobile phone can be used to access

followinginformation and services:

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.

Page 43: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 3: Software Part of DATPS

32

3.4.1 Types of AT Commands

There are four types of AT commands, which are presented in Fig. 3.7.

Fig.3.7: Classifications of AT commands

The detailed discussion about the four AT commands is stated below:

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.

Page 44: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 3: Software Part of DATPS

33

Some of SMS AT commands are given bellow:

Table 3.1: AT commands

Command Description

AT+CSMS Select message service.

AT+CFUN Set phone functionality

AT+CMGF Message format

AT+CSCA Service center address

AT+CUSD Unstructured supplementary service data

AT+CMGS Send message

AT+CMGDA Delete all SMS

AT+CSAS Save setting

AT+CRES Restore setting

AT+CMGW Write message to memory

AT+CMGR Read message

AT+CMGW Write message

Page 45: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 4: Practically Implementation

34

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.

Fig. 4.1: Onboard implementation of the proposed DATPS circuit

Power Adapter 5VDC

RFID Reader

LCD -1 LCD-2

Proximity Sensor

GSM Module

Microcontroller

Page 46: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 4: Practically Implementation

35

Fig. 4.2: Final implementation of the proposed DATPS.

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.

Serial No. Unique code Types of vehicle Toll Amount (BDT)

Card#1 020072A1F524 Car 10 Card#2 020072F9B138 Small Bus 15 Card#3 020041D4BF28 Large Bus 20 Card#4 020042ACBD51 Small Truck 30 Card#5 0200732B1A40 Medium Truck 40 Card#6 0200428215D7 Large Truck 50 Card#7 020041D764F0 Trailers 50 Card#8 020042ECC26E Taxi 10

Car

Garden RFID

Module Box

Page 47: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 4: Practically Implementation

36

Card#9 020071292D77 CNG 10 Card#10 01008FAB99BC Motor Bike 10

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.

4.2.1 Hardware Setup

In implementation of the hardware module of DATPS, at first pin diagram of MCU should be

studied perfectly mentioned at Chapter 2. After that, 5V DC was supplied to the pin no. 1 of

MCU for its activations, whereas, pin no. 13 and 14 connected with 16MHz crystal

oscillator.To connect the LCD display with MCU, the datapin, RS pin and enable pin of the

LCD had made connection with the pin no. of 4-7, 35 and 36, respectively.For serial

communication between GSM module and microcontroller, the transmitter TXD pin and

receiver RXD pin of the GSM module were connected with the pin no. of 25 and 26 of MCU,

respectively.In case of RFID module, pin no. 1 should be grounded. For serial communication,

the connection was made between pin no. 8 of RFID and pin no. 6 of MCU. In order to control

the servo motor and photo electric proximity sensor, those were connected with pin no. 6 and

21 of MCU, respectively.

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.

Fig. 4.3: Welcome status of toll plaza controller in LCD display.

Page 48: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 4: Practically Implementation

37

4.2.2 Observation for registered vehicles

It is observed that when a vehicle passes through a toll plaza area, RFID readersearches the

RFID tags unique code as these are attached with all vehicles (see Figs. 4.2 and 4.4). Then,

data is transferred to MCU through serial communication. MCU then compares this unique

code with the information stored in the data base system. If the vehicles RFID tag numbers are

matched with the data stored in main database system of MCUthenMCU communicates with

GSM module by serial communication. Afterthat, GSM modulecommunicateswiththe vehicle

owner DBBL rocket account with the association of microcontroller shown in Fig. 4.5. If the

GSM module recognizes the registered vehicle DBBL rocket account as well as the available

balancethere, then the vehicle (i.e., Car) toll money 10 Tk./= is automatically deducted by the

system displayed in the LCD display (see Fig. 4.6). Such deducted toll money is determined

according to the data stored in MCU memory shown in Table 4.1.In the meantime, one SMS is

automatically generated and sent to the specific vehicle owner’s mobile number shown in Fig.

4.7. This deducted amount is then added to the toll plaza server number (see Fig. 4.8).In this

phenomenon;MCUalso receives a feedback from GSM module.When MCU receives

feedback, vehicle information and money deduction information are displayed in LCD

through MCU as well as the gate barrier is opened by controlling servo motor (see Figs. 4.9-

4.10). To complete such processes, DATPS needs around 30 seconds. The main gate barrier is

opened until the vehicle passes the proximity sensor area. In course of this time, such

information transferred to the MCU that ultimately closes the toll gate barrier using servo

motor.

Page 49: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 4: Practically Implementation

38

Fig. 4.4: Passing of registered vehicle in the toll plaza area.

Fig.4.5: Rocket dialing for registered vehicle.

Fig.4.6: Deducted amount shown in LCD display

Page 50: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 4: Practically Implementation

39

Fig.4.7: SMS sent to the vehicle’s owner mobile number.

Fig.4.8: Deducted amount addedto the toll plaza server DBBL account.

Fig.4.9: Barricade opening status shown in LCD display

Fig. 4.10: Barricade is opened shown on main controller display

Page 51: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 4: Practically Implementation

40

4.2.3 Observation for unregistered vehicles

In accordance with the above process, it isobserved that when anunregisteredvehicle passes

through a toll plaza area, RFID reader searches the unique codes of RFID tags attached with

all vehicles (see Figs. 4.2 and 4.4). If the vehicles RFID tag numbers are matched with the

data stored in main database system of MCU then MCU communicates with GSM module by

serial communication. Afterthat, GSM module communicateswith the vehicle owner DBBL

rocket account with the association of microcontroller shown in Fig. 4.5. Because of the

unregistered vehicle, GSM module cannot recognize the vehicle.Such information then

displayed in the LCD display (see Fig. 4.11) as well as in the main controller display (see Fig.

4.12). Therefore, the gate barrier does not open and the toll plaza road is being locked. That’s

why; the vehicle is informed to follow the by-pass road for manually paying the toll money

(see Fig. 4.13).

Fig. 4.11: Tracking of unregistered vehicle showninLCDmaindisplay.

Fig. 4.12: Tracking of unregistered vehicle shown in LCD main controller display.

Page 52: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 4: Practically Implementation

41

Fig.4.13: Passing of unregistered vehicle using the By-Pass Road in the toll plaza area.

4.2.4 Observation for insufficient balanced vehicles

The vehicles without being the sufficient balance (i.e., sufficient toll money)passing through

the toll plaza area, firstly, GSM module checks the vehicle RFID tag whether it is registered or

not. If the registration is found OK, then checking is started for the sufficient balance available

in the DBBL rocket account. If the balance money is lower than, the required toll plaza

money, thentwomessagesis displayed consecutively in the LCD display (see Figs. 4.14-4.15)

showing “Insufficient balance” and “Please recharge immediately and go to the bypass road”,

respectively. In the meantime, one SMS sent to the owner’s mobile of insufficient balanced

vehicle shown in Fig. 4.16.Therefore, the gate barrier does not open and the toll plaza road is

being locked. That’s why; the vehicle is informed to follow the by-pass road for manually

paying the toll money (see Fig. 4.17).

Fig.4.14: Insufficient balance shownin LCD main display.

Page 53: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 4: Practically Implementation

Fig.4.15: Requesting recharge immediately shown in

Fig.4.16: SMS sent to the

Fig. 4.17: Passing of insufficient balanced v

Chapter 4: Practically Implementation

42

Requesting recharge immediately shown in LCD main display.

SMS sent to the owner’s mobile number of insufficient balanced v

Passing of insufficient balanced vehicle using the By-Pass Road in the toll plaza

area.

LCD main display.

insufficient balanced vehicle.

Pass Road in the toll plaza

Page 54: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 4: Practically Implementation

43

4.3 Cost-effectiveness analysis of the proposed DATPS

Cost-effectiveness analysis is a form of economic analysis that compares the relative costs and

outcomes (i.e., effects) of different courses of action. In this context,

BangbandhuBridgeplaced at Shirajgonj district, Bangladesh was considered. It is found that

the vehicle toll money collecting system in this bridge is still manually

performed.Bangabandhubridge has ten toll collection booths per side i.e., east and west. There

are six booths available being used to collect toll money of vehicles and the other four to

measure the weight of vehicles. Under the investigation it was found that, the averagenumber

of vehicles passing over the Bangabandhubridge per day at Normal time and EID time is

13500 and 15500, respectively where the averaged clearance time in the toll plaza area is 35-

40 seconds. All the above inform can be found in Table 4.2 as well as the toll rate of different

vehicles in BangabandhuBridge are mentioned in Table 4.3.

Table 4.2: Statement of the toll booth in BangabandhuBridge.

Side

Types of toll booth No. of vehicles passing per dayin average

Clearance time per vehicle in average (Sec.)

Money collection Weight measurement

Normal time EIDtime

35 –40 East 6 4

13500 15500 West 6 4

Table4.3: Toll rate of the different vehicles inBangabandhuBridge.

Vehicle Type Toll Amount Bike 40.00

Light vehicle/Car 500.00 Small Bus 650.00 Big Bus 900.00

Small Truck 850.00 Medium Truck 1100.00

Big Truck 1400.00

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

Page 55: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 4: Practically Implementation

44

Plaza Systems

of vehicles passing per

year

for passing vehicles per year (hour)

passing vehicles per year (litre)

passing vehicles per year (BDT)

booth operators per year (BDT)

Manual 4927500 52012.5 65,015.62 58,51,405.80/= 86,40,000/=

DATPS 4927500 27375 34,218.75 30,79,687.50/= 7,20,000/=

Difference 24637.5 30,796.87 27,71,718.30/= 79,20,000/= A set of investigated data found in BangabandhuBridge, Shirajgonj shown in Table 4.5. It is

observed that for the both manual and DATPStoll plaza systems the average number of

vehicles passing through the BangabandhuBridge is 4927500 per year. According to the Table

4.4, each vehicle takes in average 38 secondsfor completing the manual toll plaza system,

whereas average 20 seconds are necessary in DATPS that demanding 52012.5 hours and

27375 hours per year for both the processes, respectively. It is estimated that the fuel

consumption of each vehicle is 1.25 litre in averageper hour. Thus, the required fuel in passing

vehicles per year for the both toll plaza systems are 65,015.62 litreand 34,218.75litre,

respectively. If the fuel cost per litre in average is 90.00 BDT, then the total fuel cost per year

in BDT are 58, 51,405.80/= and 30, 79,687.50/=, respectively. In addition, for operating the

manual toll plaza system in Bangabandhubridge, it requires in total 36 booth operators per day

for the both sides where each having the service responsibility 8 hours per day. The salary of

each operator per month in average 20,000/= BDT. Thus, the total salary of booth operators

per yearin average 86, 40,000/= BDT and 7, 20,000/= BDT, respectively.

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.

Page 56: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 5: Conclusion

45

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.

Page 57: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Chapter 5: Conclusion

46

5.2 Recommendationfor Future Work

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.

Page 58: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

47

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.

[2] ShilpaMahajan, “ Microcontroller based automatic toll collection system”, International

Journal of Information and Computation Technology, vol. 3, no. 8, pp. 793-800, 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/

[6] LM2576, LM2576HV SNVS107D-JUNE 1999-REVISED/pdf/datasheet

[7]“PIC16F87X data sheet, 28/40-pin Enhanced FLASH Microcontrollers”, URL:

http://html.alldatasheet.com/html-

pdf/115035/MICROCHIP/PIC16F87XA/489/1/PIC16F87XA.html

[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

[12] http:// www.onsemi.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

Page 59: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

48

Program Coding for Toll Plaza

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 Dim inphone[11] As Byte Dim sms_noAs Byte Dim amount[2] As Byte Dim IdNumber[2] As Byte Dim Buffer[12] As Byte Dim WDT_Reset_TimerAs Byte Dim Card#1[12] As Byte Dim Card#2[12] As Byte Dim Card#3[12] As Byte Dim Card#4[12] As Byte Dim Card#5[12] As Byte Dim Card#6[12] As Byte Dim Card#7[12] As Byte Dim Card#8[12] As Byte Dim Card#9[12] As Byte Dim Card#10[12] As Byte Dim Card#11[12] As Byte Dim Card#12[12] As Byte Dim Card#13[12] As Byte

Page 60: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

49

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"

Page 61: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

50

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"

Page 62: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

51

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"

Page 63: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

52

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 Symbol GIE = INTCON.7 Symbol TMR1_Val = 5600 Symbol TMR1_mS = 1 Symbol Timer1 = TMR1L.Word Symbol TMR1_Enable = PIE1.0 Symbol TMR1_Overflow = PIR1.0 Symbol TMR1_On = T1CON.0 GoSubInitialization clrwdt DelayMS500 clrwdt DelayMS500 Cls Print At 1,1,"READY TO" Print At 2,1,"GO" DelayMS1000

Page 64: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

53

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 =" SerInFromPC,Baud,500,main,[SKIP 1,Str Buffer] 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"

Page 65: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

54

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

Page 66: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

55

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

Page 67: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

56

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:

Page 68: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

57

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] For i=0 To 100 Servo_Position = 680 Servo servo_motor ,Servo_Position DelayMS2 Next i 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

Page 69: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

58

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(">")] SerOutTXD,Baud,["Insufficient Balance: Please Recharge your DBBL, Rocket Account ",26] SerInRXD,Baud,4000,E_RROR,[Wait("OK")] 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

Page 70: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

59

Print At 1,1, "Rocket fail" DelayMS1000 GoTomain 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

Program Coding for LCD

Device=16F877A XTAL=16

Page 71: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

60

Config HS_OSC , WDT_OFF , PWRTE_ON , BODEN_ON , LVP_OFF , CP_OFF , CPD_ON , DEBUG_OFF 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 'Symbol TXD PORTC.6 'INput PORTB.7 Symbol RXD PORTB.7 Dim Disp[20] As Byte Dim Pattern As Byte Dim Digit As Byte Dim Digit_CalAs Byte Dim i As Byte Dim Disp_SelectionAs Byte Dim Receive_DataAs Byte Dim check As Byte Dim test As Byte 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

Page 72: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

61

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

Page 73: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

62

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"

Page 74: DEVELOPMENT OF AN AUTOMATED TOLL PLAZA SYSTEM …

Appendix

63

Print At 2,1,"for motor BIKE " Print At 3,1,"DM: HA-142115 " Print At 4,1," " check = 1 DelayMS1000 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