Automatic Railway Gate

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 26

Index

Sr. No. Name of The Topic Page No.


1 Acknowledgement 2
2 Introduction 3
3 Block Diagram 4
4 Circuit Diagram 5
5 Working 7
6 Components 8
7 Applications 28
8 Result and Conclusion 29
9 Reference 30

Automatic Railway Gate Page1


Acknowledgement

We have great pleasure to convey our gratitude to


_____________ Principal, ___________Collage, _________ for
permitting to do the mini project.
We express our heartiest gratitude and respectful regards to
_____________Head of the Department of _____________,
_____________Collage, _____________ for his support and
encouragement while doing the mini project.
We express our profound sense of gratitude to our internal
guide _____________, Associate Professor of Physics department for
his valuable guidance, constructive criticism and consistent
enthusiastic interest during the course of investigation and writing of
manuscript that led this work to its successful completion.
We regard our sincere thanks to the technical staff that helped
us during the project and made our project successful.
Last but not the least our special thanks to our Parents and
friends for their support and constant encouragement during the
project work.

_____________

Automatic Railway Gate Page2


Introduction

Many times accidents are happening not only in on the rod due
to cars or trucks but also rail gate bye railway. This happen due to
improper closing of railway gate, carelessness of railway gate
operator or many reasons hence this accidents are happen. No one
technology’s are available in the railway gate where these accidents
are prevented. The options provided by technicians are much
expensive and not easy to handle the operating by any person easily.
To solve this problem ‘Automatic Railway Gate’ this project
can be used. In this project we use very low number of components
and hence it is less expensive, very sensitive and reduce human
interference on railway gate hence this more secure reliable and
applicable to all railway gates in all environment.
Main concept of this project is that when some railway in come
near to any railway gate sense the presence of this railway and
automatically closes the gates. And also mention which railway is
coming using Buzzer. For all this operation we use ultrasonic module
having rage up to 2 meters. When railway is come automatically gates
are closed.

When railway is passing through the gate automatically railway


gate are open for normal vehicles.

Automatic Railway Gate Page3


Block Diagram

Servo Railway
IR Sensor Atmega328
Motor Gate

Automatic Railway Gate Page4


Circuit Diagram

Automatic Railway Gate Page5


Working

In this project input as device Ultrasonic sensor is used. This sensor has
4 pins name as VCC, ECHO, TRIG and GND. This sensor is work on the
principle of echo location. When this sensor get trigger pulse of 10 micro-
second it fire 8 pulses of frequency 40 KHz hence it is called as ultrasonic.

After transmitting these ultrasonic waves the echo pin of this sensor is
goes to logic high level. Until the echo wave is come this pin is at high state,
when echo wave is received by the ultrasonic receiver then this pin is goes to
logic low level.

At the end we get a pulse form the ultrasonic sensor. The width of this
pulse is directly proportional to the distance which is covered by the ultrasonic
waves.

Now to count the width of this pulse microcontroller Atmega328 is


used. In this a pulse width counting program is burned on it. After calculating
the width of this pulse it is converted into distance when distance is more than
set distance then no action is tacked but if distance is less than set point then
Arduino output is activated which is connected to gate servo motor.

Is thin is come which is detected by the ultrasonic sensor then gate


motor is move downward side hence gate of railway crossing is closed then
when train is move forward and cross the railway gate then microcontroller give
signal to motor to up the gate. At same time buzzer is sounding for audio
indication.

Automatic Railway Gate Page6


Components

 ATmega328

Introduction

The Atmel ATmega8A is a low-power CMOS 8-bit microcontroller


based on the AVR enhanced RISC architecture. By executing powerful
instructions in a single clock cycle, the ATmega8A achieves throughputs close
to 1MIPS per MHz. This empowers system designer to optimize the device for
power consumption versus processing speed.

Features

• High-performance, Low-power Atmel AVR 8-bit Microcontroller

• Advanced RISC Architecture

– 130 Powerful Instructions - Most Single-clock Cycle Execution

– 32 x 8 General Purpose Working Registers

– Fully Static Operation

– Up to 16MIPS Throughput at 16MHz

– On-chip 2-cycle Multiplier

• High Endurance Non-volatile Memory segments

– 8KBytes of In-System Self-programmable Flash program memory

– 512Bytes EEPROM

– 1KByte Internal SRAM

Automatic Railway Gate Page7


– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM

– Data retention: 20 years at 85°C/100 years at 25°C(1)

– Optional Boot Code Section with Independent Lock Bits

