Chapter - 1: 1.1 Purpose

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

SAFEGUARD AUTOMATION OF RAILWAY USING IOT

CHAPTER -1

INTRODUCTION

The railway system is the most commonly used transportation mode in India. It is also one of
those modes of transport that faces a lot of challenges due to human errors. There are mainly
two types of level crossing they are manned level crossing and unmanned level crossing.
When we go through the daily newspapers we come across many railway accidents
occurring at unmanned railway crossings obstacle on track system. This is mainly due to
the carelessness in manual operations or lack of workers. In order to avoid the human
errors that could occur during the operation of gates, the proposed system introduces the
concept of railway gate automation.

The existing system involves the manual gate operation by the gate keepers based on the
signals received from the control room. But the rate of manual error that could occur at
these level crosses are high because they are unsafe to perform without actual knowledge
about the train time table. The human errors such as delay in informing the gatekeeper
about the arrival of the train, delay in the gate operation by the gate keeper, obstacle stuck
in the level cross etc. leads to the increasing rate of accidents at the level cross.

Thus the railway gate automation system aims to deal with two things. It reduces the total
time taken for the gate operation at the level cross and also ensures the safety of the
passengers at the level cross during when the train passes. The reduction in the direct
human intervention during the gate operation in turn helps to reduce the collision and
accidents at the level cross. Since the gate operations are automated based on the sensors,
the time for which the gate is closed is less.

Sensors are fixed at 1km on both sides of the gate. When sensor1 gets activated, the gate
motor is turned on in one direction and the gate is closed and stays closed until the train
crosses the gate. When sensor2 gets activated motor turns in opposite direction and gate
opens and motor stops. Buzzer will immediately sound at the sensor1 activation and gate
will close after 5 seconds, so giving time to drivers to clear gate area in order to avoid
trapping between the gates and stop sound after the train has crossed.

1.1 PURPOSE

This project is aimed at developing an IOT device which can automate the railway gate system in
real time. This automation gate system makes the gate close and open system automatic with the
help of sensors. The main purpose of this automation is to reduce the accidents and traffic jam at
railroad crossing. This is also used in unmanned railway gate in order to avoid accidents.

1
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

1.2 SCOPE
This project is mainly used in unmanned railway gates. This railway gate system doesn’t need
any man power to operate gates. It warns people about occurrence of fire accident in train.

1.3 OVERVIEW

The automatic railway gate system uses two IR sensors in which IR1 senses the arrival of train
and gives warning signal and then closes the railway gate by using gear motor. IR2 senses the
departure of train and then opens the gate by using gear motor. Smoke sensor is also used which
is used in detecting the smoke intensity in train when there is any fire accidents. It detects the
amount of smoke if it is greater than actual range then it initiates alarm sound indicating the
occurrence of fire accidents in train. The Arduino sketch is written, compiled and loaded to the
Arduino board using Arduino IDE.

2
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

CHAPTER - 2

LITERATURE SURVEY

1. Automation in unmanned railway level crossing in IEEE 9th


International Conference on Intelligent Systems and Control (ISCO)
Published on: Jan 2015

This paper deals mainly with the automation in unmanned and manned railway crossings. In
recent days the accidents in railway level crossing are increasing. There are two types of level
crossing Manned and Unmanned. The accidents occurring in both level crossings are very
severe. Our work uses simple mechanical and electrical components to control the railway gate.
The Infrared detector which is placed at a few distances away from the gate detects the train and
sends the signal to the controller. From the controller the signal is send to the timer which is
connected to LED display near the gate. Timer displays the time remaining for closing or
opening of the gate according to the necessary situation. The power is transmitted from the
controller to the motor which is connected to the L-shaped cylinder through the pinion of rack
and pinion arrangement. Thus our paper presents a highly secured and safe automated level
crossing at low cost, which requires no human monitoring.

2. Arduino Based Automatic Railway Gate Control and Obstacle Detection


System in International Journal of Advanced Research in Electrical,
Electronics and Instrumentation Engineering:
Published on: May 2016

In the rapidly flourishing countries accidents in the unmanned level crossings and due to obstacle
on track are increasing day by day. No fruitful steps have been taken so far in these areas. Our
project deals with automatic railway gate control at a level crossing replacing the gates operated

3
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

by the gatekeepers and detection of obstacle on track. By employing the automatic railway gate
control at the level crossing the arrival of the train is detected by the sensors placed in the side of
the tracks. Hence, the time for which it is closed is less compared to the manually operated gates.
Detection of obstacle on railway track deals with two things, Firstly it senses any obstacle on the
track by using sensors placed on the front end of the train and Secondly, to convey the obstacle
detection message to the nearby railway station through GSM technology.
The proposed system uses infrared sensors to detect the arrival and departure of trains at
the railway level crossing, ultrasonic sensor to detect the obstacle on the track, GSM to convey
the obstacle message to the nearby railway station and Arduino to control the opening/closing of
gates and to convey the obstacle message. The review of train accidents of the last 5 years (2009-
10 to 2013-14) for which the data is available indicates that a large number of accidents happen
because of derailments & at level crossing. NCRB says a total of 2,547 railway crossing
accidents led to 2,575 deaths and 126 injuries across the country in 2014. This motivated us to
take up this project.

