1.abstract: Unmanned Automated Railway Gate Controller
1.abstract: Unmanned Automated Railway Gate Controller
1.abstract: Unmanned Automated Railway Gate Controller
1.ABSTRACT
OBJECTIVE: The aim of this project is to Automate unmanned railway gate using
microcontroller.
PROJECT DEFINATION:
The objective of this project is to manage the control system of railway gate using
the microcontroller. When train arrives at the sensing point alarm is triggered at the
railway crossing point so that the people get intimation that gate is going to be closed.
Then the control system activates and closes the gate on either side of the track. once the
train crosses the other end control system automatically lifts the gate. For mechanical
operation of the gates stepper motors are employed. Here we are using embedded
controller built around the 8051 family (AT89C52) for the control according to the data
pattern produced at the input port of the micro controller, the appropriate selected action
will be taken.. The logic is produced by the program written in Embedded C language.
The software program is written, by using the KEIL micro vision environment. The
program written is then converted in HEX code after simulation and burned on to
microcontroller using FLASH micro vision.
WORKING METHODOLOGY:
Present project is designed using 8051 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 after 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 afterside sensors. When afterside 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.
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.
2.INTRODUCTION
Introduction:
The objective of this project is to manage the control system of railway gate using
the microcontroller. When train arrives at the sensing point alarm is triggered at the
railway crossing point so that the people get intimation that gate is going to be closed.
Then the control system activates and closes the gate on either side of the track. once the
train crosses the other end control system automatically lifts the gate. For mechanical
operation of the gates 1.8 step angle stepper motors are employed. Here we are using
embedded controller built around the 8051 family (AT89C52) for the control according to
the data pattern produced at the input port of the micro controller, the appropriate selected
action will be taken.. The logic is produced by the program written in Embedded C
language. The software program is written, by using the KEIL micro vision environment.
The program written is then converted in HEX code after simulation and burned on to
microcontroller using FLASH micro vision.
AT89C51 Microcontroller
The Micro controller (AT89C51) is a low power; high performance CMOS 8-bit
micro controller with 4K bytes of Flash programmable and erasable read only memory
(PEROM). The on-chip Flash allows the program memory to be reprogrammed in-system
or by a conventional non-volatile 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. By using this controller the data inputs from the smart card is passed to the
parallel port of the pc and accordingly the software responds. The IDE for writing the
embedded program used is KEI L software.
3.CIRCUIT DIAGRAM
4.COMPONENTS
The project consists of three main parts:
8051 microcontroller
IR Transmitter
IR Receiver
Stepper Motor Circuit
8051 CONTROLLER
The I/O ports of the 8051 are expanded by connecting it to an 8255 chip. The 8255 is
programmed as a simple I/O port for connection with devices such as LEDs, stepper
motors and sensors.
The following block diagram shows the various devices connected to the different
ports of an 8255. The ports are each 8-bit and are named A, B and C. The individual ports
of the 8255 can be programmed to be input or output, and can be changed dynamically.
The control register is programmed in simple I/O mode with port A, port B and port C
(upper) as output ports and port C (lower) as an input port.
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.
IR TRANSMITTER
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
5.EMBEDDED SYSTEMS
Introduction:
An Embedded system is a combination of computer hardware and software, and
perhaps additional mechanical or other parts, designed to perform a specific function.
Embedded systems are usually a part of larger, complex system. Dedicated
applications, designed to execute specific activities, are implemented and embedded in
systems. These embedded applications are required to collaborate with the other
components of an enclosed system. Embedded application components interact mostly
with the non-human external environment. They continuously collect data from sensors
or other computer components and process data within real-time constraints. Embedded
systems are usually associated with dedicated hardware and specific software.
Collaborative application
Understand
Understanduser
user
requirements
requirements
Choose
optimum
5.1 EMBEDDED PRODUCT
DEVELOPMENT
LIFE CYCLE
Choose
optimum
electronic
electronicchip
chip
S/W Side
H/W Side
HLL/ALL
HLL/ALL
PCB
PCBLayout
Layoutdesign
design
Algorithm
Algorithm
Coding/Editing
Coding/Editing
Compiling/Assembling
Compiling/Assembling
Assembling
Assembling
components
components
Debugging
Debugging
Testing
Testing
Testing
Testing
Simulator
Simulator
S/W
S/W
H/W
H/W
DOWNLOAD
ICE
ICE(In
(InCircuit
Circuit
Emulator)
Emulator)
Embedded
EmbeddedProduct
Product
Introduction:
Unlike software designed for general-purpose computers, embedded software
cannot usually be run on other embedded system without significant modification. This is
mainly because of the incredible variety in the underlying hardware. The hardware in
each embedded system is tailored specifically to the application, in order to keep system
costs low. As a result, unnecessary circuitry is eliminated and hardware resources are
shared whenever possible.
In order to have software, there must be a place to store the executable code and
temporary storage for runtime data manipulation. These take the form of ROM and RAM,
respectively. All embedded systems also contain some type of inputs and outputs. It is
almost always the case that the outputs of the embedded system are a function of its
inputs and several other factors. The inputs to the system usually take the form of sensors
and probes, communication signals, or control knobs and buttons. The outputs are
typically displays, communication signals, or changes to the physical world.
Memory
Memory
Inputs
Inputs
Processor
Processor
Outputs
Outputs
Processing power
Memory
Development cost
Number of Units
Expected Lifetime
Reliability
Processing power
This is the amount of processing power necessary to get the hob done. A common
way to compare processing power is the MIPS (millions of instructions per second)
rating. Other important features of the processor need to be consider is register width,
typically ranges from 8 to 64 bits.
Memory:
The amount of memory (ROM and RAM) required holding the executable
software and data it manipulates. The amount of memory required can also affect the
processor selection. In general, the register width off a processor establishes the upper
limit of the amount of memory it can access.
Development cost:
The development cost of the hardware and software design processes is a fixed,
one-time cost, so it might be that money is no object or that this is the only accurate
measure of system cost.
Number of units:
The tradeoff between production cost and development cost is affected most by
the number of units expected to be produced and sold.
Expected lifetime:
This indicates how long must the system continue to function? This affects all
sorts of design decisions from the selection of hardware components to how much the
system may cost to develop and produce.
Reliability:
How reliable must the final product be? If it is a childrens toy, it doesnt always
have to work right, but if it is part of a space shuttle or a car, it had sure better do what it
is supposed to each and every time.
The Basic Design REALTIME:
Designing Embedded systems is a challenging task. Most of the challenge comes
from the fact that Embedded systems have to interact with real world entities. These
interactions can get fairly complex. A typical Emebbed system might be interacting with
thousands of such entities at the same time. For example, a telephone switching system
routinely handles calls from tens of thousands of subscriber. The system has to connect
each call differently. Also, the exact sequence of events in the call might vary a lot.
Embedded systems have to respond to external interactions in a predetermined
amount of time. Successful completion of an operation depends upon the correct and
timely operation of the system. Design the hardware and the software in the system to
meet the Realtime requirements. For example, a telephone switching system must feed
dial tone to thousands of subscribers within a recommended limit of one second. To meet
nodes, it is likely that the system may not be able to meet the Realtime
requirement due to even mild congestion. Thus a simpler architecture has a better
chance of meeting the Realtime requirements.
Is the Operating System suitable? Assign high priority to tasks that are involved
in processing Realtime critical events. Consider preemptive scheduling if
Realtime requirements are stringent. When choosing the operating system, the
interrupt latency and scheduling variance should be verified.
o Scheduling variance refers to the predictability in task scheduling times.
For example, a telephone switching system is expected to feed dialtone in
less than 500 ms. This would typically involve scheduling three to five
tasks within the stipulated time. Most operating systems would easily meet
6.MICROCONTROLLER
Introduction:
Microcontrollers are "embedded" inside some other device (often a consumer
product) so that they can control the features or actions of the product. Another name for
a microcontroller, therefore, is "embedded controller."
Microcontrollers are dedicated to one task and run one specific program. The
program is stored in ROM (read-only memory) and generally does not change.
A microcontroller has a dedicated input device and often (but not always) has a
small LED or LCD display for output. A microcontroller also takes input from the
device it is controlling and controls the device by sending signals to different
components in the device.
For example, the microcontroller inside a TV takes input from the remote control
and displays output on the TV screen. The controller controls the channel selector,
the speaker system and certain adjustments on the picture tube electronics such as
tint and brightness. The engine controller in a car takes input from sensors such as
the oxygen and knock sensors and controls things like fuel mix and spark plug
A microcontroller is often small and low cost. The components are chosen to
minimize size and to be as inexpensive as possible.
BLOCK DIAGRAM:
PIN CONFIGURATIONS:
PIN DESCRIPTION
VCC Supply voltage.
GND Ground.
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
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:
Port Pin
P3.0
P3.1
P3.2
P3.3
P3.4
P3.5
P3.6
P3.7
Alternate Functions
RXD (serial input port)
TXD (serial output port)
INT0 (external interrupt 0)
INT1 (external interrupt 1)
T0 (timer 0 external input)
T1 (timer 1 external input)
WR (external data memory Write
strobe)
RD (external data memory read
strobe)
RST
Reset 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 microcontroller is in external execution mode.
PSEN
Program Store Enable is the read strobe to external program memory. When the
AT89C51 is executing code from external program memory,
each machine cycle, except that two
PSEN
PSEN
is activated twice
/VPP
External Access Enable 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
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
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 Figure 1.
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 2. 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.
oscillate
back
and
f=12 ((1+C/CP)/(LC)))
front
at
the
resonant
frequency
of
crystal.
Quartz crystal exhibits a property called the piezo-electric effect that is they
produce an electric voltage. When subjected to pressure along certain direction of the
crystal because of this property quartz crystal has important application in electronics
industry for controlling the frequency of radio waves.When piezo-electric crystal is used
in place of LC circuit for higher frequency stability, the oscillator is called as crystal
oscillator.
Crystal oscillator is used for stability frequency for a long period of time. The
resolution of 0.01 nm/s can be obtained. Crystal operates between fp and fs frequency (a
very narrow bandwidth).
Status of External Pins during Idle and Power-down Modes
Mode
Idle
Idle
Powerdown
Powerdown
Program
ALE
PSEN
Port 0
Port 1
Port 2
1
1
1
1
Data
Float
Data
Data
Data
Data
Address Data
Internal
Data
Data
Data
Data
External
Float
Data
Data
Data
Memory
Internal
External
Port3
LB1
LB2
LB3
Protection Type
No program lock features
MOVC instructions executed
from
external
Flash is disabled
Same as mode 2, also verify is disabled
Same as mode 3, also external execution is
disabled
RST
PSEN
Bit-1
Bit-2
Bit-3
ALE/PROG
P3.7
H/12V H
H/12V H
H/12V H
Chip Erase
H
Read Signature H
L
L
H/12V H
H
L
L
L
L
L
L
L
Write
Lock
EA
Symbol
1/tCLCL
tCLCL
techs
talc
talc
techs
Parameter
Oscillator Frequency
Clock Period
High Time
Low Time
Rise Time
Fall Time
Min
0
41.6
15
15
Max
24
20
20
Units
MHz
ns
ns
ns
ns
ns
7.HARDWARE DISCRIPTION
7.1 STEPER MOTOR
Introduction:
Stepper motors convert electrical energy into precise mechanical motion. These
motors rotate a specific incremental distance per each step. The number of steps executed
controls the degree of rotation of the motors shaft. This characteristic makes step motors
excellent for positioning applications. For example, a 1.8 step motor executing 100 steps
will rotate exactly 180 with some small amount of non-cumulative error. The speed of
step execution controls the rate of motor rotation. A 1.8 step motor executing steps at a
speed of 200 steps per second will rotate at exactly 1 revolution per second.
Stepper motors can be very accurately controlled in terms of how far and how fast
they will rotate. The number of steps the motor executes is equal to the number of pulse
commands it is given. A step motor will rotate a distance and at a rate that is proportional
to the number and frequency of its pulse commands.
Basic Stepper Motor System
The driver takes the pulses from the pulse generator and determines how and
when the windings should be energized. The windings must be energized in a specific
sequence to generate motion. Finally there is the step motor itself. A step motor has two
primary parts; the rotor, the moving piece, and the stator, the stationary piece. The stator
contains coils of wire called windings. The rotor spins on bearings or bushings inside the
stator. All step motors operate through the principle of the rotor following a rotating
magnetic field created by sequencing the flow of current through the stator windings.
Each NMB step motor has two phases, which are groups of electrically connected
windings. As current is passed through each phase, the motor takes steps or small
movements to keep in synchronism with the magnetic field. The degree of rotation per
step depends on the style of driver used and the construction of the motor.
Step Motor Advantages:
Accuracy & Repeatability Ability to position accurately.
Responsiveness & Quick Acceleration Step motors have low rotor inertia,
allowing them to get up to speed quickly. This makes step motors an excellent choice for
short, quick moves.
Excellent torque for their size Step motors have the highest torque per cubic
inch of any motor.
Positioning Stability Unlike other types of motors, step motors can be held
completely motionless in their stopped position.
7.2 CAPACITORS
Introduction:
An electrolytic capacitor is a type of capacitor typically with a larger capacitance
per unit volume than other types, making them valuable in relatively high-current and
low-frequency electrical circuits. This is especially the case in power-supply filters,
where they store charge needed to moderate output voltage and current fluctuations, in
rectifier output, and especially in the absence of rechargeable batteries that can provide
similar low-frequency current capacity. They are also widely used as coupling capacitors
in circuits where AC should be conducted but DC should not; the large value of the
capacitance allows them to pass very low frequencies.
The electrolytic capacitor was invented in 1886 by Charles Pollack. It was largely
responsible for the development of mains-powered radio receivers, since it permitted the
filtering of the 50-60 hertz power supplied to residences, after it was rectified to power
the radio tubes. This was not practical without the small volume and low cost of
electrolytic capacitors.
Construction
Aluminum electrolytic capacitors are constructed from two conducting aluminum
foils, one of which is coated with an insulating oxide layer, and a paper spacer soaked in
electrolyte. The foil insulated by the oxide layer is the anode while the liquid electrolyte
and the second foil act as cathode. This stack is then rolled up, fitted with pin connectors
and placed in a cylindrical aluminum casing. The two most popular geometries are axial
leads coming from the center of each circular face of the cylinder, or two radial leads or
lugs on one of the circular faces. Both of these are shown in the picture
Polarity
In aluminum electrolytic capacitors, the layer of insulating aluminum oxide on the
surface of the aluminum plate acts as the dielectric, and it is the thinness of this layer that
allows for a relatively high capacitance in a small volume. The aluminum oxide layer can
These are the different schematic symbols for electrolytic capacitors. The minus or N
marked side of the physical capacitor is equivalent to the node opposite to the plus sign
on its symbolic equivalent. Tip: Take notice of the shape of the symbols and the
placement of the positive and negative nodes, because most schematics do not print the
"+", but rely on the symbol itself instead.
note: caps in metal can have the color mark at the minus side !
axial: the minus wire is connected to the case, the plus wire is isolated.
radial = single ended: a vertical color stripe indicates the minus side.
Electrolyte
The electrolyte is usually boric acid or sodium borate in aqueous solution together
with various sugars or ethylene glycol which are added to retard evaporation. Care should
be taken to avoid ingestion of or eye contact with the electrolyte, and any areas of the
body where skin contact has occurred should be washed in good time. It is important to
follow safe working practice and to use appropriate protective equipment, notably gloves
and safety glasses, when working with the electrolyte. Some very old tantalum
electrolytic, often called "Wet-slug", contain the more hazardous sulfuric acid, however
most of these are no longer in service due to corrosion.
Capacitance
The capacitance value of any capacitor is a measure of the amount of electric
charge stored per unit of potential difference between the plates. The basic unit of
capacitance is a farad, however this unit has been too large for general use until the
invention of the Double-layer capacitor, so microfarad, nanofarad and microfarad are
more commonly used. These are usually abbreviated to if or of, no and puff
Many conditions determine a capacitor's value, such as the thickness of the
dielectric and the plate area. In the manufacturing process, electrolytic capacitors are
made to conform to a set of preferred numbers. By multiplying these base numbers by a
power of ten, any practical capacitor value can be achieved, which is suitable for most
applications.
A standardized set of capacitor base numbers was devised so that the value of any
modern electrolytic capacitor could be derived from multiplying one of the modern
conventional base numbers 1.0, 1.5, 2.2, 3.3, 4.7 or 6.8 by a power of ten. Therefore, it is
common to find capacitors with values of 10, 15, 22, 33, 47, 68, 100, 220, and so on.
Using this method, values ranging from 0.1 to 4700 are common in most applications.
Values are generally in microfarads (F).
Most electrolytic capacitors have a tolerance range of 20 %, meaning that the
manufacturer is stating that the actual value of the capacitor lies within 20 % of its
labeled value. Selection of the preferred series ensures that any capacitor can be sold as a
standard value, within the tolerance.
Super capacitor
MC and BC series super capacitors (up to 3000 farad capacitance) produced by Maxwell
Technologies
Super capacitors, also known as ultra capacitors or electrochemical double layer
capacitors (EDLC), are electrochemical capacitors that have an unusually high energy
density when compared to common capacitors, typically on the order of thousands of
times greater than a high-capacity electrolytic capacitor. For instance, a typical D-cell
sized electrolytic capacitor will have a storage capacity measured in microfarads, while
the same size super capacitor would store several farads, an improvement of about 10,000
times. Larger commercial super capacitors have capacities as high as 5,000 farads.
Super capacitors have a variety of commercial applications, notably in "energy
smoothing" and momentary-load devices. Some of the earliest uses were motor startup
capacitors for large engines in tanks and submarines, and as the cost has fallen they have
started to appear on diesel trucks and railroad locomotives. More recently they have
become a topic of some interest in the green energy world, where their ability to quickly
soak up energy makes them particularly suitable for regenerative braking applications,
whereas batteries have difficulty in this application due to slow charging times. If the
LEES or Ester devices can be commercialized, they will make an excellent replacement
for batteries in all-electric cars and plug-in hybrids, as they combine quick charging,
temperature stability and excellent safety properties.
Technology advantages
Due to the capacitor's high number of charge-discharge cycles (millions or more
compared to 2001000 for most commercially available rechargeable batteries) there
were no disposable parts during the whole operating life of the device, which makes the
device environmentally friendly. storing energy from other sources for load balancing
purposes and then using any excess energy to charge the batteries only at opportune
times.
Other advantages of super capacitors compared with rechargeable batteries are
extremely low internal resistance or ESR, high efficiency (up to 97-98%), high output
power, extremely low heating levels, and improved safety. According to ITS (Institute of
Transportation Studies, Davis, CA) test results, the specific power of super capacitors can
exceed 6 kW/kg at 95% efficiency
The idea of replacing batteries with capacitors in conjunction with novel
alternative energy sources became a conceptual umbrella of the Green Electricity (GEL)
Initiative, introduced by Dr. Alexander Bell.
For example, a resistor with bands of yellow, violet, red, and gold will have first
digit 4 (yellow in table below), second digit 7 (violet), followed by 2 (red) zeros:
4,700 ohms. Gold signifies that the tolerance is 5%, so the real resistance could lie
anywhere between 4,465 and 4,935 ohms.
Resistors manufactured for military use may also include a fifth band which
indicates component failure rate (reliability); refer to MIL-HDBK-199 for further details.
The Standard EIA Color Code Table per EIA-RS-279 is as follows:
100
Brown 1
101
1% (F)
100 pap
Red
102
2% (G)
50 pap
Orange 3
103
15 pap
Yellow 4
104
25 pap
Green 5
105
0.5% (D)
Blue
106
0.25% (C)
Violet 7
107
0.1% (B)
Grey
108
0.05% (A)
White 9
109
Gold
0.1
5% (J)
Silver
0.01
10% (K)
None
20% (M)
Note: red to violet are the colors of the rainbow where red is low energy and violet is
higher energy.
CIRCUIT DIAGRAM:
7805
1
230 V
AC
SUPPL
4
Y TRANSFORMER
50 HZ
IN4007
2
6
1 100u
IN400
7
1k
1
2 1000u
1f
LED
POWER SUPPLY:
To run the electronic gadget at home it is provided by some power supply. The
microcontroller used (at89c51) requires 12v D.C supply. The DTMF receiver used
(mt8870) requires 5v D.C. so design of these regulated power supply is also an important
part in hardware design. The A.C power supply from mains is taken and regulated using
the rectifiers.
For design of a regulated power supply components used are:
Transformer.
Diodes.
Rectifiers.
Regulated IC chips.
Capacitive filters.
Trans former:
A transformer is required to couple the mains to the actual power supply circuit.
This is required to isolate the mains from the actual regulated power supply circuit and
the other part of the kit. This isolation eliminates the dame of the kit to any power supply
variations or from a faulty shock.
i2
V1
V2
V1 = i2 = n1
V2 i1 n2
Diodes:
In bride rectifier four diodes are used. The specifications of diodes are chosen
as:
PIV > input voltage.
Si diode is better.
Power dissipation is kept fixed with respect to current through the diode.
Junction capacitance need not be considered for frequencies <1 kHz.
RECTIFIERS:
Rectification is a process of conversion of AC to DC. Here, the AC of transformer
output is given to the rectifier input, which converts it to DC output. Basically, bridge
rectifiers or diodes arranged in bridge called Diode arrangement are used for power
supply design.
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
Capacitors:
Capacitive filters are used stabilized or perfect regulation of the voltage. The
capacitive filters are opted because, they are more efficient. But they are also more costly.
Different types of capacitors are:
1. Ceramic capacitors.
2. Electrolyte capacitors.
3. Paper/Mica capacitors.
4. Silver capacitors.
5. Tantalum capacitors.
Ceramic, Paper/Mica, Silver are nonpolarized capacitors. Electrolyte and Tantalum
are polarized capacitors. For high frequency, Ceramic capacitors are used. For low
frequencies, Electrolyte capacitors are used.
ULN2803buffer:
Features:
500-mA Rated Collector Current (Single
Output)
High-Voltage Outputs . . . 50 V
description/ordering information:
The ULN2803A is a high-voltage, highcurrent Darlington transistor array. The device
consists of eight nun Darlington pairs that feature high-voltage outputs with commoncathode clamp diodes for switching inductive loads. The collector-current rating of each
Darlington pair is 500 mA. The Darlington pairs may be connected in parallel for higher
current capability.
Applications include relay drivers, hammer drivers, lamp drivers, display drivers
(LED and gas discharge), line drivers, and logic buffers. The ULN2803A has a 2.7kseries base resistor for each Darlington pair for operation directly with TTL or 5-V
CMOS devices.
Logic diagram:
M NEMONICS
A useful mnemonic for remembering the first ten color codes matches the first letter
of the color code, by order of increasing magnitude. There are many variations:
Bad Beer Rots Our Young Guts But Vodka Goes Well
Bright Boys Rave Over Young Girls But Veto Getting Wed
B. B. R O Y of Great Britain has a Very Good Wife
Big Boys Race Our Young Girls But Violet Generally Wins
Better Be Right Or Your Great Big Venture Goes West
Black Beauty Ran Over Yellow Grass By Violent Grey Waters
Bad Boys Race Over Yonder Green But Victory Goes Wanting
Black Birds Roam Over Your Garden But Vultures Go West
Bye Bye Rosie Off You Go Birmingham Via Great Weston
The word "Bad" in the first mnemonic and "Bright" in the second mnemonic are often
replaced with the word "Black" since black comes before brown in the color code. While
the second mnemonic is certainly the most offensive of these, all except the third lack a
sobriety that might be desirable, especially in a teaching context. A more staid memory
aide uses the fact that the central part of the code follows the color spectrum, without the
i for indigo. That is,
The most common variation of the mnemonic for the EIA color code generally
doesn't stay posted on this page for long due to its choice of words which is more
offensive to many today than when it was originated (mid 1920's). Refer to the discussion
for details.
Besides the ten colors of the main value code, the tolerance code is often
remembered as "for Gold or Silver" appended to the more offensive mnemonic, or "Get
Some Now" where Now refers to none for 20%.
If it is difficult to recall that black comes before brown in the color code, it may
be helpful to use the position of white at the end of the color code as a key to remember
that black (and not brown) is at the beginning.
Examples
Green-Blue-Black-Black-Brown
o 560 1%
Red-Red-Orange-Gold
o 22,000 5%
Yellow-Violet-Brown-Gold
o 470 5%
Blue-Gray-Black-Gold
o 68 5%
Note: The sizes of the resistors depend only on the power they can dissipate, and do not
affect their value.
Enough current flows to make the LED light up, but not so much that the LED is
damaged. Later in this Chapter, you will find out how to calculate a suitable value for this
resistor. (LEDs are described in detail in Chapter 5.)
The 'box' symbol for a fixed resistor is popular in the UK and Europe. A 'zig-zag'
symbol is used in America and Japan:
Resistors are used with transducers to make sensor subsystems. Transducers are
electronic components which convert energy from one form into another, where one of
the forms of energy is electrical. A light dependent resistor, or LDR, is an example of
an input transducer. Changes in the brightness of the light shining onto the surface of
the LDR result in changes in its resistance. As will be explained later, an input transducer
is most often connected along with a resistor to to make a circuit called a potential
divider. In this case, the output of the potential divider will be a voltage signal which
reflects changes in illumination.
Microphones and switches are input transducers. Output transducers include
loudspeakers, filament lamps and LEDs. Can you think of other examples of transducers
of each type?
How can the value of a resistor be worked out from the colours of the bands?
Each color represents a number according to the following scheme:
Number
Color
black
brown
red
orange
yellow
green
blue
violet
grey
white
The first band on a resistor is interpreted as the FIRST DIGIT of the resistor
value. For the resistor shown below, the first band is yellow, so the first digit is 4:
Color
1%
brown
2%
red
5%
gold
10%
silver
When you want to read off a resistor value, look for the tolerance band, usually
gold, and hold the resistor with the tolerance band at its right hand end. Reading resistor
values quickly and accurately isn't difficult, but it does take practice!
8.SOFTWARE DISCRIPTION
8.1
KEIL MICROVISION
Introduction:
Keil development tools for the 8051 Microcontroller Architecture support every
level of software developer from the professional applications engineer to the student just
learning about embedded software development.
The industry-standard Keil C Compilers, Macro Assemblers, Debuggers, Real-time
Kernels, Single-board Computers, and Emulators support all 8051 derivatives and help
you get your projects completed on schedule
The Keil 8051 Development Tools are designed to solve the complex problems facing
embedded software developers.
When starting a new project, simply select the microcontroller you use from the
Device Database and the Vision IDE sets all compiler, assembler, linker, and
memory options for you.
Numerous example programs are included to help you get started with the most
popular embedded 8051 devices.
The Keil Vision Debugger accurately simulates on-chip peripherals (IC, CAN,
UART, SPI, Interrupts, I/O Ports, A/D Converter, D/A Converter, and PWM
Modules) of your 8051 device. Simulation helps you understand hardware
configurations and avoids time wasted on setup problems. Additionally, with
simulation, you can write and test applications before target hardware is available.
When you are ready to begin testing your software application with target
hardware, use the MON51, MON390, MONADI, or FlashMON51 Target
Monitors, the ISD51 In-System Debugger, or the ULINK USB-JTAG Adapter to
download and test program code on your target system.
The Vision3 IDE offers numerous features and advantages that help you quickly and
successfully develop embedded applications. They are easy to use and are guaranteed to
help you achieve your design goals.
The Vision3 IDE and Debugger is the central part of the Keil development tool chain.
Vision3 offers a Build Mode and a Debug Mode.
In the Vision3 Build Mode you maintain the project files and generate the application.
In the Vision3 Debug Mode you verify your program either with a powerful CPU and
peripheral simulator or with the Keil ULINK USB-JTAG Adapter (or other AGDI
drivers) that connect the debugger to the target system. The ULINK allows you also to
download your application into Flash ROM of your target system.
The tabs of the Output Window provides: Build messages and fast error access;
Debug Command input/output console; Find in Files results with quick file
access.
The Memory Window gives access to the memory areas in display various
formats.
The Watch & Call Stack Window allows you to review and modify program
variables and displays the current function call tree.
The Workspace is used for the file editing, disassembly output, and other debug
information.
The Peripheral Dialogs help you to review the status of the on-chip peripherals
in the microcontroller.
Vision3 IDE
The Vision3 IDE combines project management, a rich-featured editor with
interactive error correction, option setup, make facility, and on-line help. Use Vision3 to
create your source files and organize them into a project that defines your target
application. Vision3 automatically compiles, assembles, and links your embedded
application and provides a single focal point for your development efforts.
Library Manager
The library manager allows you to create object library from the object files
created by the compiler and assembler. Libraries are specially formatted, ordered
program collections of object modules that may be used by the linker at a later time.
When the linker processes a library, only those object modules in the library that are
necessary to create the program are used.
Linker/Locator
The Linker/Locator creates an executable program file using the object modules
extracted from libraries and those created by the compiler and assembler. An executable
program file (also called absolute object module) contains no reloadable code or data. All
code and data reside at fixed memory locations.
Vision3 Debugger
The Vision3 symbolic, source-level debugger is ideally suited for fast, reliable
program debugging. The debugger includes a high-speed simulator that let you simulate
an microcontroller system including on-chip peripherals and external hardware. The
Vision3 Debugger provides several ways for you to test your programs on real target
hardware.
Use the Keil ULINK USB-JTAG adapter for Flash downloading and software test
of your program via on-chip debugging system like the Embedded ICE macro cell
that is integrated in many ARM devices.
Use the AGDI interface to attach use the Vision3 Debugger front end with your
target system using other debuggers like Monitor, In-System Debugger, or
Emulator.
At Keil Software, we are dedicated to provide you with the best embedded
development tools and documentation available. If you have suggestions or comments
regarding any of the on-line manuals accompanying this product, please contact us. If
you think you have discovered a problem with the software, do the following before
calling technical support.
1. Read the sections in this manual that pertains to the job or task you are trying to
accomplish.
2. Make sure you are using the most current version of the software and utilities.
Check www.keil.com/update to make sure that you have the latest software
version.
3. Isolate the problem to determine if it is a problem with the assembler, compiler,
linker, debugger, or another development tool.
4. Further isolate software problems by reducing your code to a few lines.
If you are still experiencing problems after following these steps, report them to
our technical support group. Please include your product serial number and version
number. We prefer that you send the problem via email. If you contact us by fax, be sure
to include your name and telephone numbers (voice and fax) where we can reach you.
Try to be as detailed as possible when describing the problem you are having. The
more descriptive your example, the faster we can find a solution. If you have a singlepage code example demonstrating the problem, please email it to us. If possible, make
The menu bar provides menus for editor operations, project maintenance,
development tool option settings, program debugging, external tool control,
window selection and manipulation, and on-line help.
The toolbar buttons allow you to rapidly execute Vision3 commands. A Status
Bar provides editor and debugger information. The various toolbars and the status
bar can be enabled or disabled from the View Menu commands.
Keyboard shortcuts offer quick access to Vision3 commands and may be
configured via the menu command Edit Configuration - Shortcut Key.
The following sections list the Vision3 commands that can be reached by menu
commands, toolbar buttons, and keyboard shortcuts. The Vision3 commands are
grouped mainly based on the appearance in the menu bar:
CREATING APPLICATIONS
Home Creating Applications
This chapter describes the Build Mode of Vision3 and is grouped into the
following sections:
Project Target and File Groups: shows how to create application variants
and organized the files that belong to a project.
Tips and Tricks: provides information about the advanced features of the
Vision3 Project Manager.
CREATE PROJECT
Home Creating Applications Create Project
Vision3 is a standard Windows application and started by clicking on the
program icon. About the Environment describes the different window areas of
Vision3.
Vision3 includes a project manager which makes it easy to design applications
for an ARM based microcontroller. You need to perform the following steps to create
a new project:
The section provides a step-by-step tutorial that shows you how to create a
simple Vision3 project.
PROJECT TARGETS
AND
FILE GROUPS
The Project Workspace shows all groups and the related files. Files are built
and linked in the same order as shown in this window. You can move file positions
with Drag & Drop. You may select a target or group name and Click to rename it.
The local menu opens with a right mouse Click and allows you for each item:
to
to
to
to
In the build toolbar you can quickly change the current project target to build.
PROJECT COMPONENTS
Home Dialogs Project
You may add, delete, or re-arrange the items with the list box buttons in
Project Targets, Groups, and Files.
Project Targets
Shows all Project Targets in your project. Project Targets let you create
several programs form a single project. You may need one target for testing
and another target for a release version of your application.
Groups
Files
Shows all File Groups in your current project. File Groups let you group
associated files together in a project. This is useful for grouping files into
functional blocks or for identifying engineers in your software team.
FILE EXTENSIONS
Home Creating Applications Tips and Tricks File Extensions
The dialog Project Components, Environment and Books allows you to
set the file extension for the various file types of a project. You can enter several
extensions when you separate them by semi-colon. The file extensions are project
specific.
Debugging
Home Debugging
This chapter describes the Debug Mode of Vision3 and shows you how to use the
user interface to test a sample program. Also discussed are simulation mode and the
different options available for program debugging.
You can use Vision3 Debugger to test the applications you develop. The
Vision3 Debugger offers two operating modes that are selected in the Options for
Target Debug dialog.
including the serial port, external I/O, and timers. The peripheral set is
selected when you select a CPU from the device database for your target.
Use Advanced GDI drivers, like the ULINK Debugger to interface to your
target hardware. For Vision3 various drivers are available that interface to:
o JTAG/OCDS Adapter: which connects to on-chip debugging systems
like the ARM Embedded ICE.
o Monitor: that may be integrated with user hardware or is available on
many evaluation boards.
o Emulator: which connects to the CPU pins of the target hardware.
o In-System Debugger: which is part of the user application program
and provides basic test functions.
o Test Hardware: such as the Infineon Smartcard ROM Monitor RM66P
or the Philips Smarm Box.
Flash Programming
Home Flash Programming
Vision3 integrates Flash Programming Utilities in the project environment. All
configurations are saved in context with your current project.
You may use external command-line driven utilities (usually provided by the chip
vendor) or the Keil ULINK USB-JTAG Adapter. The Flash Programming Utilities are
configured under Project - Options - Utilities.
Flash Programming may be started from the Flash Menu or before starting the
Vision3 Debugger when you enable Project - Options - Utilities - Update Target
before Debugging.
The Files page in the Project Workspace shows the source files that compose
the MEASURE project. The three application related source files that are located in
the Source Files group. The function of the source files is described below. To open
a source file, double-click on the filename.
Measures: contains the main C function for the measurement system and
the interrupt routine for timer 0. The main function initializes all peripherals of
the ARM and performs command processing for the system. The timer
interrupt routine, timer0, manages the real-time clock and the measurement
sampling of the system.
MCommand.C: processes the display, time, and interval commands. These
functions are called from main. The display command lists the analog values
in floating-point format to give a voltage between 0.00V and 5.00V.
GetLine.C: contains the command-line editor for characters received from
the serial port.
IRQ.S: is an interface module for the interrupt service routine.
Testing Measure
Home Example Programs Measure: A Remote Measurement System Testing
Measure
Program Execution
Home Example Programs Measure: A Remote Measurement System
Program Execution
Before you begin simulating MEASURE, open the Serial Window #1 that
displays the serial output with the View menu or the Debug toolbar. You may
disable other windows if your screen is not large enough.
You can use the Step toolbar buttons on assembler instructions or source
code lines. If the Disassembly Window is active, you single step at assembly
instruction basis. If an editor window with source code is active, you single step at
source code level.
Call Stack
Home Example Programs Measure: A Remote Measurement System Call
Stack
Vision3 internally tracks function nesting as the program executes. The Call
Stack page of the Watch Window shows the current function nesting. A double
click on a line displays the source code that called the selected function.
Breakpoints Dialog
Home Example Programs Measure: A Remote Measurement System
Breakpoints Dialog
Description
Reset CPU.
If program execution is halted begin executing the MEASURE program.
After a few seconds, Vision3 halts execution. The program counter line in the debug
window marks the line in which the breakpoint occurred.
9.CODING
Program written in C language
#include<stdio.h>
#include<reg51.h>
void delay(into);
void medley(void);
sit sen1=P1^0;
sit sen2=P1^1;
sit buzz=P1^3;
sit sig1=P1^4;
sit sig2=P1^5;
sit laser=P1 ^6;
void close();
void open();
void buzzer();
into m=10000;
void main()
{
P0=P2=P3=0x00;
P1=0xff;
buzzer();
sig1=0x00; //train stop/road go
sig2=0x01;
open();
for(;;)
{
if(sen1==0x00)
{
sig1=0x01; sig2=0x00; //train go/road stop
buzzer();
close();
medley();
while(sen2==0x01){}
while(sen2==0x00){}
sig1=0x00; sig2=0x01; //train stop/road go
buzzer();
open();
}
if(sen2==0x00)
{
sig1=0x01; sig2=0x00; //train go/road stop
buzzer();
close();
medley();
while(sen1==0x01){}
10. CONCLUSIONS :
Hence the Unmanned railway gates operate according to the data input from
sensors to microcontroller. First an alarm is triggered and then the gate is operated.
Specifications:
11. BIBLIOGRAPHY
Name of the sites:
1. www.mitel.databook.com
2. www.atmel.databook.com
3. www.franklin.com
4. www.keil.com
References:
www.8052.com/tutorial.phtml
8051 microcontroller by Kenneth J. Ayala
www.electronicsforu.com/electronicsforu/articles/hits.asp?id=1431