• In-System Programming by On-chip Boot Program

• True Read-While-Write Operation

– Programming Lock for Software Security

Automatic Railway Gate Page8


Block Diagram

Automatic Railway Gate Page9


Pin Diagram

Automatic Railway Gate Page10


Pin Descriptions

VCC

Digital supply voltage

GND

Ground

Port B (PB7:PB0) – XTAL1/XTAL2/TOSC1/TOSC2

Port B is an 8-bit bi-directional I/O port with internal pull-up resistors


(selected for each bit). The Port B output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port B pins
that are externally pulled low will source current if the pull-up resistors are
activated. The Port B pins are tri-stated when a reset condition becomes active,
even if the clock is not running. Depending on the clock selection fuse settings,
PB6 can be used as input to the inverting Oscillator amplifier and input to the
internal clock operating circuit. Depending on the clock selection fuse settings,
PB7 can be used as output from the inverting Oscillator amplifier. If the Internal
Calibrated RC Oscillator is used as chip clock source, PB7:6 is used as
TOSC2:1 input for the Asynchronous Timer/Counter2 if the AS2 bit in ASSR is
set. The various special features of Port B are elaborated in Alternate Functions
of Port B and System Clock and Clock Options.

Port C (PC5:PC0)

Port C is a 7-bit bi-directional I/O port with internal pull-up resistors


(selected for each bit). The Port C output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port C pins
that are externally pulled low will source current if the pull-up resistors are

Automatic Railway Gate Page11


activated. The Port C pins are tri-stated when a reset condition becomes active,
even if the clock is not running.

PC6/RESET

If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note


that the electrical characteristics of PC6 differ from those of the other pins of
Port C. If the RSTDISBL Fuse is un-programmed, PC6 is used as a Reset input.
A low level on this pin for longer than the minimum pulse length will generate a
Reset, even if the clock is not running. The minimum pulse length is given in
Table 30-5. Shorter pulses are not guaranteed to generate a Reset. The various
special features of Port C are elaborated in Alternate Functions of Port C.

Port D (PD7:PD0)

Port D is an 8-bit bi-directional I/O port with internal pull-up resistors


(selected for each bit). The Port D output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port D pins
that are externally pulled low will source current if the pull-up resistors are
activated. The Port D pins are tri-stated when a reset condition becomes active,
even if the clock is not running. Port D also serves the functions of various
special features of the ATmega8A as listed in Alternate Functions of Port D.

RESET

Reset input. A low level on this pin for longer than the minimum pulse
length will generate a reset, even if the clock is not running. The minimum
pulse length is given in Table 30-5. Shorter pulses are not guaranteed to
generate a reset.

Automatic Railway Gate Page12


AVCC

AVCC is the supply voltage pin for the A/D Converter, Port C (3:0), and
ADC (7:6). It should be externally connected to VCC, even if the ADC is not
used. If the ADC is used, it should be connected to VCC through a low-pass
filter. Note that Port C (5:4) use digital supply voltage, VCC.

AREF

AREF is the analog reference pin for the A/D Converter.

ADC7:6 (TQFP and QFN/MLF Package Only)

In the TQFP and QFN/MLF package, ADC7:6 serve as analog inputs to


the A/D converter. These pins are powered from the analog supply and serve as
10-bit ADC channels.

Automatic Railway Gate Page13


HC-SR 04 ultrasonic module:

HC-SR04 is an ultrasonic ranging module designed for embedded


system projects like this. It has a resolution of 0.3cm and the ranging distance is
from 2cm to 500cm. It operates from a 5V DC supply and the standby current is
less than 2mA. The module transmits an ultrasonic signal, picks up its echo,
measures the time elapsed between the two events and outputs a waveform
that’s high time is modulated by the measured time which is proportional to the
distance. The photograph of an HC-SR04 module is shown below.

The supporting circuits fabricated on the module makes it almost stand


alone and what the programmer need to do is to send a trigger signal to it  for
initiating transmission and receive the echo signal from it for distance
calculation. The HR-SR04 has four pins namely Vcc, Trigger, Echo, GND and
they are explained in detail below.

Automatic Railway Gate Page14


Features:

1. resolution of this module 3mm


2. ranging distance is 2cm to 400cm
3. angle measurement is 30 degrees
4. trigger input pulse width is 10us
5. required current 15mA
6. Frequency 40 KHz

Pin Configuration:

 Vcc:  This pin is connected to the positive 5V DC


 Trigg: The trigger signal is applied to this pin for starting the