4
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

CHAPTER-3
PROBLEM DEFINITION

Train accidents are drastically increasing day by day due to various reasons which cannot
be ignored. Traditional method of manual operating of railway gate system is one of the major
cause for the occurrence of accidents at railway crossing. Since gates of Railway crossing are
usually operated manually by a gate keeper, for most of the times gates are kept closed for no
reason, increasing road traffic. As in some places there are no gates at railway crossing and in
some areas gate keepers are delaying in closing gates due to this the accidents at rail road

crossing are increased.


Fire accidents also takes place in trains. When these accidents are occurring in remote
areas or during night times the loss or damage being caused is at higher rates. The damage is
heavier due to improper reach of service at right time due to improper communication. This time
delay is causing heavier damage. In these we will use smoke sensor to detect smoke range,
indicating of fire accident occurrence and IR sensors for automatic gate open close system.

3.1 EXISTING SYSTEM


The existing system uses manual operating of railway gate by gatekeeper. The gate keeper
receives the information about the train arrival from a near station. When the train starts to leave
the station, the station in-charge delivers this information to the closest gatekeeper to get ready
and he closes the gate depending on the timing at which the train arrives.

3.2 PROBLEMS IN EXISTING SYSTEM


The problem with existing system is accidents at the tracks due to the carelessness in manual
operations or lack of workers. In situations where the train is late due to some reason, the gates
remain closed for long durations causing dense traffic jam near the gates. In some places there
are no gates at railway crossing and in some areas gate keepers are delaying in closing gates due

5
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

to this the accidents occurs. When there is any occurrence of fire accidents in remote areas or
during night times the loss or damage being caused is at higher rates.

3.3 PROPOSED SYSTEM


The proposed system uses automatic railway gate at a level crossing replacing
the gates operated by the gatekeeper. It uses infrared sensors to detect the arrival and departure
of trains at the railway level crossing and Arduino to control the opening/closing of gates. It
reduces the total time taken for the gate operation at the level cross and also ensures the safety of
the passengers at the level cross during when the train passes. s. By attaching smoke sensor in
the compartments of train senses the smoke detection, it assumes a fire accident as an emergency
and starts the buzzer.
3.4 ADVANTAGES OF PROPOSED SYSTEM
 Less expensive.
 Reduces accidents.
 Reduce the road traffic at railway crossing.
 Reduce the time for which gate remains closed.
 Reduces the manpower.
 Provides safety to the users.
 Error due to manual operation is prevented.
 Sensors have long life time and less cost.

6
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

CHAPTER-4
SYSTEM REQUIREMENTS AND ANALYSIS

4.1 HARDWARE REQUIREMENTS:


 Micro Controller - Arduino UNO-R3
 IR sensor
 3-24V Piezo Electronic Tone Buzzer
 Red & Green Led
 Gear Motor 12V
 Driver Module
 Smoke Sensor MQ2
 Bread Board
 Jumper Wires
4.2 SOFTWARE REQUIREMENTS:
 Operating system - Arduino IDE, Windows7 or above
 Programming Language – Arduino

4.2.1 SOFTWARE INSTALLATION PROCESS

Arduino microcontrollers come in a variety of types. The most common is the Arduino UNO, but
there are specialized variations. Before you begin building, do a little research to figure out
which version will be the most appropriate for your project.

Download the Arduino Software (IDE):

Get the latest version from the download page. You can choose between the Installer (.exe) and
the Zip packages. We suggest you use the first one that installs directly everything you need to

7
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

use the Arduino Software (IDE), including the drivers. With the Zip package you need to install
the drivers manually. The Zip file is also useful if you want to create a portable installation.When
the download finishes, proceed with the installation and please allow the driver Installation
process when you get a warning from the operating system.

Choose the components to install :

8
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

Choose the installation directory (we suggest to keep the default one)
STEP 1:
To begin, you'll need to install the Arduino Programmer, the integrated development
environment (IDE).
STEP 2:
Connect your Arduino to the USB port of your computer. This may require a specific
USB cable. Every Arduino has a different virtual serial-port address, so you’ll need to
reconfigure the port if you're using different Arduinos.
STEP 3:
Set the board type and the serial port in the Arduino Programmer.
STEP 4:
Test the microcontroller by using one of the preloaded programs, called sketches, in the
Arduino Programmer. Open one of the example sketches, and press the upload button to
load it. The Arduino should begin responding to the program: If you've set it to blink an
LED light, for example, the light should start blinking.
STEP 5:
To upload new code to the Arduino, either you'll need to have access to code you can
paste into the programmer, or you'll have to write it yourself, using the Arduino
programming language to create your own sketch. An Arduino sketch usually has five
parts: a header describing the sketch and its author; a section defining variables; a setup
routine that sets the initial conditions of variables and runs preliminary code; a loop
routine, which is where you add the main code that will execute repeatedly until you stop
running the sketch; and a section where you can list other functions that activate during
the setup and loop routines. All sketches must include the setup and loop routines.

