0% found this document useful (0 votes)
50 views

Final Report Crowd Management Arduino

The document discusses implementing a centralized bus control system using RFID and other technologies. Passengers would get a unique ID bus pass card to store their details. Conductors can deduct fares by scanning the cards, and passengers get e-tickets via SMS. This system aims to reduce fraud, track passengers, and remove issues with exact change. It also discusses using the system to encourage public transport use and ensure safety during the COVID-19 pandemic.

Uploaded by

kshamakbhat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Final Report Crowd Management Arduino

The document discusses implementing a centralized bus control system using RFID and other technologies. Passengers would get a unique ID bus pass card to store their details. Conductors can deduct fares by scanning the cards, and passengers get e-tickets via SMS. This system aims to reduce fraud, track passengers, and remove issues with exact change. It also discusses using the system to encourage public transport use and ensure safety during the COVID-19 pandemic.

Uploaded by

kshamakbhat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 70

CHAPTER 1:

ABSTRACT:

The Embedded Technology is now in its prime and the wealth of Knowledge available is mind-blowing.
Embedded technology plays a major role in integrating the various functions associated with it. This
needs to tie up the various sources of the Department in a closed loop system. This proposal greatly
reduces the manpower, saves time and operates efficiently without human interference. This project puts
forth the first step in achieving the desired target. With the advent in technology, the existing systems are
developed to have in built intelligence

The Embedded Technology is now in its prime and the wealth of Knowledge available is mind-blowing.
Embedded technology plays a major role in integrating the various functions associated with it. This needs to tie up
the various sources of the Department in a closed loop system. This proposal greatly reduces the manpower, saves
time and operates efficiently without human interference. This project puts forth the first step in achieving the
desired target. With the advent in technology, the existing systems are developed to have in built intelligence. Now
a days we come across theft, terrorist attacks on public transportation systems. Many a time it becomes difficult for
investigating agencies to track the cases. We are proposing a Centralized bus control system where a passenger
needs to fill up the details by submitting required ID & address proof as per Know your Passenger policy and
purchase a unique ID Bus pass card having unique number (RFID Tag). We are using RFID Reader to read the
RFID unique Tags. Thus the bus centralized control cell has the passenger’s details in their database. Passenger has
to get that card recharged in the bus stop (Centralized Cells authorized outlets) or in the bus itself by a conductor.
With this proposed system the existing paper ticket system can be removed with an e-ticket by triggering an SMS to
the Passenger mobile number when the conductor swipes Passenger card. Hence we are proposing a Smart
Automated ETicket System for Indian transport system by using RFID & IOT technologies using Arduino.

The crowded Pubic Transports is Bangalore’s lifeline. The city’s supply chain of essential commodities and its
residents are heavily dependent on this mode of transport. The Buses, used by more than 37 lakha commuters daily,
are being sanitised in a bid to control the spread of corona virus. Special efforts are being put in to ensure
cleanliness and hygiene in all passenger interface areas and components in buses, including door handles, side
handles, grab handles, seats, windows, etc. That said, travelling in the local buses could be the easiest way to
contract the virus. The Bangalore locals, which are known to carry commuters 2.6 times more than its capacity, are
famous for people breathing down each other’s necks, literally. An infected person travelling on a local buses in
Bangalore can potentially infect Lakhs.
INTRODUCTION

We come across theft, terrorist attacks on public transportation systems & fraud by Passengers or conductors
by reusing the old tickets. Sometimes there is problem for the passenger if he does not have the exact change to
purchase a ticket; this trivial issue sometimes leads to big fights between conductor & passengers. Also we know it
becomes difficult for investigating agencies to track the cases in case of accidents or terrorist attacks with the
existing system. We are proposing a Centralized bus control system where a passenger needs to fill up the details
and purchase a unique ID bus pass card having unique number. Thus the bus centralized control cell has the
passenger’s details in their database. While collecting details the centralised Cell needs to collect the passenger’s
photo, mobile number, ID proof & address proofs as well. Also this issued card should be valid for only certain
time. In our case we are proposing the validity period for 1 year. After Expiry of the card, passenger needs to get
the card renewed again in the Centralised cell by paying the prescribed fee. While preparing the data of the
passenger, we can use Aadhar number (Unique ID issued by Govt of India ) so that unique identity of the
Passenger is maintained & hence monitoring & maintenance becomes more easy. Every time Passenger needs to
get that card recharged in the bus stop (Centralized Cell outlets) or in the bus itself by a conductor. With this
proposed system existing old system such as the paper ticket can be removed with an e-ticket. Here E-ticket is sent
to passenger’s mobile number with his journey & amount deduction details in the message. As the E-ticket will
have the timestamp & bus number & journey details, it cannot be reused & it will be passenger specific. There is
an issue of exact change to be given to the passenger when he buys a ticket. When the conductor/ passenger do
not have the exact change, then it will be problem which sometimes results in fight between them. Thus by using
proposed system by conductor, a RFID reader automatically reads the unique tag number & Processor processes
the transaction & deducts the amount from the passengers tag (card). A SMS message which we call here as E-
ticket is triggered to the customer/ Passenger stating that certain amount for his journey has been deducted from
his tag no. This SMS again will be used by a passenger as an E-ticket for that journey as the message will have
timestamp hence valid for that specific journey only & hence no issue of reuse of it thus preventing the fraud by
the passenger. Thus the proposed system will not only help Indian transport systems such as KSRTC BMTC etc. in
preventing fraud but also helps in maintaining the database & helps Security agencies. KSRTC or BMTC can
encourage the people for using public transportation system by introducing various lucky draw offers by points
system for their journey. Passengers can redeem their accumulated points against their card no for attractive
offers or prizes. If the passengers are regularly using the public transport system, to encourage them discounts
should be offered. To encourage people occasionally offers need to be given so that they can prefer public
transport system over their own vehicles.

In the face of the corona virus outbreak, health officials are advising citizens to avoid crowds whenever possible,
and people are increasingly worried about being in close contact with strangers. For those who use public transit,
this concern is top of the mind. Health experts know that Covid-19 causes respiratory problems. This virus is similar
to the common cold and other respiratory viruses, which usually spread through exposure to tiny droplets from a
sick person’s cough or sneeze. Scientists have been planning for a pandemic for decades and transport hubs are
widely regarded as infection hotspots, with virus transmission rates up to six times higher for those using public
transport systems. Airplanes, trains and buses (and the stations and airports you must travel through) provide in
many respects the perfect environment for droplet-spread diseases such as coronavirus (Covid-19) to thrive.
Most cities with large transit systems, such as in the US, are doubling down on deep cleaning their subway cars,
buses, turnstiles, and handrails. The London Underground, which serves roughly 1.2 billion passengers annually, is
a particular hotspot. Many mass transit companies have set up pandemic response teams. If the outbreak gets
significantly worse, it is up to transit and local officials to use their discretion and shut down the system or reduce
service.

Authorities in Wuhan, China, the epicentre of the outbreak, closed all transportation hubs in an unprecedented
quarantine, stopping all trains, ferries, buses, and planes from leaving the city when the disease started to take hold
in late January. This drastic step, in retrospect, appears to have been most effective in slowing the spread of the
virus.
What measures can individuals and companies take to reduce risk and effectively slow the spread of the virus?
Individuals can consider commuting during non-peak hours, using transport other than mass transit systems, or
working from home. Many major companies have asked employees to work from home or instituted a staggered
work-from-home plan. If you feel sick or belong to the category classified as “at higher risk” of contracting the
corona virus (older adults, people with chronic medical conditions, etc), staying at home or self-quarantining is the
best thing to do. Generally speaking, close contact with people in crowded spaces (whether that be a subway,
airplane, or office) makes a person more susceptible to catching the virus.
Previous research has shown that using public transport can increase a person’s risk of catching a respiratory
infection (the flu or common cold), since “buses and [trains] are crowded with people sitting and standing in close
proximity” to one another. Herd immunity (we often say that Indians have great immunity) to other infections may
not hold true for the corona virus since it’s a new virus strain.
The very need for digitalizing the fares to be error free and easy access to the public transport system, is
achieved using RFID for access into the public transport, where the user has to top up the card for using it similar to
a SIM and when entering the transport system it would check for the availability of funds in the card, if available it
would provide access to the service, if not it would indicate the same through a red LED and if the user has to leave
the public transport at desired station, the user has to tap the card at the exit., in this manner it would detect the exact
fare for his/her journey.

There being a large scope once digitalized one of the other application which could be implemented is, when
there are children below the age of 16 who would be using their discount card to travel to and from there school/
college their parents or guardians could subscribe for a service where in which to let them know when and where
their children are. In this manner there is an opportunity to expand and develop using this system.
1.1 Problem Statement And Solutions

In traditional paper based ticketing, everyday tickets are being printed and sealed with the date manually by
the bus conductor travelling in the bus. After finish travelling, the passengers usually throw away the used paper
made tickets here & there which ultimately pollutes the environment. Trees are being cut as to make papers and the
current system uses the paper based ticketing. Our proposed system uses the RFID tagged card carried out by the
passengers and does everything automatically and eventually reduces the complexities faced by the commuters.
Some benefits of RFID based ticketing framework over conventional system (both paper based tickets & magnetic
tickets) .