transmission. This signal must be HIGH for 10us. When a valid
trigger signal is applied, it generates 8 pulses of 40 KHz.
 Echo: At this pin, module generates the signal whose time period is
proportional to distance.
 GND:  This pin is connected to the ground.

Automatic Railway Gate Page15


HC-SR04 timing diagram:

From the timing diagram, you can see that the 40KHz pulse train is
transmitted just after the 10uS triggering pulse and the echo output is obtained
after some more time. The next triggering pulse can be given only after the echo
is faded away and this time period is called cycle period. The cycle period for
HC-SR04 must not be below 50mS. According to datasheet, the distance can be
calculated from the echo pulse width using the following equations.

Distance in cm = echo pulse width in uS/58


Distance in inch = echo pulse width in uS/148

How to Operate this Ultrasonic Rangefinder Circuit?

1. Initially burn the program to the microcontroller


2. Now give the connections as per the circuit diagram

Automatic Railway Gate Page16


3.  While giving the connections make sure that Vcc of ultrasonic module is
connected to 5V DC
4. Switch on the board supply
5. Place the obstacle in front the ultrasonic module, now you can observe the
distance on LCD.
6. Switch off the board supply.

Ultrasonic Rangefinder Project Circuit Applications:

 Used to measure the obstacle distance.


 This system used in automotive parking sensors and obstacle warning
systems.

 Used in terrain monitoring robots.

Limitations of the Circuit:

 This system is not able to measure longer distances.

Automatic Railway Gate Page17


Servomotors

Definition:

A servo motor is a rotary actuator or a motor that allows for a precise control in terms
of the angular position, acceleration, and velocity. Basically it has certain capabilities that a
regular motor does not have. Consequently it makes use of a regular motor and pairs it with a
sensor for position feedback.

Mechanism of servomotor:

Basically a servo motor is a closed-loop servomechanism that uses position feedback


to control its motion and final position. Moreover the input to its control is a signal (either
analogue or digital) representing the position commanded for the output shaft. The motor is
incorporates some type of encoder to provide position and speed feedback. In the simplest
case, we measure only the position. Then the measured position of the output is compared
with the command position, the external input to controller. Now If the output position differs
from that of the expected output, an error signal generates. Which then causes the motor to
rotate in either direction, as per need to bring the output shaft to the appropriate position. As
the position approaches, the error signal reduces to zero. Finally the motor stops. The very
simple servomotors can position only sensing via a potentiometer and bang-bang control of
their motor. Further the motor always rotates at full speed. Though this type of servomotor
doesn’t have many uses in industrial motion control, however it forms the basis of simple and
cheap servo used for radio control models. Servomotors also find uses in optical rotary
encoders to measure the speed of output shaft and a variable-speed drive to control the motor

Automatic Railway Gate Page18


speed. Now this, when combined with a PID control algorithm further allows the servomotor
to be in its command position more quickly and more precisely with less overshooting.

Working of servomotors:

Servo motors control position and speed very precisely. Now a potentiometer can
sense the mechanical position of the shaft. Hence it couples with the motor shaft through
gears. The current position of the shaft is converted into electrical signal by potentiometer,
and is compared with the command input signal. In modern servo motors, electronic encoders
or sensors sense the position of the shaft .We give command input according to the position
of shaft. If the feedback signal differs from the given input, an error signal alerts the user. We
amplify this error signal and apply as the input to the motor, hence the motor rotates. And
when the shaft reaches to the require position. Error signal become zero, and hence the motor
stays standstill holding the position. The command input is in form of electrical pulses. As
the actual input to the motor is the difference between feedback signal (current position) and
required signal, hence speed of the motor is proportional to the difference between the current
position and required position. The amount of power require by the motor is proportional to
the distance it needs to travel.

Automatic Railway Gate Page19


LM7805 (Voltage Regulator)

Pin Diagram

Description:
The KA78XX/KA78XXA series of three-terminal positive
regulator are available in the TO-220/D-PAK package and with
several fixed output voltages, making them useful in a wide range of
applications. Each type employs internal current limiting, thermal
shut down and safe operating area protection, making it essentially
indestructible. If adequate heat sinking is provided, they can deliver
over 1A output current. Although designed primarily as fixed voltage
regulators, these devices can be used with external components to
obtain adjustable voltages and currents.

Automatic Railway Gate Page20