STEP 6:
Once you've uploaded the new sketch to your Arduino, disconnect it from your computer
and integrate it into your project as directed.

9
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

CHAPTER-5
SYSTEM ARCHITECTURE

IOT:
IOT is simply the network of interconnected things/devices which are embedded with sensors,
software, network connectivity and necessary electronics that enables them to collect and
exchange data making them responsive.

More than a concept Internet of Things is essentially an architectural framework which allows
integration and data exchange between the physical world and computer systems over existing
network infrastructure. Any stand-alone internet-connected device that can be monitored and/or
controlled from a remote location is considered an IoT device. With more smaller, more
powerful chips, almost all products can be an Internet of Things devices.

MODULES EXPLANATION:

5.1.1 ARDUINO UNO-R3:


 The Arduino Uno R3 is a microcontroller board based on the ATmega328.
 It has 14 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 a reset button.
 It contains everything needed to support the microcontroller; simply connect it to a with a
USB cable or power it with a AC-DC adapter or battery to get started.
 Programs can be loaded on to it from the easy-to-use Arduino computer program.
 The Arduino has an extensive support community, which makes it a very easy way to get
started working with embedded electronics.
 This is the 3rd revision of the Uno (R3), which has a number of changes.
 The USB controller chip changed from ATmega8U2 (8K flash) to ATmega16U2 (16K
flash). This does not increase the flash or RAM available to sketches.
 Three new pins were added, all of which are duplicates of previous pins.

10
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

 The I2C pins (A4, A5) have been also been brought out on the side of the board near
AREF. There is a IOREF pin next to the reset pin, which is a duplicate of the 5V pin.
 The reset button is now next to the USB connector, making it more accessible when a
shield is used. Arduino boards are able to read inputs - light on a sensor, a finger on a
button, or a Twitter message and turn it into an output activating a motor, turning on an
LED, publishing something online.
 All Arduino boards are completely open-source, empowering users to build them
independently and eventually adapt them to their particular needs.
 The software, too, is open-source, and it is growing through the contributions of users
worldwide.
 It is an Atmega 328 based controller board which has 14 GPIO pins, 6 PWM pins, 6
Analog inputs and on board UART, SPI and TWI interfaces. In this IOT device, 9 pins of
the board are utilized.

11
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

1. Power USB
2. Power (Barrel Jack)
3. Voltage Regulator
4. Crystal Oscillator
5. Arduino Reset

6. Voltage(5v)

7. Voltage(3.3v)

8. GND(Ground)

9. Vin

10. Analog pins

11. Main microcontroller

12. ICSP pin

13. Power LED indicator

14. TX and RX LEDs

15. Digital I/O

16. AREF(Analog Reference)

12
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

NEED OF ARDUINO:

 Active User Community: A group of people using a similar product can hold posted
message conversations and share their experiences or solve the problems of the other
users in the communities with their own experience
.
 Growth of Arduino: Arduino was developed with intent to provide an economical and
trouble-free way for hobbyists, students and professionals to build devices that interact
with their situation using sensors and actuators.

 Inexpensive Hardware: Since Arduino is an open source platform the software is not
purchased and only the cost of buying the board or its parts is incurred, thus making it
very cheap.

 Arduino Board as a Programmer: To make Arduino board function easy and also
making it available everywhere these boards come with a USB cable for power
requirements

 Multi-platform Environment: The Arduino IDE is capable of running on a number of


platforms including Microsoft, Linux and Mac OS.

Elements of an Arduino Board can be done into two categories:

• Hardware

• Software

HARDWARE:
The Arduino Development Board consists of many components that together make it
work. Here are some of those main component blocks that help in its functioning:

13
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

Microcontroller:

This is the heart of the development board, which works as a mini computer and can
receive as well as send information or command to the peripheral devices connected to
it. The microcontroller used differs from board to board; it also has its own various
specifications.

The Arduino Uno has a number of facilities for communicating with a computer,
another Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V)
serial communication, which is available on digital pins 0 (RX) and 1 (TX). An
ATmega8U2 on the board channels this serial communication over USB and appears as
a virtual com port to software on the computer. The '8U2 firmware uses the standard
USB COM drivers, and no external driver is needed. However, on Windows, an *.inf
file is required.

