Sei sulla pagina 1di 65

TRAIN CROWD MANAGEMENT

SYSTEM
A Project Report

Submitted in partial fulfilment of the requirements


for the award of the Degree of
BACHELOR OF SCIENCE (INFORMATION TECHNOLOGY)
By

JIGNESH CHAUHAN
Seat Number: ______________
Under the esteemed guidance of

Mrs. LEENA JADHAV


Assistant Professor, Department of Information Technology

DEPARTMENT OF INFORMATION TECHNOLOGY

VIDYALANKAR SCHOOL OF INFORMATION TECHNOLOGY


(Affiliated to University of Mumbai)
MUMBAI, 400 037
MAHARASHTRA
2018 - 2019
VIDYALANKAR SCHOOL OF INFORMATION TECHNOLOGY
(Affiliated to University of Mumbai)
MUMBAI-MAHARASHTRA-400037
DEPARTMENT OF INFORMATION TECHNOLOGY

CERTIFICATE
This is to certify that the project entitled, "Train Crowd Management System ", is bonafide
work of JIGNESH CHAUHAN bearing Seat No: ________________ submitted in partial
fulfilment of the requirements for the award of degree of BACHELOR OF SCIENCE in
INFORMATION TECHNOLOGY from University of Mumbai.

Internal Guide Coordinator

Internal Examiner External Examiner

Date: College Seal Principal

2
3
ABSTRACT
4
Local train’s are very integral part of our day today life. We largely depend on them
for regular travel and journey. But that journey becomes very horrible experience for us when
trains are overcrowded, and uncountably crowd in trains is very common thing. This
experience can become worse when we need to travel along with our family or hand full of
baggage in both the hands. Technology has advanced very far in our life same we can use to
make information available to public in advance, so that they can take judgment or decision
in advance for better journey.

In the system, which we are proposing, all trains will carry a sensor system to sense
level of occupancy in each train compartment and it will be shown on a large indicator on
platform before the train arrives on station via Zigbee based wireless communication such
that people can take decision in advance to ride the train or leave it and if decide to travel then
in which compartment, that can be decide well in advance, This will help train also to
distribute crowd evenly throughout the train.

ACKNOWLEDGEMENT
5
First and foremost, we are grateful to our college “VIDYALANKAR SCHOOL OF
INFORMATION TECHNOLOGY” for timely successful completion of this project.

We are indebted to our respected Principal Dr. ROHINI KELKAR , it was there
constant support and guidance that kept us in alignment with our project as a great learning
experience.

We owe a sincere gratitude to our Head of Project Prof. Leena Jadhav (Project
Guide), who supported us and guided us with a continuous source of information. It leds to
our dedicated and determined approach, right from the selection of project, working through
it and overcoming several obstacles and completing it within the time schedule.

We convey our deep sense of gratitude to all teaching and non-teaching staff of
INFORMATION TECHNOLOGY Department for their constant encouragement, support
and time-to-time help throughout the project work.

It is great pleasure to acknowledge the help and the suggestion, which we received
from the department of Computer Engineering. We wish to express our profound thanks to all
of those who helped us in finding information about project.

DECLARATION

6
I hereby declare that the project entitled, “TRAIN CROWD MANAGEMENT
SYSTEM” done at Vidyalankar School of Information Technology, has not been in any
case duplicated to submit to any other universities for the award of any degree. To the best of
my knowledge other than me, no one has submitted to any other university.

The project is done in partial fulfilment of the requirements for the award of degree of
BACHELOR OF SCIENCE (INFORMATION TECHNOLOGY) to be submitted as final
semester project as part of our curriculum.

Name and Signature of the Student

TABLE OF CONTENTS
7
INTRODUCTION..................................................................................................................................... 10
CHAPTER 1 .............................................................................................................................................. 1
INTRODUCTION....................................................................................................................................... 1
1.1 BACKGROUND................................................................................................................................... 1
1.2 OBJECTIVES ....................................................................................................................................... 1
1.3 PURPOSE, SCOPE AND APPLICABILITY .............................................................................................. 2
1.3.1 PURPOSE .................................................................................................................................... 2
1.3.2 SCOPE ......................................................................................................................................... 2
SURVEY OF TECHNOLOGIES .................................................................................................................... 3
CHAPTER 2 .............................................................................................................................................. 4
SURVEY OF TECHNOLOGIES .................................................................................................................... 4
REQUIREMENTS AND ANALYSIS ............................................................................................................. 6
CHAPTER 3 .............................................................................................................................................. 7
REQUIREMENTS AND ANALYSIS ............................................................................................................. 7
3.1 PROBLEM DEFINITION ...................................................................................................................... 7
3.2 REQUIREMENT SPECIFICATION......................................................................................................... 7
3.3 PLANNING AND SCHEDULING........................................................................................................... 8
3.4.1 HARDWARE REQUIREMENTS ................................................................................................... 11
3.4.2 SOFTWARE REQUIREMENTS .................................................................................................... 17
SYSTEM DESIGN .................................................................................................................................... 19
CHAPTER 4 ............................................................................................................................................ 20
SYSTEM DESIGN .................................................................................................................................... 20
4.1 BASIC MODULES ............................................................................................................................. 20
4.2 PROCEDURAL DESIGN ..................................................................................................................... 22
CIRCUIT DIAGRAM ................................................................................................................................ 29
CHAPTER 5 ............................................................................................................................................ 33
IMPLEMENTATION AND TESTING ......................................................................................................... 33
5.1 IMPLEMENTATION APPROACH ....................................................................................................... 34
5.2 CODE DETAILS ................................................................................................................................. 34
5.2.1 CODE EFFICIENCY ..................................................................................................................... 41
WORKING MODEL PICTURES ................................................................................................................ 41
GANTT CHART ....................................................................................................................................... 42
5.3 TESTING APPROACH ....................................................................................................................... 43

