Automatic Railway Gate Control System is a simple but very useful project, which help is automatically opening and closing the railway gate upon detecting arrival or departure of the train.
In general, Railway gates are opened or closed manually by a gate keeper. The information about arrival of train for opening or closing of door is received from nearby station. But some railway crossings are totally unmanned and many railway accidents occur at these unmanned level crossings.
To avoid the human intervention at level crossings completely, we need to automate the process of railway gate control.
We have two different Automatic Railway Gate Control circuits mentioned in this article: using 8051 and AVR.
- Construction and Output Video
- Principle of Operation
- Circuit 1 Automatic Railway Gate Control using 8051
- Circuit 2 Automatic Railway Gate Controller with High Speed Alerting System
Construction and Output Video
Principle of Operation
The principle of operation behind the working of this project lies in the functioning of IR Sensor. A Reflective type IR Sensor is used in this project.
In Reflective Type IR Sensor, the IR transmitter and receiver are placed side by side. When there is no obstacle in front of the sensor, the IR rays transmitted by the IR Transmitter will travel undetected as there are no rays falling on the IR Receiver.
If there is an obstacle in front of the IR Transmitter and Receiver pair, the IR Rays gets reflected off from the surface of the obstacle and are incident on the IR Receiver.
This setup can be configured to detect an object like a Train and in turn can be used to switch ON or OFF the loads like motors with the help of microcontroller.
Circuit 1 Automatic Railway Gate Control using 8051
Circuit Diagram of Automatic Railway Gate Control using 8051
- AT89C51 MCU
- 11.0592 MHz Quartz Crystal
- 2 x 33pF Ceramic Capacitor
- 10µF / 16V Electrolytic Capacitor
- 10KΩ Resistors x 2
- AT89C51 Programmer Board
Sensor and Load Section
- 2 x Reflective Type IR Sensor
- 2 x 1KΩ Resistor
- L293D Motor Driver IC
- An IR sensor is used in this project to sense the arrival and departure of the train.
- An IR Sensor generally comprises of two components: an IR Transmitter and an IR Receiver. An IR Transmitter is a device that emits IR Rays.
- Similarly, an IR Receiver is a device that detects the IR Rays. Photo Diodes are the most commonly used IR Receivers.
- The following image shows the circuit of IR Sensor used in this project.
L293D Motor Driver
L293D is a motor driver IC used in this project to control the gate motor. L293D Motor Drive IC is a dual H-bridge type motor driver and is available in 16-pin Dual in-line Package.
With the help of this motor driver IC, we can control two motors at a time with both forward and reverse direction control for individual motors.
Motor drivers are generally used to drive high current drawing devices like DC Motors, stepper motors, high intensity lights, etc. They act as simple current amplifiers as their input is a low current signal usually from a microcontroller and their output is a high current signal to drive the loads.
Major components of our project are 8051 microcontroller (AT89C51), Reflective Type IR Sensor, L293D Motor Driver IC and a Motor.
The mandatory connections for 8051 MCU include oscillator circuit, reset switch and EA Pin.
A crystal oscillator of up to 20MHz can be used as a source of external clock. In this project, an 11.0592 MHz quartz crystal oscillator is used. To complete the external oscillator circuit, two 33pF capacitors are used. Finally, the EA pin is pulled high using a 10KΩ resistor.
Now, let us see the actual connections required to implement the project. In that, first is the L293D Motor drive. The inputs (IN1 and IN2) to the motor driver (Pins 1 and 2) are given from Port 0 of the microcontroller.
But before connecting them, two 1KΩ resistors are used to pull the Port 0 pins high. Now, connect the motor driver input pins i.e. IN1 and IN2 to first two pins of Port 0 i.e. P0.0 and P0.1.
A motor is connected to OUT pins of the motor driver.
Finally connect two IR sensors to the microcontroller: one for detecting the arrival of the train and one for detecting the departure of the train.
So, connect the data outputs of the IR sensors to the pins P2.6 and P2.7 of the microcontroller.
The working of the project is very simple and is explained here.
- Practically, the two IR sensors are placed at left and right side of the railway gate. The distance between the two IR sensors is dependent on the length of the train. In general we have to consider the longest train in that route.
- Now we’ll see how this circuit actually works in real time. In this image, we can see the real time representation of this project.
- If the sensor 1 detects the arrival of the train, microcontroller starts the motor with the help of motor driver in order to close the gate.
- The gate remains closed as the train passes the crossing.
- When the train crosses the gate and reaches second sensor, it detects the train and the microcontroller will open the gate.
Advantages and Applications
- An Automatic Railway Gate Control is implemented with very simple hardware and easy control.
- Human intervention at level crossings can be removed with the help of this project and many railway level crossing accidents can be prevented.
- The system can be implemented more efficiently by incorporating more efficient sensor network.
- A combination manual wireless control and sensors based control can be used for better operation.
Circuit 2 Automatic Railway Gate Controller with High Speed Alerting System
Automatic Railway Gate Control System with High Speed Alerting System is an innovative circuit which automatically controls the operation of railway gates detecting the arrival and departure of trains at the gate.
It has detectors at the far away distance on the railway track which allows us to know the arrival and departure of the train.These detectors are given to microcontroller which activates the motors which open/close the railway gate correspondingly.
Also Read the Post: Automatic Door Bell With Object Detection
Another feature of this circuit is that it has an intelligent alerting system which detects the speed of the train that is arriving. If the speed is found to be higher than the normal speed, then the microcontroller automatically activates the alarm present at the gate.
This alerts the passengers at the railway crossing on the road about this. Also This circuit has the feature for Identification of train from other intruders i.e, animals etc .This can be implemented in manned level crossings also, as manual errors can be eliminated by automation.
Circuit Diagram of Automatic Railway Gate Controller
The operation of the circuit can be clearly explained as follows. Basically the circuit consists of four IR LED-Photo diode pairs arranged on either side of the gate such that IR LED and photodiodes are on either side of the track as shown in the figure below.
Initially transmitter is continuously transmitting the IR light which is made to fall on the receiver. When the train arrives it cuts the light falling on receiver. Let us assume the train is arriving from left to right, now when the train cuts the 1st sensor pair a counter is activated and when it crosses 2nd sensor pair the counter is stopped. This counter value gives the time period which is used to calculate the velocity of the train.
The sensor2 output is sent to microcontroller which makes the relay activate which causes the gate to be closed. Now when the last carriage of the train cuts the sensor4 microcontroller de-activates the relay and gates are opened.
How does the sensor know the last carriage?
Here as previously mentioned the counter value is used to calculate the velocity of the train, which means that every wheel of the carriage cuts the sensor pair within small fraction of time based on its velocity. After the last carriage is passed there is no obstacle to the sensor pair within that fraction of time hence it knows that the train has left.
One more feature of this circuit is detecting a train accurately i.e, there may be a chance that some obstacle (for e.g some animal) may cut the sensor then in such a case the counter is made to run for certain period of time (this time period is set considering the possible lowest speed of train) if the obstacle does not cut the 2nd sensor before this predefined time then this obstacle is not considered as train and gates remain opened.
Another advantage of calculating the velocity of train is, if the speed of the train crosses a limit i.e, if it is traveling at an over speed then the passengers are alerted using a by activating a buzzer.
The system basically comprises two IR LED – Photodiode pairs, which are installed on the railway track at about 1 meter apart, with the transmitter and the photodiode of each pair on the opposite sides of the track. The installation is as shown in the block diagram. The system displays the time taken by the train in crossing this distance from one pair to the other with a resolution of 0.01 second from which the speed of the vehicle can be calculated as follows:
Speed (kmph) = Distance/Time
As distance between the sensors is known and constant, the time is counted by the microcontroller and from this information, we can calculate the speed.
This circuit has been designed considering the maximum permissible speed for trains as per the traffic rule.
The microcontroller is used to process the inputs that are provided by the sensors and generate the desired outputs appropriately.
Note: Also Read the Post Automatic Washroom Light Switch