The Arduino software includes a serial monitor which allows simple textual data to be
sent to and from the Arduino board. The RX and TX LEDs on the board will flash when
data is being transmitted via the USB-to serial chip and USB connection to the
computer (but not for serial communication on pins 0 and 1).

External Power Supply:


This power supply is used to power the Arduino development board with a regulated
voltage ranging from 9 – 12 volts.

USB plug:

This plug is a very important port in this board. It is used to upload (burn) a program to
the microcontroller using a USB cable. It also has a regulated power of 5V which also
powers the Arduino board in cases when the External Power Supply is absent.

Internal Programmer:
The developed software code can be uploaded to the microcontroller via USB port,
without an external programmer.

Reset button:
This button is present on the board and can be used to resets the Arduino microcontroller .

14
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

Analog Pins:

There are some analog input pins ranging from A0 – A7 (typical). These pins are used
for the analog input / output. The no. of analog pins also varies from board to board.

Digital I/O Pins:


There are some digital input pins also ranging from 2 to 16 (typical). These pins are used
for the digital input / output. The no. of these digital pins also varies from board to board.

Power and GND Pins:


There are pins on the development board that provide 3.3, 5 volts and ground through
them.

Serial: 0 (RX) and 1 (TX)


Used to receive (RX) and transmit (TX) TTL serial data. These pins are connected to the
corresponding pins of the ATmega8U2 USB-to-TTL Serial chip

External Interrupts: 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. See the attach Interrupt () function for details.

PWM: 3, 5, 6, 9, 10, and 11:


Provide 8-bit PWM output with the analogWrite() function.

SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK):


These pins support SPI communication, which, although provided by the underlying
hardware, is not currently included in the Arduino language.

LED: 13:
There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the
LED is on, when the pin is LOW, it's off.

AREF:
Reference voltage for the analog inputs. Used with analogReference().

15
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

Reset:
Bring this line LOW to reset the microcontroller. Typically used to add a reset button to
shields which block the one on the board.

The Arduino Uno has a resettable polyfuse that protects your computer's USB ports from
shorts and overcurrent. Although most computers provide their own internal protection,
the fuse provides an extra layer of protection. If more than 500 mA is applied to the USB
port, the fuse will automatically break the connection until the short or overload is
removed.

SOFTWARE:

The program code written for Arduino is known as a sketch. The software used for
developing such sketches for an
Arduino is commonly known as the Arduino IDE.

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.

16
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

Arduino IDE contains the following parts in it:

Text editor:
This is where the simplified code can be written using a simplified version of C++
Programming language.

Message area:
Displays error and also gives a feedback on saving and exporting the code.

Text:
The console displays text output by the Arduino environment including complete error
messages and other information

Console Toolbar:
This toolbar contains various buttons like Verify, Upload, New, Open, Save and Serial
Monitor. On the bottom right hand corner of the window there displays the
Development Board and the Serial Port in use.

FEATURES:

 ATmega328 microcontroller
 Input voltage - 7-12V
 14 Digital I/O Pins (6 PWM outputs)
 6 Analog Inputs
 32k Flash Memory
 16Mhz Clock Speed

17
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

5.1.2 IR Sensor:

 An infrared sensor circuit is one of the basic and popular sensor module in an electronic
device. This sensor is analogous to human’s visionary senses, which can be used to detect
obstacles and it is one of the common applications in real time.
 More in detail an IR transmitter, also known as IR LED, sends an infrared signal
with a certain frequency compatible with an IR receiver which has the task to
detect it.
 IR sensors use infrared radiation of wavelength between 0.75 to 1000µm which falls
between visible and microwave regions of electromagnetic spectrum.
 IR Transmitter acts as source for IR radiation. IR receivers are photo diode and photo
transistors. They are capable of detecting infrared radiation.

An Infrared Sensor works in the following sequence:

 IR source (transmitter) is used to emit radiation of required wavelength.


 This radiation reaches the object and is reflected back.
 The reflected radiation is detected by the IR receiver.
 The IR Receiver detected radiation is then further processed based on its intensity.
Generally, IR Receiver output is small and amplifiers are used to amplify the detected
signal.

18
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

FEATURES OF IR SENSOR :

 IR transmitter
 Ambient light protected IR receiver
 3 pin easy interface connectors
 Indicator LED & Power LED
 Detection distance: 2 ~ 30cm
 Can differentiate between dark and light colours
 Active Low on object detection
 3.3 to 5V operation
 The comparator using LM393, stable

Adjustable detection distance range via potentiometer:

 Clockwise: Increase detection distance


 Counter-clockwise: Reduce detection distance

19
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

5.1.3 MQ2 Smoke Sensor:

 The MQ-2 is a flammable gas and smoke sensor detects the concentrations of
combustible gas in the air and outputs its reading as an analog voltage. The conductivity
of this material is lower in clean air.
 The sensor can measure concentrations of flammable gas of 300 to 10,000 ppm. The MQ-