8
5.3.1. UNIT TESTING .......................................................................................................................... 43
5.3.2. INTEGRATION TESTING ........................................................................................................... 44
CHAPTER 6 ............................................................................................................................................ 45
RESULTS AND DISCUSSION ................................................................................................................... 45
6.1 TEST REPORTS ................................................................................................................................. 45
6.2 USER DOCUMENTATION ................................................................................................................. 46
7.1 CONCLUSION .................................................................................................................................. 48
7.2 LIMITATION OF THE SYSTEM .......................................................................................................... 48
7.3 FUTURE SCOPE OF THE PROJECT .................................................................................................... 49
References ........................................................................................................................................... 49
Bibliography....................................................................................................................................... 50
Website Used ...................................................................................................................................... 51
Glossary .............................................................................................................................................. 52
Appendices .......................................................................................................................................... 53
Summary ............................................................................................................................................ 54
Further Reading ................................................................................................................................ 55

9
INTRODUCTION

10
CHAPTER 1
INTRODUCTION

1.1 BACKGROUND
● In recent days there is major problem in our life is the overcrowded railway station, there
is no such technology by which crowd gets managed.
● Railway Train Crowd manages crowd in each compartment of the train by calculating the
percentage of the passengers and displays the approximate percentage on the LCD display
which is being connected on the railway station by which passengers will accommodate
accordingly.
● This will help people to easily accommodate to the vacant areas in which compartment
crowd is less.

1.2 OBJECTIVES
The main aim of this project is to MANAGE THE CROWD OF THE COMPARTMENTS.
● People can easily accommodate to the vacant compartments.
● Saves human struggle to run here and there.
● Approximate percentage of the peoples will show on LCD.
● Can be controlled by Zigbee technology.
● In-system programmable i.e. we can modify the code of the Controller at any time
depending upon our requirement without taking out the controller from the board.
Instead of keeping a chain for emergency, We will keep a panel of four switches in each
compartment with acknowledgement indicator and different condition labels like :-

➢ Fire bracket

➢ Medical emergency

➢ Theft attempt
This will help traveller and train management both to make quick and informed decision
through wireless communication between train and station head office.

1
1.3 PURPOSE, SCOPE AND APPLICABILITY

1.3.1 PURPOSE
Railway Train Crowd manages crowd in each compartment of the train by calculating
the percentage of the passengers and displays the approximate percentage on the LCD display
which is being connected on the railway station by which passengers will accommodate
accordingly.
Mainly, behind coming up with this project idea is that to manage crowd as well as for
passengers who get unconscious because of the crowd on railway platforms.
This will help people to easily accommodate to the vacant areas in which compartment
crowd is less.

1.3.2 SCOPE
This embedded project (Train Crowd Management), can be used in future for Indian/Western
Railways.
Train Crowd Management System can also further evaluated with high technologies
like Wi-Fi/WiMAX for transmitting the data continuously in continuous ways of
communication.

1.3.3 APPLICABILITY
The main idea is to overcome the problem of crowd at railway station so this Train
Crowd Management System can be applicable in regions like
● Local Railway Stations

2
SURVEY OF
TECHNOLOGIES

3
CHAPTER 2
SURVEY OF TECHNOLOGIES
ZIGBEE TECHNOLOGY
This project report provides a complete description of the concepts and features that make
ZigBee technology what it is. All aspects of ZigBee are described including the IEEE802.15.4
layers, the ZigBee stack, and the motivation behind the system, typical applications and
design methodologies. Many silicon manufacturers are been currently taking advantage of the
features and popularity of ZigBee. This report surveys the devices currently on the market, the
advantages and disadvantages of each, and provides a simple, unbiased, side by side
comparison of the available silicon. This comparison aimed at helping a newcomer to ZigBee
select a device that will be suitable for their application.

THE ZIGBEE ADVANTAGE

The ZigBee protocol was designed to carry data through the hostile RF enviornments that
routinely exist in commercial and industrial applications.

ZigBee protocol features are:

• Provides longer battery life.


• Supports for multiple network topologies.
• Up for 65000 nodes on a network.
• 128-bit AES encryption i.e. Provides secure connections between devices
• Collision avoidance.