Public transport system using wifi and RFID is designed for user friendly applications and also LCD is
interfaced in order to display the messages, IR sensor are used to identify whether the passengers is carrying the
card or not. Here the RFID is used for ticketing purpose, Wifi and GPS is used for mobile data transmission and
tracking location.

The design and development of this project is due to its tremendous scope in public transport system. The
aim of this project is to design and develop “RFID and IOT based Public transport system” to make the fares to be
error free. It provides an easy option for seat availability checking for public in a easy way.
1.2 Objectives:

• To design a system using RFID , IOT to travelling in BMTC BUS.


• Deduct the amount from their smart card according to the How much KM they Travel.
• SMS sending to the after completion of the journey.
• Seat availability facility.
• Crowd Management In Buses.

1.3 BLOCK DIAGRAM

Figure 1.1 Block diagram of project


Hardware and the Software Requirements:
Hardware:
 Microcontroller – Arduino
 LCD - 16 x 2
 Rs232 - MAX232
 SCR Relays circuit
 Wifi Modem
 7812/ 7805 voltage regulators for power supply
 Power supply circuit
 RFID

Software:
 Embedded c
 Arduino Suite
1.3 BLOCK DIAGRAM DESCRIPTION
1.3.1 MICRO CONTROLLER

Arduino is an open source computer hardware and software that designs single-board
microcontrollers and microcontroller kits for building digital devices and interactive objects that can sense and
control objects in the physical and digital world. The project's products are distributed as open-source
hardware and software, which are licensed under the GNU Lesser General Public License (LGPL). Arduino boards
are available commercially in preassembled form or by designing the kits with respect to different application.

1.3.2 Wifi
Then we apply this voltage to the power supply circuit. Note that we do this test without microcontroller
because if there is any excessive voltage, this may lead to damaging the controller. We check for the input to the
voltage regulator i.e., are we getting an input of 12v and an output of 5v. This 5v output is given to the
microcontrollers’ 40th pin. Hence we check for the voltage level at 40 th pin. Similarly, we check for the other
terminals for the required voltage. In this way we can assure that the voltage at all the terminals is as per the
requirement.

Fig : ESP 8266 Wifi Communicator