2 gas sensor is sensitive to LPG, i-butane, propane, methane, alcohol, Hydrogen and
smoke.
 MQ2 is one of the commonly used gas sensors in MQ sensor series. It is a Metal Oxide
Semiconductor (MOS) type Gas Sensor also known as Chemiresistors as the detection is
based upon change of resistance of the sensing material when the Gas comes in contact
with the material. Using a simple voltage divider network, concentrations of gas can be
detected.
 The sensor is actually enclosed in two layers of fine stainless steel mesh called Anti-
explosion network. It ensures that heater element inside the sensor will not cause an
explosion, as we are sensing flammable gases.
 The smoke sensor has a built-in potentiometer that allows you to adjust the sensor
sensitivity according to how accurate you want to detect gas.

20
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

Specifications:-

 Power Supply: 5 Volts

 Interface Type: Analog & Digital

 High Sensitivity to Smoke & combustible gasses like Hydrogen, LPG & Propane.

 Low Cost.

 Stable & Long Life.

 On board Power indication.

VCC supplies power for the module. You can connect it to 5V output from your Arduino.
GND is the Ground Pin and needs to be connected to GND pin on the Arduino.
D0 provides a digital representation of the presence of combustible gases.
A0 provides analog output voltage in proportional to the concentration of smoke/gas.

21
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

5.1.4 BREAD BOARD:

 A Breadboard is a construction base for prototyping of electronics originally


it was literally a breadboard, a polished piece of wood used for slicing bread.

 In the 1970’s the solder less breadboard became available and now a days the
Term “breadboard” is commonly used to refer to these.

 Because the solder less breadboard does not require soldering, it is reusable,
This makes it easy to use for creating temporary prototypes and experimenting
with circuit design.

 A modem solder less breadboard consists of a perforated block of plastic with


numerous tin nickel silver alloy spring clips under the perforations.

 The clips are often called tie points or contact points .The number of the tie
points is often given in the specification of the breadboard.

 The spacing between the clips is typically 0.1 in integrated circuits. In dual in-line
packages (DIPS) can be inserted to straddle the centerline of the block.

 Interconnecting wires and the led’s of discrete components(such as capacitors,


resistors and inductors)can be inserted into the remaining free holes to complete
the circuit.

 Where IC’s are not used ,discrete components and connecting wires may use any
of the holes.

22
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

5.1.5 JUMPER WIRES:

 A jumper wire is an electrical wire or group of them in a cable with a


connector or pin at each end, which is normally used to interconnect the
components of a breadboard or other prototype or test circuit, internally or with
other equipment or components, without soldering.

 Individual jump wires are fitted by inserting their “end connectors “into the
slots provided in a breadboard, the header connector of a circuit board, or a piece
of test equipment.

Male to Male:
These are Jumper wire male to male, used in connecting female header pin of any
development board (like Arduino) to other development board or breadboard.Also you
can combined it with our Female jumper wire to create Male to Female jumper wire.

23
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

Male to Female:
Jumper wire male to female, used in connecting female header pin of any development
board (like Arduino) to other development board having male connector.

5.1.6 DC MOTOR:
A DC Motor is a type of electric motor that converts DC electrical power to mechanical
power i.e. a DC supply is converted to rotation or movement. DC motors are one of the
commonly used motors in different applications like electronic toys, power tools,
portable fans, etc.

Features:

 Although motor gives 500 RPM at 12V, motor runs smoothly from 4V to
12V and gives the wide range of RPM, and torque.
 The shaft has a hole for better coupling.
 Operating Voltage(V): 12
 Rated Torque(kg-cm): 0.7
 Stall Torque(kg-cm): 3

24
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

5.1.7 L293 Driver Module:

A motor driver is a small Current Amplifier whose function is to take a low-current


control signal and then turn it into a higher-current signal that can drive a motor. The
L293D is a typical Motor Driver which can drive 2 DC motors simultaneously. L293D is
a 16-pin IC which can control a set of two DC motors simultaneously in any direction. It
means that you can control two dc motor with a single L293D IC. Dual H-bridge Motor
Driver integrated circuit (IC).

Features:

• Operating Voltage: 7 V to 12V DC.


• 4 channel output (can drive 2 DC motors bidirectionally).
• 600mA output current capability per channel.
• PTR connectors for easy connections.
• User accessible enable pins facility.

5.1.8 Piezo Buzzer:

Piezo buzzer is an electronic device commonly used to produce sound. Light weight,
simple construction and low price make it usable in various applications like car/truck
reversing indicator, computers, call bells etc. Most buzzers produce sound in the range of
2 to 4 kHz.

25
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

Specifications:

o Rated Voltage: 6V DC
o Operating Voltage: 4-8V DC
o Rated current: <30mA
o Sound Type: Continuous Beep
o Resonant Frequency: ~2300 Hz
o Small and neat sealed package