4
SECURE CONNECTIONS

The ZigBee specifications provides a security toolbox approach to ensuring reliable and
secure networks.

ZigBee enables the broad-based deployment of wireless networks with low-cost and low-
power solutions. It also provides the ability to run for the years on inexpensive batteries.

5
REQUIREMENTS AND
ANALYSIS

6
CHAPTER 3
REQUIREMENTS AND ANALYSIS

3.1 PROBLEM DEFINITION


Mumbai is the financial and the commercial capital of India. Mumbai wouldn’t have
achieved this without the lifeline of city, its local trains. For any large densely populated urban
area, the local trains are essential for an speedy cross-over of a large population over long
distances. Lakhs of the people travel regularly and commute by local trains over varying
distances ranging from 10 to 60 kilometer a day.

The Mumbai local railway network branches out through the three main lines –
Central, Western and the Harbour, each connecting a distinct part of the city to another. It may
be considered as one of the best examples of strategic management in transport.
Most the commuters use this means of transport to reach the places of their job,
profession, business and educational purposes. Most travellers commuting on a daily basis
hold season passes that makes the local train travel even more cost-efficient.
The problem in the project could be the range issues, if connectivity breaks entire work
displaying on LCD will stop.

3.2 REQUIREMENT SPECIFICATION


In today’s system there is no such technology who will tell/notify you about the
passenger’s crowd before train arrives on the platform. Passenger’s gets unconscious for

7
vacant space as train arrives on the platform as train don’t have technology to tell the
passengers crowd.

In this purposed system we will use the wireless technology (Zigbee Technology)
which will transmit the data (i.e. the approximate count of the passengers who will be in the
compartment) to the station side. There will be a transmitter and receiver who will be placed
in train and station side respectively.

This system also provides the four emergency buttons which are being replaced by the
train chain. This four buttons will be placed in the center top side of the train and will pass the
notification to the motor man (i.e. Driver of the train) and will take actions as required. This
buttons are indexed for Fire Bracket, Medical Emergency, Unknown Object and Theft
Attempt.

By this system passengers will save their time, they won’t panic to search vacant places in the
train.

1. High Performance.
2. Saves passengers time.
3. Easy to implement.

In this system we are going to use Load Cell which will translate physical element pressure
into an electrical signal. We are also going to use the Resistors which is electronic component
used to oppose an electric current by producing voltage drop between its terminal. Push button
is used to linked together by mechanical linkage. Capacitor is passive electronic component
consisting of pair of conductors separate by a dielectric. In this project we are using LCD to
display the percentage of people accommodate in one compartment of train on next station.
LDR is also used to on or off the fan in the train according to the requirement which is useful
to save the electricity.

3.3 PLANNING AND SCHEDULING

8
Software process model deals with an model which we are going to use for the
development of the project. There are many software process models available but, while
choosing it we should choose it according to the project size that is whether it is the industry
scale project or big scale project or medium scale project. Accordingly a model which we
choose should be suitable for the project as the software process model changes the cost of the
project also changes because the steps in a each software process model varies. This software
is build using the waterfall model. This model suggests work cascading from step to step like
an series of waterfalls. It consists of the following steps in the following manner.

WATERFALL MODEL

9
Analysis Phase: To attack an problem by breaking it into sub-problems. The objective of an
analysis is to determine exactly what must be done to solve the problem. Typically, an
system’s logical elements (its boundaries, processes, and data) are defined during analysis.

Design Phase: The objective of an design is to determine how the problem will be solved.
During design the analyst’s focus shifts from a logical to the physical. Data elements are a
grouped to form physical data structures, screens, reports, files and databases.

Coding Phase: The system is been created during this phase. Programs are been coded,
debugged, documented, and tested. New hardware is been selected and ordered. Procedures
are been written and tested. End-user documentation is been prepared. Databases and files are
been initialized. Users are been trained.

Testing Phase: Once a system is developed, it is been tested to ensure that it does what it was
designed to do. After the system passes its been final test and any remaining problems are
corrected, the system is been implemented and released to the user.

3.4 SOFTWARE AND HARDWARE REQUIREMENTS


10
3.4.1 HARDWARE REQUIREMENTS

 LCD (Liquid Crystal Display)


This is example for the Parallel Port. This example doesn't use the Bi-directional feature
found on the newer ports, thus it should work with the most, if not all Parallel Ports. It
however doesn't show the use of the Status Port as input for a 16 Character x 2 Line LCD
Module to the Parallel Port. These LCD Modules are very much common these days, and are
quite simple to work with it, as all the logic required running them is on board.

Pros:

● Very compact and light.


● Low power consumption.
● Not affected by screen burn-in.
● No high voltage or other hazards present during repair/service.
● Can be made in almost any size or shape.

 CAPACITORS
A capacitor or a condenser is a passive electronic component consisting of a pair of
conductors separated by a dielectric. When the voltage potential difference exists between the
conductors, an electric field is present in the dielectric. This field stores energy and produces
an mechanical force between the plates. The effect is greatest between the wide, flat, parallel,
narrowly separated conductors.

