INTERNATIONAL JOURNAL OF LATEST TECHNOLOGY IN ENGINEERING,
MANAGEMENT & APPLIED SCIENCE (IJLTEMAS)
ISSN 2278-2540 | DOI: 10.51583/IJLTEMAS | Volume XIV, Issue X, October 2025
www.ijltemas.in Page 8
Microcontroller Based Automatic Railway Crossing Control and
Track Obstacle Monitoring System
M.S.N.L.Narasimha Rao
1
, S. Kumar Swamy
2
, P. Hari Chandana
3
1
Assistant Professor, Dept. of Electrical and Electronics Engineering, Sir C R Reddy College of Engineering, AP
2, 3
UG Students, Dept. of Electrical and Electronics Engineering, Sir C R Reddy College of Engineering, AP
DOI: https://doi.org/10.51583/IJLTEMAS.2025.1410000002
Abstract: In many countries, a significant number of accidents occur at unmanned level crossings, where the lacks of human
supervision and obstacles on the tracks have become serious daily concerns. Traditionally, railway gates are operated manually by
gatekeepers. This paper proposes replacing manual operations with an automated railway gate system utilising Arduino, Sensors,
Servo Motors, Buzzers and GSM modules to eliminate human intervention and reduce accident risk. The system detects trains
and track objects using sensors positioned alongside the tracks. When a train approaches, the gate closes automatically and the
system issues alerts to prevent accidents. Once the train departs, the gate reopens. Compared to manual operation, the automated
gates are closed for a shorter duration. Obstacle detection is achieved in two ways: sensors at the front of the train sense objects
on the track, and detected obstacles are communicated to nearby railway stations via GSM technology. The system employs
infrared sensors to monitor train arrival and departure, ultrasonic sensors for obstacle detection, and Arduino to manage gate
operation and messaging. The automated approach improves safety, efficiency and reliability at rail crossings.
Keywords: Arduino, GSM modem, Obstacle, Infrared sensor, Ultrasonic sensor
I. Introduction
Railway level crossings, where roadways and railway tracks intersect at the same elevation, are critical points of safety concern.
These crossings may be either manned or unmanned, with the latter being more prone to accidents due to human negligence,
delayed gate operations, or shortage of manpower. To reduce such risks, this work presents an automated railway gate control and
obstacle detection system based on simple electronic components and microcontroller technology.
The system employs vibrant sensors mounted on the track to detect the movement of train wheels and notify a microcontroller
(Arduino) of the train’s approach. Once addition, an ultrasonic sensor positioned at the train’s front end continuously monitors for
obstructions on the tracks or the presence of an oncoming train from the opposite direction. Upon detecting an obstacle, the
microcontroller triggers a GSM module that sends immediate warning messages to predefined contacts, enabling timely action.
By automating gate control and integrating real-time obstacle detection with GSM communication, the proposed system
significantly reduces the chances of accidents at level crossings and minimizes the likelihood of train collisions
Rail Accidents Statistics
Fig. 1 Illustrates the percentage of railway accidents in India due to various reasons during 2021.
Railway accidents have numerous underlying causes, but incidents at level crossings represent the highest percentage among
them. Based on recent data, collisions at level crossings and accidents involving pedestrians on tracks account for approximately
67% of all railway-related accidents. These often result from mistakes made by gate operators or the absence of personnel at
unmanned crossings. The adoption of automated gate systems at these intersections can significantly decrease, or even prevent,
such accidents.
INTERNATIONAL JOURNAL OF LATEST TECHNOLOGY IN ENGINEERING,
MANAGEMENT & APPLIED SCIENCE (IJLTEMAS)
ISSN 2278-2540 | DOI: 10.51583/IJLTEMAS | Volume XIV, Issue X, October 2025
www.ijltemas.in Page 9
II. System Architecture
Overview of the proposed System:
Fig 2 System Block Diagram
The Arduino UNO ATMEGA328 serves as the central processor in the automated railway crossing system. It coordinates input
from infrared sensors, which are tasked with detecting when trains approach or leave the level crossing area. For track safety, an
HC SR04 ultrasonic sensor is mounted to identify obstacles ahead. When an obstacle is detected, the system uses a SIM900A
GSM module to notify the nearest railway station, supporting rapid incident response.
Gate operation is handled by a servo motor controlled by the Arduino, allowing automatic opening and closing of barriers in sync
with train movements. Additionally, road users are kept informed through indicator signals LED lights and buzzers activated
by the microcontroller. As soon as a train is sensed to be incoming, the system switches the traffic indicator to red and ensures the
gate remains closed until the railway crossing is clear.
Upon detecting the train’s departure, the controller changes the traffic light to green and activates the servo motor to open the gate
for vehicles.
The fully automated mechanism minimizes manual intervention and helps reduce risks at railway crossings by integrating sensor-
based monitoring and wireless communication.
Function Modules:
The architecture of the system is divided into following primary modules:
a. Train Detection Module
Components: Two pairs of IR transmitter-receiver sensors
Functionality: Vibration Sensor detects train wheels on the track and sends signal to Arduino/Microcontroller
b. Microcontroller Unit
Model used: Arduino UNO (ATMEGA328)
Functionality: Receives input from sensors, processes data, and performs decision-making, and controls the gate motor and
communication modules.
INTERNATIONAL JOURNAL OF LATEST TECHNOLOGY IN ENGINEERING,
MANAGEMENT & APPLIED SCIENCE (IJLTEMAS)
ISSN 2278-2540 | DOI: 10.51583/IJLTEMAS | Volume XIV, Issue X, October 2025
www.ijltemas.in Page 10
Power Supply: 12V regulated DC supply with buck converter for 5V logic level.
c. Gate Control Mechanism
Components: Servo Motor, Buzzer
Control Logic: Operated via relays controlled by microcontroller and automatically lowers gates when train approaches and
raises them after the train passes.
A buzzer is an audio signal device, which may be mechanical, electromechanical or piezoelectric type. It contains a built-in
oscillator, and only need to provide a steady DC voltage to produce a sound.
d. Traffic Signal Integration
Components: Red and Green LED’s
Function: When gate is closed, red signal flash for road traffic. When the gate is open, green signals allow vehicle to proceed.
e. GSM Module
Model used: GSM Modem SIM900A
Control Logic: When an obstacle is detected, the system uses a SIM900A GSM module to communicate over cellular networks
for voice calls, sending messages to the nearest railway station, supporting rapid incident response.
f. Ultra Sonic Sensor
Model used: HC SR04
INTERNATIONAL JOURNAL OF LATEST TECHNOLOGY IN ENGINEERING,
MANAGEMENT & APPLIED SCIENCE (IJLTEMAS)
ISSN 2278-2540 | DOI: 10.51583/IJLTEMAS | Volume XIV, Issue X, October 2025
www.ijltemas.in Page 11
Control Logic: The ultrasonic detector module consists of a transmitter, a receiver and a control circuit. It is used to measure the
distance of the obstacle in front of it. It interfaces with a microcontroller using two primary pins: a trigger pin (output) and an
echo pin (input). The sensor operates at DC voltage of 5V with a current consumption of approximately 15mA. It functions at a
frequency of 40 kHz, with a detection range between 2 centimetres (minimum) and 4 meters (maximum). An ultrasonic wave is
sent from transmitter of the module, and then the wave is reflected back and received at the receiver.
III. Flowchart
Fig 3 Flow chart for automatic railway gate control
At the beginning, the train module which consists of two (IR) transmitter-receiver sensors to detect both the arrival and departure
of the trains. When a train approaches, the train sensor-1 is triggered, sending a ‘HIGH’ signal. This activates the Buzzer and
Light indicators to alert road users, and the gate is ‘CLOSED’ by the servo motor. Once the train departs the crossing, then the
train sensor-1 deactivates, and the train sensor-2 is triggered, and its output goes ‘HIGH’. This signal turns ‘OFF’ the Buzzer and
Light indicators, and the gate is ‘OPENED by the servo motor, allowing normal traffic flow.
Fig 4 Flowchart for obstacle detection system
In the system, an ultrasonic sensor is mounted at the front of the train to detect any obstacles on the track. If an obstacle is
detected, the sensor’s output becomes HIGH’, prompting the train to stop. Simultaneously, a notification about the obstacle is
sent to predefined number with the help of the GSM module at the nearby railway station, and the gate automatically closes via
the servo motor for safety.
IV. Model of Proposed System
INTERNATIONAL JOURNAL OF LATEST TECHNOLOGY IN ENGINEERING,
MANAGEMENT & APPLIED SCIENCE (IJLTEMAS)
ISSN 2278-2540 | DOI: 10.51583/IJLTEMAS | Volume XIV, Issue X, October 2025
www.ijltemas.in Page 12
V. Experimental Results
The proposed system was tested as a working model prototype. It features an 90 cm diameter railway track, a toy train with an
ultra-sonic sensor for obstacle detection and two infrared sensors, a servo motor for gate operation, four LED’s acting as traffic
signals, a GSM modem for message communication, and a buzzer to alert road users.
For gate operation, IR sensors are positioned 35 cm on each side of the crossing. When the toy train triggers the first sensor, the
system activates a RED LED to warn the traffic and closes the gate by using the servo motor. The gate reopens and the LED turns
off once the train’s departure is sensed by the second IR sensor.
Obstacle detection is handled by an ultrasonic sensor mounted at the front of the train. If an obstacle is found on the track, the
system sends a signal to the control room and notifies the nearby railway station via GSM technology. The train’s movement is
managed based on the sensors feedback, ensuring safety and prompt action. The prototype system was constructed and tested
using several key components: an 90 cm diameter railway track, a toy train, two infrared sensors, one ultrasonic sensor, a servo
motor for gate operation, four LEDs as traffic signals, a GSM modem for alerts, and a buzzer for notifications.
VI. Conclusion
The automatic railway gate control system is centered on the idea of reducing human involvement for closing and opening the
railway gate, which allows and prevents accidents near the level crossing. The railway gate is a cause of many deaths and
accidents. Hence, automating the gate can bring about a ring of surety in controlling the gates. Humans may make errors or
mistakes, so automating this process will reduce the chances of gate failures and reduce the errors made by gatekeepers. The
accidents are avoided at places where there is no person to manage the railway crossing gates. Here we use the servo motor to
open and close the gates automatically when it rotates clockwise or counter clockwise to operate the gate automatically.
In the obstacle detection part, the ultrasonic sensor sensed the obstacle, and the train stops as soon as the obstacle detection
message is conveyed to the nearby railway station, as well as to the train operator. So through this system, any obstacle on track
can be detected and an accident can be avoided, and also the message has been conveyed to the concerned.
Future Scope
The accidents due to railway level crossings and the obstacles can be avoided in real time by implementing this system, and the
whole process is completely automatic. In the future, features like wireless system, camera module for real-time video
surveillance, solar-powered version for energy efficiency, AI-based image recognition to detect human/animal on tracks, etc., can
be implemented in the real-time operation.
In the future operations, the vibration sensors can be used in place of IR sensors for the detection of the arrival and departure of
trains. Comparatively, the vibration sensor serves better than IR sensors in real-time. And also, the GPS can be implemented and
interfaced with the circuitry. The GPS ensures that the correct location of the obstacle can be sent to the nearby railway station
through a GSM modem. This helps to get the exact location of the obstacle so that the work for the clearance of the obstacle can
be done faster.
References
1. R. Gopinathan and B. Siva Shankar, “PLC based railway level crossing gate control”, International Journal of Emerging
Technology in Computer Science & Electronics (IJETCSE). ISSN: 0976-1353 Volume 8 Issue 1 April 2014.
2. Pradeep Raj, “Increasing accidents in the unmanned level crossing of the railways”, 2012
3. Xishi Wang, Ning Bin, and Cheng Yinhang, “A new microprocessor based approach to an automatic control system.
“International Symposium on Industrial Electronics, PP.842-843, 1992
4. 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.
5. Sangita N.Guja, Jagruti R. Panchal, Lalita K.Wani, “Improving safety with obstacle detection and track following car
using sensor, GPS and GSM”, International Journal of Research in Engineering and Technology.
www.arduino.cc/reference
INTERNATIONAL JOURNAL OF LATEST TECHNOLOGY IN ENGINEERING,
MANAGEMENT & APPLIED SCIENCE (IJLTEMAS)
ISSN 2278-2540 | DOI: 10.51583/IJLTEMAS | Volume XIV, Issue X, October 2025
www.ijltemas.in Page 13
6. Karthik, Krishnamurthy, Monica Bobby, Vidya V, Sensor based automatic control of railway gates”, International
Journal of Advanced Research in Computer Engineering & Technology.
7. KSCSE, KSCSE library: “Railway track monitoring system”, project report.
8. Ministry of Railways, Government of India, “Yearly report on accidents at unmanned railway crossings”, 2022 [Online],
Available: https://indianrailways.gov.in/
9. J. Banuchandar et al., “Automated unmanned railway level crossing system”, Int.J. Mod. Eng. Res., vol. 2, no. 1, pp. 458
469, 2012.
10. A. Waghware, H. Ghate, G. Maske, and P. Kurzekar, “Automatic railway gate controlling and smart system of railway
gate crossing using IoT”, Recent trends Inf. Technol. Appl., vol.3, no.1, pp.48-54, 2020.
11. P. Sikora et al., “Artificial intelligence-based surveillance system for railway crossing traffic”, IEEE Sens. J., vol.21,
no.14, pp.15515-15526, 2021
12. H. Dong, B. Ning, B. Cai, and Z. Hou, “Automatic train control system development and simulation for high-speed
railways”, IEEE Circuits Syst. Mag., vol.10, no.2, pp.6-18, 2010.
13. S. Mahmud, I. R. Emon, and M. M. Billah, “Automated railway gate controlling system”, Int.J. Comput. Trends
Technol., vol.27, no.1, pp.1-4, 2015.
14. G. Ashok et.al., “Automated rail gate control using Arduino”, EPRA Int.J. Res. Dev., vol.7, pp.146-151, 2021
15. R. S. Rajput and R. M. Patrikar, “Design and development of intelligent railway crossing control system using Arduino
and GSM, Mater. Today Proc., vol. 56, pp. 30713077, 2022, doi: 10.1016/j.matpr.2021.11.426.
16. A. S. Sekhon and S. Singh, “Smart railway crossing gate control system using IoT and cloud,” J. Phys. Conf. Ser., vol.
1706, p. 012157, 2020, doi: 10.1088/1742-6596/1706/1/012157.
17. A. Qayyum, M. Usama, and M. I. Khalil, “A low-cost railway crossing safety mechanism using ultrasonic and IR
sensors,” in Proc. Int. Conf. Commun. Technol. (ICCT), 2021, pp. 15, doi: 10.1109/ICCT52961.2021.9498090.
18. S. Ravindran, A. S. Bhanu, and A. R. Alagarsamy, “Real-time monitoring and intelligent traffic control system for
railway crossings,” Eur. J. Mol. Clin. Med., vol. 7, no. 11, pp.22772282, 2020
19. M. F. Arshad and H. Bin Zia, “A vision-based system for unmanned level crossing monitoring using machine learning,”
Sensors, vol. 21, no. 12, p. 4173, 2021, doi: 10.3390/s21124173.
20. R. K. Raut, R. S. Pawar, and M. S. Joshi, “Smart railway level crossing system using wireless communication and
sensors,” Int. Res. J. Eng. Technol. (IRJET), vol. 7, no. 5, pp. 3489 3493, 2020.
21. R. Mahmud and A. Sarker, “RFID-based intelligent railway gate control system,” Int. J. Sci. Eng. Res., vol. 9, no. 6, pp.
132136, Jun. 2018.
22. M. Khan, H. Singh, and A. K. Rathore, “Automated railway gate system using GSM and microcontroller,” Int. J. Recent
Trends Eng. Technol., vol.30, no.1, pp.1518, 2019
23. S. Biswas and P. Pal, “Smart vision-based railway crossing surveillance and alert system,” Int. J. Emerg. Technol. Adv.
Eng., vol. 10, no. 5, pp. 4246, May 2020.
24. A. K. Dewangan, M. Gupta, and P. Patel, “Automation of railway gate control using micro-controller,” Int. J. Eng. Res.
Technol., vol. 1, no. 1, pp. 18, 2012.