Anda di halaman 1dari 5

Ahsanullah University of Science and Technology

Project Report:

Group Number: 15
ID: 12.02.05.145
12.02.05.134
Re-Add-12.01.05.036
Re-Add-12.01.05.104

Date of Submission: 22.07.2014

Automatic Railway Gate Control System


Introduction:
I am trying to make automatic Railway Gate control system using Arduino Uno micro
controller. Gates will close automatically when train arrival and open when train departure
from crossing. The main purpose of this project is to avoid accidents and save time
This project utilizes Two IR Tx./Rx. Pair is placed at either side of the gate with some
distance as shown in the pic above. When train cuts first sensor light signal Red and railway
gate will closed. When train cuts second sensor then a light signal Green and gates will
open. You can easily measure this timing for your toy train.
I design circuit using Arduino Uno microcontroller.IR sensors output is connected to
comparator LM324.LM324 generates TTL High/Low signal at its output pins which is fed to
MCU's pins as Input. According to input from LM324 Micro-controller take action.One DC
Motors is used for controlling the gate, these motor's current requirement is much more
then MCU hence we need a Motor Driver IC L293D.

Required Components:
1. DC Geared Motors RPM:30 - 1
2.IR Tx./Rx. Pairs - 2
3. MCU Arduino Uno - 1
4. IC-LM324 - 2
5.IC-L293D - 1
6. Registers 470E - 4, 10K-4
7. Some LED's : 1- Green, 1-Red
8. 9Volt Battery
12. Some wires, burg strips etc.

Circuit Diagram:

Using Software:
arduino-1.5.7-windows

Code:
int before = 4; // input from first IR and will connect to Digital PIN no. 4 of ARDUINO
int after = 7; // input from first IR and will connect to Digital PIN no. 7 of ARDUINO

intmotorL = 2; // connect arduino digital pin no. 2 with the pin no. 2 of L293D
intmotorR = 9; // connect arduino digital pin no. 9 with the pin no. 7 of L293D
void setup()
{
pinMode(before, INPUT);
pinMode(motorR, OUTPUT);
}
void loop()
{
if(digitalRead(before)==LOW)
{
digitalWrite(motorL, HIGH);
if(digitalRead(before)==HIGH)
{
digitalWrite(motorL, LOW);
}
}
if(digitalRead(after)==HIGH)
{
digitalWrite(motorR,LOW);
if(digitalRead(after)==LOW)
digitalWrite(motorR, HIGH);
}
}

Discussion:
In this project there have some trouble shoot in our working procedure. We am facing many problems
thats have we had not sufficient power supply for biasing and for motor driver. Another problem was
the IR_TX/IR_RX pair problems.
There have some limitation in this project. Thats are: In Practical The train compartment junction have
some space and if the train gate or windows are open then these IR pair does not give the smooth
signal so the gate should be facing some trouble.
If we get chance to moderate it, we will add Buzzer and timer for setting up warning and time limit to
close and open this gate. And for IR pair problem we will use frequency system.