An ideal capacitor is characterized by the single constant value, capacitance, which is


measured in farads. This is a ratio of the electric charge on each conductor to the potential
difference between them. In practice, the dielectric between the plates passes a small amount
of the leakage current. The conductors and leads introduce an equivalent series resistance and
the dielectric has an electric field strength limit resulting in the breakdown voltage.

11
The properties of a capacitors in a circuit may determine the resonant frequency and quality
factor of a resonant circuit, power dissipation and operating frequency in a digital logic
circuit, energy capacity in the high-power system, and many other important aspects.

A capacitor (formerly known as condenser) is a device for storing the electric charge.
The forms of practical capacitors vary widely, but all the contain at least two conductors
separated by a non-conductor. Capacitors used as the parts of electrical systems, for example,
consist of metal foils separated by a layer of insulating film.

 LIGHT DEPENDENT RESISTOR (LDR)

A photo resistor or a light dependent resistor (LDR) is a resistor whose resistance


decreases with increasing incident light intensity. It can be also referred to as a
photoconductor.

A photo resistor is made of the high resistance semiconductor. If light falling on the
device is of high enough frequency, photons absorbed by a semiconductor give bound

12
electrons enough energy to jump into the conduction band. The resulting free electrons (and
its hole partner) conduct electricity, thereby lowering resistance.
A photoelectric device can be an either intrinsic or extrinsic. An intrinsic
semiconductor has its own charge carriers and is not an efficient semiconductor, i.e. silicon. In
intrinsic devices the only available electrons are in valence band, and hence the photon must
have enough energy to excite the electron across the entire band gap. Extrinsic devices have
impurities, also called as dopants, and added whose ground state energy is closer to the
conduction band; since the electrons don’t have as far to jump, lower energy photons (i.e.,
longer wavelengths and lower frequencies) are sufficient to trigger the device. If a sample of
silicon has some of the atoms replaced by phosphorus atoms (impurities), there will be extra
electrons available for conduction. This is an example of an extrinsic semiconductor.

 ARDUINO UNO
The Arduino Uno is an microcontroller board based on the ATmega328. It has a 20
digital input/output pins (of which 6 can be used as PWM outputs and 6 can be used as analog
inputs), a 16 MHz resonator, a USB connection, a power jack, an in-circuit system
programming (ICSP) header, and the reset button. It contains an everything needed to support
the microcontroller; simply connect it to a computer (or appropriate wall power adapter) with
a USB cable or power it with an AC-to-DC adapter or battery to get started.

The Uno differs from all the preceding boards in that it does not use the FTDI USB-
toserial driver chip. Instead features an ATmega16U2 programmed as a USB-to-serial
converter. This auxiliary microcontroller have its own USB boot loader, which allows
advanced users to reprogram it.

The Arduino has the large support community and an extensive set of support libraries
and hardware add-on “shields” (e.g. you can easily make your Arduino wireless with our
Wixel shield), making it a great introductory platform for an embedded electronics.

13
 LIGHT EMITTING DIODE (LED)
A light-emitting diode (LED) is the semiconductor light source. LEDs are used as in
indicator lamps in many devices, and are increasingly used for lighting. When a light-emitting
diode is a forward biased (switched on), electrons are able to recombine with holes within the
device, releasing the energy in the form of photons. This effect is called as
electroluminescence and the colour of the light (corresponding to the energy of photon) is
determined by the energy gap of an semiconductor. An LED is an often small in area (less than
1 mm2), and integrated optical components may be used as to shape its radiation pattern. LEDs
present many of the advantages over incandescent light sources including lower energy
consumption, longer lifetime, improved robustness, and smaller size, faster switching, and
greater durability and reliability.

Types of LED’S

Electronic Symbol of LED

14
 RESISTORS
A resistor is the two-terminal electronic component designed to oppose an electric current
by producing a voltage drop between its terminals in a proportion to the current, that is, in
accordance with Ohm's law:

V = IR
Resistors are used as the part of electrical networks and electronic circuits. They are an
extremely common place in most of the electronic equipment. Practical resistors can be made
up of various compounds and films, as well as resistance wire (wire made of a highresistivity
alloy, such as nickel/chrome).

 LOAD CELL
A load cell is a physical element (or a transducer if you want to be technical) that can
translate the pressure (force) into an electrical signal.

15
 PUSH BUTTON

Types of Push Buttons


A push-button or a simply button is a simple switch mechanism for controlling the
some aspect of a machine or a process. Buttons are typically made out of the hard material,
usually plastic or a metal. The surface is an usually flat or shaped to accommodate the human
finger or hand, so as to be easily depressed or pushed. Buttons are the most often biased
switches, though even many un-biased buttons (due to their physical nature) require a spring
to return to their un-pushed state. Different people use the different terms for the "pushing" of
the button, such as press, depress, mash, and punch.

 ZIGBEE SYSTEM
