Automatic Railway Signalling System
Automatic Railway Signalling System
Automatic Railway Signalling System
INDEX
CONTENTS
1.Abbreviations
2.Introduction
3.Block Diagram
5.Schematic
6.Schematic Description
7.Hardware Components
Microcontroller
Power supply
LCD
BUZZER
Reflection sensor
Signalling system
8.Circuit Description
9.software
ACC Accumulator
11.Future Aspects
B B register
12.Bibliography
PSW Program status word
ABBREVIATIONS
SP Stack pointer
P0 Port0
P1 Port1
P2 Port2
P3 Port3
EMBEDDED SYSTEM:
Personal digital assistants (PDAs) or handheld computers are generally considered embedded
devices because of the nature of their hardware design, even though they are more expandable in software
terms. This line of definition continues to blur as devices expand. With the introduction of the OQO
Model 2 with the Windows XP operating system and ports such as a USB port — both features usually
belong to "general purpose computers", — the line of nomenclature blurs even more.
Physically, embedded systems ranges from portable devices such as digital watches and MP3
players, to large stationary installations like traffic lights, factory controllers, or the systems controlling
nuclear power plants.
In terms of complexity embedded systems can range from very simple with a single
microcontroller chip, to very complex with multiple units, peripherals and networks mounted inside a
large chassis or enclosure.
Examples of Embedded Systems:
Avionics, such as inertial guidance systems, flight control hardware/software and other
integrated systems in aircraft and missiles
Cellular telephones and telephone switches
Engine controllers and antilock brake controllers for automobiles
Home automation products, such as thermostats, air conditioners, sprinklers, and security
monitoring systems
Handheld calculators
Handheld computers
Household appliances, including microwave ovens, washing machines, television sets,
DVD players and recorders
Medical equipment
Personal digital assistant
Videogame consoles
The railroad industry’s own desire to maintain their ability to provide safe and secure transport
of their customers hazardous materials, has introduced new challenges in rail security.
Addressing these challenges is important, as railroads, and the efficient delivery of their cargo,
play a vital role in the economy of the country.
The present project is designed to satisfy the security needs of the railways. This system provides
the security in four ways: automatic gate opening/closing system at track crossing, signaling for
the train driver, tracking the signals, and the track protection. The automatic gate opening/closing
system is provided with the Reflection sensors placed at a distance of few kilometers on the both
sides from the crossing road. These sensors give the train reaching and leaving status to the
embedded controller at the gate to which they are connected. The controller operates
(open/close) the gate as per the received signal from the Reflection sensors.
The train driver always observes the signals placed beside the track. These signals are controlled
from the control room. The green light denotes that the track is free and red light denotes the
track is busy or damaged. These signals are controlled based on the train position which is
sensed by using the Reflection sensors placed along the track. The position of the train can be
estimated by using the Reflection sensor placed along the track and is displayed on the control
room to indicate the train position along the track.
.
The track protection is achieved by providing the closed loop along the track. If any crack or cut
is occurred to the track simultaneously the same happens to the closed loop. This gives a signal
to the controller at the control room. From control room we can give the red signal by knowing
the position of the train through the Reflection sensors.
Hardware Components:
Micro Controller
IR Sensor
LCD
Gate opening system
Signalling system
Track Protection circuit
Buzzer
Software Tools:
Keil u-Vision
Embedded ‘C’
Express PCB
Applications:
Railway Sector
BLOCK DIAGRAM:
REFLECTION
SENSOR
GATE
OPENING
SYSTEM
(DC)
SIGNALLING
SYSTEM
Buzzer
Firstly, the required operating voltage for Microcontroller 89C51 is 5V. Hence the 5V
D.C. power supply is needed by the same. This regulated 5V is generated by first stepping down
the 230V to 9V by the step down transformer.
The step downed a.c. voltage is being rectified by the Bridge Rectifier. The diodes used
are 1N4007. The rectified a.c voltage is now filtered using a ‘C’ filter. Now the rectified, filtered
D.C. voltage is fed to the Voltage Regulator. This voltage regulator allows us to have a Regulated
Voltage which is +5V.
The rectified; filtered and regulated voltage is again filtered for ripples using an electrolytic
capacitor 100μF. Now the output from this section is fed to 40 th pin of 89c51 microcontroller to
supply operating voltage.
The microcontroller 89c51 with Pull up resistors at Port0 and crystal oscillator of
11.0592 MHz crystal in conjunction with couple of capacitors of is placed at 18 th & 19th pins of
89c51 to make it work (execute) properly.
The reflection sensors are connected to using the transistor logics. The LEDs which will
show the status of the track ,either it is free or not.
The LCD data pins are connected to the port 1 of the microcontroller. The control pins
are connected to the p2.7 down to p2.5.
The reflection sensors are connected to the p3.2 top3.4 as shown in the schematic.
The DC motor is connected to port 0 of microcontroller through the driver circuit which is
known as the ULN driver.
Hardware components:
MICRO CONTROLLER (AT89S51)
Introduction
A Micro controller consists of a powerful CPU tightly coupled with memory, various I/O
interfaces such as serial port, parallel port timer or counter, interrupt controller, data acquisition
interfaces-Analog to Digital converter, Digital to Analog converter, integrated on to a single
silicon chip.
If a system is developed with a microprocessor, the designer has to go for external
memory such as RAM, ROM, EPROM and peripherals. But controller is provided all these
facilities on a single chip. Development of a Micro controller reduces PCB size and cost of
design.
One of the major differences between a Microprocessor and a Micro controller is that a
controller often deals with bits not bytes as in the real world application.
Intel has introduced a family of Micro controllers called the MCS-51.
Features:
• Compatible with MCS-51® Products
• 4K Bytes of In-System Programmable (ISP) Flash Memory
– Endurance: 1000 Write/Erase Cycles
• 4.0V to 5.5V Operating Range
• Fully Static Operation: 0 Hz to 33 MHz
• Three-level Program Memory Lock
• 128 x 8-bit Internal RAM
• 32 Programmable I/O Lines
• Two 16-bit Timer/Counters
• Six Interrupt Sources
• Full Duplex UART Serial Channel
• Low-power Idle and Power-down Modes
Description
The AT89S51 is a low-power, high-performance CMOS 8-bit microcontroller with 4K bytes of in-system
programmable Flash memory. The device is manufactured using Atmel’s high-density nonvolatile memory
technology and is compatible with the industry- standard 80C51 instruction set and pinout. 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 in-system programmable Flash on a monolithic chip, the
Atmel AT89S51 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to
many embedded control applications.
Block diagram:
Figure: Block diagram
Pin diagram:
Pin Description
VCC - Supply voltage.
GND - Ground.
Port 0:
Port 0 is an 8-bit open drain bidirectional 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 can 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 bidirectional 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 bidirectional 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 also receives the high-order address bits and some control signals during Flash
programming and verification.
Port 3:
Port 3 is an 8-bit bidirectional 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 receives some control signals for Flash programming and verification. Port 3 also serves
the functions of various special features of the AT89S51, as shown in the following table.
RST:
Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device.
This pin drives High for 98 oscillator periods after the Watchdog times out. The DISRTO bit in SFR AUXR
(address 8EH) can be used to disable this feature. In the default state of bit DISRTO, the RESET HIGH out
feature is enabled.
ALE/PROG:
Address Latch Enable (ALE) is an 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 microcontroller is in external execution mode.
PSEN:
Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S51 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.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2:
Output from the inverting oscillator amplifier.
Oscillator Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier
which can be configured for use as an on-chip oscillator, as shown in Figs 6.2.3. Either a quartz
crystal or ceramic resonator may be used. To drive the device from an external clock source,
XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 6.2.4.There are
no requirements on the duty cycle of the external clock signal, since the input to the internal
clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high
and low time specifications must be observed.
Fig 6.2.3 Oscillator Connections Fig 6.2.4 External Clock Drive Configuration
BUZZER
The "Piezoelectric sound components" introduced herein operate on an innovative principle
utilizing natural oscillation of piezoelectric ceramics. These buzzers are offered in lightweight
compact sizes from the smallest diameter of 12mm to large Piezo electric sounders. Today,
piezoelectric sound components are used in many ways such as home appliances, OA equipment,
audio equipment telephones, etc. And they are applied widely, for example, in alarms, speakers,
telephone ringers, receivers, transmitters, beep sounds, etc.
Oscillating System:
DESIGN PROCEDURES:
In general, man's audible frequency range is about 20 Hz to 20kHz. Frequency ranges of
2kHz to 4kHz are most easily heard. For this reason, most piezoelectric sound components are
used in this frequency range, and the resonant frequency (f0) is generally selected in the same
range too. As shown in Fig. 3, the resonant frequency depends on methods used to support the
piezoelectric diaphragm. If piezoelectric diaphragms are of the same shape, their values will
become smaller in the order of (a), (b) and (c).
In general, the piezoelectric diaphragm is installed in a cavity to produce high sound
pressure. The resonant frequency (fcav) of the cavity in is obtained from Formula (1)
(Helmholtz's Formula). Since the piezoelectric diaphragm and cavity have proper resonant
frequencies, (f0) and (fcav) respectively, sound pressure in specific frequencies can be increased
and a specific bandwidth can be provided by controlling both positions.
Power supply:
Transformers convert AC electricity from one voltage to another with little loss of power.
Transformers work only with AC and this is one of the reasons why mains electricity is AC.
Step-up transformers increase in output voltage, step-down transformers decrease in output
voltage. Most power supplies use a step-down transformer to reduce the dangerously high mains
voltage to a safer low voltage. The input coil is called the primary and the output coil is called
the secondary. There is no electrical connection between the two coils; instead they are linked by
an alternating magnetic field created in the soft-iron core of the transformer. The two lines in the
middle of the circuit symbol represent the core. Transformers waste very little power so the
power out is (almost) equal to the power in. Note that as voltage is stepped down current is
stepped up. The ratio of the number of turns on each coil, called the turn’s ratio, determines the
ratio of the voltages. A step-down transformer has a large number of turns on its primary (input)
coil which is connected to the high voltage mains supply, and a small number of turns on its
secondary (output) coil to give a low output voltage.
An Electrical Transformer
Turns ratio = Vp/ VS = Np/NS
VS X IS=VP X IP
Vp = primary (input) voltage
Np = number of turns on primary coil
Ip = primary (input) current
RECTIFIER:
A circuit which is used to convert a.c to dc is known as RECTIFIER. The process of conversion
a.c to d.c is called “rectification”
TYPES OF RECTIFIERS:
Type of Rectifier
Parameter
Half wave Full wave Bridge
Number of diodes
1 2 4
PIV of diodes
Vm 2Vm Vm
Full-wave Rectifier:
From the above comparison we came to know that full wave bridge rectifier as more advantages than the
other two rectifiers. So, in our project we are using full wave bridge rectifier circuit.
Bridge Rectifier: A bridge rectifier makes use of four diodes in a bridge arrangement to achieve
full-wave rectification. This is a widely used configuration, both with individual diodes wired as
shown and with single component bridges where the diode bridge is wired internally.
A bridge rectifier makes use of four diodes in a bridge arrangement as shown in fig(a) to achieve
full-wave rectification. This is a widely used configuration, both with individual diodes wired as shown
and with single component bridges where the diode bridge is wired internally.
Fig(A)
Operation:
During positive half cycle of secondary, the diodes D2 and D3 are in forward biased while D1 and D4 are
in reverse biased as shown in the fig(b). The current flow direction is shown in the fig (b) with dotted
arrows.
Fig(B)
During negative half cycle of secondary voltage, the diodes D1 and D4 are in forward biased while D2
and D3 are in reverse biased as shown in the fig(c). The current flow direction is shown in the fig (c)
with dotted arrows.
Fig(C)
Filter:
Capacitor Filter:
We have seen that the ripple content in the rectified output of half wave rectifier is 121% or that of
full-wave or bridge rectifier or bridge rectifier is 48% such high percentages of ripples is not acceptable
for most of the applications. Ripples can be removed by one of the following methods of filtering.
(a) A capacitor, in parallel to the load, provides an easier by –pass for the ripples voltage though it due to
low impedance. At ripple frequency and leave the d.c.to appears the load.
(b) An inductor, in series with the load, prevents the passage of the ripple current (due to high impedance
at ripple frequency) while allowing the d.c (due to low resistance to d.c)
(c) Various combinations of capacitor and inductor, such as L-section filter section filter, multiple
section filter etc. which make use of both the properties mentioned in (a) and (b) above. Two cases of
capacitor filter, one applied on half wave rectifier and another with full wave rectifier.
Regulator:
Voltage regulator ICs is available with fixed (typically 5, 12 and 15V) or variable output voltages. The
maximum current they can pass also rates them. Negative voltage regulators are available, mainly for use
in dual supplies. Most regulators include some automatic protection from excessive current ('overload
protection') and overheating ('thermal protection'). Many of the fixed voltage regulator ICs have 3 leads
and look like power transistors, such as the 7805 +5V 1A regulator shown on the right. The LM7805 is
simple to use. You simply connect the positive lead of your unregulated DC power supply (anything from
9VDC to 24VDC) to the Input pin, connect the negative lead to the Common pin and then when you turn
on the power, you get a 5 volt supply from the output pin.
The following are the merits of LEDs over conventional incandescent and other types of lamps
Function
LEDs can be damaged by heat when soldering, but the risk is small unless you are very slow. No
special precautions are needed for soldering most LEDs.
Testing an LED
LEDs are available in red, orange, amber, yellow, green, blue and white. Blue and white LEDs are much
more expensive than the other colours.
Tri-colour LEDs
The most popular type of tri-colour LED has a red and a green LED combined in one package
with three leads. They are called tri-colour because mixed red and green light appears to be yellow and
this is produced when both the red and green LEDs are on.
The diagram shows the construction of a tri-colour LED. Note the different lengths of the three
leads. The centre lead (k) is the common cathode for both LEDs, the outer leads (a1 and a2) are the
anodes to the LEDs allowing each one to be lit separately, or both together to give the third colour.
Bi-color LEDs
A bi- colour LED has two LEDs wired in 'inverse parallel' (one forwards, one backwards) combined in
one package with two leads. Only one of the LEDs can be lit at one time and they are less useful than the
tri-colour LEDs described above.
LEDs are available in a wide variety of sizes and shapes. The 'standard' LED has a round cross-
section of 5mm diameter and this is probably the best type for general use, but 3mm round LEDs are also
popular.
Round cross-section LEDs are frequently used and they are very easy to install on boxes by
drilling a hole of the LED diameter, adding a spot of glue will help to hold the LED if necessary. LED
clips are also available to secure LEDs in holes. Other cross-section shapes include square, rectangular
and triangular.
As well as a variety of colors, sizes and shapes, LEDs also vary in their viewing angle. This tells
you how much the beam of light spreads out. Standard LEDs have a viewing angle of 60° but others have
a narrow beam of 30° or less. Rapid Electronics stock a wide selection of LEDs and their catalogue is a
good guide to the range available.
R = (VS - VL) / I
VS = supply voltage
VL = LED voltage (usually 2V, but 4V for blue and white LEDs)
I = LED current (e.g. 20mA), this must be less than the maximum permitted
If the calculated value is not available choose the nearest standard resistor value which is greater,
so that the current will be a little less than you chose. In fact you may wish to choose a greater resistor
value to reduce the current (to increase battery life for example) but this will make the LED less bright.
where:
V = voltage across the resistor (= VS - VL in this case)
So R = (VS - VL) / I
If you wish to have several LEDs on at the same time it may be possible to connect them in
series. This prolongs battery life by lighting several LEDs with the same current as just one LED.
All the LEDs connected in series pass the same current so it is best if they are all the same type.
The power supply must have sufficient voltage to provide about 2V for each LED (4V for blue and white)
plus at least another 2V for the resistor. To work out a value for the resistor you must add up all the LED
voltages and use this for VL.
Connecting several LEDs in parallel with just one resistor shared between them is generally not a
good idea.
If the LEDs require slightly different voltages only the lowest voltage LED will light and it may
be destroyed by the larger current flowing through it. Although identical LEDs can be successfully
connected in parallel with one resistor this rarely offers any useful benefit because resistors are very
cheap and the current used is the same as connecting the LEDs individually.
PHOTO SENSOR
IR remote controls use wavelengths between 850 - 950nm. At this short wavelength, the light is invisible
to the human eye, but a domestic camcorder can actually view this portion of the electromagnetic
spectrum. Viewed with a camcorder, an IR LED appears to change brightness.
All remote controls use an encoded series of pulses, of which there are thousands of combinations. The
light output intensity varies with each remote control; remotes working at 4.5V dc generally will provide
a stronger light output than a 3V dc control. Also, as the photodiode in this project has a peak light
response at 850nm, it will receive a stronger signal from controls operating closer to this wavelength. The
photodiode will actually respond to IR wavelengths from 400nm to 1100nm, so all remote controls should
be compatible.
A sensor is a type of transducer, or mechanism, which responds to a type of energy by producing another
type of energy signal, usually electrical. They are either direct indicating (an electrical meter) or are
paired with an indicator (perhaps indirectly through an analog to digital converter, a computer and a
display) so that the value sensed is translated for human understanding. Types of sensors include
electromagnetic, chemical, biological and acoustic. Aside from other applications, sensors are heavily
used in medicine, industry& robotics.
In theory, when the sensor is working perfectly, the output signal of a sensor is exactly proportional to the
value of the property it is meant to measure. The gain is then defined as the ratio between output signal
and measured property. For example, if a sensor measures temperature and has an actual voltage output,
the gain is a constant with the unit.
When the sensor is not perfect, various deviations can occur, including gain error, long term drift, and
noise. These and other deviations can be classified as systematic, or random, errors. Systematic deviations
may be compensated for by means of some kind of calibration strategy. Noise is an example of a random
error that can be reduced by signal processing, such as filtering, usually at the expense of the dynamic
behavior of the sensor.
A sensor network is a computer network of spatially distributed devices using sensors to monitor
conditions (such as temperature, sound, vibration, pressure, motion or pollutants) at a variety of locations.
Usually the devices are small and inexpensive, allowing them to be produced and deployed in large
numbers; this constrains their resources in terms of energy, memory, and computational speed and
bandwidth. Each device is equipped with a radio transceiver, a small micro controller, and an energy
source, most commonly a battery. The devices work off each other to deliver data to the computer which
has been set up to monitor the information. Sensor networks involve three areas: sensing,
communications, and computation (hardware, software, algorithms). They are applied in many areas, such
as video surveillance, traffic monitoring, home monitoring and manufacturing.
PRINCIPE:
Transmitter and receiver are incorporated in a single housing. The modulated infrared light of the
transmitter strikes the object to be detected and is reflected in a diffuse way. Part of the reflected light
strikes the receiver and starts the switching operation. The two states – i.e. reflection received or no
reflection – are used to determine the presence or absence of an object in the sensing range.
This system safely detects all objects that have sufficient reflection. For objects with a very bad degree of
reflection (matt black rough surfaces) the use of diffuse reflection sensors for short ranges or with
background suppression is recommended.
FIG26:PHOTO TRANSMITTER
FIG 27: RECEIVER CHARACTERISTICS
Sensitivity setting - Diffuse reflection sensors
For diffuse reflection sensors with sensitivity setting the sensitivity should always be set to maximum
independent of the required range in order to achieve the highest possible operational safety. Only in the
case of interfering backgrounds (walls, machine parts) could it be necessary to reduce the range.
Liquid crystal displays (LCDs) have materials, which combine the properties of both
liquids and crystals. Rather than having a melting point, they have a temperature range within
which the molecules are almost as mobile as they would be in a liquid, but are grouped together
in an ordered form similar to a crystal.
An LCD consists of two glass panels, with the liquid crystal material sand witched in between
them. The inner surface of the glass plates are coated with transparent electrodes which define the
character, symbols or patterns to be displayed polymeric layers are present in between the electrodes and
the liquid crystal, which makes the liquid crystal molecules to maintain a defined orientation angle.
One each polarisers are pasted outside the two glass panels. These polarisers would rotate the
light rays passing through them to a definite angle, in a particular direction.
When the LCD is in the off state, light rays are rotated by the two polarisers and the liquid
crystal, such that the light rays come out of the LCD without any orientation, and hence the LCD appears
transparent.
When sufficient voltage is applied to the electrodes, the liquid crystal molecules would be aligned
in a specific direction. The light rays passing through the LCD would be rotated by the polarisers, which
would result in activating/ highlighting the desired characters.
The LCD’s are lightweight with only a few millimeters thickness. Since the LCD’s consume less
power, they are compatible with low power electronic circuits, and can be powered for long durations.
The LCD’s don’t generate light and so light is needed to read the display. By using backlighting,
reading is possible in the dark. The LCD’s have long life and a wide operating temperature range.
Changing the display size or the layout size is relatively simple which makes the LCD’s more
customers friendly.
The LCDs used exclusively in watches, calculators and measuring instruments are the simple
seven-segment displays, having a limited amount of numeric data. The recent advances in technology
have resulted in better legibility, more information displaying capability and a wider temperature range.
These have resulted in the LCDs being extensively used in telecommunications and entertainment
electronics. The LCDs have even started replacing the cathode ray tubes (CRTs) used for the display of
text and graphics, and also in small TV applications.
This section describes the operation modes of LCD’s then describe how to program and interface
an LCD to 8051 using Assembly and C.
LCD operation
In recent years the LCD is finding widespread use replacing LEDs(seven-segment LEDs or other
multisegment LEDs).This is due to the following reasons:
1. The declining prices of LCDs.
2. The ability to display numbers, characters and graphics. This is in
contract to LEDs, which are limited to numbers and a few characters.
3. Incorporation of a refreshing controller into the LCD, there by
relieving the CPU of the task of refreshing the LCD. In the contrast,
the LED must be refreshed by the CPU to keep displaying the data.
4. Ease of programming for characters and graphics.
Uses:
The LCDs used exclusively in watches, calculators and measuring instruments are the
simple seven-segment displays, having a limited amount of numeric data. The recent advances in
technology have resulted in better legibility, more information displaying capability and a wider
temperature range. These have resulted in the LCDs being extensively used in telecommunications and
entertainment electronics. The LCDs have even started replacing the cathode ray tubes (CRTs) used for
the display of text and graphics, and also in small TV applications.
LCD INTERFACING
STEPPER MOTOR
Introduction
Stepping motors can be used in simple open-loop control systems; these are generally
adequate for systems that operate at low accelerations with static loads, but closed loop
control may be essential for high accelerations, particularly if they involve variable loads. If
a stepper in an open-loop control system is over torqued, all knowledge of rotor position is
lost and the system must be reinitialized; servomotors are not subject to this problem.
Stepping motors are known in German as Schrittmotoren, in French as moteurs pas à pas, and in Spanish
as motor paso paso. Stepper motor control may be based on open loop or closed loop models. We are
primarily interested in open loop models, because this is where stepping motors excel, but we will treat
closed loop models briefly because they are somewhat simpler. Figure 7.1 illustrates an extreme
Example:
If the shaft encoder is rotated one step clockwise or counterclockwise from the neutral
position, the control vector output by the shaft encoder will pull the rotor clockwise (or
counterclockwise). As the rotor turns, the shaft encoder will change the control vector so that
the rotor is always trying to maintain a position one step clockwise (or
counterclockwise) from where it is at the moment. The torque produced by this method will
fall off with rotor speed, but this control system will always produce the maximum torque the
motor is able to deliver at any speed.
In effect, with this one-step displacement, we have constructed a brushless DC motor from a
stepping motor and a collection of off-the-shelf parts. In practice, this is rarely done, but
there are numerous applications of stepping motors in closed-loop control systems that are
based on this model, usually with a microprocessor included in the feedback loop between
the shaft encoder and the motor controller. In an open-loop control system, this feedback
loop is broken, but at a high level, the basic principle remains quite similar, as illustrated in
Figure 6.4.2
In Figure 6.4.2, we replace the shaft encoder from Figure 6.4.1 with a simulation model of the
response of the motor and load to the control vector. At any instant, the actual position of the
rotor is unknown! Nonetheless, we can use the simulation model to predict, based on an assumed
rotor position and velocity, how the motor will respond to the control vector, and we can
construct this model so that its output is the control vector generated by a simulated shaft
encoder.
So long as the model is sufficiently accurate, the behavior of the motor controlled by this model will be
the same as the behavior of the motor controlled by a closed loop system!
Stepping motors come in two varieties, permanent magnet and variable. Lacking a label on
the motor, We can generally tell the two apart by feel when no power is applied. Permanent
magnet motors tend to "cog" as you twist the rotor with your fingers, while variable
reluctance motors almost spin freely (although they may cog slightly because of residual
magnetization in the rotor). We can also distinguish between the two varieties with an
ohmmeter. Variable reluctance motors usually have three (sometimes four) windings, with a
common return, while permanent magnet motors usually have two independent windings,
with or without center taps. Center-tapped windings are used in uni-polar permanent magnet
motors. Stepping motors come in a wide range of angular resolution. The coarsest motors
typically turn 90 degrees per step, while high resolution permanent magnet motors are
commonly able to handle 1.8 or even 0.72 degrees per step. With an appropriate controller,
most permanent magnet and hybrid motors can be run in half-steps, and some controllers can
handle smaller fractional steps or micro-steps. For both permanent magnet and variable
reluctance stepping motors, if just one winding of the motor is energized, the rotor (under no
load) will snap to a fixed angle and then hold that angle until the torque exceeds the holding
torque of the motor, at which point, the rotor will turn, trying to hold at each successive
equilibrium point.
The cross section shown in Figure 1.1 is of 30 degree per step variable reluctance motor. The
rotor in this motor has 4 teeth and the stator has 6 poles, with each winding wrapped around
two opposite poles. With winding number 1 energized, the rotor teeth marked X are attracted
to this winding's poles. If the current through winding 1 is turned off and winding 2 is turned
on, the rotor will rotate 30 degrees clockwise so that the poles marked Y line up with the
poles marked 2. To rotate this motor continuously, we just apply power to the 3 windings in
sequence. Assuming positive logic, where a 1 means turning on the current through a motor
winding, the following control sequence will spin the motor illustrated in Figure 1.1
clockwise 24 steps or 2 revolutions:
Winding 1 1001001001001001001001001
Winding 2 0100100100100100100100100
Winding 3 0010010010010010010010010
time --->
There are also variable reluctance stepping motors with 4 and 5 windings, requiring 5 or 6
wires. The principle for driving these motors is the same as that for the three winding variety,
but it becomes important to work out the correct order to energize the windings to make the
motor step nicely. The motor geometry illustrated in Figure 1.1, giving 30 degrees per step,
uses the fewest number of rotor teeth and stator poles that performs satisfactorily. Using
more motor poles and more rotor teeth allows construction of motors with smaller step angle.
Toothed faces on each pole and a correspondingly finely toothed rotor allows for step angles
as small as a few degrees.
Unipolar Motors
The motor cross section shown in Figure 1.2 is of a 30 degree per step permanent magnet
or hybrid motor -- the difference between these two motor types is not relevant at this
level of abstraction. Motor winding number 1 is distributed between the top and bottom
stator pole, while motor winding number 2 is distributed between the left and right motor
poles. The rotor is a permanent magnet with 6 poles, 3 south and 3 north, arranged
around its circumference.
For higher angular resolutions, the rotor must have proportionally more poles. The 30
degree per step motor in the figure is one of the most common permanent magnet motor
designs, although 15 and 7.5 degree per step motors are widely available. Permanent
magnet motors with resolutions as good as 1.8 degrees per step are made, and hybrid
motors are routinely built with 3.6 and 1.8 degrees per step, with resolutions as fine as
0.72 degrees per step available.
As shown in the figure, the current flowing from the center tap of winding 1 to terminal a
causes the top stator pole to be a north pole while the bottom stator pole is a south pole.
This attracts the rotor into the position shown. If the power to winding 1 is removed and
winding 2 is energized, the rotor will turn 30 degrees, or one step.
To rotate the motor continuously, we just apply power to the two windings in sequence.
Assuming positive logic, where a 1 means turning on the current through a motor
winding, the following two control sequences will spin the motor illustrated in Figure 1.2
clockwise 24 steps or 4 revolutions:
Winding 1a 1000100010001000100010001
Winding 1b 0010001000100010001000100
Winding 2a 0100010001000100010001000
Winding 2b 0001000100010001000100010
time --->
Winding 1a 1100110011001100110011001
Winding 1b 0011001100110011001100110
Winding 2a 0110011001100110011001100
Winding 2b 1001100110011001100110011
time --->
Note that the two halves of each winding are never energized at the same time. Both sequences
shown above will rotate a permanent magnet one step at a time. The top sequence only powers
one winding at a time, as illustrated in the figure above; thus, it uses less power. The bottom
sequence involves powering two windings at a time and generally produces a torque about 1.4
times greater than the top sequence while using twice as much power.
The step positions produced by the two sequences above are not the same; as a result,
combining the two sequences allows half stepping, with the motor stopping alternately at the
positions indicated by one or the other sequence. The combined sequence is as follows:
Winding 1a 11000001110000011100000111
Winding 1b 00011100000111000001110000
Winding 2a 01110000011100000111000001
Winding 2b 00000111000001110000011100 time --->
Bipolar Motors
Bipolar permanent magnet and hybrid motors are constructed with exactly the same mechanism as is
used on unipolar motors, but the two windings are wired more simply, with no center taps. Thus, the
motor itself is simpler but the drive circuitry needed to reverse the polarity of each pair of motor
poles is more complex. The schematic in Figure 1.3 shows how such a motor is wired, while the
motor cross section shown here is exactly the same as the cross section shown in Figure 1.2.
Briefly, an H-bridge allows the polarity of the power applied to each end of each winding to
be controlled independently. The control sequences for single stepping such a motor are
shown below, using + and - symbols to indicate the polarity of the power applied to each
motor terminal:
Note that many full H-bridge driver chips have one control input to enable the output and
another to control the direction. Given two such bridge chips, one per winding, the following
control sequences will spin the motor identically to the control sequences given above:
This section of the stepper motor deals with the basic final stage drive circuitry for stepping
motors. This circuitry is centered on a single issue, switching the current in each motor
winding on and off, and controlling its direction. The circuitry discussed in this section is
connected directly to the motor windings and the motor power supply, and this circuitry is
controlled by a digital system that determines when the switches are turned on or off. This
section covers the most elementary control circuitry for each class of motor. All of these
circuits assume that the motor power supply provides a drive voltage no greater than the
motor's rated voltage, and this significantly limits motor performance. The next section, on
current limited drive circuitry, covers practical high-performance drive circuits.
Fig 6.4.6 Boxes Used for representing switches
In Figure 3.1, boxes are used to represent switches; a control unit, not shown, is responsible for
providing the control signals to open and close the switches at the appropriate times in order to spin
the motors. In many cases, the control unit will be a computer or programmable interface controller,
with software directly generating the outputs needed to control the switches, but in other cases,
additional control circuitry is introduced, sometimes gratuitously! Motor windings, solenoids and
similar devices are all inductive loads. As such, the current through the motor winding cannot be
turned on or off instantaneously without involving infinite voltages! When the switch controlling a
motor winding is closed, allowing current to flow, the result of this is a slow rise in current. When the
switch controlling a motor winding is opened, the result of this is a voltage spike that can seriously
damage the switch unless care is taken to deal with it appropriately. There are two basic ways of
dealing with this voltage spike. One is to bridge the motor winding with a diode, and the other is to
bridge the motor winding with a capacitor. Figure 3.2 illustrates both approaches:
The diode shown in Figure must be able to conduct the full current through the motor winding, but it
will only conduct briefly each time the switch is turned off, as the current through the winding
decays. If relatively slow diodes such as the common 1N400X family are used together with a fast
switch, it may be necessary to add a small capacitor in parallel with the diode. The capacitor shown in
Figure 3.2 poses more complex design problems! When the switch is closed, the capacitor will
discharge through the switch to ground, and the switch must be able to handle this brief spike of
discharge current. A resistor in series with the capacitor or in series with the power supply will limit
this current. When the switch is opened, the stored energy in the motor winding will charge the
capacitor up to a voltage significantly above the supply voltage, and the switch must be able to
tolerate this voltage. To solve for the size of the capacitor, we equate the two formulas for the stored
energy in a resonant circuit:
P = C V2 / 2
P = L I2 / 2
Where:
In Figure as in previous Figure boxes are used to represent switches; a control unit, not shown, is
responsible for providing the control signals to open and close the switches at the appropriate times in
order to spin the motors. The control unit is commonly a computer or programmable interface
controller, with software directly generating the outputs needed to control the switches. As with drive
circuitry for variable reluctance motors, we must deal with the inductive kick produced when each of
these switches is turned off. Again, we may shunt the inductive kick using diodes, but now, 4 diodes
are required, as shown in Figure 3.4:
Figure 6.4.9 Drive circuitry of stepper motor
The extra diodes are required because the motor winding is not two independent inductors, it is a
single center-tapped inductor with the center tap at a fixed voltage. This acts as an autotransformer!
When one end of the motor winding is pulled down, the other end will fly up, and visa versa. When a
switch opens, the inductive kickback will drive that end of the motor winding to the positive supply,
where it is clamped by the diode.
The opposite end will fly downward, and if it was not floating at the supply voltage at the time, it
will fall below ground, reversing the voltage across the switch at that end. Some switches are immune
to such reversals, but others can be seriously damaged. A capacitor may also be used to limit the
kickback voltage, as shown in Figure 6.4.10:
The rules for sizing the capacitor shown in Figure 3.5 are the same as the rules for sizing the
capacitor shown in Figure 3.2, but the effect of resonance is quite different! With a permanent magnet
motor, if the capacitor is driven at or near the resonant frequency, the torque will increase to as much
as twice the low-speed torque! The resulting torque versus speed curve may be quite complex, as
illustrated in
This circuit is effective for driving motors with up to about 50 ohms per winding at voltages up to
about 4.5 volts using a 5 volt supply. Each tri-state buffer in the LS244 can sink about twice the
current it can source, and the internal resistance of the buffers is sufficient, when sourcing current, to
evenly divide the current between the drivers that are run in parallel. This motor drive allows for all
of the useful states achieved by the driver in Figure 3.13, but these states are not encoded as
efficiently:
XYE Mode
The second dynamic braking mode, XYE=110, provides a slightly weaker braking effect than the first
because of the fact that the LS244 drivers can sink more current than they can source.
ULN2003
DESCRIPTION
The ULN2003 is high voltage, high current Darlington arrays each containing seven open
collectors Darlington pairs with common emitters. Each channel rated at 500mAand can
withstand peak currents of 600mA.Suppressiondiodesare included for inductive load driving and
the inputs are pinned opposite the outputs to simplify board layout.
PIN CONNECTION
THERMAL DATA
CIRCUIT DESCRIPTION:
In this project we required operating voltage for Microcontroller 89C51 is 5V. Hence the 5V
D.C. power supply is needed for the IC’s. This regulated 5V is generated by stepping down the
voltage from 230V to 18V now the step downed a.c voltage is being rectified by the Bridge
Rectifier using 1N4007 diodes. The rectified a.c voltage is now filtered using a ‘C’ filter. Now
the rectified, filtered D.C. voltage is fed to the Voltage Regulator. This voltage regulator
provides/allows us to have a Regulated constant Voltage which is of +5V. The rectified; filtered
and regulated voltage is again filtered for ripples using an electrolytic capacitor 100μF. Now the
output from this section is fed to 40th pin of 89C51 microcontroller to supply operating voltage.
The microcontroller 89C51 with Pull up resistors at Port0 and crystal oscillator of 11.0592 MHz
crystal in conjunction with couple of 30-33pf capacitors is placed at 18 th & 19th pins of 89C51 to
make it work (execute) properly. The automatic gate opening/closing system is provided with the
Reflection sensors placed at a distance of few kilometers on the both sides from the crossing
road. These sensors give the train reaching and leaving status to the embedded controller at the
gate to which they are connected. The controller operates (open/close) the gate as per the
received signal from the Reflection sensors.
The train driver always observes the signals placed beside the track. These signals are controlled
from the control room. The green light denotes that the track is free and red light denotes the
track is busy or damaged. These signals are controlled based on the train position which is
sensed by using the Reflection sensors placed along the track. The position of the train can be
estimated by using the Reflection sensor placed along the track and is displayed on the control
room to indicate the train position along the track.
.
The track protection is achieved by providing the closed loop along the track. If any crack or cut
is occurred to the track simultaneously the same happens to the closed loop. This gives a signal
to the controller at the control room. From control room we can give the red signal by knowing
the position of the train through the Reflection sensors.
Software
Software components
About Keil
Save the Project by typing suitable project name with no extension in u r own folder sited in
either C:\ or D:\
Then Click on Save button above.
Now double click on the Target1, you would get another option “Source group 1” as shown in
next page.
Click on the file option from menu bar and select “new”
The next screen will be as shown in next page, and just maximize it by double clicking on its
blue boarder.
For a program written in Assembly, then save it with extension “. asm” and for “C” based
program save it with extension “ .C”
Now right click on Source group 1 and click on “Add files to Group Source”
Now you will get another window, on which by default “C” files will appear.
Now select as per your file extension given while saving the file
Now Press function key F7 to compile. Any error will appear if so happen.
If the file contains no error, then press Control+F5 simultaneously.
It has been developed by integrating features of all the hardware components used.
Presence of every module has been reasoned out and placed carefully thus contributing to the
best working of the unit.
Secondly, using highly advanced IC’s and with the help of growing technology the project has
been successfully implemented.
Bibliography
-Kenneth J.Ayala
-B.Ram
-Ramesh S. Gaonkar
Electronic Components
-D.V. Prasad
Wireless Communications
- Theodore S. Rappaport
Mobile Tele Communications
www.national.com
www.atmel.com
www.microsoftsearch.com
www.geocities.com