Project by
Mebin P M
Puthencurz,Kerala

This is a simple project to beginners in the field of electronics.Automatic railway gate control is highly economical microcontroller based arrangement, designed for use in almost all the unmanned level crossings in the country 

   By employing the automatic railway gate control at the level crossing the arrival of train is detected by the sensor placed on either side of the gate at about 5km from the level crossing. Once the arrival is sensed , the sensed signal is sent to the microcontroller and it gives signal motor(gate) to close.

Subsequently, buzzer indication and light signals on either side are provided to the road users indicating the closure of gatesThe departure of the train is detected by sensors placed at about 1km from the gate. The signal about the departure is sent to the microcontroller, which in turn operates the motor and opens the gate.

 

The main components required are arduino uno, l293D IC, LM324 IC, 100 RPM DC motor,pair of ir leds & sensors, red & green leds

Here the working is ir sensor is connected to the lm324 inputs, whenever the train passes in between the ir sensor & led it gives a low signal.Out of lm324 is fed to one of the digital pins of arduino(D5). Whenever the D5 pin is low, you will turn a motor(gate) for small delay time to close the gate & turn on the red led to warn & off green led. This is the case for the arrival. Repeat the same for departure.Turn on the green led & turn off red led.

Arduino Code

int a,d;

void setup()
{pinMode (2,INPUT);//to set pin 2 as input(ir sensor1)
pinMode (5,INPUT);//to set pin 5 as input(ir sensor2)
pinMode (11,OUTPUT);//to control motor
pinMode (12,OUTPUT);//to control motor

pinMode (7,OUTPUT);//to blink the led1

pinMode (8,OUTPUT);//to blink the led2

digitalWrite(0,HIGH);to enable the motor1

}
void loop()
{
  a=digitalRead(2);//read the value of ir sensor1
  if(a==LOW)
  
    {digitalWrite(11,HIGH);//to close the gate(motor)
    digitalWrite(12,LOW);
    delay(1000);
      digitalWrite(7,HIGH);//blink red led
    digitalWrite(8,LOW);//off green led
    
    
    delay(100);
    
    digitalWrite(7,LOW);
    digitalWrite(8,LOW);
    
    
  delay(1000);
}
  d=digitalRead(5);//read the value of ir sensor2
  if(d==LOW)

    {
      digitalWrite(11,LOW);//to open the gate(motor)
      digitalWrite(12,HIGH);
      delay(1000);
      digitalWrite(8,HIGH);//blink green led
    digitalWrite(7,LOW);//off red led
    
    delay(100);
    
    digitalWrite(7,LOW);
    digitalWrite(8,LOW);
    
    
delay(1000);
}}
    
    
    
  

  
  

User Review (1)

BASIL VARGHESE   Kerala

Nice idea

Reply  Report Abuse   18 February,2015 12:02
Related Items