Zigbee communication is specially built for the control and sensor networks on IEEE
802.15.4 standard for wireless personal area networks (WPANs), and it is a product from
Zigbee alliance. This communication standard defines the physical and Media Access Control
(MAC) layers to handle many devices at low-data rates. The date rate of 250 kbps is best
suited for the periodic as well as an intermediate two-way transmission of data between
sensors and controllers.

Zigbee Modem

16
Zigbee is a low-cost and low-powered mesh network widely deployed for controlling
and monitoring applications where it covers the 10-100 meters within the range. This
communication system is a less expensive and simpler than the other proprietary shortrange
wireless sensor networks as Bluetooth and Wi-Fi.

Zigbee supports the different network configurations for master to master or master to
slave communications. And also, it can be operated in the different modes as a result the
battery power is conserved. Zigbee networks are an extendable with the use of routers and
allow many nodes to interconnect with each other for the building a wider area network.

3.4.2 SOFTWARE REQUIREMENTS

 ARDUINO IDE

An Arduino Integrated Development Environment - or Arduino Software (IDE) –


contains the text editor for writing code, message area, a text console, a toolbar with buttons
for a common functions and the series of menus.

17
The Arduino IDE is an incredibly minimalistic, yet it provides the near-complete
environment for most Arduino-based projects. The top menu bar has a standard options,
including “File” (new, load, save, etc), “Edit” (font, copy, paste, etc), “Sketch” (for compiling
and programming), “Tools” (useful options for testing projects), and “Help”. The middle
section of an IDE is a simple text editor that where you can enter a program code. The bottom
section of an IDE is dedicated to an output window that is been used to see the status of the
compilation, how much memory has been used, any errors that were found in a program, and
various other useful messages.

 C EMBEDDED LANGUAGE

Embedded C Programming is a soul of the processor functioning inside each and every
embedded system we have been come across in our daily life, such as mobile phones, washing
machines, and digital cameras.
Each processor is associated with an embedded software. The first and foremost thing is
the embedded software that decides functioning of the embedded system. Embedded C
language is most frequently used to program the microcontroller

3.5 PRELIMNARY PRDOUCT DESCRIPTION

Our this embedded project, which has been titled as Train Crowd Management is been
intended to calculate weight whenever passengers boards in compartment and load cell must
calculate weight and must show on station LCD. Additionally it also switches on the fan
automatically wherever passengers stands in the compartment and it also gives four buttons
instead of train chain for emergency.

18
SYSTEM DESIGN
19
CHAPTER 4
SYSTEM DESIGN

4.1 BASIC MODULES

In our project there are three basic modules which are as follows
• COMPARTMENT
Compartment is one of the major modules in our project as it is the platform
on which load cell will be connected.

• LOAD CELL
Load cell will calculate weight occupancy within the compartment.

• LIQUID CRSYTAL DISPLAY


This will show the occupancies approximate percentage on LCD.

20
+

4.1.1 LOGIC DIAGRAMS

• BLOCK DIAGRAM OF TRAIN SIDE

• BLOCK DIAGRAM OF STATION SIDE

21
4.2 PROCEDURAL DESIGN

• USE CASE DIAGRAM (MAIN FUNCTIONING)

22
• USE CASE OF FEATURES

● ACTIVITY DIAGRAM (STATION SIDE)

23
• ACTIVITY DIAGRAM

● ACTIVITY DIAGRAM (MAIN FUNCTIONING)

• ACTIVITY DIAGRAM (FEATURES)

24
• DATAFLOW DIAGRAM

25
• SEQUENCE DIAGRAM

26
● FLOWCHART

27
28
CIRCUIT DIAGRAM

• STATION SIDE

29
• TRAIN SIDE

EVENT TABLE

30
Event Trigger Source Activity Response Destination

Train Passenger Train Stepping into Train Next station


arrives boards train train moves to
next station
Load cell Shows Train Passengers Train Next Station
occupancy of accommodate moves to
compartment accordingly next station
on LCD
Fans Passenger Fans Stepping into a Fans turns Fans turned
boards train train on on

Emergency Passenger Emergency Passenger Notification Train got an


switches boards train switches pressed a to train alert
switch motor man

PROTOTYPE DIAGRAM

31
 STATION SIDE

 TRAIN SIDE

32
IMPLEMENTATION AND
TESTING

CHAPTER 5
IMPLEMENTATION AND TESTING

33
5.1 IMPLEMENTATION APPROACH
Sr. No. Implementation Plan Action
1. Module  Arduino Board Uno
 LCD Display(16x2)
 EM-18 Reader Module
 Zigbee Module
 Load Cell
2. Percentage Completed Arduino Board Uno 100%

LCD Display(16x2) 100%

EM-18 Reader Module 100%

Zigbee Module 100%

Load Cell 100%

3. Status Arduino Board Uno Completed

LCD Display(16x2) Completed

EM-18 Reader Module Completed

Zigbee Module Completed

Load Cell Completed

4. Day Started 13th December 2018


