Arduino Based Auto Rail Gate Signal Control System: Daffodil International University
Arduino Based Auto Rail Gate Signal Control System: Daffodil International University
BY
Hafizuddin
ID: 182-15-11763
AND
Md Emrul Hassan
ID: 182-15-11748
Supervised By
Co-Supervised By
This Project titled “Arduino Based Auto Rail Gate Signal Control System”, submitted
by Hafizuddin, ID; 182-15-11763 and Md. Emrul Hasan, ID182-15-11748 to the
Department of Computer Science and Engineering, Daffodil International University, has
been accepted as satisfactory for the partial fulfillment of the requirements for the degree
of B.Sc. in Computer Science and Engineering and approved as to its style and contents.
The presentation has been held on *date*.
BOARD OF EXAMINERS
DECLARATION
2
We hereby declare that, this project has been done by us under the supervision of Md.
Tarek Habib, Assistant Proffesor, Department of CSE Daffodil International
University. We also declare that neither this project nor any part of this project has been
submitted elsewhere for award of any degree or diploma.
Supervised by:
Co-Supervised by:
Submitted by:
Hafizuddin
ID: -182-15-11763
Department of CSE
Daffodil International University
3
ACKNOWLEDGEMENT
First we express our heartiest thanks and gratefulness to almighty God for His divine
blessing makes us possible to complete the final year project/internship successfully.
We really grateful and wish our profound our indebtedness to Md. Tarek Habib, Assistant
Professor, Department of CSE Daffodil International University, Dhaka. Deep
Knowledge & keen interest of our supervisor in the field of “Field name” to carry out this
project. His endless patience ,scholarly guidance ,continual encouragement , constant and
energetic supervision, constructive criticism , valuable advice ,reading many inferior
draft and correcting them at all stage have made it possible to complete this project.
We would like to express our heartiest gratitude to -----, -----, and Head, Department of
CSE, for his kind help to finish our project and also to other faculty member and the staff
of CSE department of Daffodil International University.
We would like to thank our entire course mate in Daffodil International University, who
took part in this discuss while completing the course work.
Finally, we must acknowledge with due respect the constant support and patients of our
parents.
4
ABSTRACT
Nowadays everything becomes digitalized. The main aim of our project is to operate and
control the Railway Gate in the proper manner and digital way in order to avoid accidents
in the level crossing. This Automatic Railway Gate Sensor Control System is an
innovative circuit that automatically controls the operation of Railway Gates detecting
when the Train arrives and when the departure of train at the Gate. The intention of the
project is to achieve automatic control at the level crossings when the arrival in the signal
departure of the train takes place replacing the manual gate control. The first part is the
concern with the hardware development where all Electronic components have included.
IR sensors are the input components while buzzer, servo motor, and LCD display are the
output components. These are controlled by the Arduino Uno R3. It will receive the input
signal from the IR sensors and then sends the information to the gate servo motor driver
for opening the gate and closing the gate. Besides, the output signal Arduino will activate
the LCD display and alarm. The IR sensor is fixed at a certain distance from the gate. The
gate is closed when the train crosses the IR sensor and the gate is opened during some
times. This system deals with one of the efficient methods to avoid train accidents. The
second part is a project based on a software program to operate the hardware structure.
The hardware Device is supported by Arduino programming. The proposed system is
more reliable and cost-efficient. From this project, we’ll know how to implement
automation in railway gate control using Arduino. The application of this project
is the direct implementation in the real world.
5
TABLE OF CONTENTS
CONTENTS PAGE
Board of examiners i
Declaration ii
Acknowledgements iii
Abstract iv
CHAPTER
CHAPTER 1: 11
CHAPTER 2:
2.1 Structure of Bangladesh Railway 15
2.2 Existing Railway Signaling System 16
2.3 Railway developments in Bangladesh 16
17
2.4 Flaws in present System
17
2.5 Effects on Analog Rail Gate Control System in Bangladesh
19
2.5.1 Accidental data of Dhaka Railway Division
21
2.5.2 Accidental data of Bangladesh Railway Division
21
2.6 Importance of Auto Rail Gate Control System
22
24
6
CHAPTER 3: 26
3.1 Proposed System 27
3.2 Proposed System Flowchart 28
3.2.1 Flow chart for train detection 29
3.2.2 Flow chart for obstacle detection
30
CHAPTER 4:
30
4.1 Arduino Uno
31
4.2 Arduino IDE
32
4.3 IR Sensor module
33
4.4 Features
34
4.5 L298N Motor Driver
34
4.5.1 Features:
35
4.6 Servo Motor
35
4.6.1 Features of Servo Motor (SG-90)
36
4.7 I2C LCD Display Module .......
36
4.7.1 Features of I2C LCD Display Module
37
4.8 HC-SR04 Ultrasonic Sensor
37
4.9 Ultrasonic Sensor Pin Configuration
38
4.10 System Design for Train
39
4.11 Flowchart for Train
40
4.12 System Design for Rail Gate
41
4.13 Flowchart for Rail Gate
41
4.14 System Implementation
44
4.15 Arduino Code for Train
45
4.16 Arduino Code for Auto Rail Gate
46
CHAPTER 5: 47
5.1 Result Analysis for Train 48
5.2 Result Analysis for Auto Rail Gate 49
50
5.3 Experimental Results
5.4 Discussion
CHAPTER 6: 52
6.1 Conclusion 52
6.2 Limitation 53
6.3 Comparison 53
7
6.4 Future Development
REFERENCES 54-57
LIST OF FIGURES
FIGURES PAGE NO
Figure 2.1: Train accident 10
Figure 3.1: Functional block diagram 14
Figure 3.2: Block diagram of system 15
Figure 3.2: Proposed System Flowcharts 16
Figure 3.3: Flow chart for train detection 17
Figure 3.4: Flow chart for obstacle detection 18
Figure 4.1: An Ardiuno Uno Board- 20
Figure 4.2: A screenshot from the Arduino IDE software 21
Figure 4.3: IR Sensor module 22
Figure 4.5: L298N motor driver 24
Figure 4.6: Servo Motor 25
Figure 4.7: I2C LCD Display Module 26
Figure 4.8: HC-SR04 Ultrasonic Sensor 27
Figure 4.9: System Design circuit for Train 28
Figure 4.10: Flowchart of Train 29
Figure 4.10: System Design circuit for Rail Gate 30
Figure 4.11: System Flowchart for Rail Gate 31
Figure 4.12: Implementation circuit for train 32
8
Figure 4.13: Implementation circuit for auto rail gate 32
Figure 4.14: Implementation circuit (auto rail gate closed) 33
Figure 4.15: Implementation circuit (auto rail gate open) 33
Figure 5.1: Result analysis for Train 37
Figure 5.2: Serial monitor 38
Figure 5.3: Result analysis for Auto Rail Gate 39
LIST OF TABLES
TABLES PAGE NO
Table 1: Accidental data of Dhaka Railway Division 21
Table 2: Accidental data of Bangladesh Railway Division 21
9
10
Chapter writing style:
CHAPTER 1
Introduction
1.1 Introduction The growing population and flexibility in recent years in Bangladesh
put pressure on road and railway network control. Railway internal communication
system is one of the most selective modes of travel for passengers and for transportation.
Railway communication is presently considered to be environment friendly, comfortable,
and affordable in a densely populated country like Bangladesh. Efficient connectivity is
creating an enabling scenario for business by reducing the cost of transportation.
Realizing the importance of railway communication System is a separate ministry named,
the Ministry of Railways was accustomed on 04 December 2011, and the railway sector
has been given the highest priority in the Perspective Plan of Bangladesh 2010-2021:
11
Making Vision 2021 A Reality and in the Sixth Five Year Plan of Bangladesh A Railway
Master Plan has been the structural way to be implemented in the next 10 years with an
objective of making railway an effective mode of mass transportation and to meet the
peoples’ demand, we can see our Metrorail service. Since the existing system has major
shortcomings, this thesis is the first step in that direction which will meet the goal of the
Ministry of Railways by making a complete automated railway system. Which one is so
much more functional, quicker and easy than that of a human-controlled? This matter
could hardly be solved without upgrading the subsist system, taking need features of
modern technology. In today’s structure, we know the Railway is the cheapest mode of
transportation, and due to manual operation, accidents are likely to happen. The railway
crossing is that area where the rail line intersects with the other vehicle road which is
used by car transportation or other vehicles. To prevent accidents a system named Level
Crossing way has been developed. But in the early days, all the level crossings are
operated by humans. So human interference was mandatory. But manual control is not
erroring free. The manual railway gate is opened or closed by an appointed employee
who was informed from the nearest railway station when the train is arriving. There are
also many level crossings in Bangladesh that are unmanned. So, they are potentially
dangerous for road users. In Bangladesh, we must develop a prototype to be implemented
to automatically control the railway gate upon arrival as well as the departure of the train.
The project is not too expensive but should reliable for use. So we used Arduino Uno
which is quite reliable as well as affordable.
1.2 Level Crossing
A level crossing is an intersection where a railway line crosses a road or path at the same
level, as opposed to the railway line crossing over or under using a bridge or tunnel. The
term also applies when a light rail line with separate right-of-way or reserved track
crosses a road in the same fashion. Other names include railway level crossing, grade
crossing, road through railroad, railroad crossing, train crossing, and RXR.
1.3 History of level crossing
The history of level crossings depends on the location, but often early level crossings had
a flagman in a nearby booth who would, on the approach of a train, wave a red flag or
lantern to stop all traffic and clear the tracks. Gated crossings became commonplace in
12
many areas, as they protected the railway from people trespassing and livestock, and they
protected the users of the crossing when closed by the signalman/gateman. In the second
quarter of the 20th century, manual or electrical closable gates that barricaded the
roadway started to be introduced, intended to be a complete barrier against intrusion of
any road traffic onto the railway. Automatic crossings are now commonplace in some
countries as motor vehicles replaced horse-drawn vehicles and the need for animal
protection diminished with time. Full, half or no barrier crossings superseded gated
crossings, although crossings of older types can still be found in places. New technology
is advancing to create new ways of protecting the railway from users of a level crossing,
with one of the most recent being obstacle detection scanners fitted to some crossings in
Europe. In rural regions with sparse traffic, the least expensive type of level crossing to
operate is one without flagmen or gates, with only a warning sign posted. This type has
been common across North America and in many developing countries.
1.4 Objective
Our main objectives are:
1.5 Motivation
It was decided that a project will be nice as for full filament of the requirement of 4 th
year 2 nd semester project. Nowadays, a number of people die due to human error while
crossing the railway gate. The major errors include no proper control flow of traffic,
manual operation of traffic gates. If mechanism is automatic, the margin of error becomes
less. Hence, can save lives of people through this concept. Using Arduino, We can
emphasis on systematic flow of traffic and therefore avoid tension at junction. Arduino
Based Auto Rail Gate Control System.
1.6 Application
13
Railway safety is the most crucial aspect of railways all over the world. This is the
cheapest mode of transportation all over the world, and therefore, accidents are bound to
happen due to carelessness manual operations. The main application of Arduino Based
Auto Rail Gate Control System is given below:
1.Automatic railway gate control systems reduce the time for which gate remains closed.
2.This type of gates can be employed in an unmanned level crossing where the chances of
accidents is higher and reliable operation is required.
3.Automatic operation prevents errors due to manual operation.
4.The security system of the rail gate will be smart.
5.The rail gate will maintain automatically.
6.Lastly, no human resource is required. This makes its running cost very low compared
to manned gates.
CHAPTER 2
Background Study
14
2.1 Structure of Bangladesh Railway
Bangladesh Railway (reporting mark BR), is the state-owned rail transport agency of
Bangladesh. It operates and maintains the entire railway network of the country. BR is
controlled by the Directorate General of Bangladesh Railway under the Ministry of
Railways along with Bangladesh Railway Authority (BRA) and which works for policy
guidance of BR. Key features of BR are the coexistence of several gauges, Broad gauge,
Meter gauge and dual gauge, and the separation of the system by the Jamuna River
(Brahmaputra) into a Western and Eastern Zone of operations with only one bridge, the
2003 Jamuna Bridge, connecting the two zones. Bangladesh Railway covers a length of
2,855 route kilometers and employs 34,168 people. BR operates international, intercity
and suburban rail systems on its multi-gauge network.
15
2.2 Existing Railway Signaling System
Semaphore signals are the old style signals seen widely throughout the railway network;
where each signal has an assembly with an arm mounted on a mast, where the arm can
move through two or three different positions at different angles, each position providing
a distinct signaling message. Color-light signals are assemblies of lamps that indicate
different messages by means of different colors of lamps that are lighted. Color-light
signals were introduced in 1928 but were slow to take off. In recent years many older
semaphore signals have been replaced by color-light signals. However, both the
Semaphore signals and Color light signals exist in the Bangladesh Railway system, but
the share of Color-light signals has been increasing. There are two types of systems: fixed
and moving block signaling. In a fixed block signaling system, the position of each train
is known only by the block section(s) that it occupies. The separation between trains is
maintained by imposing the restriction that each block section be occupied by at most one
train at a time. Block section lengths, train speeds, and train lengths are, therefore,
important parameters of fixed block signaling. In a moving block signaling system, the
position of each train is known continuously, thus permitting better regulation of the
relative distances. This requires an efficient communication system between line signals,
cabs, and control centers. [3] Presently railway-crossing gates are operated manually. At
the level crossings the railway gates are operated manually by the gate keeper, after
receiving the arrival of a train. After a train starts to leave a particular station, the
stationmaster delivers the message to the next gate and this loops goes on till the train
reach its particular destination. The message is being passed with the help of
telecommunication services. From 1984, Bangladesh Railway went for an advancement
of the telecommunication 17 systems and subsequently laid optical fiber-based digital
telecommunication network as major share of line. The telecommunication network
spans approximately over 1800 km and connects about 250 railway stations. The
telecommunication system provides about 250 train control telephones and the same
number of station-to-station telephones. About 70% of railway networks is under optical
fiber-based communications system [3]. Before that Bangladesh Railway used
telecommunication facilities from Bangladesh Telegraph and Telephone Board (BTTB)
16
up to late eighties. These facilities were landline based, prone to interference and were
unreliable. Even now there is no centralized system which will keep tracks of a train that
could be located centrally
19
in Dhaka city. Most of the unwanted events occur due to the lack of precise control of train
engine, track and traffic gates/rail crossing. Sometimes, in uncontrolled level crossing, obstacle
is present due to traffic jam and human error.
Fig 2.1 Train Accidents
At least 11 people, including a newly married couple, have been killed while five others
injured when a train hit a microbus carrying a bridal party at a level crossing in
Sirajganj's Ullapara upazila. Sirajganj Government Railway Police Station OC Harun
Majumder said: "The incident happened around 6:45 pm on Monday when Dhaka-bound
Padma Express from Rajshahi crashed into the microbus while it was trying to cross the
rail tracks through the level crossing in Panchakroshi area." "The incident left five
passengers of the microbus dead on the spot and seven others injured while four others
died on their way to the hospital. Later, two more injured people died while undergoing
treatment,"
20
2.5.2 Accidental data of Bangladesh Railway Division
22
3.1 Proposed System
Our proposed system is Arduino Based Auto Rail Gate Control System In the proposed
system, sensors are used to detect the train arrival and departure. The System uses three
different sensors to control the rail arrival and departure. Arduino is used for program the
sensors. As shown in functional diagram of our proposed model in Fig. 1. The following
materials and components are used in this proposed system for automatic gateway control
system. The block diagram as shown in Fig. 1, describes the working of our proposed
system. Where an Arduino is used for connecting devices like IR sensor, Servo Motor. In
the Proposed Model the servo motor is used for monitoring of cross Way and IR sensors
is used to detect the motion of objects nearby the crossway, which when detects the train
or motion of any other vehicle nearby the crossway it takes the corresponding action of
whether opening or closing the gateway at the crossing
23
Line following car acts as the train .This line following car normally consists of either
four wheels, two wheels or single wheel. The line following car was designed to follow a
line that may be a physical spot on the floor. The sensor was mounted with the robot in
order to communicate with microcontroller in sensing the line that had drawn by line
tracer on a white surface or vice versa. The project is constructed using an Arduino
Board(UNO) as a microcontroller, two servo motors, 12V DC supply , and car frame.
The block diagram of the system is shown in Figure 2.
24
3.2 Proposed System Flowchart
25
3.2.1 Flow chart for train detection
26
3.2.2 Flow chart for obstacle detection
27
CHAPTER 4
Design
Methodology and
Implementation
28
4.1 Analysis of System Elements
In this experiment we are going to use a different type of elements and they are
explained below:
(a) Arduino Uno board
(b) Arduino IDE software
(c) IR sensor
(d) L298N Motor Driver
(e) Servo Motor
(f) Digital display
(g) HC-SR04 Ultrasonic Sensor Those parts are explained in further value with how to
program them and use them with codes below.
30
31
Some Other Instructions:
Thesis/Project Size: Minimum 30 page limit for Bachelor program
Page Setup: Left- 1.25"
Right-1.25"
Top: 1.0-1.25"
Bottom-1.0-1.25"
Orientation- Portrait
Paragraph Line Spacing: 1.5
Column: Single column
Font: Time New Roman
Header: Bold, Capital letter, Alignment-Center, Font-14
Inner Text: Font-12, Plain text
Reference: Font-10
All references to books, papers, and other publications must be fully and correctly
quoted. There are several methods of quoting references. One is to state the name of the
author and a serial number in the main text with the full details of the reference in the
Reference section of the report, for example:
In the text:
....The analysis of the algorithms has been extensively reviewed by Yorozu et al. [1]
and will ....
[1] Y. Yorozu, M. Hirano, K. Oka, and Y. Tagawa, “Electron spectroscopy studies on magneto-optical
media and plastic substrate interface,” IEEE Transl. J. Magn. Japan, vol. 2, pp. 740–741, August 1987.
Conference/Journal Papers:
32
[1] Author1, Author2, and Author3, “Paper Title”, Conference/Journal, Volume, page number, Month and
year.
Example:
[1] Y. Yorozu, M. Hirano, K. Oka, and Y. Tagawa, “Electron spectroscopy studies on magneto-optical
media and plastic substrate interface,” IEEE Transl. J. Magn. Japan, vol. 2, pp. 740–741, August 1987.
Books:
[2] Author, Book Title, Edition/Volume, Publisher, Year, Page number
Example:
[2] T. H. Cormen, C. E. Leiserson, R. L. Rivest, C. Stein, Introduction to Algorithms, 3rd Edition, The MIT
Press, 2009, pp. 120-122.
Websites:
[3] Name/Title of the Website, available at << https://URL>>, last accessed on Date at Time.
Example:
[3] Learn about Wikipedia, available at << http://www.wikipedia.org/>>, last accessed on 06-06-2019 at
12:00 PM.
33