railways gate control
TRANSCRIPT
ABSTRACT
Aim of this project is control the unmanned rail gate automatically using embedded platform.
Today often we see news papers very often about the railway accidents happening at un-
attended railway gates. Present project is designed to avoid such accidents if implemented in
spirit.
This project utilizes two powerful IR transmitter and two receivers, one pair of transmitter and
receiver is fixed at upside (from the train comes) at a level higher than human being in exact
alignment and similarly other pair is fixed at down side of the train direction sensor activation
time is so adjusted by calculating the time taken at a certain speed to cross at least one
compartment of standard minimum size of the Indian railway, normally 5 seconds.
The sensors are fixed at 1000 meters on both sides of the gate, we call fore side sensor pair
for common towards gate train, and aft side sensors for the train just Crosses the gate. When
train cross the fore side sensor it gives signal to the gate receiver to close the gate. The buzzer
is activated to clear the gate area for drivers about 5 seconds. Gate motor is turned on in one
direction and gate is closed, and stay closed till train crosses the gate and reaches aft side
sensors when aft side receiver get activated motor turns in opposite direction and gate opens
and motor stops .
If there is any problem in the gate means it will operate red signal on both side fro the driver
indication.
Train arrival and departure sensing can be achieved by means of Relay techniques. When the
wheels of the train moves over, both tracks are shorted to ground and this acts as a signal to
microcontroller (89C51) indicating train arrival. RED signal appears for the road user, once the
train cuts the relay sensor placed before the 5Kms before the gate .A buzzer is made on as a pre
cautionary measure for the road users.
1
CHAPTER -1
INTRODUCTION
2
INTRODUCTION
Railway gate control is a project that can control the by pass road gates i.e when train is
coming near to the gate pass the gates motor will be active and both the gates now in closed
state so that no one can pass through it and when train completely passed through that passage
the gates will open shortly using sensor like IR module sensor that sense the train for coming
status as well as for complete passage of the train. the main application of this project is to
protect accidents and to provide new generation automation in train system.
Present project is designed using AT89C51 microcontroller to avoid railway accidents
happening at unattended railway gates, if implemented in spirit. This project utilizes two
powerful IR transmitters and two receivers; one pair of transmitter and receiver is fixed at up
side (from where the train comes) at a level higher than a human being in exact alignment and
similarly the other pair is fixed at down side of the train direction. Sensor activation time is so
adjusted by calculating the time taken at a certain speed to cross at least one compartment of
standard minimum size of the Indian railway. We have considered 5 seconds for this project.
Sensors are fixed at 1km on both sides of the gate. We call the sensor along the train direction
as ‘foreside sensor’ and the other as ‘aft side sensor’. When foreside receiver gets activated, the
gate motor is turned on in one direction and the gate is closed and stays closed until the train
crosses the gate and reaches aft side sensors. When aft side receiver gets activated motor turns
in opposite direction and gate opens and motor stops. Buzzer will immediately sound at the
fore side receiver activation and gate will close after 5 seconds, so giving time to drivers to
clear gate area in order to avoid trapping between the gates and stop sound after the train has
crossed.
The same principle is applied for track switching. Considering a situation wherein an express
train and a local train are traveling in opposite directions 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. Two
sensors are placed at the either sides of the junction where the track switches. If there’s a train
approaching from the other side, then another sensor placed along that direction gets activated
and will send an interrupt to the controller. The interrupt service routine switches the track.
3
Indicator lights have been provided to avoid collisions. Here the switching operation is
performed using a stepper motor. Assuming that within a certain delay, the train has passed the
track is switched back to its original position, allowing the first train to pass without any
interruption. This concept of track switching can be applied at 1km distance from the stations.
Gate Control:
Railways being the cheapest mode of transportation are preferred over all the
other means .When we go through the daily newspapers we come across many railway
accidents occurring at unmanned railway crossings. This is mainly due to the carelessness in
manual operations or lack of workers. We, in this project has come up with a solution for the
same. Using simple electronic components we have tried to automate the control of railway
gates. As a train approaches the railway crossing from either side, the sensors placed at a
certain distance from the gate detects the approaching train and accordingly controls the
operation of the gate. Also an indicator light has been provided to alert the motorists about the
approaching train.
4
CHAPTER -2
WORKING
5
WORKING OPERATION: -
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 checks for possible presence of vehicle between the gates, again
using sensors. Once, no vehicle is sensed in between the gate the motor is activated and the
gates are closed. When no obstacle is sensed GREEN light is indicated, and the train is to free
to move.
The 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.
AUTOMATIC RAILWAY GATE CONTROL & TRACK SWITCHING
To avoid railway accidents happening at unattended railway gates, if implemented in spirit.
This project utilizes two powerful IR transmitters and two receivers; one pair of transmitter and
receiver is fixed at up side (from where the train comes) at a level higher than a human being in
exact alignment and similarly the other pair is fixed at down side of the train direction. Sensor
activation time is so adjusted by calculating the time taken at a certain speed to cross at least
one compartment of standard minimum size of the Indian railway. We have considered 5
seconds for this project. Sensors are fixed at 1km on both sides of the gate. We call the sensor
along the train direction as ‘foreside sensor’ and the other as ‘aft side sensor’. When foreside
receiver gets activated, the gate motor is turned on in one direction and the gate is closed and
stays closed until the train crosses the gate and reaches aft side sensors. When aft side receiver
gets activated motor turns in opposite direction and gate opens and motor stops. Buzzer will
immediately sound at the fore side receiver activation and gate will close after 5 seconds, so
giving time to drivers to clear gate area in order to avoid trapping between the gates and stop
sound after the train has crossed.
The same principle is applied for track switching. Considering a situation wherein an
express train and a local train are traveling in opposite directions 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 6
track. Two sensors are placed at the either sides of the junction where the track switches. If
there’s a train approaching from the other side, then another sensor placed along that direction
gets activated and will send an interrupt to the controller. The interrupt service routine switches
the track. Indicator lights have been provided to avoid collisions. Here the switching operation
is performed using a stepper motor. Assuming that within a certain delay, the train has passed
the track is switched back to its original position, allowing the first train to pass without any
interruption. This concept of track switching can be applied at 1km distance from the stations.
Th
e project is simple to implement and subject to further improvement.
2. BASIC IDEA
GATE CONTROL
Railways being the cheapest mode of transportation are preferred over all the other
means .When we go through the daily newspapers we come across many railway accidents
occurring at unmanned railway crossings. This is mainly due to the carelessness in manual
operations or lack of workers. We, in this project has come up with a solution for the same.
Using simple electronic components we have tried to automate the control of railway gates. As
a train approaches the railway crossing from either side, the sensors placed at a certain distance
7
from the gate detects the approaching train and accordingly controls the operation of the gate.
Also an indicator light has been provided to alert
Using the same principle as that for gate control, we have developed a concept of
automatic track switching. Considering a situation wherein an express train and a local train are
travelling in opposite directions 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 collisions .
8
9
CHAPTER -3
3. HARDWARE DESCRIPTION
The project consists of three main parts:
8051 microcontroller
IR Transmitter
IR Receiver
Stepper Motor Circuit
10
3. HARDWARE DESCRIPTION
The project consists of three main parts:
8051 microcontroller
IR Transmitter
IR Receiver
Stepper Motor Circuit
CIRCUIT DIAGRAM:-
11
COMPONENTS:
PIC16F877A (MICROCONTROLLER)
LM7805 Voltage Regulator +5V
Capacitor
1N4007 DIODE
Resistor
Potentiometer
Crystal Oscillator
Switch
LM358
IR sensor
PCB (Printed Circuit Board)
Geared motors
12
MICROCONTROLLER
PIC16F877A (MICROCONTROLLER):-
This document contains device specific information about the following devices:
• PIC16F877A
PIC16F874A/877A devices are available in 40-pin and 44-pin packages.
All devices in the PIC16F87XA family share common architecture withthe following
differences:
• The PIC16F873A and PIC16F874A have one-half of the total on-chip memory of the
PIC16F876A and PIC16F877A.
• The 28-pin devices have three I/O ports, while the 40/44-pin devices have five.
• The 28-pin devices have fourteen interrupts, while the 40/44-pin devices have fifteen.
• The 28-pin devices have five A/D input channels, while the 40/44-pin devices have eight.
• The Parallel Slave Port is implemented only on the 40/44-pin devices.
13
14
15
IR CIRCUITS
This circuit has two stages: a transmitter unit and a receiver unit. The transmitter unit
consists of an infrared LED and its associated circuitry. unit. The transmitter unit consists of an
infrared LED and its associated circuitry.
IR TRANSMITTER
The transmitter circuit consists of the following components:
Resistors
Capacitors
IR LED
The IR LED emitting infrared light is put on in the transmitting unit. To generate IR
signal, 555 IC based astable multivibrator is used. Infrared LED is driven through transistor
BC 548.
IC 555 is used to construct an astable multivibrator which has two quasi-stable states.
It generates a square wave of frequency 38kHz and amplitude 5Volts. It is required to switch
‘ON
16
LM7805 Voltage Regulator +5V
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.
The 78xx (sometimes LM78xx) is a family of self-contained fixed linear voltage regulator
integrated circuits. The 78xx family is commonly used in electronic circuits requiring a
regulated power supply due to their ease-of-use and low cost. For ICs within the family, the xx
is replaced with two digits, indicating the output voltage (for example, the 7805 has a 5 volt
output, while the 7812 produces 12 volts). The 78xx line are positive voltage regulators: they
produce a voltage that is positive relative to a common ground.
CIRCUITS OF VOLTAGE REGULATING IC’S
The 78XX series of voltage regulator are intended to provide a fixed voltage for use with a
variety of different circuits. They are available in a range of different voltages as shown below
and, although only the positive variety are considered here, there is a complimentary range of
negative regulators that are essentially identical. The voltage regulators are capable of
providing currents of up to 1.5A with adequate heat-sinking and internal protection circuitry
17
makes them almost indestructible. In other configurations and with extra components, these
regulators can be employed as variable voltage sources or constant current sources
CAPACITOR :-
Capacitors are components that are used to store an electrical charge. Sometimes capacitors are
used to smooth a current in a circuit. When power is supplied to a circuit that includes a
capacitor - the capacitor charges up. When power is turned off the capacitor discharges its
electrical charge slowly.
18
Symbols of capacitors
A battery will transport charge from one plate to other until the voltage produced by the
charge buildup is equal to the battery voltage.
19
Capacitor Polarization generally refers to the electrolytic type capacitors but mainly the
Aluminium Electrolytic's, with regards to their electrical connection. The majority of
electrolytic capacitors are polarized types, that is the voltage connected to the capacitor
terminals must have the correct polarity, i.e. positive to positive and negative to negative.
1N4007 DIODE:-
The most common function of a diode is to allow an electric current to pass in one direction
(called the diode's forward direction), while blocking current in the opposite direction
(the reverse direction). Thus, the diode can be viewed as an electronic version of a check valve.
This unidirectional behavior is called rectification, and is used to convert alternating
current to direct current, including extraction of modulation from radio signals in radio
receivers these diodes are forms of rectifiers.
20
RESISTOR:-
A resistor is a component of an electrical circuit that resists the flow of electrical current.
A resistor has two terminals across which electricity must pass, and is designed to drop the
voltage of the current.
A resistor is primarily used to create and maintain a known safe current within an electrical
component.
Resistance is measured in ohms , after Ohm 's law.
This rule states that electrical resistance is equal to the drop in voltage across the terminals of
the resistor divided by the current being applied to the resistor.
A high ohm rating indicates a high resistance to current.
This rating can be written in a number of different ways depending on the ohm rating.
For example- 81R represents 81 ohms, while 81K represents 81,000 ohms.
Series and parallel connection of resistors
In a series configuration, the current through all of the resistors is the same, but the voltage
across each resistor will be in proportion to its resistance. The potential difference (voltage)
seen across the network is the sum of those voltages, thus the total resistance can be found as
the sum of those resistances:
21
The parallel equivalent resistance can be represented in equations by two vertical lines "||" (as
in geometry) as a simplified notation. Occasionally two slashes "//" are used instead of "||", in
case the keyboard or font lacks the vertical line symbol. For the case of two resistors in
parallel, this can be calculated using:
POTENTIOMETER (POT / VARIABLE RESISITOR) :-
A pot in electronics technology is a component. A three-terminal resistor with a sliding
contact that forms an adjustable voltage divider. If only two terminals are used, one end
and the wiper, it acts as a variable resistor or rheostat. A potentiometer measuring
instrument is essentially a voltage divider used for measuring electric potential (voltage); The
component is an implementation of the same principle, hence its name.
22
SYMBOLS OF VARIABLE RESISTOR
Linear taper potentiometer
A linear taper potentiometer (linear describes the electrical characteristic of the device,
not the geometry of the resistive element) has a resistive element of constant cross-section,
resulting in a device where the resistance between the contact (wiper) and one end terminal
is proportional to the distance between them. Linear taper potentiometers are used when the
division ratio of the potentiometer must be proportional to the angle of shaft rotation (or slider
position), for example, controls used for adjusting the centering of an analog cathode-
ray oscilloscope
23
CRYSTAL OSCILLATOR:-
A crystal oscillator is an electronic oscillator circuit that uses the mechanical resonance of a
vibrating crystal of piezoelectric material to create an electrical signal with a very precise
frequency. This frequency is commonly used to keep track of time (as in quartz wristwatches),
to provide a stable clock signal for digital integrated circuits, and to stabilize frequencies for
radio transmitters and receivers. The most common type of piezoelectric resonator used is the
quartz crystal, so oscillator circuits incorporating them became known as crystal oscillators,
but other piezoelectric materials including polycrystalline ceramics are used in similar circuits.
Quartz crystals are manufactured for frequencies from a few tens of kilohertz to tens of
megahertz. More than two billion crystals are manufactured annually. Most are used for
consumer devices such as wristwatches, clocks, radios, computers, and cell phones. Quartz
crystals are also found inside test and measurement equipment, such as counters, signal
generators, and oscilloscopes.
24
SWITCH:-
In electrical engineering, a switch is an electrical component that can break an electrical
circuit, interrupting the current or diverting it from one conductor to another.
The most familiar form of switch is a manually operated electromechanical device with one or
more sets of electrical contacts, which are connected to external circuits. Each set of contacts
can be in one of two states: either "closed" meaning the contacts are touching and electricity
can flow between them, or "open", meaning the contacts are separated and the switch is
nonconducting. The mechanism actuating the transition between these two states (open or
closed) can be either a "toggle" (flip switch for continuous "on" or "off") or "momentary"
(push-for "on" or push-for "off") type.
25
LIGHT EMITING DIODE (LED) :-
A light-emitting diode (LED) is
a semiconductor light source. LEDs are used as
indicator lamps in many devices and are increasingly
used for other lighting. When a light-
emitting diode is forward biased (switched
on), electrons are able to recombine with electron
holes within the device, releasing energy the form
of photons. This effect is called electro luminescence
and the color of the light (corresponding to the
energy of the photon) is determined by the energy
gap of the semiconductor. An LED is often small in
area (less than 1 mm2), and integrated optical
components may be used to shape its radiation pattern. LEDs present many advantages over
incandescent light sources including lower energy consumption, longer lifetime, improved
physical robustness, smaller size, and faster switching. LEDs powerful enough for room
lighting are relatively expensive and require more precise current and heat management than
compact fluorescent lamp sources of comparable output.
26
Appearing as practical electronic components in 1962, early LEDs emitted low-intensity red
light, but modern versions are available across the visible, ultraviolet,
and infrared wavelengths, with very high brightness.
LED CONNECTION:-
DIFFERENT TYPES OF LED:-
LM35 sensor (Precision Centigrade Temperature Sensors)
27
General Description
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is
linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage
over linear temperature sensors calibrated in ˚ Kelvin, as the user is not required to subtract a
large constant voltage from its output to obtain convenient Centigrade scaling. The LM35 does
not require any external calibration or trimming to provide typical accuracies of ±1⁄4˚C at
room temperature and ±3⁄4˚C over a full −55 to +150˚C temperature range. Low cost is assured
by trimming and calibration at the wafer level. The LM35’s low output impedance, linear
output, and precise inherent calibration make interfacing to readout or control circuitry
especially easy. It can be used with single power supplies, or with plus and minus supplies. As
it draws only 60 µA from its supply, it has very low self-heating, less than 0.1˚C in still air.
The LM35 is rated to operate over a −55˚ to +150˚C temperature range, while the LM35C is
rated for a −40˚ to +110˚C range (−10˚ with improved accuracy). The LM35 series is available
packaged in hermetic TO-46 transistor packages, while the LM35C, LM35CA, and LM35D are
also available in the plastic TO-92 transistor package. The LM35D is also available in an 8-
lead surface mount small outline package and a plastic TO-220 package.
28
FEATURES:-
n Calibrated directly in ˚ Celsius (Centigrade)
n Linear + 10.0 mV/˚C scale factor
n 0.5˚C accuracy guaranteeable (at +25˚C)
n Rated for full −55˚ to +150˚C range
n Suitable for remote applications
n Low cost due to wafer-level trimming
n Operates from 4 to 30 volts
n Less than 60 µA current drain
n Low self-heating, 0.08˚C in still air
n Nonlinearity only ±1⁄4˚C typical
n Low impedance output, 0.1 Ω for 1 mA load
29
APPLICATIONS OF LED:-
In general, all the LED products can be divided into two major parts, the public lighting and
indoor lighting. LED uses fall into four major categories:
Visual signals where light goes more or less directly from the source to the human eye, to
convey a message or meaning.
Illumination where light is reflected from objects to give visual response of these objects.
Measuring and interacting with processes involving no human vision.
Narrow band light sensors where LEDs operate in a reverse-bias mode and respond to incident
light, instead of emitting light.
For more than 70 years, until the LED, practically all lighting was incandescent and fluorescent
with the first fluorescent light only being commercially available after the 1939 World's Fair.
30
DIGITAL INPUTS:-
Digital inputs can be define as that which inputs those having in digital signal condition i.e.
high or low, either Vs or VE on other hand in binary form 1 or 0 these types of signal are
known as digital inputs signals. These digital inputs are provide by digital sensor modules or
switches.
Here we use for digital inputs some switches and IR sensor digital module which gives us a
digital inputs to the controlling part of this project
IR MODULE :-
In this tutorial we will see how to make simple infrared sensor module for detecting reflecting
surface. This sensor can be used to detect reflecting silver/white strip, obstacle detection, flame
detection, etc. These sensors are primary requirement of any simple line follower robocar.
WORKING OF IR SENSORS:-
IR LED emits infrared radiation. This radiation illuminates the surface in front of LED.
Surface reflects the infrared light. Depending on reflectivity of the surface, amount of light
reflected varies. This reflected light is made incident on reverse biased IR sensor. When
photons are incident on reverse biased junction of this diode, electron-hole pairs are generated,
which results in reverse leakage current. Amount of electron-hole pairs generated depends on
intensity of incident IR radiation. More intense radiation results in more reverse leakage
current. This current can be passed through a resistor so as to get proportional voltage. Thus as
intensity of incident rays varies, voltage across resistor will vary accordingly.
31
This voltage can then be given to OPAMP based comparator. Output of the comparator can be
read.
IR LED is used as a source of infrared rays. It comes in two packages 3mm or 5mm. 3mm is
better as it is requires less space. IR sensor is nothing but a diode, which is sensitive for
infrared radiation. This infrared transmitter and receiver is called as IR TX-RX pair. It can be
obtained from any decent electronics component shop and costs less than 10Rs. Following
snap shows 3mm and 5mm IR pairs. Colour of IR transmitter and receiver is different.
However you may come across pairs which appear exactly same or even has opposite colours
than shown in above pic and it is not possible to distinguish between TX and RX visually. In
case you will have to take help of
multimeter to distinguish between them
The IR LED is just like any other LED, in
that a current-limiting resistor is useful to
control the device current and therefore the
light intensity. With a 100 ohm resistor and
the approximately 1.5V forward voltage
drop of the IR LED, we'll have a LED current of about 35mA. That's fairly high, but more light
emitted will yield more light coming back to our sensor.
The phototransistor is a device with an exposed silicon junction. When light passes through the
plastic casing, most non-IR wavelengths are simply absorbed by the plastic, but the infrared
light makes it to the sensor within. Each photon striking the silicon junction causes an electron
to flow. Because this is a phototransistor and not a photodiode, this current is multiplied by the
transistor's current gain, so each photon may actually cause perhaps 10 to 100 electrons to
flow. This current has nowhere to go except through the 10K resistor, and as the current passes
through the resistor, the voltage across the resistor rises (V=IR). This change in voltage is read
by our microcontroller's Analog to Digital Converter (ADC).
32
LM324 (LOW POWER QUAD OPERATIONAL AMPLIFIERS) :-
These circuits consist of four independent, high gain, internally frequency compensated
operational amplifiers .
They operate from a single power supply over a wide range of voltages.
Operation from split power supplies is also possible and the low power supply current drain is
independent of the magnitude of the power supply voltage.
Operation from split power supplies is also possible so long as the difference between the two
supplies is 3 volts to 32 volts.
Application areas include transducer amplifier, DC gain blocks and all the conventional OP
Amp circuits which now can be easily implemented in single power supply systems.
Internally Frequency Compensated for Unity Gain
Large DC Voltage Gain: 100dB
Wide Power Supply Range: LM324: 3V~32V (or 1.5 ~16V)
Input Common Mode Voltage Range Includes Ground
33
Large Output Voltage Swing: 0V to VCC -1.5V
Power Drain Suitable for Battery Operation
34
APPLICATIONS OF LM:-
The LM35 can be applied easily in the same way as other integrated-circuit temperature
sensors. It can be glued or cemented to a surface and its temperature will be within about
0.01˚C of the surface temperature. This presumes that the ambient air temperature is almost the
same as the surface temperature; if the air temperature were much higher or lower than the
surface temperature, the actual temperature of the LM35 die would be at an intermediate
temperature between the surface temperature and the air temperature. This is expecially true
for the TO-92 plastic package, where the copper leads are the principal thermal path to carry
heat into the device, so its temperature might be closer to the air temperature than to the
surface temperature. To minimize this problem, be sure that the wiring to the LM35, as it
leaves the device, is held at the same temperature as the surface of interest. The easiest way to
do this is to cover up these wires with a bead of epoxy which will insure that the leads and
wires are all at the same temperature as the surface, and that the LM35 die’s temperature will
not be affected by the air temperature. The TO-46 metal package can also be soldered to a
metal surface or pipe without damage. Of course, in that case the V− terminal of the circuit will
be grounded to that metal. Alternatively, the LM35 can be mounted inside a sealed-end metal
tube, and can then be dipped into a bath or screwed into a threaded hole in a tank. As with any
IC, the LM35 and accompanying wiring and circuits must be kept insulated and dry, to avoid
leakage and corrosion. This is especially true if the circuit may operate at cold temperatures
where condensation can occur. Printed-circuit coatings and varnishes such as Humiseal and
epoxy paints or dips are often used to insure that moisture cannot corrode the LM35 or its
connections.These devices are sometimes soldered to a small light-weight heat fin, to decrease
the thermal time constant and speed up the response in slowly-moving air. On the other hand, a
small thermal mass may be added to the sensor, to give the steadiest reading despite small
deviations in the air temperature.
35
BUZZER :-
A buzzer or beeper is an audio signalling device, which may be mechanical, electromechanical,
or piezoelectric. Typical uses of buzzers and beepers include alarm devices, timers and
confirmation of user input such as a mouse click or keystroke.
PIEZOELECTRIC:-
A piezoelectric element may be driven by an oscillating electronic circuit or other audio signal
source, driven with a piezoelectric audio amplifier. Sounds commonly used to indicate that a
button has been pressed are a click, a ring or a beep.
36
DC MOTOR:-
A DC motor is a mechanically commutated electric motor powered from direct current (DC).
The stator is stationary in space by definition and therefore so is its current. The current in the
rotor is switched by the commutator to also be stationary in space. This is how the relative
angle between the stator and rotor magnetic flux is maintained near 90 degrees, which
generates the maximum torque.
DC motors have a rotating armature winding but non-rotating armature magnetic field and a
static field winding or permanent magnet. Different connections of the field and armature
winding provide different inherent speed/torque regulation characteristics. The speed of a DC
motor can be controlled by changing the voltage applied to the armature or by changing the
field current. The introduction of variable resistance in the armature circuit or field circuit
allowed speed control. Modern DC motors are often controlled by power electronics systems
called DC drives.
37
Alternating current differ from DC in the direction of electron flow , first in one direction for
a short time , then reverse direction and flow again in opposite direction for short time . The
flow of electrons in one direction and then in another direction is called a cycle of AC . The
number of cycles occur in one second of time is called “Cycles/Second”. In our country the
standard power line frequency is 50 Hz .
The major blocks of the power supply units are
Step down transformer
Rectifier diodes
Filters
Voltage regulators
STEP DOWN TRANSFORMER:-
The instrument transformer for power supply in this project is to convert AC from
230V to required low level such as 5V AC . This transformer apart from stepping down AC
voltage, gives isolation between power source and power supply circuitries.
38
RECTIFIER UNIT :-
In a power supply unit , rectification is normally achieved by a solid state diode .
Diode contains two electrodes called the anode and the cathode . A diode has the property that
will let electron flow easily in one direction . As a result when AC is applied to a diode,
electrons only flow when the anode is positive and cathode is negative. Reversing the polarity
of voltage applied to a diode will not permit electron flow .
The various method of rectifying AC to DC or half wave , full wave and bridge
rectifications . This project employs a full wave bridge rectifier which is most commonly used
in industries.
A bridge structure of four diodes is commonly used in power supply units to
achieve full wave rectification. When AC voltage is applied to the primary winding of power
transformer. It is stepped down to 5V AC across the secondary winding of the transformer.
Normally one alteration of the input voltage will cause the polarities to reverse. Opposite end
of the transformer will therefore, always be 180 degrees out of phase with each other.
For positive cycle, two diodes connected to the top winding gets positive voltage
and only one diode conducts for that cycle due to forward bias. At the same time one out of the
other two diodes conducts, for the negative voltage being applied from the bottom winding due
to forward bias for that diode DC of frequency 100Hz.
In the next alteration the two diodes conducted from top winding and bottom winding as they
are forward biased in this cycle. It is to be noted that the current flow through the load is
always in one direction for each alteration of the applied AC input. This is of course, means
that AC is rectified into DC. This DC output, in this case, has a ripple frequency of 100Hz,
since each alternation produces a resulting output pulse, the ripple frequency or 2*50 Hz
=100Hz. The output DC is not a pure DC. It is pulsating DC voltage.
39
Filter Unit:-
After pulsating DC has been produced by our rectifier, it must be filtered in or for it
to be usable in a power supply. Filtering involves the ripple frequency. The power supply unit
employed in this project used 7805 voltage regulator (for positive output voltages ) and a 7905
regulator ( for negative output voltages ).
Resistors R1 and R2 maintain line load regulation. Capacitors C2 and C4 act
as high frequency suppressors.
40
CHAPTER -4
Microcontroller
41
Microcontroller
INTRODUCTION :
A computer-on-a-chip is a variation of a microprocessor, which combines the processor core
(CPU), some memory, and I/O (input/output) lines, all on one chip. The computer-on-a-chip is called
the microcomputer whose proper meaning is a computer using a (number of) microprocessor(s) as its
CPUs, while the concept of the microcomputer is known to be a microcontroller. A microcontroller can
be viewed as a set of digital logic circuits integrated on a single silicon chip. This chip is used for only
specific applications.
7.2.1 ADVANTAGES OF USING A MICROCONTROLLER OVER MICROPROCESSOR:
A designer will use a Microcontroller to
1. Gather input from various sensors
2. Process this input into a set of actions
3. Use the output mechanisms on the Microcontroller to do something useful
4. RAM and ROM are inbuilt in the MC.
5. Cheap compared to MP.
6. Multi machine control is possible simultaneously.
Examples:
8051, 89C51 (ATMAL), PIC (Microchip), Motorola (Motorola), ARM Processor, Applications:
Cell phones, Computers, Robots, Interfacing to two pc’s.
42
89c51 Microcontroller IC
The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4Kbytes of Flash
programmable and erasable read only memory (PEROM). The device is manufactured using Atmel’s
high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51
instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-
system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with
Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer, which provides
a highly-flexible and cost-effective solution to many embedded control applications. The
AT89C51 provides the following standard features: 4Kbytes of Flash, 128 bytes of RAM, 32
I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex
serial port, on-chip oscillator and clock circuitry. In addition, the AT89C51 is designed with
static logic for operation down to zero frequency and supports two software selectable power
saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial
port and interrupt system to continue functioning. The Power-down Mode saves the RAM
contents but freezes the oscillator disabling all other chip functions until the next hardware
reset.
43
7.2.2 Pin description of ATMEL At89c51:
Fig: 7.2. 2 The AT 89c51 micro controller is a 40-pin IC. The 40th pin of the controller is Vcc pin and the
5V dc supply is given to this pin. This 20 th pin is ground pin. A 12 MHZ crystal oscillator is
connected to 18th and 19th pins of the AT 89c51 micro controller and two 22pf capacitors are
connected to ground from 18th and 19th pins. The 9th pin is Reset pin.
44
Port 0
Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL
inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 may
also be configured to be the multiplexed low order address/data bus during accesses to external
program and data memory. In this mode P0 has internal pull-ups. Port 0 also receives the code bytes
during Flash programming, and outputs the code bytes during program verification. External pull-ups
are required during program verification.
Port 1
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers can sink/source
four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull-ups and
can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current
(IIL) because of the internal pull-ups. Port 1 also receives the low-order address bytes during Flash
programming and verification.
Port 2
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers can sink/source
four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull-ups and
can be used as inputs. As inputs Port 2 pins that are externally being pulled low will source current (IIL)
because of the internal pull-ups. Port 2 emits the high-order address byte during fetches from external
program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @
DPTR). In this application, it uses strong internal pull-ups when emitting 1s. During accesses to
external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2
Special Function Register. Port 2 also receives the high-order address bits and some control signals
during Flash programming and verification.
Port 3
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers can sink/source
four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull-ups and
can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current
(IIL) because of the pull-ups. Port 3 also serves the functions of various special features of the
AT89C51 as listed below:
45
Port Pin Alternate Functions
P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)
Port 3 also receives some control signals for Flash programming and verification.
RSTReset input. A high on this pin for two machine cycles while the oscillator is running resets the device.
ALE/PROG
Address Latch Enable output pulse for latching the low byte of the address during accesses to external
memory. This pin is also the program pulse input (PROG) during Flash programming. In normal
operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external
timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to
external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH.
With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is
weakly pulled high. Setting the ALE-disable bit has no effect if the micro controller is in external
execution mode.
46
PSEN
Program Store Enable is the read strobe to external program memory. When the AT89C51 is executing
code from external program memory, PSEN is activated twice each machine cycle, except that two
PSEN activations are skipped during each access to external data memory.
EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from
external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is
programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal
program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash
programming, for parts that require 12-volt VPP.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2
It is the output from the inverting oscillator amplifier.
47
CHAPTER -5
PCB MANUFACTURING PROCESS.
48
PCB MANUFACTURING PROCESS:
It is an important process in the fabrication of electronic equipment. The design of PCBs
(Printed Circuit Boards) depends on circuit requirements like noise immunity, working
frequency and voltage levels etc. High power PCBs requires a special design strategy.
The fabrication process to the printed circuit board will determine to a large extent the price
and reliability to the equipment. A common target aimed is the fabrication of small series of
highly reliable professional quality PCBs with low investment cost. The target becomes
especially important for custom tailored equipment in the area of industrial electronics.
PREPARE SOLUTION FOR ITCHING LAYOUT:-
NOW DROP PRINTED CIRCUIT BOARD INTO SOLUTION:-
49
WAIT FOR 3 MINUTES FOR COMPLETE CLEANING EXTRA COPPER ON BOARD:-
50
CONCLUSION:
From the above discussion and information of this system we, upto now
surely comes to know that it is highly reliable effective and economical at dense
traffic area, sub urban area and the route where frequency of trains is more.
As it saves some auxiliary structure as well as the expenditure onattendant it is more
economical at above mentioned places than traditional railwaycrossing gate system. We know
that though it is very beneficial but it is alsoimpossible to install such system at each and every
places, but it gives certainly aconsiderable benefit to us, thereby to our nation.www
51
REFERENCES:
1. Kenneth.J.Ayala”The 89C51 Microcontroller Architecture programming
and Applications”, Pen ram International.
2. D.Roychoudary and Sail Jain”L.I.C”, New Age International.
3. “Principles of Electronics” by V.K.MEHTA.
4. “Communication Systems” by Simon Hawkins.
5. “Electrical Technology – vol. 2- B.L. Theraja.
WEB REFERENCES:
1. http://www.learn-c.com/adc0809.pdf
2. http://www.atmel.com/dyn/resources/prod_documents/doc0265.pdf
3. http://www.ortodoxism.ro/datasheets/texasinstruments/max232.pdf
52