5. Day to be Completed 27th February 2019
6. Actual Completion Date 7th March 2019
7. Module Assignment Name of Module Owner
8. Importance of Module Arduino Board Uno High

LCD Display(16x2) High

EM-18 Reader High


Module
Zigbee Module High

Load Cell High

5.2 CODE DETAILS

TRAIN CROWD MANAGEMENT TX CODE

#include <LiquidCrystal.h>

34
#include <SoftwareSerial.h>
SoftwareSerial mySerial(4, 2); // RX, TX
LiquidCrystal lcd(6, 7, 8, 9, 10, 11);
#include "HX711.h"
//
//// HX711.DOUT - pin #A1
//// HX711.PD_SCK - pin #A0
HX711 scale(A5,A4); // parameter "gain" is ommited; the default value 128 is used by the
library

int Buzzer=12;
int LED=13;
int FAN=A0;
int SW_1=A1;
int SW_2=A2;
int SW_3=A3;
int LDR=5;

int Station_1=0,Station_2=0,Station_3=0,Station_4=0;
int ldr_state=0,SW_1_state=0,SW_2_state=0,SW_3_state=0;
int light_fan_on=0,Train_Full=0;
long load_value=0;
String EM_DATA;
void setup()
{

Serial.begin(9600);
mySerial.begin(9600);
Serial.print("SM_ARU@3327");
pinMode(LDR, INPUT);
pinMode(SW_1, INPUT);
pinMode(SW_2, INPUT);
pinMode(SW_3, INPUT);
pinMode(LED, OUTPUT);
pinMode(FAN, OUTPUT);
pinMode(Buzzer, OUTPUT);
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print(" Smart Train ");
lcd.setCursor(0, 1);
lcd.print(" System ");
Init_HX711_scale();
digitalWrite(LDR, HIGH);
digitalWrite(SW_1, HIGH);
digitalWrite(SW_2, HIGH);
digitalWrite(SW_3, HIGH);
digitalWrite(Buzzer, LOW);

35
digitalWrite(LED, LOW);
digitalWrite(FAN, LOW);
delay(3000);
lcd.clear();
}

void loop()
{
ldr_state = digitalRead(LDR);
SW_1_state = digitalRead(SW_1);
SW_2_state = digitalRead(SW_2);
SW_3_state = digitalRead(SW_3);
if (SW_2_state == LOW)light_fan_on=0;
if (SW_3_state == LOW)light_fan_on=1;

if (ldr_state == LOW || light_fan_on==1)


{
Serial.println("Light Fan ON");
digitalWrite(LED, HIGH);
digitalWrite(FAN, HIGH);
}
else
{
Serial.println("Light Fan OFF");
digitalWrite(LED, LOW);
digitalWrite(FAN, LOW);
}
if (SW_1_state == LOW)
{
lcd.clear();
lcd.print("Emergrncy");
digitalWrite(Buzzer, HIGH);
delay(1000);
digitalWrite(Buzzer, LOW);
}
rf_tag();
station_status();
Read_HX711_parameter();
if(load_value>=4)
{
lcd.clear();
lcd.print("Train Full");
digitalWrite(Buzzer, HIGH);
delay(1000);
digitalWrite(Buzzer, LOW);
Train_Full=1;
}

36
else Train_Full=0;
update_xbee();
}

void rf_tag()
{
if (mySerial.available())
{
lcd.clear();EM_DATA="";
while (mySerial.available())
{EM_DATA=mySerial.readString();}
Serial.print(EM_DATA);
lcd.clear();
lcd.print(" Reach At");

if(EM_DATA=="45005D03C6DD")
{Station_1=1;Station_2=0;Station_3=0;Station_4=0;
lcd.setCursor(0, 1); lcd.print(" Mumbai Central");}

if(EM_DATA=="45005D03465D")
{Station_1=0;Station_2=1;Station_3=0;Station_4=0;
lcd.setCursor(0, 1); lcd.print(" Dadar");}

if(EM_DATA=="45005D028C96")
{Station_1=0;Station_2=0;Station_3=1;Station_4=0;
lcd.setCursor(0, 1); lcd.print(" Bandra");}

if(EM_DATA=="45005D01C0D9")
{Station_1=0;Station_2=0;Station_3=0;Station_4=1;
lcd.setCursor(0, 1); lcd.print(" Andheri");}
delay(1000);
}
}

void station_status()
{
if(Station_1==0 && Station_2==0 && Station_3==0 && Station_4==0)
{lcd.clear();lcd.print(" Next Station");lcd.setCursor(0, 1); lcd.print(" Mumbai Central");}
if(Station_1==1 && Station_2==0 && Station_3==0 && Station_4==0)
{lcd.clear();lcd.print(" Next Station");lcd.setCursor(0, 1); lcd.print(" Dadar");}
if(Station_1==0 && Station_2==1 && Station_3==0 && Station_4==0)
{lcd.clear();lcd.print(" Next Station");lcd.setCursor(0, 1); lcd.print(" Bandra");}
if(Station_1==0 && Station_2==0 && Station_3==1 && Station_4==0)
{lcd.clear();lcd.print(" Next Station");lcd.setCursor(0, 1); lcd.print(" Andheri");}
if(Station_1==0 && Station_2==0 && Station_3==0 && Station_4==1)
{lcd.clear();lcd.print(" Next Station");lcd.setCursor(0, 1); lcd.print(" Borivali ");}
delay(1000);

37
}