ARDUINO COMPILER:

The project file or the sketches for a project are saved with the file extension .ion

 Features such as cut / copy / paste are supported in this IDE.

 There also is a facility for finding a particular word and replacing it with another by
pressing the Ctrl + F buttons on the keyboard

 The most basic part or the skeleton of all Arduino code will have two functions.

 There are two main parts every sketch will always have, they are:

Void setup ()
Void loop ()

26
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

1) Void setup ():

This is the first routine that begins when the Arduino starts functioning. This
function is executed only once throughout the entire program functioning. The setup
function contains the initialization of every pin we intend use in our project for input
or output. Here is an example of how it should be written

Void setup ()
{
Pin Mode (pin, INPUT);
Pin Mode (pin, OUTPUT);
}

Here the pin is the no. of the pin that is to be defined. INPUT / OUPUT correspond to
the mode in which the pin is to be used.
Void setup ()
{
Serial. Begin (9600);
}

2) Void loop ():

This function is the next important function in the Sketch. It consists of that part of the
code that needs to be continuously executed unlike the part of the code written in the
setup function.

Void loop ()
{
Digital Write (pin, HIGH);
}

27
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

STATECHART DIAGRAM :

5.2 FLOWCHART OF SMOKE SENSOR:

28
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

FOR IR SENSOR:

29
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

5.2.1 How the circuit works:

.
 Initially connect IR sensor1 GND and Vcc to IR2 GND and Vcc respectively i.e.
common connection.
 From IR sensor2 GND and Vcc connect to arduino GND and Vcc respectively.
 Connect IR1 out pin to arduino pin5.
 Connect IR2 out pin to arduino pin6.
 This IR sensor is used to detect the objects and indicates through LED lights. It is a cheap
device. The detection distance is 2 ~ 30cm.
 Connect Red LED on the PCB board with resistor to vary the voltage and connect
arduino pin13 to red Led.
 This red Led will be in on state when it detects the train arrival.
 Connect Green LED on the PCB board with resistor to vary the voltage and connect
arduino pin10 to green Led.
 Now use Buzzer to warn the passengers and road users at the track for indication of train
arrival.
 Connect Buzzer wires one to Gnd and other to the resistor placed on the breadboard and
make connection with arduino by connecting arduino pin9 to the buzzer wire.

30
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

 Using Gear motor for railway gate close and open when it detects the train. Connect the
gear motor to arduino using driver module L293.
 L293D Driver Module is a medium power motor driver perfect for driving DC Motors
and Stepper Motors. It uses the popular L293 motor driver IC. It can drive 4 DC motors
on and off, or drive 2 DC motors with directional and speed control.
 It can drive motors up to 12 V with a total DC current of up to 600mA.
 An L293D has 4 input pins, 4 output pins, 2 enable pins, Vcc and GND. Vcc is the
voltage that it needs for its internal operation. L293D will not use this voltage for driving
the motor.
 The 2 input pins IN1 & IN2 are connected to arduino 11 & 12 pins respectively. The
11th and 12th pin of arduino is used for controlling the direction of rotation.
 The 2 output pins OUT1 & OUT2 are connected to the gear motor.
 Connect adapter positive to gear motor positive wire and adapter negative to gear motor
negative wire for the passage of current to gear motor.
 Then we will connect the MQ2 sensor with the Arduino.
 Connect the VCC and the ground pin of the sensor to the 5V and ground of the Arduino
and the Analog pin of sensor to the A0 of the Arduino.
 The MQ2 sensor can sense LPG, Butane, Propane, Methane, Alcohol & Hydrogen.
 The analog output voltage provided by the sensor changes in proportional to the
concentration of smoke/gas. The greater the gas concentration, the higher is the output
voltage; while lesser gas concentration results in low output voltage .
 We give certain threshold value as a input. If the smoke range is greater than threshold
value then there is an indication that fire accident will occur.
 This will be cautioned to passengers by red led and buzzer alarm sound for alerting them.
 If smoke range doesn’t cross the threshold value the model works as usual.
 This component is useful in saving the lives of passengers in the train.

5.3 CODE EXPLANATION:

The program code is intended to be loaded on an Arduino UNO. In the program code, first the
standard open-source libraries of Arduino for setting up virtual serial communication are
imported. This followed by declaration of variables representing the circuit connections of the
Arduino with the character MQ-2 sensor and IR sensor.

The setup() function is used to initialize the input and output pins of components. This is used to
set input to IR sensor that is object and smoke sensor also acts an input. Leds, motor input pins
and buzzer acts as an output.

The loop () function is called in which the smoke sensor value is read using the
analogRead () function and the value is stored in a variable. It reads the IR sensor value
using the digitalRead() function and the value is stored in a variable.

31
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

Program:

int irsensor1 = 5;
int irsensor2= 6;
int MI1 = 11;
int MI2 = 12;
int led3 = 13;
int led4 = 10;
int buzzer = 9;
int smokeA0 = A0;
int sensorThres = 200;

void setup ()
{
pinMode(irsensor1, INPUT);
pinMode(irsensor2, INPUT);
pinMode(MI1, OUTPUT);
pinMode(MI2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(smokeA0, INPUT);
}

void loop()
{
int readsen = digitalRead(irsensor1);
int readsen1 = digitalRead(irsensor2);
int analogSensor = analogRead(smokeA0);

if(readsen == HIGH && readsen1 == !HIGH )


{
digitalWrite(led4, HIGH);
delay(5000);
digitalWrite(MI1, HIGH);
digitalWrite(MI2, LOW);
delay(10);
tone(buzzer, 1000);
delay(1000);
noTone(buzzer);
delay(50);
digitalWrite(led4, LOW);
}

32
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

else if(readsen == HIGH && readsen1 == HIGH)


{
digitalWrite(MI1, LOW);
digitalWrite(MI2, LOW);

}
else if(readsen == !HIGH && readsen1 == HIGH)
{ digitalWrite(led3, HIGH);
delay(5000);
digitalWrite(MI1, !HIGH);
digitalWrite(MI2, HIGH);
delay(1000);
digitalWrite(led3, LOW);
}

else if(readsen == !HIGH && readsen1 == !HIGH)


{
digitalWrite(MI1, LOW);
digitalWrite(MI2, LOW);
}
if (analogSensor > sensorThres)
{
digitalWrite(led4, HIGH);
tone(buzzer, 1000, 5000);
noTone(buzzer);
}
else
{
digitalWrite(led4, LOW);
noTone(buzzer);
}
delay(100);
}

33
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

5.4 SCREENSHOTS:

34
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

CHAPTER-6

SYSTEM TESTING

Software Testing:

Software testing is the process of evaluation a software item to detect differences between given
input and expected output. Also to assess the features of a software item. Testing assesses the
quality of the product. Software testing is a process that should be done during the development
process. In other words software testing is a verification and validation process.

Verification:

Verification is the process to make sure the product satisfies the conditions imposed at the start
of the development phase. In other words, to make sure the product behaves the way we want it
to.

Validation:

Validation is the process to make sure the product satisfies the specified requirements at the end
of the development phase. In other words, to make sure the product is built as per customer
requirements.

Basics of software testing:

There are two basics of software testing: Blackbox testing and Whitebox testing.

Blackbox Testing:

Black box testing is a testing technique that ignores the internal mechanism of the system and
focuses on the output generated against any input and execution of the system. It is also called
functional testing.

Whitebox Testing:

White box testing is a testing technique that takes into account the internal mechanism of a
system. It is also called structural testing and glass box testing.

Black box testing is often used for validation and white box testing is often used for verification.

35
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

Types of testing:

There are many types of testing like

 Unit Testing
 Integration Testing
 Functional Testing
 System Testing
 Acceptance Testing
 Regression Testing
 Beta Testing

Unit Testing:

Unit testing is the testing of an individual unit or group of related units. It falls under the class of
white box testing. It is often done by the programmer to test that the unit he/she has implemented
is producing expected output against given input.

Integration Testing:

Integration testing is testing in which a group of components are combined to produce output.
Also, the interaction between software and hardware is tested in integration testing if software
and hardware components have any relation. It may fall under both white box testing and black
box testing.

Functional Testing:

Functional testing is the testing to ensure that the specified functionality required in the system
requirements works. It falls under the class of black box testing.

Functional testing is centred on the following items:

Valid Input : Identified classes of valid input must be accepted.

Invalid Input : Identified classes of valid input must be rejected.

Functions : Identified functions must be exercised.

Output : identified classes of application outputs must be exercised.

Systems or Procedures : interfacing systems or procedures must be invoked.

36
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

System Testing:

System testing is the testing to ensure that by putting the software in different environments (e.g.,
Operating Systems) it still works. System testing is done with full system implementation and
environment. It falls under the class of black box testing.

Acceptance Testing:

Acceptance testing is often done by the customer to ensure that the delivered product meets the
requirements and works as the customer expected. It falls under the class of black box testing.

Regression Testing:

Regression testing is the testing after modification of a system, component, or a group of related
units to ensure that the modification is working correctly and is not damaging or imposing other
modules to produce unexpected results. It falls under the class of black box testing.

Beta Testing:

Beta testing is the testing which is done by end users, a team outside development, or publicly
releasing full pre-version of the product which is known as beta version. The aim of beta testing
is to cover unexpected errors. It falls under the class of black box testing.

TESTING OBJECTIVES:

The main objective of testing is to uncover a host of errors, systematically and with
minimum effort and time. Stating formally, we can say
 Testing is a process of executing a program with the intent of finding an error.

 A successful test is one that uncovers an as yet undiscovered error.

 A good test case is one that has a high probability of finding error, if it exists.

 The tests are inadequate to detect possibly present errors.

37
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

CHAPTER-7

CONCLUSION

Automatic gate control system offer an effective way to reduce the occurrence of railway
accidents. This system can contribute a lot of benefit either to the road users or to the railway
management. Since the design is completely automated it can be used in remote villages where
no station master or line man is present. Railway sensors are placed at two sides of gate. It is
used to sense the arrival and departure of the train. This system uses the DC motor to open and
close the gates automatically when it is rotated clockwise or anticlockwise direction. The LCD
display shows the status of the railway gate control system. The system can also generate buzzer
and light indicators while the train passing through the level crossing. So by using this automated
system we can reduce the accidents.

FUTURE ENHANCEMENT:

 In future we can enhance our project by using RFID card reader sensor which detects
the train even in reverse direction.

 We can store the data of train arrival & departure over the cloud by using data
analytics.
 We can create an app about the train status of location.

38
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

BIBILIOGRAPHY

REFRENCES:

1. R. Boopala Venkatesh, K. Kamalanathan, “Microcontroller Based Automatic Railway Gate


Control With Zero Accident,” Vol. 3, Special Issue 2, March 2016.

2. Sayali R. More, Ruchira J. Raut, Rasika K. Tandel, Snehal D. Yendhe, “Intelligent Railway
Crossing Gate Control with High Speed Anti-Collision Alerting System,” .

3. Jeong Y., Choon-Sung Nam, Hee-Jin Jeong, and Dong Shin, “Train Auto Control System
based on OSGI”, International Conference on Advanced Communication Technology, pp.276-
279, 2008.

4. Karthik, Krishnamurthi, Monica Bobby, Vidya V, “Sensor based automatic control of railway
gates”, International Journal of Advanced Research in Computer Engineering & Technology.

WEB REFERENCES:

1. https://www.academia.edu/5914238/IEEE_Automatic_Railway_Gate_Control_System/

2. https://www.ijareeie.com/upload/2016/may/105_22_Arduino.pdf/

3. https://ieeexplore.ieee.org/document/4304240/

4. https://www.electronicshub.org › ... › Embedded › AVR Microcontroller/

39
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

PROJECT WORK MAPPING WITH PROGRAMME OUTCOMES

Pos 1 2 3 4 5 6 7 8 9 10 11 12

Project ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔

PROGRAMME OUTCOMES (POs)


Engineering Graduates will be able to:
1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering
fundamentals, and an engineering specialization to the solution of complex engineering
problems.
2. Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of mathematics,
natural sciences, and engineering sciences.
3. Design/development of solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate
consideration for the public health and safety, and the cultural, societal, and environmental
considerations.
4. Conduct investigations of complex problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities
with an understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to
the professional engineering practice.

40
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

7. Environment and sustainability: Understand the impact of the professional engineering


solutions in societal and environmental contexts, and demonstrate the knowledge of, and need
for sustainable development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
norms of the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or
leader in diverse teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and write
effective reports and design documentation, make effective presentations, and give and receive
clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a member and
leader in a team, to manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for and have the preparation and ability to engage
in independent and life-long learning in the broadest context of technological change.

PROGRAM SPECIFIC OUTCOMES

Student will be able to

1. Organize, maintain and protect IT Infrastructural resources.


2. Design and Develop web, mobile, and smart apps based software solutions to the real
world problems.

41
Gudlavalleru Engineering College
SAFEGUARD AUTOMATION OF RAILWAY USING IOT

PROJECT WORK MAPPING WITH PROGRAMME OUTCOMES AND

PROGRAM SPECIFIC OUTCOMES

Application Product Research Review


Classification
of
Project 

Project Outcomes
Outcome 1 Identify the problem statement by analyzing various
domains.
Outcome 2 Design and implement solutions to the computational
problems by applying engineering knowledge.
Outcome 3 Present technical report by applying different
visualization tools and Evaluation metrics.
Outcome 4 Analyze ethical, environmental, legal and security
issues related to computing projects.

Mapping Table

Project Programme Outcomes (POs) PSOs


Outcomes PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2
Outcome 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1

Outcome 2 3 1 3 2 3 3 2 3 3 3 3 2 3 1

Outcome 3 2 1 1 3 2 2 3 2 2 2 2 3 3 2

Outcome4 1 1 1 3 2 2 2 1 1 1 1 1 2 3

Note: Map each project outcomes with POs and PSOs with either 1 or 2 or 3 based
on level of mapping as follows:
1-Slightly (Low) mapped 2-Moderately (Medium) mapped 3-Substantially (High) mapped

42
Gudlavalleru Engineering College

You might also like