Automatic Railway Gate Control System Using Arduino, IR Sensor

Share This

Hello friends! Welcome back to ElectroDuino. This blog is base on How to Make Automatic Railway Gate Control System Using Arduino, IR Sensor & servo motor. Here we will discuss Introduction to Automatic Railway Gate Control System, Project Concept, Block Diagram, components required, circuit diagram, working principle, and Arduino code.

Introduction

Railway Gate is very essential for security purposes. If there has any defect in the system it will damage one or more life. Every year thousands of accidents occur on railway crossings and thousands of people are dying. Here we are making a circuit by which the Gate will be operated by itself. This project will make the system more reliable and precise.

Project Concept

The Automatic Railway Gate Control System project concept is very simple. The key components of the project are the IR sensor, Arduino microcontroller, servo motor, LEDs, and Buzzer.

In this project, two IR Sensor works like the eyes of the project. It detects the train position. Two Servo motors are used to open and close the railway crossing gate. Also, we will use the Arduino microcontroller board, which is the brain of the project. It controls the whole system. Finally, LEDs and buzzer are used as an indicator.

When one of the IR sensors detects the train the system closes the gate automatically and indicated by the red LED and buzzer. When the sensors are doesn’t detect the train, then the system will be open the gate automatically and indicated by the green LED.  

Block Diagram

Automatic Railway Gate Control System Block Diagram
Automatic Railway Gate Control System Block Diagram

Components Required

Components NameQuantity
Arduino Nano1
IR Sensor Module 2
Sg-90 Servo Motor 2
150-ohm Resistor 2
Red LED (D1 & D2)2
Green LED (D3 & D4)2
Buzzer1
Toggle or Slide switch 1
9-volt Battery with Battery Connector 1

Circuit Diagram of Automatic Railway Gate Control System Using Arduino

Circuit Diagram of Automatic Railway Gate Control System Using Arduino
Circuit Diagram of Automatic Railway Gate Control System Using Arduino

Circuit Wiring

Components PinArduino Pin
9-v battery positive(+) terminalVIN Pin through the slide-switch(SW1)
9-v battery negative(-) terminalGND(ground) Pin
IR Sensor 1, 2 and Servo motor 1, 2 Vcc Pin5v pin
IR Sensor 1, 2 and Servo motor 1, 2 GND PinGND (ground) pin
IR Sensor 1, 2 OUT PinAnalog pins A1 and A2 serially
Servo motor 1, 2 PWM PinDigital pin D5 and D6 serially
Buzzer positive terminalDigital pin D3
LED D1 & D2 Positive terminalLED D1 & D2 Positive terminals are shorted and connected to the Digital pin D11 Pin through The Resistor(R1)
LED D3 & D4 Positive terminalLED D3 & D4 Positive terminals are shorted and connected to the Digital pin D12 Pin through The Resistor(R2)
Buzzer and LED D1, D2, D3 & D4 ground terminalGND (ground) pin

Working of Automatic Railway Gate Control System

First of all, we need to place the components correct position for the perfect work of the system. Two IR sensors are placed on both sides of level crossings and the distance between the two IR sensors is dependent on the length of the train. Two Servo motors are placed on both sides of the railway track.

When the train comes in front of the IR sensor-1. Then IR sensor-1 detects the arrival of the train. So, the sensor-1 output goes LOW(0). But, the other side the IR Sensor-2 output is HIGH (1) because this time sensor-2 does not detect the tarin. When the Arduino gets this signal from two sensors, then the Arduino sends the PWM signal to the servo motors. As a result, servo motors start working and close the gate. At the time, the Arduino sends commands to turn on Red LED and buzzer starts to generate beep sound, it means that the train is coming.

When the train crosses the level crossing and the train comes in front of the IR sensor-2. Then IR sensor-2 detects the arrival of the train. So, the sensor-2 output goes LOW(0). But, the other side the IR Sensor-1 output is HIGH (1) because this time sensor-1 does not detect the tarin. When the Arduino gets this signal from two sensors, then again the Arduino sends the PWM signal to the servo motors. As a result, servo motors back to the first position, and automatically open the gate. This time Green LED will turn on and the buzzer will stop, it means that the train is gone.

When IR sensor 1 and IR sensor 2 does not detect train, then the output of the sensor is High (1). In this condition, the gate is open and the Green LED will turn on and the buzzer will stop, it means that the train does not come.

Arduino Code for Automatic Railway Gate Control System

 

Share This

Leave a Reply

Your email address will not be published. Required fields are marked *