void Init_HX711_scale()
{
Serial.println("HX711 Demo");

Serial.println("Before setting up the scale:");


Serial.print("read: \t\t");
Serial.println(scale.read()); // print a raw reading from the ADC

Serial.print("read average: \t\t");


Serial.println(scale.read_average(20)); // print the average of 20 readings from the ADC

Serial.print("get value: \t\t");


Serial.println(scale.get_value(5)); // print the average of 5 readings from the ADC minus the
tare weight (not set yet)

Serial.print("get units: \t\t");


Serial.println(scale.get_units(5), 1); // print the average of 5 readings from the ADC minus tare
weight (not set) divided
// by the SCALE parameter (not set yet)

scale.set_scale(2280.f); // this value is obtained by calibrating the scale with known


weights; see the README for details
scale.tare(); // reset the scale to 0

Serial.println("After setting up the scale:");

Serial.print("read: \t\t");
Serial.println(scale.read()); // print a raw reading from the ADC

Serial.print("read average: \t\t");


Serial.println(scale.read_average(20)); // print the average of 20 readings from the ADC

Serial.print("get value: \t\t");


Serial.println(scale.get_value(5)); // print the average of 5 readings from the ADC minus the
tare weight, set with tare()

Serial.print("get units: \t\t");


Serial.println(scale.get_units(5), 1); // print the average of 5 readings from the ADC minus
tare weight, divided
// by the SCALE parameter set with set_scale

Serial.println("Readings:");
}

38
void Read_HX711_parameter()
{
Serial.print("one reading:\t");
Serial.print(scale.get_units());
Serial.print("\t| average:\t");
Serial.println(scale.get_units(10));
lcd.clear();
lcd.setCursor(0,1);
load_value=(scale.get_units());
lcd.print("Load= ");
load_value=load_value/100;
lcd.print(load_value);
Serial.println(load_value);
scale.power_down(); // put the ADC in sleep mode
delay(500);
scale.power_up();
}

void update_xbee()
{
mySerial.print("*");
mySerial.print(Station_1);
mySerial.print(Station_2);
mySerial.print(Station_3);
mySerial.print(Station_4);
mySerial.print(load_value);
mySerial.println("#");
}

TRAIN CROWD MANAGEMENT RX CODE

#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
SoftwareSerial Xbee(2,3);
LiquidCrystal lcd(4,5,6,7,8,9);
39
String SM_ARU="";
void setup()
{
Serial.begin(9600);
Xbee.begin(9600);
Serial.print("SM_ARU@3327");
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print("Train Platform");
lcd.setCursor(0, 1);
lcd.print(" Board ");
delay(3000);
lcd.clear();
}