` ESP8266 offers a complete and self-contained Wi-Fi networking solution, allowing it to either host the
application or to offload all Wi-Fi networking functions from another application processor.

When ESP8266 hosts the application, and when it is the only application processor in the device, it is able to boot
up directly from an external flash. It has integrated cache to improve the performance of the system in such
applications, and to minimize the memory requirements.

Alternately, serving as a Wi-Fi adapter, wireless internet access can be added to any microcontroller-based
design with simple connectivity through UART interface or the CPU AHB bridge interface.
ESP8266 on-board processing and storage capabilities allow it to be integrated with the sensors and other
application specific devices through its GPIOs with minimal development up-front and minimal loading during
runtime. With its high degree of on-chip integration, which includes the antenna switch balun, power management
converters, it requires minimal external circuitry, and the entire solution, including front-end module, is designed
to occupy minimal PCB area.

1.3.3 RADIO FREQUENCY IDENTIFICATION


Radio-frequency identification (RFID) is a technology that uses communication via radio waves to exchange
data between a reader and an electronic tag attached to an object, for the purpose of identification and tracking.
Some tags can be read from several meters away and beyond the line of sight of the reader. The application of bulk
reading enables an almost parallel reading of tags. Radio-frequency identification involves interrogators (also
known as readers), and tags (also known as labels).Most RFID tags contain at least two parts. One is an integrated
circuit for storing and processing information, modulating and demodulating a radio-frequency (RF) signal, and
other specialized functions. The other is an antenna for receiving and transmitting the signal.

1.3.4 DISPLAY
An LED lamp is a solid-state lamp that uses light-emitting diodes (LEDs) as the source of light. The term
LED light bulb is also colloquially used. Here in the system the LED is controlled by the microcontroller in order to
indicate whether the passenger has got the access to board the travel or not. These are got to know by the system by
accessing the RFID. If the red LED glows, it indicates access denied or not.

1.3.5 IR Sensor
The purpose of the transmitter is to transform the information we want to send into a signal that can be propagated
by the channel. In the case of our wired copper channel, this means we want the information to be transformed into
a modulated voltage level, something like the pulse train. For a wireless channel, however, the transmitter needs to
encode the information onto an EM wave that can be easily propagated.
CHAPTER 2
LITERATURE SURVEY

[1] The 89v51 microcontroller and embedded systems, from this book we studied the instruction set of c language
89v51. We studied information and programming of interfacing of LCD.

[2] www.PHILLIPS.com from this web site we studied about the microcontroller P89V51 and its pin description
and pin configuration.

[3] LCD Tutorial for interfacing with microcontroller 8051 we studied and studied and collected the information
about interfacing tutorials, LCD tutorial, 8051 assembly language programming.

[4] http://www.NSK Electronics.com, from this we got data sheet of microcontroller (Phillips) module.

[5] www.smallslate.com from this web site we down loaded information regarding the MAX232 and its working.

[6] www.philips.com:From this website we studied about the microcontroller P89V51 and its pin description and
pin configuration. The P89V51 low power and a high performance volatile 8 bit microcomputer with 64K bytes of
flash and 1024 bytes of data RAM. This Is Manufactured Using Philips Corporation volatile Memory technology
and is compatible with both TTL and CMOS logic. It has 40DIP.

[7] LCD interfacing with microcontroller: We studied how the LCD is interfacing with the microcontroller.LCD’s
combine the properties of both liquids and crystals.LCD consist of two glass panels, with the Liquid Crystal
material sand witched in between them. The inner surfaces of the glass plates are coated with transparent electrodes,
which define the character, symbols or patterns to be displayed.

[8] www.smallslate.com:From this website we down loaded information regarding the MAX232 and its working.
Usually all the digital ICs work on TTL or CMOS voltage levels which cannot be used to communicate over RS-
232 protocol. So a voltage or level converter is needed which can convert TTL to RS232 and RS232 to TTL voltage
levels. The most commonly used RS-232 level converter is MAX232.This IC includes charge pump which can
generate RS232 voltage levels (-10Vand +10V)from 5V power supply.
[9] www.nskelectronics.com from this website we got the information of IR sensors.

[10] The P89V51 microcontroller architecture, programming and applications, we studied about architecture and
memory organization of the P89V51 microcontroller.

[11] http://www.Engineers garage.com, from this we got datasheet of microcontroller

[12] www.smallslate.com from this web site we downloaded information regarding the MAX232 and its working

[13] www.datasheet catlog.com we studied about electronic components and working and we downloaded project
regarding paper
[14] www.datasheet.com:we studied about RFID and GSM

[15] http://www.RFID.org/ purpose of radio frequency identification and detection system is to facilitate data
transmission through the portable devices known as tag that is read with the help of RFID reader, and process it as
per the needs of application
CHAPTER 3
HARDWARE DESCRIPTION
Arduino is an open source computer hardware and software that designs single-board
microcontrollers and microcontroller kits for building digital devices and interactive objects that can sense and
control objects in the physical and digital world. The project's products are distributed as open-source
hardware and software, which are licensed under the GNU Lesser General Public License (LGPL). Arduino boards
are available commercially in preassembled form or by designing the kits with respect to different
application.Figure 3.2 and 3.3 shows the Arduino Uno board and pin diagram respectively.
The different types of Arduino Uno are Arduino Nano,Arduino Pro Mini,Arduino Mega, Arduino Due, and
Arduino Leonardo.

Fig :Arduino Uno board

Fig :Arduino Uno board pin diagram


PIN DESCRIPTION
Table 3.1 explains the pin descriptionArduino Uno board.
Table 3.1: The pin descriptionArduino Uno board.
Pin Category Pin Name Details
Vin: Input voltage to Arduino when
using an external power source.
Power Vin, 3.3V, 5V, GND
5V: Regulated power supply used to
power microcontroller and other
components on the board.
3.3V: 3.3V supply generated by on-
board voltage regulator. Maximum
current draw is 50mA.
GND: ground pins.
Reset Reset Resets the microcontroller.
Used to provide analog input in the
Analog Pins A0 – A5
range of 0-5V

Input/output Pins Digital Pins 0 - 13 Can be used as input or output pins.

Used to receive and transmit TTL


Serial 0(Rx), 1(Tx)
serial data.

External Interrupts 2, 3 To trigger an interrupt.

PWM 3, 5, 6, 9, 11 Provides 8-bit PWM output.

10 (SS), 11 (MOSI), 12
SPI Used for SPI communication.
(MISO) and 13 (SCK)

10 (SS), 11 (MOSI), 12
SPI Used for SPI communication.
(MISO) and 13 (SCK)

Inbuilt LED 13 To turn on the inbuilt LED.

TWI A4 (SDA), A5 (SCA) Used for TWI communication.

To provide reference voltage for


AREF AREF
input voltage.

ARDUINO UNO TECHNICAL SPECIFICATION


Table 3.2 explains the Arduino Uno technical specification.
Table 3.2: Arduino Uno technical specification
Microcontroller ATmega328P – 8 bit AVR family microcontroller

Operating Voltage 5V
Recommended Input
7-12V
Voltage

Input Voltage Limits 6-20V

Analog Input Pins 6 (A0 – A5)

Digital I/O Pins 14 (Out of which 6 provide PWM output)

DC Current on I/O Pins 40 mA

DC Current on 3.3V Pin 50 mA

Flash Memory 32 KB (0.5 KB is used for Bootloader)

SRAM 2 KB

EEPROM 1 KB

Frequency (Clock
16 MHz
Speed)

OVERVIEW
Arduino Uno is a microcontroller board based on 8-bit ATmega328P microcontroller. Along with ATmega328P, it
consists other components such as crystal oscillator, serial communication, voltage regulator, etc. to support the
microcontroller. Arduino Uno has 14 digital input/output pins (out of which 6 can be used as PWM outputs), 6
analog input pins, a USB connection, A Power barrel jack, an ICSP header and a reset button.

HOW TO USE AURDINO BOARD


The 14-digital input/output pins can be used as input or output pins by using pin Mode (), digital Read () and digital
Write () functions in Arduino programming. Each pin operates at 5V and can provide or receive a maximum of
40mA current and has an internal pull-up resistor of 20-50 K Ohms which are disconnected by default. Out of these
14 pins, some pins have specific functions as listed below:

1. Serial Pins 0 (Rx) and 1 (Tx): Rx and Tx pins are used to receive and transmit TTL serial data. They are
connected with the corresponding ATmega328P USB to TTL serial chip.
2. External Interrupt Pins 2 and 3: These pins can be configured to trigger an interrupt on a low value, a
rising or falling edge, or a change in value.
3. PWM Pins 3, 5, 6, 9 and 11: These pins provide an 8-bit PWM output by using analog Write () function.
4. SPI Pins 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK): These pins are used for SPI communication.
5. In-built LED Pin 13: This pin is connected with built-in LED.When pin 13 is high, then LED willON and
when 13 pin is low, it represent led is OFF.
There are 14digital pins and 6 analog input pins, each of which provides 10 bits of resolution, i.e. 1024 different
values. They measure from 0 to 5 volts but this limit can be increased by using AREF pin with analog reference ()
function.
Analog pin 4 Serial Data Access(SDA) and pin 5 scratch controlling aurduino(SCA) also used for TWI
communication using wire library.Arduino Uno has a couple of other pins as explained below:

1. AREF: Used to provide reference voltage for analog inputs with analog Reference () function.
2. Reset Pin: Making this pin LOW, resets the microcontroller.

COMMUNICATION
Arduino can be used to communicate with a computer, another Arduino board or other microcontrollers. The
ATmega328P microcontroller provides UART TTL (5V) serial communication which can be done using digital pin
0 (Rx) and digital pin 1 (Tx). An ATmega16U2 on the board channels this serial communication over USB and
appears as a virtual com port to software on the computer. The ATmega16U2 firmware uses the standard USB
COM drivers, and no external driver is needed. However, on Windows, a in file is required.

The Arduino software includes a serial monitor which allows simple textual data to be sent to and from the
Arduino board. There are two RX and TX LEDs on the Arduino board which will flash when data is being
transmitted via the USB-to-serial chip and USB connection to the computer (not for serial communication on pins 0
and 1). A Software Serial library allows for serial communication on any of the Uno's digital pins. The
ATmega328P also supports I2C (TWI) and SPI communication. The Arduino software includes a Wire library to
simplify use of the I2C bus.

ARDUINO UNO TO ATMEGA328 PIN MAPPING


When ATmega328 chip is used in place of Arduino Uno, or vice versa, the image below shows the pin
mapping between the two.

SOFTWARE
Arduino IDE (Integrated Development Environment) is required to program the Arduino Uno board.
ARDUINO PROGRAMMING
Once Arduino IDE is installed on the computer, connect the board with computer using USB cable. Now
open the Arduino IDE and choose the correct board by selecting Tools>Boards>Arduino/Genuine Uno and choose
the correct Port by selecting Tools>Port. Arduino Uno is programmed using Arduino programming language based
on Wiring. To get it started with Arduino Uno board and blink the built-in LED, load the example code by selecting
Files>Examples>Basics>Blink. Once the example code (also shown below) is loaded into the IDE, click on the
‘upload’ button given on the top bar. Once the upload is finished, it should see the Arduino’s built-in LED blinking.
Below is the example code for blinking.

// the setup function runs once it press reset or power the board

void setup () {

// initialize digital pin LED_BUILTIN as an output.

pin Mode (LED_BUILTIN, OUTPUT);

// the loop function runs over and over again forever

void loop () {

digital Write (LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)

delay (1000); // wait for a second

digital Write (LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW

delay(1000); // wait for a second

APPLICATIONS

1. Prototyping of Electronics Products and Systems


2. Multiple DIY Projects.
3. Easy to use for beginner level DIY and makers.
4. Projects requiring Multiple I/O interfaces and communications.

ARDUINO UNO 2D MODEL

Fig :Arduino Uno 2D Model

3.3.1 RFID Reader Description:


RFID Reader Module, are also called as interrogators. They convert radio waves retuned from the RFID tag
into a form that can be passed on to Controllers, which can make use of it. RFID tags and readers have to be tuned
to the same frequency in order to communicate. RFID systems use many different frequencies, but the most
common and widely used and supported by our reader is 125 kHz. RFID readers or receivers are composed of a
radio frequency module, a control unit and an antenna to interrogate electronic tags via radio frequency (RF)
communication.
The reader powers an antenna to generate an RF field. When a tag passes through the field, the information
stored on the chip in the tag is interpreted by reader and send to the server, which, in turn, communicates with the
data base system when the RFID system is interfaced with it.
RFID exit gate sensors (Readers) at exits are basically two types. One type reads the information on the
tag(s) going by and communicates that information to a server.
An RFID reader typically contains a module (transmitter and receiver), a control unit and a coupling element
(antenna). The reader as three main functions: energizing, demodulating and decoding. In addition, readers can be
fitted with an additional interface that converts the radio waves returned from the RFID tag into a form that can then
be passed onto another system, like a computer or any programmable logic controller. Anti-collision algorithms
permit the simultaneous reading of large numbers of tagged objects, while ensuring that each tag is read only once.

3.3.2 RFID MODULE IMPLEMENTATION:


The heart of the system is the RFID tag. This tag is equipped with a programmable chip and an antenna.
Each paper –thin tag contains an engraved antenna and a microchip with a capacity of at least 64bits, which contains
the information about the book like name of the book etc. RFID is a combination of radio-frequency-based
technology and microchip technology.
RF (radio frequency) portion of the electromagnetic spectrum is used to transmit signals. An RFID system
consists of an antenna and a transceiver, which read the radio frequency and transfers the information to a
processing device (reader) and a transponder, or RF tag, which contains the RF circuitry and information to be
transmitted. The antenna provides the means for the integrated circuit to transmit its information to the reader that
converts the radio waves reflected back from the RFID tag into digital information that can then be passed on to
computers that can analyze the data.

RFID tags and readers have to be tuned to the same frequency in order to communicate effectively. RFID
systems typically use one of the following frequency ranges: low frequency (or LF, around125 KHz), high
frequency (or HF, around 13.56 MHz), ultra-high frequency (or UHF, around 868 and 928MHz), or microwave
(around 2.45 and 5.8 GHz).

Radio frequency identification (RFID) in a variety of ways including automatic identification and data
capture (AIDC) solutions. We pride ourselves in providing customers with inexpensive RFID solutions that
integrate well with other systems. The reader has been designed as a plug & plays Module and can be plugged on a
standard 300 MIL-28 Pin IC socket form factor.
Functions:
 Supports reading of 64 bit Manchester encoded cards
 Pins for external antenna connection
 Serial interface(TTL)
 Customer application on request
3.3.3 RFID FEATURES:

Frequency 125 KHz


Reading distance 6cm
Interface UART
Antenna Built in / External
Supply Voltage 5V
Operating Temperature -10°C to +50°C
Tag Types Unique, TK 5530
Output Format ASCII, Wiegand 26

Table 3.1 RFID Features

3.3.4 DATA TRANSMISSION OF RFID


3.3.4.1 Data Transmission in ASCII Standard
Data read from the tag is Manchester encoded. The Manchester encoded data is decoded to ASCII standard.
Decoded data is sent to the UART serial interface for wired communication with the host systems. ASCII data
format is shown below:

RFID TAG

0010468883 159, 48659

Figure 3.5 RFID Tag

3.3.4.2 Data transmission in Wiegand 26 standard


The composition of the open existing industry standard 26- bit Wiegand format contains 8 bits for the
facility code field and 16 bits for the ID number field. Mathematically these 8 facility code bits allow a total of 256
(0 to 255) facility codes, while the 16 ID number bits allow a total of only 65,536 (0 to 65,535) individual ID's
within each facility code. The Data 1 and Data 0 signals are held at logic high level until the reader is ready to send
a data stream. The output comprises of 3 bytes of data. Binary 1 is indicated as low pulse on DATA 1(pin 4) line
and binary zero by low pulse on DATA 0(pin 3) lines. The Data 1 and Data 0 pulses do not overlap or occur
simultaneously

Figure 3.6 Pattern of data bits sent by the reader

Voh -- 90% of maximum output voltage.


Vol -- 10% of maximum output voltage.
Tpw -- Pulse Width Time (between 20 μs and 100 μs)
Tpi -- Pulse Interval time (between 200 μs and 20 ms).
Timing pattern falls within the Wiegand guidelines as prescribed by the SIA's Access Control Standard
Protocol for the 26-bit Wiegand Reader Interface.

3.3.5 THE FOUR CORE COMPONENTS OF AN RFID SYSTEM


An RFID system has four basic components:
 A tag which is composed of a semiconductor chip and an antenna.
 An interrogator (sometimes called a read/write device), which is composed of an antenna, a RF electronics
module, and a control electronics module.
 A controller (sometimes called a host), which most often takes the form of a PC or a workstation running
database and control (often called middleware) software.
 An antenna, which converts electrical power to RF power.
Figure 3.7 RFID Card showing the Microchip and Antenna

3.3.6 RFID TAG


The basic function of an RFID tag is to store data and transmit data to the interrogator. At its most basic, a
tag consists of an electronics chip and an antenna encapsulated in a package to form a usable tag, such as a packing
label that might be attached to a box.

Figure 3.8(a) RFID Tag


Generally, the chip contains memory where data may be stored and read from and sometimes written, too, in
addition to other important circuitry. Some tags also contain batteries, and this is what differentiates active tags
from passive tags. In our project we use passive tag.
Figure 3.8(b) RFID Tag components

3.3.7 TYPES OF TAGS


3.3.7.1 Passive
 Also called ‘pure passive’, ‘reflective’ or ‘beam powered’
 obtains operating power from the reader
 the reader sends electromagnetic waves that induce current in the tag’s antenna, the tag reflects the RF
signal transmitted and adds information by modulating the reflected signal
 Semi-passive
 uses a battery to maintain memory in the tag or power the electronics that enable the tag to modulate the
reflected signal
 communicates in the same method, as the other passive tags

3.3.7.2 Active
 powered by an internal battery, used to run the microchip’s circuitry and to broadcast a signal to the reader
 Generally ensures a longer read range than passive tags
 More expensive than passive tags (especial because usually are read/write)
 The batteries must be replaced periodically
3.3.7.3 Semi-passive tags
 They have their power source, but the battery powers the microchip and does not broadcast the signal.
 The battery-assisted receive circuitry of semi passive tag lead to greater sensitivity than passive tags,
typically 100 times more.
 Semi passive tags have three main advantages
1. Greater sensitivity than passive tags.
2. Better battery life than active tags.
3. Can perform active functions (such as temperature logging) under its own power, even when no
reader is present.

3.4 Liquid Crystal Display

In recent years the LCD is finding widespread use replacing LEDs .This is due to following reasons
1) The declining prices of LCDs
2) The ability to display numbers, characters and graphics. This is in contrast to LEDs, which are limited to
numbers and few characters.
3) Incorporation of a refreshing controller in to LCD, there by relieving the CPU of the task of refreshing the
LCD. In contrast LCD must be refreshed by CPU to keep displaying the data.

Figure 3.9 LCD display

Liquid crystals are substances that exhibit a phase of matter that has properties.
Between those of a conventional liquid, and those of a solid crystal. For instance, a liquid
Crystal (LC) may flow like a liquid, but have the molecules in the liquid arranged and/or
Oriented in a crystal-like way.
Each pixel of an LCD typically consists of a layer of molecules aligned between two transparent electrodes,
and two polarizing filters, the axes of transmission of which are (most of the cases) perpendicular to each other. The
surfaces of the electrodes, which are in contact with the liquid crystal material, are treated so as to align the liquid
crystal molecules in a particular direction. This treatment typically consists of a thin polymer layer that is
unidirectional rubbed using, for example, a cloth. The direction of the liquid crystal alignment is then defined by the
direction of rubbing. Electrodes are made of a transparent conductor called Indium Tin Oxide (ITO).

Figure 3.10 liquid crystal molecule alignment

3.4.1 Connections
A 14 pin access is provided having 8 data lines,3 control lines and 3 power lines. The connections are laid
out in one of two common configurations, either two row of seven pins, or a single row of 14 pins.

Figure3.11 Pin out of the LCD formats.

On most displays, the pins are numbered on the LCD’s PCB, but if not, it is quite easy to locate pin1.Since
this pin is connected to ground; it often has a thicker PCB track
connected to it and it is generally connected to the metal work at some point. The LCD module with all the pin
details is shown in figure 3.11.
Pin 1 and 2 are the power supply lines, Gnd and Vcc.
The Vcc pin should be connected to positive supply and Gnd to 0V supply or ground. Although the LCD
module data sheets specify a 5Vdc supply, Supplies of 6V and 4-5V both work well, and even 3V is sufficient for
some modules.
Pin 3 is a control pin , Vee , which is used to alter the contrast of the display. Ideally, this pin should be
connected to a variable voltage supply.
Pin 4 is the (RS) register select line. When this line is low, data bytes transferred to the display are treated as
commands and data bytes read from the display indicate its status. By setting the RS line high, character data can be
transferred to and from the module.
Pin 5 is read/write line. This line is pulled low in order to write commands or character data to the module,
or pulled high to read character data or status information from its registers.
Pin 6 is the enable line. this input is used to initiate the actual transfer of commands or character data
between the module and the data lines. When writing to the display, data is transferred only on high to low
transition of this signal.
Pin 7 to 14 are data bus lines (D0 to D7).data can be transferred to and from the display either as a single 8 bit
byte or two 4 bit nibbles. The other two pins LED+ and LED- is used for back light of the LCD.
When powered up, the display should show a series of dark squares, possibly on a part of the display. These
character cells are actually in their off state, so the contrast control should be adjusted anti clock wise until the
squares are only just visible.
The display module resets itself to an initial state when power is applied, which curiously the display has
blanked off, so that even if the characters are entered, they cannot be seen. It is therefore necessary to issue a
command at this point, to switch the display on. The display on/off and cursor command turns on the display, but
also determines the cursor style at the same time.

3.4.2 The internal structure of LCD module.


LCD is connected to the microcontroller through the controller interface. LCD has an internal memory
which stores the lookup table for all the characters. Any ASCII value of a character that is passed to the LCD
module is compared with the lookup table in the memory and that value is displayed.
3.4.3 LCD Initialization

This is the pit fall for beginners. Proper working of LCD depend on the how the LCD is initialized. We have
to send few command bytes to initialize the lcd. Simple steps to initialize the LCD

1. Specify function set: Send 38H for 8-bit, double line and 5x7 dot character format.

2. Display On-Off control: Send 0FH for display and blink cursor on.

3. Entry mode set: Send 06H for cursor in increment position and shift is invisible.

4. Clear display: Send 01H to clear display and return cursor to home position

3.4.4 LCD Command Codes

Code(HEX Command to LCD Instruction Register


)
1 Clear display screen
2 Return home
4 Decrement cursor (shift cursor to left)
6 Increment cursor (shift cursor to right)
80 Force cursor to the beginning of first line
C0 Force cursor to the beginning of second line
38 2 lines and 5x7 matrix

Table 3.2 LCD Command codes

3.5 LED’S
LED's are special diodes that emit light when connected in a circuit. They are frequently used as "pilot"
lights in electronic appliances to indicate whether the circuit is closed or not. A clear (or often colored) epoxy case
enclosed the heart of an LED, the semi-conductor chip.

Example: Circuit symbol:

Figure 3.12: LED

3.5.1 FUNCTION:
LEDs emit light when an electric current passes through it. The two wires extending below the LED epoxy
enclosure or the "bulb" indicate how the LED should be connected into a circuit. The negative side of an LED lead
is indicated in two ways: 1) by the flat side of the bulb, and 2) by the shorter of the two wires extending from the
LED. The negative lead should be connected to the negative terminal of a battery. LED's operate at relative low
voltages between about 1 and 4 volts, and draw currents between about 10 and 40 mill amperes. Voltages and
currents substantially above these values can melt a LED chip. The most important part of a light emitting diode
(LED) is the semi-conductor chip located in the center of the bulb as shown at the right. The chip has two regions
separated by a junction. The p region is dominated by positive electric charges, and the n region is dominated by
negative electric charges. The junction acts as a barrier to the flow of electrons between the p and the n regions.
Only when sufficient voltage is applied to the semi-conductor chip, can the current flow, and the electrons cross he
junction into the p region.

3.5.2 Colors of LEDs


LEDs are available in red, orange, amber, yellow, green, blue and white. Blue and white LEDs are much
more expensive than the other colors.
The color of an LED is determined by the semiconductor material, not by the coloring of the 'package' (the
plastic body). LEDs of all colors’ are available in uncolored packages which may be diffused (milky) or clear (often
described as 'water clear'). The
colored packages are also available as diffused (the standard type) or transparent.

3.5.3 Working of LED:


When sufficient voltage is applied to the chip across the leads of the LED, electrons can move easily in only
one direction across the junction between the p and n regions. In the p region there are many more positive than
negative charges. In the n region the electrons are more numerous than the positive electric charges. When a voltage
is applied and the current starts to flow, electrons in the n region have sufficient energy to move across the junction
into the p region. Once in the p region the electrons are immediately attracted to the positive charges due to the
mutual Coulomb forces of attraction between opposite electric charges. When an electron moves sufficiently close
to a positive charge in the p region, the two charges "re-combine".

Each time an electron recombines with a positive charge; electric potential energy is converted into
electromagnetic energy. For each recombination of a negative and a positive charge, a quantum of electromagnetic
energy is emitted in the form of a photon of light with a frequency characteristic of the semi-conductor material
(usually a combination of the chemical elements gallium, arsenic and phosphorus). Only photons in a very narrow
frequency range can be emitted by any material. LED's that emit different colors are made of different semi-
conductor materials, and require different energies to light them.

3.6 Wifi ESP 8266


ESP8266 offers a complete and self-contained Wi-Fi networking solution, allowing it to either host the
application or to offload all Wi-Fi networking functions from another application processor.

When ESP8266 hosts the application, and when it is the only application processor in the device, it is able to
boot up directly from an external flash. It has integrated cache to improve the performance of the system in such
applications, and to minimize the memory requirements.

Alternately, serving as a Wi-Fi adapter, wireless internet access can be added to any microcontroller-based
design with simple connectivity through UART interface or the CPU AHB bridge interface.
ESP8266 on-board processing and storage capabilities allow it to be integrated with the sensors and other
application specific devices through its GPIOs with minimal development up-front and minimal loading during
runtime. With its high degree of on-chip integration, which includes the antenna switch balun, power
management converters, it requires minimal external circuitry, and the entire solution, including front-end
module, is designed to occupy minimal PCB area.

3.9 POWER SUPPLY UNIT


The circuit needs two different voltages, +5V & +12V, to work. These dual voltages are supplied by this
specially designed power supply.
The power supply, unsung hero of every electronic circuit, plays very important role in smooth running of
the connected circuit. The main object of this ‘power supply’ is, as the name itself implies, to deliver the required
amount of stabilized and pure power to the circuit.
The stabilization of DC output is achieved by using the three terminal voltage regulator IC. This regulator IC
comes in two flavors: 78xx for positive voltage output and 79xx for negative voltage output. For example 7812
gives +12V output and 7912 gives -12V stabilized output. These regulator ICs have in-built short-circuit protection
and auto-thermal cutout provisions. If the load current is very high the IC needs ‘heat sink’ to dissipate the
internally generated power.

KIA 78xx
Series

1 2 3

KIA 78xx

Figure 3.20 Voltage Regulator IC


3.9. IR Sensor
The purpose of the transmitter is to transform the information we want to send into a signal that can be propagated
by the channel. In the case of our wired copper channel, this means we want the information to be transformed into
a modulated voltage level, something like the pulse train. For a wireless channel, however, the transmitter needs to
encode the information onto an EM wave that can be easily propagated.

IR TRANSMITTER

The IR transmitter part consists of an Infra red light emitting diode that can capable of sending modulated data
within infra red band. To match the receiver frequency the the data is modulated at 38.7 KHZ by configuring 555
timer at astable mode of operation, which generates frequency using the components R2 and C2 as shown in above
fig. This frequency can be varied over a long range just by varying the preset R1 and C1.

IR RECEIVER
The IR receiver consists of TSOP 1738 module which is a simple yet effective IR proximity sensor built around the

TSOP 1738 module. The TSOP module is commonly found at the receiving end of an IR remote control system;

e.g., in TVs, CD players etc. These modules require the incoming data to be modulated at a particular frequency and

would ignore any other IR signals. It is also immune to ambient IR light, so one can easily use these sensors

outdoors or under heavily lit conditions.

Such modules are available for different carrier frequencies from 32 kHz to 42kHz.

In this particular proximity sensor, we will be generating a constant stream of square wave signal using IC555

centered at 38 kHz and would use it to drive an IR led. So whenever this signal bounces off the obstacles, the

receiver would detect it and change its output. Since the TSOP 1738 module works in the active-low configuration,

its output would normally remain high and would go low when it detects the signal (the obstacle).

Basically an ir sensor is used for detecting an obstacle, there are some areas where valuable things are placed, an IR

transmitter and receiver is placed there, an infrared path is established and if any person comes into that path the

buzzer gets on which gives out a long beep Similarly a fire sensor is used to detect fire

The sensed data is given to the microcontroller, processing is done according to the logic in the microcontroller and

then writes onto GSM which will further send sms to the mobile at the user
A buzzer is interfaced to microcontroller to give out a beep sound whenever an obstacle and fire is detected.

3.9.1 VOLTAGE REGULATOR LM7805


The LM78XX series of three terminal positive regulators are available in the TO-220/D-PAK package and
with several fixed output voltages, making them useful in a wide range of applications. Each type employs internal
current limiting, thermal shut down and safe operating area protection, making it essentially indestructible. If
adequate heat sinking is provided, they can deliver over 1A output current. Although designed primarily as fixed
voltage regulators, these devices can be used with external components to obtain adjustable voltages and currents.

Figure 3.21 Internal Block Diagram of LM 7805

Pin out of LM 7805 (TO – 220 PACKAGE)


1. INPUT

2. GROUND

3. OUTPUT

Figure 3.22 pin out of LM 7805

3.9.2 Electrical Characteristics of LM 7805

Table 3.4 Characteristics of LM 7805


3.10 MULTIPLEXER (IC74153)

Figure 3.23 Multiplexer

In electronics, a multiplexer (or MUX) is a device that selects one of several analog or digital input signals
and forwards the selected input into a single line. A multiplexer of 2 n inputs has n select lines, which are used to
select which input line to send to the output. Multiplexers are mainly used to increase the amount of data that can
be sent over the network within a certain amount of time and bandwidth. A multiplexer is also called a data selector.
They are used in CCTV, and almost every business that has CCTV fitted, will own one of these.

An electronic multiplexer makes it possible for several signals to share one device or resource, for example
one A/D converter or one communication line, instead of having one device per input signal.

3.11 IR SENSOR
3.11.1 IR TRANSMITTER AND RECEIVER
The Wireless Control System can be implemented using one of the following methods: Radio Frequency
[RF]; Ultrasonic Sound Waves; or Infra Red Light Rays. From all these, the last one, Infra Red Light rays are
widely used for wireless controlling.
INFRARED remote control switch is a modern, simple electronic remote controlling system, which can be
used to control the required electronic or electrical device in any industry or home. For the purpose of switching ON
or OFF of any electronic or electrical system, it uses a novel type of IR light beam.

The Light Emitting Diodes [LEDs] used in this Wireless Control System produces a special infra red light
beams. Infra red beams are a special form of light which has a wave length slightly greater than the wave length of
the visible light [whose wavelength is 7 x 10 -7]. This makes the transmitted signal invisible to the naked human eye,
but an infra red photo-diode or photo-transistor can sense this signal.

3.11.2 IR TRANSMITTER
The information is passed from the IR Transmitter and Receiver in the form of combinational digital pulse
signals. These pulses are transmitted to the receiver by modulating a carrier frequency using Pulse Code Modulation
[PCM] method. That means it uses pulse-duration (pulse-width) modulation.

Figure 3.24 IR Transmitter


3.11.3 CIRCUIT DESCRIPTION
The design trade-offs for the application include cost, size, battery life, and transmission distance. The
schematic for the MSP430 TV IR remote control is shown in fig above. The design uses a low cost CR2032 3V
Lithium coin cell battery. Because the application requires short bursts of relatively high current and a Lithium coin
cell battery cannot source high levels of current, capacitor C1 is used to source the IR LED. This capacitor is
charged through resistor R3 and discharged through resistor R2 when the LED is turned on. The choice of values for
C1, R2 and R3 is very important. R2 determines how much current will be drawn through the LED, which
determines the range of the remote control. R3 determines how fast capacitor C1is charged. The value must be small
enough to charge capacitor C1 in a reasonable amount of time, but large enough to not overstress the battery.
Depending on the values of R2 and R3, the capacitor must be large enough to retain most of its charge through a
complete data packet.
In this remote control demo application, the MSP430F2xx family eliminates the need for many external
components. Because the internal DCO is stable on its own, there is no need for an external crystal. Also, the
MSP430F2xx family devices have software-selectable internal pull-up and pull-down port pin resistors, saving
board space and cost. The CPU is active for less than 1,500 clock cycles each transmission.

3.11.4 IR RECEIVER
The ‘packets’ of Radio Frequency signals transmitted from the IR ID Transmitter of the moving vehicle is
received by this unit. The chip used to receive the transmitted signals and decodes it gives the output in 4-bit format.

The ‘packets’ of infra-red light transmitted in this way are received on a diode or transistor which is
sensitive to infra-red light. Next, the signal is converted back into electrical pulses by a 36 KHz receiver and an
associated detector. The pulses are applied to a decoder which is capable of recognizing the transmitted code.
Depending on the received (and recognized) code, one of the functions of the load is switched. [14]
Figure 3.25 IR Receiver
CHAPTER 4
SOFTWARE DESCRIPTION

4.1 Arduino IDE


Arduino is a prototype platform (open-source) based on an easy-to-use hardware and software. It consists of a
circuit board, which can be programed (referred to as a microcontroller) and a ready-made software called Arduino
IDE (Integrated Development Environment), which is used to write and upload the computer code to the physical
board.

Arduino provides a standard form factor that breaks the functions of the micro-controller into a more accessible
package.

A program for Arduino may be written in any programming language for a compiler that produces binary machine code for the
target processor. Atmel provides a development environment for their microcontrollers, AVR Studio and the newer Atmel Studio.

The Arduino project provides the Arduino integrated development environment (IDE), which is a cross-platform application written
in the programming language Java. It originated from the IDE for the languages Processing and Wiring. It includes a code editor
with features such as text cutting and pasting, searching and replacing text, automatic indenting, bracematching, and syntax
highlighting, and provides simple one-click mechanisms to compile and upload programs to an Arduino board. It also contains a
message area, a text console, a toolbar with buttons for common functions and a hierarchy of operationmenus.

A program written with the IDE for Arduino is called a sketch. Sketches are saved on the development computer as text files with
the file extension .ino. Arduino Software (IDE) pre-1.0 saved sketches with the extension .pde.

The Arduino IDE supports the languages C and C++ using special rules of code structuring. The Arduino IDE supplies a software
library from the Wiring project, which provides many common input and output procedures. User-written code only requires two
basic functions, for starting the sketch and the main program loop, that are compiled and linked with a program stub main() into an
executable cyclic executive program with the GNU toolchain, also included with the IDEdistribution.
A minimal Arduino C/C++ sketch, as seen by the Arduino IDE programmer, consist of only two functions:

 setup(): This function is called once when a sketch starts after power-up or reset. It is used to initialize
variables, input and output pin modes, and other libraries needed in the sketch.
 loop(): After setup() has been called, function loop() is executed repeatedly in the main program. It
controls the board until the board is powered off or isreset.

Arduino - Installation
After learning about the main parts of the Arduino UNO board, we are ready to learn how to set up the Arduino
IDE. Once we learn this, we will be ready to upload our program on the Arduino board.

In this section, we will learn in easy steps, how to set up the Arduino IDE on our computer and prepare the board
to receive the program via USB cable.

Step 1 − First you must have your Arduino board (you can choose your favorite board) and a USB cable. In case
you use Arduino UNO, Arduino Duemilanove, Nano, Arduino Mega 2560, or Diecimila, you will need a standard
USB cable (A plug to B plug), the kind you would connect to a USB printer as shown in the following image.

In case you use Arduino Nano, you will need an A to Mini-B cable instead as shown in the following image.
Step 2 − Download Arduino IDE Software.

You can get different versions of Arduino IDE from the Download page on the Arduino Official website. You
must select your software, which is compatible with your operating system (Windows, IOS, or Linux). After your
file download is complete, unzip the file.

Step 3 − Power up your board.

The Arduino Uno, Mega, Duemilanove and Arduino Nano automatically draw power from either, the USB
connection to the computer or an external power supply. If you are using an Arduino Diecimila, you have to make
sure that the board is configured to draw power from the USB connection. The power source is selected with a
jumper, a small piece of plastic that fits onto two of the three pins between the USB and power jacks. Check that it
is on the two pins closest to the USB port.
Connect the Arduino board to your computer using the USB cable. The green power LED (labeled PWR) should
glow.

Step 4 − Launch Arduino IDE.

After your Arduino IDE software is downloaded, you need to unzip the folder. Inside the folder, you can find the
application icon with an infinity label (application.exe). Double-click the icon to start the IDE.

Step 5 − Open your first project.

Once the software starts, you have two options −

 Create a new project.

 Open an existing project example.

To create a new project, select File → New.


To open an existing project example, select File → Example → Basics → Blink.
Here, we are selecting just one of the examples with the name Blink. It turns the LED on and off with some time
delay. You can select any other example from the list.

Step 6 − Select your Arduino board.

To avoid any error while uploading your program to the board, you must select the correct Arduino board name,
which matches with the board connected to your computer.

Go to Tools → Board and select your board.

Here, we have selected Arduino Uno board according to our tutorial, but you must select the name matching the
board that you are using.
Step 7 − Select your serial port.

Select the serial device of the Arduino board. Go to Tools → Serial Port menu. This is likely to be COM3 or
higher (COM1 and COM2 are usually reserved for hardware serial ports). To find out, you can disconnect your
Arduino board and re-open the menu, the entry that disappears should be of the Arduino board. Reconnect the
board and select that serial port.

Step 8 − Upload the program to your board.

Before explaining how we can upload our program to the board, we must demonstrate the function of each symbol
appearing in the Arduino IDE toolbar.
A − Used to check if there is any compilation error.

B − Used to upload a program to the Arduino board.

C − Shortcut used to create a new sketch.

D − Used to directly open one of the example sketch.

E − Used to save your sketch.

F − Serial monitor used to receive serial data from the board and send the serial data to the board.

Now, simply click the "Upload" button in the environment. Wait a few seconds; you will see the RX and TX LEDs
on the board, flashing. If the upload is successful, the message "Done uploading" will appear in the status bar.

Note − If you have an Arduino Mini, NG, or other board, you need to press the reset button physically on the
board, immediately before clicking the upload button on the Arduino Software.

Embedded C:

Embedded C is one of the most popular and most commonly used Programming Languages in the development of
Embedded Systems.

Embedded C is perhaps the most popular languages among Embedded Programmers for programming Embedded
Systems. There are many popular programming languages like Assembly, BASIC, C++ etc. that are often used for
developing Embedded Systems but Embedded C remains popular due to its efficiency, less development time and
portability.
What is an Embedded System?

An Embedded System can be best described as a system which has both the hardware and software and is designed
to do a specific task. A good example for an Embedded System, which many households have, is a Washing
Machine.

Embedded Systems can not only be stand-alone devices like Washing Machines but also be a part of a much larger
system. An example for this is a Car. A modern day Car has several individual embedded systems that perform their
specific tasks with the aim of making a smooth and safe journey.

Some of the embedded systems in a Car are Anti-lock Braking System (ABS), Temperature Monitoring System,
Automatic Climate Control, Tyre Pressure Monitoring System, Engine Oil Level Monitor, etc.

Programming Embedded Systems

As mentioned earlier, Embedded Systems consists of both Hardware and Software. If we consider a simple
Embedded System, the main Hardware Module is the Processor. The Processor is the heart of the Embedded System
and it can be anything like a Microprocessor, Microcontroller, DSP, CPLD (Complex Programmable Logic Device)
and FPGA (Field Programmable Gated Array).

All these devices have one thing in common: they are programmable i.e. we can write a program (which is the
software part of the Embedded System) to define how the device actually works.

Embedded Software or Program allow Hardware to monitor external events (Inputs) and control external devices
(Outputs) accordingly. During this process, the program for an Embedded System may have to directly manipulate
the internal architecture of the Embedded Hardware (usually the processor) such as Timers, Serial Communications
Interface, Interrupt Handling, and I/O Ports etc.

From the above statement, it is clear that the Software part of an Embedded System is equally important to the
Hardware part. There is no point in having advanced Hardware Components with poorly written programs
(Software).
There are many programming languages that are used for Embedded Systems like Assembly (low-level
Programming Language), C, C++, JAVA (high-level programming languages), Visual Basic, JAVA Script
(Application level Programming Languages), etc.

In the process of making a better embedded system, the programming of the system plays a vital role and hence, the
selection of the Programming Language is very important.

Factors for Selecting the Programming Language

The following are few factors that are to be considered while selecting the Programming Language for the
development of Embedded Systems.

 Size: The memory that the program occupies is very important as Embedded Processors like Microcontrollers
have a very limited amount of ROM.
 Speed: The programs must be very fast i.e. they must run as fast as possible. The hardware should not be
slowed down due to a slow running software.
 Portability: The same program can be compiled for different processors.
 Ease of Implementation
 Ease of Maintenance
 Readability

Earlier Embedded Systems were developed mainly using Assembly Language. Even though Assembly Language is
closest to the actual machine code instructions, the lack of portability and high amount of resources spent on
developing the code, made the Assembly Language difficult to work with.

There are other high-level programming languages that offered the above mentioned features but none were close to
C Programming Language.

Introduction to Embedded C Programming Language

Before going in to the details of Embedded C Programming Language and basics of Embedded C Program, we will
first talk about the C Programming Language.
The C Programming Language, developed by Dennis Ritchie in the late 60’s and early 70’s, is the most popular and
widely used programming language. The C Programming Language provided low level memory access using an
uncomplicated compiler (a software that converts programs to machine code) and achieved efficient mapping to
machine instructions.

The C Programming Language became so popular that it is used in a wide range of applications ranging from
Embedded Systems to Super Computers.

Embedded C Programming Language, which is widely used in the development of Embedded Systems, is an
extension of C Program Language. The Embedded C Programming Language uses the same syntax and semantics
of the C Programming Language like main function, declaration of datatypes, defining variables, loops, functions,
statements, etc.

The extension in Embedded C from standard C Programming Language include I/O Hardware Addressing, fixed
point arithmetic operations, accessing address spaces, etc.

Difference between C and Embedded C

There is actually not much difference between C and Embedded C apart from few extensions and the operating
environment. Both C and Embedded C are ISO Standards that have almost same syntax, datatypes, functions, etc.

Embedded C is basically an extension to the Standard C Programming Language with additional features like
Addressing I/O, multiple memory addressing and fixed-point arithmetic, etc.

C Programming Language is generally used for developing desktop applications whereas Embedded C is used in the
development of Microcontroller based applications.

Basics of Embedded C Program

Now that we have seen a little bit about Embedded Systems and Programming Languages, we will dive in to the
basics of Embedded C Program. We will start with two of the basic features of the Embedded C Program:
Keywords and Datatypes.
Keywords in Embedded C

A Keyword is a special word with a special meaning to the compiler (a C Compiler for example, is a software that is
used to convert program written in C to Machine Code). For example, if we take the Keil’s Cx51 Compiler (a
popular C Compiler for 8051 based Microcontrollers) the following are some of the keywords:

 bit
 sbit
 sfr
 small
 large

These are few of the many keywords associated with the Cx51 C Compiler along with the standard C Keywords.

Data Types in Embedded C

Data Types in C Programming Language (or any programming language for that matter) help us declaring variables
in the program. There are many data types in C Programming Language like signed int, unsigned int, signed char,
unsigned char, float, double, etc. In addition to these there few more data types in Embedded C.

The following are the extra data types in Embedded C associated with the Keil’s Cx51 Compiler.

 bit
 sbit
 sfr
 sfr16

The following table shows some of the data types in Cx51 Compiler along with their ranges.

Data Type Bits (Bytes) Range


bit 1 0 or 1 (bit addressable part of RAM)
signed int 16 (2) -32768 to +32767
unsigned int 16 (2) 0 to 65535
signed char 8 (1) -128 to +127
unsigned 8 (1) 0 to 255
float 32 (4) ±1.175494E-38 to ±3.402823E+38
double 32 (4) ±1.175494E-38 to ±3.402823E+38
sbit 1 0 or 1 (bit addressable part of RAM)
sfr 8 (1) RAM Addresses (80h to FFh)
sfr16 16 (2) 0 to 65535

Basic Structure of an Embedded C Program (Template for Embedded C Program)

The next thing to understand in the Basics of Embedded C Program is the basic structure or Template of Embedded
C Program. This will help us in understanding how an Embedded C Program is written.

The following part shows the basic structure of an Embedded C Program.

 Multiline Comments . . . . . Denoted using /*……*/

 Single Line Comments . . . . . Denoted using //

 Preprocessor Directives . . . . . #include<…> or #define

 Global Variables . . . . . Accessible anywhere in the program

 Function Declarations . . . . . Declaring Function

 Main Function . . . . . Main Function, execution begins here


{
Local Variables . . . . . Variables confined to main function
Function Calls . . . . . Calling other Functions
Infinite Loop . . . . . Like while(1) or for(;;)
Statements . . . . .
….
….
}
 Function Definitions . . . . . Defining the Functions
{
Local Variables . . . . . Local Variables confined to this Function
Statements . . . . .
….
….
}

Different Components of an Embedded C Program

Comments: Comments are readable text that are written to help us (the reader) understand the code easily. They are
ignored by the compiler and do not take up any memory in the final code (after compilation).

There are two ways you can write comments: one is the single line comments denoted by // and the other is
multiline comments denoted by /*….*/.

Preprocessor Directive: A Preprocessor Directive in Embedded C is an indication to the compiler that it must look
in to this file for symbols that are not defined in the program.

In C Programming Language (also in Embedded C), Preprocessor Directives are usually represented using
#include… or #define….

In Embedded C Programming, we usually use the preprocessor directive to indicate a header file specific to the
microcontroller, which contains all the SFRs and the bits in those SFRs.

In case of 8051, Keil Compiler has the file “reg51.h”, which must be written at the beginning of every Embedded C
Program.

Global Variables: Global Variables, as the name suggests, are Global to the program i.e. they can be accessed
anywhere in the program.

Local Variables: Local Variables, in contrast to Global Variables, are confined to their respective function.
Main Function: Every C or Embedded C Program has one main function, from where the execution of the program
begins.

 When designing software for a smaller embedded system with the 8051, it is very common place to develop
the entire product using assembly code. With many projects, this is a feasible approach since the amount of
code that must be generated is typically less than 8 kilobytes and is relatively simple in nature. If a hardware
engineer is tasked with designing both the hardware and the software, he or she will frequently be tempted to
write the software in assembly language.
 The trouble with projects done with assembly code can is that they can be difficult to read and maintain,
especially if they are not well commented. Additionally, the amount of code reusable from a typical
assembly language project is usually very low. Use of a higher-level language like C can directly address
these issues. A program written in C is easier to read than an assembly program.
 Since a C program possesses greater structure, it is easier to understand and maintain. Because of its
modularity, a C program can better lend itself to reuse of code from project to project. The division of code
into functions will force better structure of the software and lead to functions that can be taken from one
project and used in another, thus reducing overall development time. A high order language such as C allows
a developer to write code, which resembles a human’s thought process more closely than does the equivalent
assembly code. [25]The developer can focus more time on designing the algorithms of the system rather
than having to concentrate on their individual implementation. This will greatly reduce development time
and lower debugging time since the code is more understandable.
 By using a language like C, the programmer does not have to be intimately familiar with the architecture of
the processor. This means that someone new to a given processor can get a project up and running quicker,
since the internals and organization of the target processor do not have to be learned. Additionally, code
developed in C will be more portable to other systems than code developed in assembly. Many target
processors have C compilers available, which support ANSI C.
 All of this is not to say that assembly language does not have its place. In fact, many embedded systems
(particularly real time systems) have a combination of C and assembly code. For time critical operations,
assembly code is frequently the only way to go. One of the great things about the C language is that it allows
you to perform low-level manipulations of the hardware if need be, yet provides you the functionality and
abstraction of a higher order language.
4.3 Embedded C

When designing software for a smaller embedded system with the 8051, it is very common place to develop
the entire product using assembly code. With many projects, this is a feasible approach since the amount of code
that must be generated is typically less than 8 kilobytes and is relatively simple in nature. If a hardware engineer is
tasked with designing both the hardware and the software, he or she will frequently be tempted to write the software
in assembly language.

The trouble with projects done with assembly code can is that they can be difficult to read and maintain,
especially if they are not well commented. Additionally, the amount of code reusable from a typical assembly
language project is usually very low. Use of a higher-level language like C can directly address these issues. A
program written in C is easier to read than an assembly program.

Since a C program possesses greater structure, it is easier to understand and maintain. Because of its
modularity, a C program can better lend itself to reuse of code from project to project. The division of code into
functions will force better structure of the software and lead to functions that can be taken from one project and used
in another, thus reducing overall development time. A high order language such as C allows a developer to write
code, which resembles a human’s thought process more closely than does the equivalent assembly code. The
developer can focus more time on designing the algorithms of the system rather than having to concentrate on their
individual implementation. This will greatly reduce development time and lower debugging time since the code is
more understandable.

By using a language like C, the programmer does not have to be intimately familiar with the architecture of
the processor. This means that someone new to a given processor can get a project up and running quicker, since the
internals and organization of the target processor do not have to be learned. Additionally, code developed in C will
be more portable to other systems than code developed in assembly. Many target processors have C compilers
available, which support ANSI C.

All of this is not to say that assembly language does not have its place. In fact, many embedded systems
(particularly real time systems) have a combination of C and assembly code. For time critical operations, assembly
code is frequently the only way to go. One of the great things about the C language is that it allows you to perform
low-level manipulations of the hardware if need be, yet provides you the functionality and abstraction of a higher
order language.
System Design:
System design is the process of the defining the architecture, components, modules, interfaces, and data for a system
to satisfy specified requirements .Systems design could be seen as the application of systems theory to product
development. Object- oriented analysis and methods are becoming the most widely used methods for computer
systems design. Systems design is therefore the process of defining and developing systems to satisfy specified
requirements of the user. The UML has become the standard language in object oriented analysis and design.

5.1. ARCHITECTURAL DESIGN

System architecture is a conceptual model that defines the structure and behavior of the system. It comprises of the
system components and the relationship describing how they work together to implement the overall system.

Data Flow diagram:


A dataflow diagram is a graphical representation of the "flow" of data through an information system, modeling its
process aspects. A DFD is often used as a preliminary step to create an overview of the system without going into
great detail, which can later be elaborated. DFDs can also be used for the visualization of data processing. A DFD
shows what kind of information will be input to and output from the system, how the data will advance through the
system, and where the data will be stored.

Sequence Diagram:
A sequence diagram shows object interactions arranged in time sequence. It depicts the objects and classes involved
in the scenario and the sequence of messages exchanged between the objects needed to carry out the functionality of
the scenario. Sequence diagrams are typically associated with use case realizations in the Logical View of the
system under development.

Sequence diagrams are sometimes called event diagrams or event scenarios. A sequence diagram shows, as parallel
vertical lines (lifelines), different processes or objects that live simultaneously, and, as horizontal arrows, the
messages exchanged between them, in the order in which they occur. This allows the specification of simple
runtime scenarios in a graphical manner.

Use case Diagram:


A use case diagram at its simplest is a representation of a user's interaction with the system that shows the
relationship between the user and the different use cases in which the user is involved. A use case diagram can
identify the different types of users of a system and the different use cases and will often be accompanied by other
types of diagrams as well. While a use case itself might drill into a lot of detail about every possibility, a use case
diagram can help provide a higher-level view of the system. It has been said before that "Use case diagrams are the
blueprints for your system". They provide the simplified and graphical representation of what the system must
actually do.
Class Diagram:
The class diagram is the main building block of object-oriented modeling. It is used for general conceptual
modeling of the structure of the application, and for detailed modeling translating the models into programming
code. Class diagrams can also be used for data modeling.
Input / Output Design

C Wifi Unit
RF ID Unit O
N
T
R
O
L
IRSensors
U
N
I
T
Power Supply

Chapter 6
Testing

Testing is the process of evaluating a system or its component(s) with the intent to find whether it satisfies the
specified requirements or not. Testing is executing a system in order to identify any gaps, errors, or missing
requirements in contrary to the actual requirements.

Testing Principle

Before applying methods to design effective test cases, a software engineer must understand the basic principle
that guides software testing. All the tests should be traceable to customer requirements.

Testing Methods

There are different methods that can be used for software testing. They are,

1. Black-Box Testing

The technique of testing without having any knowledge of the interior workings of the application is
called black-box testing. The tester is oblivious to the system architecture and does not have access to
the source code. Typically, while performing a black-box test, a tester will interact with the system's user
interface by providing inputs and examining outputs without knowing how and where the inputs are
worked upon.

2. White-Box Testing

White-box testing is the detailed investigation of internal logic and structure of the code. White-box
testing is also called glass testing or open-box testing. In order to perform white-box testing on an
application, a tester needs to know the internal workings of the code. The tester needs to have a look
inside the source code and find out which unit/chunk of the code is behaving inappropriately.
Levels of Testing

There are different levels during the process of testing. Levels of testing include different methodologies that
can be used while conducting software testing. The main levels of software testing are:

 Functional Testing:

This is a type of black-box testing that is based on the specifications of the software that is to be tested.
The application is tested by providing input and then the results are examined that need to conform to
the functionality it was intended for. Functional testing of software is conducted on a complete,
integrated system to evaluate the system's compliance with its specified requirements. There are five
steps that are involved while testing an application for functionality.

 The determination of the functionality that the intended application is meant to perform.

 The creation of test data based on the specifications of the application.

 The output based on the test data and the specifications of the application.

 The writing of test scenarios and the execution of test cases.

 The comparison of actual and expected results based on the executed test cases.

 Non-functional Testing

This section is based upon testing an application from its non-functional attributes. Non-functional
testing involves testing software from the requirements which are non-functional in nature but important
such as performance, security, user interface, etc. Testing can be done in different levels of SDLC. Few
of them are

Unit Testing

Unit testing is a software development process in which the smallest testable parts of an application, called
units, are individually and independently scrutinized for proper operation. Unit testing is often automated but it
can also be done manually. The goal of unit testing is to isolate each part of the program and show that
individual parts are correct in terms of requirements and functionality. Test cases and results are shown in the
Tables.
Unit Testing Benefits

 Unit testing increases confidence in changing/ maintaining code.


 Codes are more reusable.
 Development is faster.
 The cost of fixing a defect detected during unit testing is lesser in comparison to that of defects detected
at higher levels.
 Debugging is easy.
 Codes are more reliable.

Sl # Test Case : - UTC-1

Name of Test: - LCD Testing


Items being tested: - LCD
Sample Input: - Power supply
Expected output: - LCD should display “Smart Ticketing” message.

Actual output: - LCD displays “Smart Ticketing”.

Remarks: - Pass

Table 6.3.1.1: Unit test case for LCD

Sl # Test Case : - UTC-2

Name of Test: - Scanning of RFID


Items being tested: - RFID reader and tag
Sample Input: - Scan the card
Expected output: - RFID reader should only accept registered tag.

Actual output: - RFID accepts registered tags.

Remarks: - Pass

Table 6.3.1.2: Unit test case for RFID


Sl # Test Case : - UTC-3

Name of Test: - Wifi Module message testing


Items being tested: - Wifi Module
Sample Input: - Power supply, scanning the card
Expected output: - Message should be sent to particular number given in the program

Actual output: - Message sent to the registered number

Remarks: - Pass

Table 6.3.1.3: Unit test case for Wifi


Integration Testing

Integration testing is a level of software testing where individual units are combined and tested as a group. The
purpose of this level of testing is to expose faults in the interaction between integrated units. Test drivers and
test stubs are used to assist in Integration Testing. Integration testing is defined as the testing of combined parts
of an application to determine if they function correctly. It occurs after unit testing and before validation testing.
Integration testing can be done in two ways: Bottom-up integration testing and Top-down integration testing.

1. Bottom-up Integration

This testing begins with unit testing, followed by tests of progressively higher-level combinations of
units called modules or builds.

2. Top-down Integration
In this testing, the highest-level modules are tested first and progressively, lower-level modules are
tested thereafter.

In a comprehensive software development environment, bottom-up testing is usually done first, followed
by top-down testing. The process concludes with multiple tests of the complete application, preferably in
scenarios designed to mimic actual situations. Table 8.3.2 shows the test cases for integration testing and their
results.
Sl # Test Case : - ITC-1

Name of Test: - Working of Arduino and LCD


Items being tested: - RFID card and LCD display
Sample Input: - Scan the card

Expected output: - LCD should display User details.

Actual output: - LCD displays user’s Details and Balance .

Remarks: - Pass

Table 6.3.2.1: Integration test case for RFID card and LCD display

Sl # Test Case : - ITC-2

Name of Test: - Arduino, RFID and IR testing


Items being tested: - RFID
Sample Input: - Scan the card Two times at entry and exit

Expected output: - User’s input should be accepted and displayed on the screen

Actual output: - User’s input displayed

Remarks: - Pass

Table 6.3.2.2: Integration test case for RFID and GPS


System Integration of NFC Ticketing into an Existing Public Transport Infrastructure

System Testing

System testing of software or hardware is testing conducted on a complete, integrated


system to evaluate the system's compliance with its specified requirements. System
testing falls within the scope of black-box testing, and as such, should require no
knowledge of the inner design of the code or logic. System testing is important because
of the following reasons:

 System testing is the first step in the Software Development Life Cycle, where
the application is tested as a whole.

 The application is tested thoroughly to verify that it meets the functional and
technical specifications.

 The application is tested in an environment that is very close to the production


environment where the application will be deployed.

 System testing enables us to test, verify, and validate both the business
requirements as well as the application architecture.

System Testing is shown in below tables

Sl # Test Case : - STC-1

Name of Test: - Synchronization Testing


Items being tested: - RFID, Arduino and Wifi
Sample Input: - Input taken from RFID and IR sensor
Expected output: - Device should scan, Calculate and intimate using Wifi

Actual output: - All functions work properly

Remarks: - Pass

Table 6.3.3: System test case for RFID, Dispenser, GPS, and Wifi

67
System Integration of NFC Ticketing into an Existing Public Transport Infrastructure

CHAPTER 7

APPLICATION, ADVANTAGES AND DISADVANTAGES

7.1 APPLICATIONS

 Cabs – For security of passengers


 School Buses – For children’s safety and Parents’ Concern
 Cargo Tracking – For better control over cargo and distribution management
 Public Transport System

7.2 ADVANTAGES

 Cashless ticketing.
 Stop cheating from conductors.
 Reduces man power.
 Passengers can know there amount which is deducted during his/her journey.
 Avoids Spread of Virus

7.3 DISADVANTAGES

 GPS and GSM modules are very sensitive.


 Network problem.

68
System Integration of NFC Ticketing into an Existing Public Transport Infrastructure

CONCLUSION

The system is expected to be fully automated reliable, transparent, convenient and


very effective in transport facilities. It has been implemented in many of the developed
countries. Since we are one of the emerging countries, we do can make the transport
system in an efficient manner. Using automatic ticket systems enables operators such as
transportation authorities to save time and personal costs; fare collection can be organized
much more efficiently. These systems low maintenance costs and reduced fraud-induced
losses.
The whole system can also be used in railway ticketing system. The card being
reusable, they are much more convenient compare to the paper based ticketing.

REFERENCES
[1] Maria Grazia GNONI, Alessandra ROLLO, Piergiuseppe TUNDO, "A smart model
for urban ticketing based on RFID applications," P-0572, 2009 IEEE International.
[2] Hasan, Tangim.Islam,M. “RFID-based ticketing for Public Transport system”: IEEE
Publication, Vol: 6, Pg: 459-462
[3] Global positioning system: signals, and performance by Pratap Misra, 2nd edition.
[4] DALY.P, Navstar GPS and GLONASS: global satellite navigation systems,
electronics and communication Engg. July 2005.
[5] Garfinkal,S and b.ROSENBERG, RFID: Application, Security & Privacy, Addition
Wesley Professional, Upper Saddle Rider, Edition 2005
[6] Hodges,S and D. Mc Farlance, RFID: Technology, Application & Impact ,2005
[7] Global Positioning System: Principles and Application by Satheesh Gopi, Tata
McGraw-Hill Education,2005
[8] Vijay K Garg ,” Principles and Applications of GSM”,1998, Mc Graw Hills
Publication.
[9] Muhammad Ali Mazidi,Rolin D.McKinlay,Danny Causey, ‘P89V51 Microcontroller
and Embedded Systems Using Assembly and C for P89V51’,Pearson Education.2008

69
System Integration of NFC Ticketing into an Existing Public Transport Infrastructure

[10] Bo Yan, Danyu Lee; "Ticketing System Based on RFID", pp.496 -499, 2009
International Conference on Networks Security, Wireless Communications and
Trusted Computing.

70

You might also like