A voltage regulator is designed to automatically maintain
a constant voltage level. A voltage regulator may be a simple "feed-
forward" design or may include negative feedback control loops. It
may use an electromechanical mechanism, or electronic components.
Depending on the design, it may be used to regulate one or
more AC or DC voltages.

Electronic voltage regulators are found in devices such as


computer power supplies where they stabilize the DC voltages used
by the processor and other elements. In automobile alternators and
central power station generator plants, voltage regulators control the
output of the plant. In an electric system, voltage regulators may be
installed at a substation or along distribution lines so that all
customers receive steady voltage independent of how much power is
drawn from the line.
Pin Configuration:

Pin Function Name


No

1 Input voltage (5V-18V) Input


2 Ground (0V) Ground
3 Regulated output; 5V (4.8V-5.2V) Output

Automatic Railway Gate Page21


Piezo Buzzer:

The piezo buzzer products sound based on reverse of the piezoelectric


effect. The generation of pressure variation or strain by the application of
electric potential across a piezoelectric material is the underlying principle.
These buzzers can be used alert a user of an event corresponding to a switching
action, counter single or sensor input. They are also used in alarm circuits.

The buzzer produces a same noisy sound irrespective of the voltage


variation applied to it. It consists of piezo crystals between two conductors.
When a potential is applied across these crystals, they on one conductor and pull
on the other. This, push and pull action, results in a sound save. Most buzzers
produce sound in the range of 2 to 4 kHz. The Red lead is connected to the input
and the black lead is connected to grounds.

Figure:

Automatic Railway Gate Page22


Resistor:
A resistor is a passive two-terminal electrical component that
implements resistance as a circuit element. Resistors act to reduce
current flow, and, at the same time, act to lower voltage levels within
circuits. In electronic circuits resistors are used to limit current flow,
to adjust signal levels, bias active elements, terminate transmission
lines among other uses. High-power resistors that can dissipate
many watts of electrical power as heat may be used as part of motor
controls, in power distribution systems, or as test loads for generators.
Resistors can have fixed resistances that only change slightly with
temperature, time or operating voltage. Variable resistors can be used
to adjust circuit elements (such as a volume control or a lamp
dimmer), or as sensing devices for heat, light, humidity, force, or
chemical activity.

Resistors are common elements of electrical networks  and


electronic circuits and are ubiquitous in electronic equipment.
Practical resistors as discrete components can be composed of various
compounds and forms. Resistors are also implemented
within integrated circuits.

The electrical function of a resistor is specified by its


resistance: common commercial resistors are manufactured over a
range of more than nine orders of magnitude. The nominal value of
the resistance will fall within a manufacturing tolerance.

Automatic Railway Gate Page23


Application

Track Switching:
Using the same principle as that for gate control, we
have developed a concept of automatic track switching. Consi-
dering a situation wherein an express train and a local train are
travelling in opposite direction on the same track, the express train is
allowed to travel on the same track and the local train has to
switch on to the other track, indicator lights have been provided
to avoid collision. Here the operation is performed using a motor. In
practical purpose this can be achieved using electromagnets.

Automatic Railway Gate Page24


Result and Conclusion

Due to wireless no other obstacle interference and making error


in this mechanism
Other sensors like light sensor, wait sensor and environment
dependent sensor hence in some cases they not work properly but due
to RF this circuit is work in all situation all condition of environment.
The project work” Automatic Railway Gate Control”, Now a
days so many accidents are happen at railway gate because of manual
control. To avoid these severe accidents we have to change manual
work to this latest technology (Automatic Railway Gate Control), we
can avoid maximum number of accidents.

Automatic Railway Gate Page25


Reference

1. http://wattsun.com/resources.html
2. http://www.ngdc.noaa.gov/seg/geomag/jsp/struts/calcDeclination
3. http://solar4power.com/solar-power-global-maps.html
4. XC95108 properties at
http://xilinx.com/xlnx/xil_prodcat_product.jsp?title=xc9500_page
5. Xilinx ISE 8.1i Foundation in depth tutorial at
http://www.xilinx.com/ise/logic_design_prod/foundation.htm
6. Flexible prototype board design for ADC/DAC control: application
to mini-projects, S. Lakeou, ASEE05
Proceedings
7. IBM PC Assembly Language & Programming, Peter Abel,
Prentice-Hall
8. Xilinx University Program at http://xilinx.com/univ/index.htm
9. Labview at http://www.ni.com/dataacquisition/
10. http://solar4power.com/solar-power-loads.html

Automatic Railway Gate Page26

You might also like