void loop()
{
Received_data();

}
void Received_data()
{
SM_ARU="";
if (Xbee.available())
{
SM_ARU=Xbee.readString();

Serial.println(SM_ARU);

if(SM_ARU[0]=='*' && SM_ARU[6]=='#')


{
lcd.clear();
lcd.print("Welcome to ");
lcd.setCursor(0, 1);
if(SM_ARU[1]=='1'){lcd.print(" Dadar ");}
else if(SM_ARU[2]=='1'){lcd.print(" Bandra ");}
else if(SM_ARU[3]=='1'){lcd.print(" Andheri ");}
else if(SM_ARU[4]=='1'){lcd.print(" Borivali ");}
else if(SM_ARU[1]=='0'){lcd.print(" Mumbai Central ");}

delay(1000);
lcd.clear();
lcd.print("Upcoming Train ");
lcd.setCursor(0, 1);
if(SM_ARU[5]=='0'){lcd.print(" 0% ");}
else if(SM_ARU[5]=='1'){lcd.print(" 30% ");}

40
else if(SM_ARU[5]=='2'){lcd.print(" 60% ");}
else {lcd.print(" Overloaded ");}
delay(1000);
}

else
{
lcd.clear();
lcd.print(" Wating For ");
lcd.setCursor(0, 1);
lcd.print(" Update... ");
delay(100);
}
}

5.2.1 CODE EFFICIENCY

 Efficiency is obtaining the correct results and minimizing the resources.


 Code efficiency plays a main role in applications in a high-execution-speed environment
where performance and scalability are paramount.
 Code details explain us the code block.
 Ensuring the efficiency of the code is the best practise of checking if the code is
productive enough.
 Well-developed codes should be able to handle the complex algorithms.

WORKING MODEL PICTURES

 Entire model

41
 Train side (compartment)

 Station side

GANTT CHART

42
5.3 TESTING APPROACH
 Testing Approach tells us how to test the entire project.
 There are two basic type of testing methods :-
 Unit testing where the basic modules are tested with the basic codes to check if
the components are running properly individually.
 Integration testing is where all the small single modules are connected together to
perform a desired task; the final working of the project is tested from start to the
end.

5.3.1. UNIT TESTING


 Unit testing is done to remove problems from the code by breaking your program into
different parts and testing each part.

In Train Crowd Management System Unit testing was done to check if:
 Is load cell taking the load and calculates the approximate percentage of the load.
 Are the percentages being displayed on the LCD screen?
43
 Buttons are functioning properly or not.
 If the RFID cards are being read through the EM-18 Reader Module.
 Whether the Zigbee Module is communicating or not.

5.3.2. INTEGRATION TESTING


 In Integration testing individual units are combined and tested for proper interfacing
between different components and to expose faults in the interaction between these
integrated units.

In Train Crowd Management, testing was done in such a way that,


 It checks whether compartment (load cell) percentage is being calculated and shows on
the station LCD. If passenger gets inside the train then does the fans gets switched on
where passenger stands in the particular position

44
RESULTS AND
DISCUSSION

CHAPTER 6
RESULTS AND DISCUSSION
6.1 TEST REPORTS

SR.NO ACTION EXPECTED ACTUAL O/P STATUS


O/P

1 Testing load cell Must Calculate Calculates the Pass


the weight weight

2 Zigbee Must transmit Transmits the Pass


the data data

3 EM-18 Module Must read the Reads the input Pass


input
45
4 Liquid Crystal Must show the Shows the data Pass
Display (LCD) data on it on it

6.2 USER DOCUMENTATION

 It is an embedded system which consists of different modules.


 At first the passenger needs to board a train in any of the compartment.
 Once the passenger gets in, the load cell which has been connected below the
compartment will take the load and calculates the load in terms of percentage.
 The calculated load will be send to the next stations LCD so that passengers will
accommodate easily.
 Once the data is been transmitted to the next station people will get increased and
decreased in the compartment when train arrives which leads to increment and decrement
in the compartment load and hence percentage will also get differ.
 When passenger is in compartment and is standing or sitting in particular area then that
areas fans and lights will get turned on and if they walks out of the area then fans and
lights will get turned off.
 In compartment there are three different buttons for manually on/off lights and fans and
one is an emergency switch.

46
 An emergency switch is basically the replacement of emergency chains as it may not
work properly sometimes.

47
CONCLUSIONS

CHAPTER 7
CONCLUSIONS
7.1 CONCLUSION
 The complications about managing the crowd in the compartment are solved.
 The main objective of the designed system is to manage the crowd efficiently before
train arrives on the next platform.
 This system also provides automatically fans and lights on/off .
 The efficient and advanced technique may help passengers to accommodate accordingly.

7.2 LIMITATION OF THE SYSTEM


 If the xbee chip gets damaged because of some environmental or accidental issues then
the percentage showing on next station will be halted until xbee is not replaced or
repaired in mean time.

48
7.3 FUTURE SCOPE OF THE PROJECT
 We can further enhance the entire system by replacing zigbee technology with WiMax
and it may give more strong signal and could transfer the data to the longer range.
 We can also implement this project on several platforms like for goods which gets
imported/exported in Trucks, Ships, etc.

References
Following are the references that provided the essential background or context to the project.
 “Embedded System Design” by Peter Marwedel
 A RFID-based Campus Context-Aware Notification System Nazleeni S. Haron, Nur S.
Saleem, Mohd H. Hasan, Mazeyanti M. Ariffin and Izzatdin A. Aziz
 “Embedded System Design” by Steve Heath
 ZigBee Wireless Networks and Transceivers – Chiara Buratti

49
Bibliography
Sequence Diagrams: https://youtu.be/XIQKt5Bs7II
Use Case Diagrams: https://youtu.be/zid-MVo7M-E
Activity Diagrams: https://youtu.be/CDPjTYSnCt4
Data Flow Diagrams: https://youtu.be/aqcSnjJ-EqE
Description on Zigbee and xbee module: https://www.link-labs.com/blog/zigbee-vs-xbee

50
Website Used
www.arduino.cc/en/guide/introduction
en.wikipedia.org/wiki/Load_cell
youtu.be/nGUpzwEa4vg
youtu.be/odekkumB3WQ
internetofthingsagenda.techtarget.com/definition/ZigBee
www.lucidcharts.com
www.smartdraw.com

51
Glossary
RFID:
RFID is an acronym for “Radio-frequency Identification” and refers to a technology
whereby digital data encoded in RFID tags or smart labels are captured by a reader via
radio waves.

LCD:
LCD (liquid crystal display) is the technology used
for displaying messages.

XBEE:
It is basically a chip used for transmitting and receiving the data (Zigbee Chips).

LOAD CELL:
Is used for calculating the load

52
Appendices

53
Summary

54
Further Reading
 Zigbee Wireless Networks and transceivers by Shahin Farahani

55

Potrebbero piacerti anche