Designing IA for AI - Information Architecture Conference 2024
Automatic railway gate control using microcontroller
1. AUTOMATIC RAILWAY GATE CONTROL
USING MICROCONTROLLER
PRESENTED BY
PUKESHWAR HARMUKH
VARSHA SAHU
M.Sc. 4th SEM.
6/12/2016 1
2. CONTENTS
Introduction
Aim of project
Block diagram
Working
IR sensor
DC motor
Microcontroller
Tools
Embedded C
Advantages
Disadvantages
Conclusion
Reference6/12/2016 2
3. INTRODUCTION
In the rapidly flourishing country like ours, accidents at
rail road crossing are increasing day by day.
The train accidents cause severe damage to life and
property.
This project deals with one of the efficient method to
avoid train accidents.
6/12/2016 3
4. The main aim of this project is to automize the unmanned railway
gate.
The gate is closed automatically whenever the train comes and is
opened after the train leaves the railway-road crossing
AIM OF THIS PROJECT:-
6/12/2016 4
8. We used 2 sensors in our project sensor 1and sensor 2. The sensor
consists at IR LED and photodiode. In our project we also used 2 DC
motor (DC motor 1 and DC motor 2). The DC motor rotates forward
and reverse direction.
The IR LED emitted IR range light when this light incidence to coming
train the obstacle occurs its reflected back then photodiode detects
the light signal then according to detectors the light signal converts to
electrical signal i.e. the voltage becomes high its high voltage fed to
the microcontroller specified pin. Then the system executed and DC
motor 1 rotates in forward and the DC motor 2 rotates reverse
direction. Then the railway gate closes.
When the train passed out from our project place the photodiode
doesn’t receive any signal then the voltage becomes low and DC
motor 1 rotate reverse and DC motor 2 rotates forward and the railway
gate open.
WORKING:-
6/12/2016 8
10. IR SENSOR
This circuit has two stages: a transmitter unit and a receiver
unit.
(1) IR TRANSMITTER:The IR LED emitting infrared
light is placed in the transmitting unit generate
IR signal.
(2) IR RECEIVER:The receiver unit consists of a
sensor, which detects IR pulses transmitted by IR-
LED.
OBSTACLE DETECTOR
Obstacle detector build is a combination of IR LED and PHOTODIODE
with interfacing of OPM
6/12/2016 10
13. A direct current (DC) motor is a fairly simple electric
motor that uses electricity and a magnetic field to
produce torque, which causes it to turn.
This DC or direct current motor works on the principal,
when a current carrying conductor is placed in a
magnetic field, it experiences a torque and has a
tendency to move.
DC MOTER
6/12/2016 13
15. AVR ATMEGA8 MICRO-CONTROLLER
ATmega8 is a 8-bit microcontroller based on the
AVR RISC architecture
MEMORY SEGMENTS
8K Bytes of Flash program memory.
512 Bytes non volatile EEPROM (Electrically Erasable
Programmable Read Only Memory).
1K Byte Internal RAM (Random Access Memory).
6/12/2016 15
17. Three ports i.e. Port B, Port C, Port D
Three registers associated with every port
DDRx – Data Direction Register
PINx – Port input
PORTx- Port output
‘x’ is subscript and could be either of PORT B, C, D
PORTS
6/12/2016 17
18. Port B is an 8-bit bi-directional I/O port.
Can be used either as a input port or as output
port (direction must be specified in programming).
Port B (PB7..PB0)
Port C (PC6..PC0)
Port C is an 7-bit bi-directional I/O port
Can be used either as a input port or as output
port (direction must be specified in programming).
6/12/2016 18
19. Port D is an 8-bit bi-directional I/O port
Can be used either as a input port or as output port
( direction must be specified in coding).
Port D (PD7..PD0)
6/12/2016 19
23. Examples :-
To make all pins of port A as input pins :
DDRA = 0b00000000;
To make all pins of port A as output pins
DDRA = 0b11111111;
To make lower nibble of port B as output and
higher nibble as input
DDRB = 0b00001111
6/12/2016 23
24. 6/12/2016 24
TOOLS
Compiler : WinAVR/AVR Studio/CodeVision AVR
.
The programmer hardware.
Bread board, wires, power supply, crystal, etc.
25. Embedded C is a nothing but a subset of c language is
compatible with certain microcontrollers.
some features are added some header files like
<avr/io.h>,<until/delay.h>
scanf() and printf() are removed as the inputs are
scanned from the sensors and output are given to the ports.
control structure remain the same like
if statement ,for loop, do while etc.
EMBEDED C
6/12/2016 25
26. *//headers
#include<avr/io.h
//header file for AVR i/o
#include<until/delay.h>
//header file for delay
*// main program
* int main()
{
* while(1)
{code………..]
*return(0);
}
Structure of a c program for an
embedded system :-
6/12/2016 26
27. PROGRAMMING FOR AUTOMATIC RAILWAY
GATE CONTROL PROJECT:-
#include<avr/io.h>
void main()
{
DDRC=0b0000000; //set PORTC as input port
DDRB=0b00011110; //PB1, PB2, PB3, PB4 as output port
int ls=1, rs=1; // define & initialize ls, rs integer as 1 to
// acquire the left sensor status in ls an right sensor
// status in rs
while(1)
// create infinite loop
{
ls=(PINC&0b0000010); //acquire only left sensor status connected at PC1
rs=(PINC&0b0000100); // acquire only right sensor status connected at PC2
6/12/2016 27
28. if((ls==0b0000010)&(rs==0b0000100)) //check sensor status for both sensor ON
{
PORTB=0b00010010; //close gate
}
if((ls==0b0000000)&(rs==0b0000000)) //check sensor status for both sensor OFF
{
PORTB=0b00001100; //open gate
}
if((ls==0b0000000)&(rs==0b0000100))
{
PORTB=0b00010010; //close gate
}
if((ls==0b0000010)&(rs==0b0000000))
{
PORTB=0b00010010; //close gate
}
}
}
6/12/2016 28
29. ADVANTAGES
Prevention of accidents inside the gate.
Reliable machine, which operates the railway gate even
without gatekeeper which makes it useful for operation at
unmanned crossings.
Power supply for the motor operation and signal lights is
required.
Battery which is charged by means of a solar cell can be
used in remote areas where the power supply can’t be
expected.
6/12/2016 29
30. DISADVANTAGES
To establish the entire network it is quite a costly task. Since
these are the issues of the government cost doesn’t matter a
lot.
The Arduino board is a delicate device so it has to be
handled carefully.
6/12/2016 30
31. 6/12/2016 31
Avoids manual errors and provides ultimate
safety to
road users.
Gatekeeper not necessary and automatic
operation of the gate through the motor.
The mechanism works on a simple principle.
CONCLUSION
32. 1. VOLTAGE REGULATOR(7805)
2. RESISTORS ( 100 KΩ, 300KΩ,470Ω ) =5rs
3. CAPACITOR (22PF,104PF ) =5rs
4. CRYSTAL OSCILLATOR(12MHZ) =6rs
5. MICROCONTROLLER ( AVR ATMEGA8 ) =75rs
6. DC MOTOR =40rs
7. 0BSTACLE DETECTOR =40rs
8. TRANSISTOR =8rs
PROJECT COST :- COST OF USED COMPONENT
=10rs
=189rs
6/12/2016 32
INCLUDE OTHER COMPONENTS TOTAL COST IS 900rs