Wireless Sensors for Railway Safety
Wireless Sensors for Railway Safety
DECEMBER 2023
BHARATH INSTITUTE OF HIGHER EDUCATION AND RESEARCH
BHARATH INSTITUTE OF SCIENCE AND TECHNOLOGY
CHENNAI – 600073, INDIA.
DEPARTMENT OF ELECTRONICS AND COMMUNICATION
ENGINEERING
BONAFIDE CERTIFICATE
This is to certify that the project report entitled WIRELESS SENSORS BASED
ACCIDENT PREVENTION SYSTEM FOR RAILWAYS by LANKA
MANICHANDRA (U20EC079), NAGOTHI THRISHA (U20EC103), NANNURI
SISINDRI (U20EC108) to the Department of Electronics and Communication Engineering,
Bharath institute of Higher Education and Research, in partial fulfilment for the award of the
degree of B. Tech in (Electronics and Communication Engineering) is a Bonafide record
of project work carried out by the under my supervision. The content of this report, in full or
in parts, have not been submitted to any other institution or university for the award of any
other degree.
DECLARATION
We declare that this project report titled WIRELESS SENSORS BASED ACCIDENTS
PREVENTION SYSTEMS FOR RAILWAYS submitted in partial fulfilment of the
degree of B. Tech in (Electronics and Communication Engineering) is a record of
original work carried out by us under the supervision of Dr. F. VINCY LLOYD and has
not formed the basis for the award of any other degree or diploma, in this or any other
Institution or University. In keeping with the ethical practice in reporting scientific
information, due acknowledgements have been made wherever the findings of others have
been cited.
LANKA MANICHANDRA
(U20EC079)
NAGOTHI THRISHA
(U20EC103)
NANNURI SISINDRI
(U20EC108)
PLACE: CHENNAI
DATE:
ACKNOWLEDGEMENT
First, we wish to thank the almighty who gave us good health and success throughout our
project work.
We express our deepest gratitude to our beloved President Dr. J. Sundeep Aanand and
Managing Director Dr.E. Swetha Sundeep Aanand for providing us the necessary facilities
for the completion of our project.
We take great pleasure in expressing sincere thanks to Pro Chancellor Dr. K. Vijaya Baskar
Raju, Vice Chancellor Dr. M. Sundararajan, Registrar Dr. S. Bhumi Nathan, and
Additional Registrar Dr. R. Hari Prakash for backing us in this project. We thank our Dean
Academics Dr.M. Sundararaj for providing sufficient facilities for the completion of this
project.
We thank our Dean, School of Electrical Sciences Dr.S. Prakash for his encouragement and
valuable guidance.
We also take this opportunity to express a deep sense of gratitude to our Project Coordinator
and supervisor Dr.F. VINCY LLOYD for her cordial support, valuable information, and
guidance, she helped us in completing this project through various stages.
We thank our department faculty, supporting staff and friends for their help and guidance to
complete this project.
L. MANICHANDRA (U20EC079)
N. THRISHA (U20EC103)
N. SISINDRI (U20EC108)
ABSTARCT 1
CONTENTS
BONAFIDE CERTIFICATE ……………………………………………………
DECLARATION ……………………………………………………………………
ACKNOWLEDGEMENT …………………………………………………………. 2
ABSTRACT ………………………………………………………………………… 1
CHAPTER - 1
CHAPTER-2
SPECIFICATIONS ……………………………………………………………….......
CHAPTER-3
CHAPTER-4
CHAPTER-5
5. HARDWARE ………………………………………………………………… 38 3
CHAPTER-6
CHAPTER-7
CHAPTER-8
CHAPTER-9
CHAPTER-10
CHAPTER-11
CHAPTER-12
CHAPTER 1
1. INTRODUCTION 5
Signaling is the method of regularizing the Railway track and the gate for the train to
pass through without any problem. This project titled “WIRELESS SENSORS BASED
ACCIDENT PREVENTION SYSTEM FOR RAILWAYS” deals in regularizing the traffic,
monitoring the location of the train to make it easy for the customers. The word Traction
means “any operation related to the track”.
The main objective of the project is to avoid accidents at the unmanned railway gate, two
trains coming on the same track, mismanagement during signaling and power transmission as
no technology has evolved in monitoring the position of the train. This can be achieved by
using the WSN.
WSN- Wireless Sensors Networks plays vital role in finding out the position of a moving
object in the globe. WSN system saves time, life, cost in many ways to the society along with
greater security. Worldwide for almost all the surveillance need people started using WSN. It
consists of a sensing system coupled with a local transmitter, base station to receive various
transmissions from different locations, a satellite for communication, a computer along with
powerful software for proper informative needs and decision making.
Presently, the method used for signaling at both manned and unmanned railway gate are
through telephones, where information are passed and warning bells for the gatekeepers to
close the gate that lead to major accidents. The technology that we have used in our project is
the advance embedded controller interfaced with the PC. The following are the objectives of
this project:
The WSN has been used to position the train located at distant locations. The data acquired at
every base station is transmitted to the satellites in the medium earth orbit. Through the
downlink the data is transmitted to the base station where the processing of the data is done.
The operation is explained below with an example.
Automatic traction system has sensors placed at the 2 nd, 4th and 6th Kilometers on either side
of the unmanned railway gate. The sensor placed at the 6 th Kilometers is a metal detector.
This detects the presence of the train and the information is passed to the control room, also a
voice output stating the arrival of the train at the 6 th kilometer is heard. When the train
approaches the 4th Kilometer, its presence is sensed by the IR Sensor and simultaneously the
gate is initiated to close. The gate closes completely when the train is between 2 nd and 4th
kilometer. Light indicating signaling, is conveyed at the 2 nd kilometer IR Sensor for the
extreme safety. Now the train crosses the gate without any problem and when the last bogie
of the train passes the 4th kilometer sensor on the other side of the gate, the gate opens
automatically.
In the case of any problem, the information is passed to the control room. This is an
indication for the persons at the control room to clear the obstacle at the gate. An indication
to the driver to stop the train is that the red light at the 2 nd kilometer glows. Thus effective and
efficient signaling is done near the unmanned railway gate and accidents are avoided.
CHAPTER 2
2. LITERATURE REVIEW
Since in post Independence India, Industrialization was taking place on large scale with
emphasis on indigenization of several products, the Railway Workshop at Podanur also
imbibed the impetus for growth in its initial formation stage itself.
Initially the Workshops were engaged in manufacture of Mechanical Signaling equipment 7
and gradually manufacturing of Electro-Mechanical and Electrical Signaling equipment was
taken up in pace with the advancement taking place in Technologies and also to meet the
requirements of Indian Railway organization.
By the year 1963, Electrical Signaling Reverser, Lever Lock Circuit Controllers of types,
were started to be manufactured regularly in the Workshop; besides the Heppers Key
Transmitter, Disc Indicators, Thermostat Contacts, Arm & Light Repeater, Luminous
Indicators and Token Exchangers etc.
A big leap in the indigenization of Signaling products took place during the years 1967 to
1971, with the development of Non-Vital Plug in Type Relays, Point Machine & Token Less
Block Instrument etc. During this period in addition to manufacture of 1200 Non-Vital Plug
in Type Relays, equipment such as centralized Traffic control system including master &
field location panels and Automatic train recorders were also developed and manufactured at
Signal and Telecommunication Workshops, Podanur.
In the year 1973, under expansion stage II, an order for components and drawings for plug in
Type `Q' Relays were placed for WESTINGHOUSE BRAKE & SIGNAL /LONDON.
Further during this period, installation of Modern Machine Tools like numerically controlled
Milling Machine, Jig Boring Machine, Jig Grinding Machine, Profile Grinding Machine &
Electric Discharge Machine also took place. The regular production of `Q' Relays was
commenced in the year 1974-75 on a small scale.
In the year 1976 development and manufacture of Vigilance Control Device i.e., Drivers
Alertness Alarm Device was carried out as per RDSO Design. The extensive field trials and
manufacturing of these devices took place almost simultaneously. Development of Electronic
Axle Counter Mark I was taken up in the year 1977 as per the design supplied by
RDSO/LKO. Production of Three Position DC Polarized Relay ITI Design was also
commenced in the year 1978. In the year 1980, Development of Electrically Operated Lifting
Barrier Gates took place and regular production of GRS Apparatus Cases was taken up in that
year. Export of Signaling Equipment such as Electric Signal Reversers, Track feed
Resistance, Transformer Rectifiers and Shelf Type Relays to Nigerian Railways through
"IRCON" was made in the year 1982.
In 1986-87 Plug in type "Q" Relays for Special applications viz. QSPA1, QBAT & Q JI were
developed, and Signal Control Panels for Metro Railways/ CALCUTTA were manufactured
and supplied. The modified version of Electric Lifting Barrier Gate with high reliability was
developed and after field trials, manufacturing started in the year 1986 itself. Similarly, 8
Electronic Timer and Axle Counter Mark II (RDSO DESIGN) were developed in this year.
In the year 1990 Axle counter mark II production was started, following the RDSO/LKO
design. In the year 1991 import substitute code-receiving relay namely QB 3 was developed
to replace the imported EKDB relays of M/S KAYOSON electric company Japan thus
resulting in tremendous saving in foreign exchange. In the year 1993-1994 development of
IRS Rotary Type Locking High Thrust Point Machine as per the RDSO design and also
development of Universal Axle Counter was under taken. In the year 1995-1996, IRS Rotary
Type Locking High Point Machine was introduced in the production line. Besides this,
production of Universal Type Axle Counter was taken up. Further development of Token
fewer Block Instrument with Q relay was undertaken. In the year 1996-1997 bulk production
of Token less Block Instrument with Q relay, QBA 1 relay started.
This is present is in single line routes. I don't know how they operate the block system, but
the old practice of putting tokens in cane rings has been removed. In these routes usually the
semaphore signals are replaced.
Regarding the modernization of Indian railways, the maximum improvement has taken place
in the reservation system, which is fully computerized. However, in Signaling and
positioning, the method followed is still the British one, but the instruments and equipment
are basically Indian. Moreover, there is also track circuiting and interlocking of signals,
railway gates in major lines. Along with all these features you will be able to see a signalman
at the dead of the night peeping out of his box, with the classic Indian railway signal lantern
in his hand!
Many Britishers who were in India still looks upon the railway with nostalgia. Ruskin Bond
(he settled in India) has written numerous stories based on the railways and the sincerity of
the Indian railway man (especially in the ranks of porters, lines men and cabin men).
A device, known as auxiliary warning system (AWS) is to be introduced on the Chennai
Beach and Gummidipoondi section of railways for improving the passenger safety.
The main advantage of the system, stated to be the first of its kind in Southern Railway, is
that trains would automatically stop if drivers jump the red signal by mistake. At present, the
system is available only in the suburban services in Mumbai. The Railway Board has
sanctioned Rs.6.45 crores for the scheme.
2.3 AUTOMATION 1
3. BLOCK DIAGRAMS
Wireless Wireless
transmitter Receiver
Rs
Sensor Sensor Schmitt 232
from track from track Trigger Con
PIC
Mechanical Stepper Tr. Power Opto
16F877 BASE
Model Motor Drivers Isolator STATION
A
Motor Signaling
Power Relay Output’s
Supply
BASE
STATION
3.2 BLOCK DIAGRAM OF PIC16F877A 1
External C
Crystal USART P
Oscillator PIC16F877A U
Logic I/O
Synchronous
Connector
Switch
Positive
Step Down Positive Voltage
Bridge
Transformer Charge Regulator LPF
Rectifier
Capacitor IC 7812 +5v
1
CHAPTER 4
HARDWARE DESIGN
The single board is designed around the PIC Micro controller to accomplish the above-
mentioned system requirements.
The hardware section is divided into three subsections as follows:
(1) PIC Micro controller
(2) Max 232 and RS232
(3) Power supply unit
PIC MICROCONTROLLER
4.1 ARCHITECTURE
6. Interrupt Controllers
7. PWM / Capture
Port A
PM DM Port B
I/O
Port C
Port D
Port E
CPU Ports
Timer /
Counter PWM/
Capture
ADC
USART
OSC WDT
1
The PIC 16F877A has five serial ports namely A, B, C, D and E. It has five parallel ports
namely:
1. PSP (Parallel Slave Port 8 bit wide)
2. SSP (Serial Synchronous Port)
3. MSP (Master Serial Synchronous Port)
4. I2C (Inter Integrated Circuit)
5. SPI (Serial Peripheral Interface)
12-bit 10 channel
o 12-bit accuracy
o No external hardware multiplexer is needed Sleep mode processor
o No power will be consumed during ideal condition Built in temperature sensor
Micro Chip Company is the first company to be recognized as the Embedded Solutions
Company.
World’s largest Embedded Controller Produced company until 2002 i.e., 600 millions. By
2004 expecting to reach 1000 millions.
PIC 16F877A – has 10 channels & 12-bit accuracy.
PIC is Highly Flexible & Versatile – its development tool is inexpensive.
PIC Micro Controller converts data in serial form to parallel form.
It has 21 inputs designed for Digital I/O operation & 10 inputs for Analog operation.
Its BAUD rate is 9600 bps. So, it can work at a high speed.
It includes a RAM in which the whole data is dumped & permanent data are stored in
EPROM.
It also includes Sensors for detecting various changes in the surroundings like Flame
Occurrence, Obstacle Interference etc.,
An inbuilt ADC adds to its advantage be detecting the Temperature and Pressure changes in
the environment.
PIC controls the Relay; thereby controlling the Power Supply to the Motor. 1
In PIC, Source Current = Sink Current. The output of the Embedded Controller can be used
to drive printer, relays, solenoid valves etc. No need of driver circuit.
RAM is used to control ADC. MSB is stored in RAM when LSB is Outputted. This does not
require an External Memory. It can by itself act as a Single Chip Process.
Built in USART
PIC does not require any additional chips for executing Logical Operations. All Parallel
Operations can be done directly.
Reference could be done both Internally as well as Externally. If we provide the reference
Externally, then 2 channels must be allocated for that. Hence only 8 channels out of the total
10 channels can be used. In Internal reference all the 10 channels can be used.
2
Individual Power Supply for Analog and Digital circuits is required to avoid drift on
analog portion.
Double regulated filtered reference source is needed to ensure safest ADC operation.
External clock source must be used which enables the user to design the required speed.
External CPU synchronous circuit must be designed in case of PC requirement.
Switch is used to synchronize the Embedded Controller with the PC to get the COM OK
signal.
External RS – 232 should be used for Data Conversion.
External Power on Reset Circuit is needed to Clear Memory.
The data memory is partitioned into multiple banks which contain general purpose registers
and special function registers. Bits RP 1 and RP 0 are bank select bits.
RP 1 RP 0 Bank no.
0 0 0
0 1 1
1 0 2
1 1 3
Each bank extends up to 7F H (128 bytes). The lower locations of each bank are reserved for
the Special Function Register. Above the special function registers are General Purpose
Registers, implemented as Static RAM. In all banks the bottom most 16 bits are called Access
Banks. The data’s stored in these locations can be accessed irrespective of the bank number.
Status Register:
The status register contains arithmetic status of ALU, Reset and Bank Select Bits for Data
Memory.
The bits Z, DC, C are set or reset according to the device logic.
2
IRP RP 1 RP 0 TO PD Z DC C
PD - Power-down bit
1 - After power-up or by the CLRWDT instruction
0 - By execution of the SLEEP instruction
Z - Zero Bit
1 - The result of an arithmetic or logic operation is zero
0 - The result of an arithmetic or logic operation is not zero
DC - Digit carry / borrow bit
1 - A carry-out from the 4th low order bit of the result occurred
0 - No carry-out from the 4th low order bit of the result
C - Carry / borrow bit
1 - A carry-out from the most significant bit of the result occurred
0 - No carry-out from the most significant bit of the result occurred
General Features:
Individual power supply for Analog and Digital circuits is required to avoid drift on
analog portion.
Double regulated filtered reference source is needed to ensure safest ADC operation.
External clock source must be used which enables the user to design the required
speed.
External CPU Synchronous circuit must be designed in case of PC requirement.
Switch is used to synchronize the Embedded Controller with the PC to get COMOK
signal.
External RS-232 should be used for data conversion.
PIC 87X has a 13-bit program counter capable of addressing 8k × 14 program memory space.
Each device has 4k × 14 words of program space.
The reset vector is at 0000H
Receiving Interrupt vector is at 0004H
PIC has hardware stack with 8-bit width. It needs jump instruction to access subroutines.
Push and Pop instructions cannot be used since there is no software stack is available.
Program memory is organized as page 0, page1 up to page3 each having 2K memories. Page
address should be mentioned in PC latch for executing the instructions available in some
other pages.
2
}
0004H Page 0 Stack Level 2
On-Chip
0005H Page 1 Program
memory
Stack Level 8
07FFH
Page 2
0800H
Page 3
0FFFH
1000H
3FFFH
The data memory is partitioned into multiple banks which contain general purpose registers
and special function registers.
Bits RP1 and RP0 are bank select bits.
RP1 RP0 Bank no
0 0 0 2
0 1 1
1 0 2
1 1 3
Each bank extends up to 7FH (128 bytes). The lower locations of each bank are
reserved for the special function register. Above the special function registers are General
purpose registers, implemented as Static RAM.
In all banks the bottom most 16 bits are called access banks. The datas stored in these
locations can be accessed irrespective of the bank number.
Status Register:
The status register contains arithmetic status of ALU, Reset and bank select bits for data
memory.
The bits Z, DC, C are set or reset according to the device logic.
1- Bank 2 & 3
0- Bank 0 & 1
RP1, RP0 - Bank selection bits
INTCON REGISTER:
The INTCON register is a readable and writable register which contains various
enable and flag bits for the TMRO register overflow, RB port change and external RBO/INT
pin interrupts.
OPTION REGISTER:
PERSONEL COMPUTER
In personal computer, data transfer takes place serially. RS-232standard is used for serial
communication. PIC Micro controller is linked to PC through the RS-232 port. The PC
displays the menu for selecting the calibrating equipment and all the calibration results
graphically and in tabular form. The user can access the calibration data to get calibration
reports, comparison graphs etc at any time using the menu offered in the PC.
4. 6 RS 232
The most common communication interface for short distance is RS-232. RS-232 defines a
serial communication for one device to one computer communication port, with speeds up to
19,200 baud. Typically, 7 or 8 bits (on/off) signal are transmitted to represent a character or
digit. The 9-pin connector is used. The pin details are given below.
The PIC Micron controllers are supported with a full range of hardware and software
development tools. The used PIC16F877A device comes in 40 pin packages To communicate
with the PIC we are using RS232 port of the computer. So we have to initialize the port
before using it. To initialize and to communicate with the PIC, the file COM.C defines and
uses several functions. The functions and their definitions are given below.
3
+12V
CTS
RxD+
RxD-
Register D:
Register B:
Reserved Bits
cannot alter
Register C:
Can be configured
as input or output.
Register A:
3
Configurable bits can be either zero or one according to the initialization. If the particular bit
is to be used as a input port then write '1' to it else '0' for output. For Example, initialize Port
("[1ffffffff]");
Above statement mention all registers bits are act as input port.
MAX232
The Max 232 is a dual RS-232 receiver / transmitter that meets all EIA RS232C specifications while
using only a +5V power supply. It has 2 onboard charge pump voltage converters which generate +10V and –
10V power supplies from a single 5V power supply. It has four level translators, two of which are RS232
transmitters that convert TTL\ CMOS input levels into + 9V RS232 outputs. The other two-level translators are
RS232 receivers that convert RS232 inputs to 5V TTL\CMOS output level. These receivers have a
nominal threshold of 1.3V, a typical hysteresis of 0.5V and can operate up to + 30V input.
1. Suitable for all RS232 communications.
2. +12V power supplies required.
3. Voltage quadrapular for input voltage up to 5.5V (used in power supply Section of
computers, peripherals, and modems).
Three main sections of MAX232 are
1. A dual transmitter
2. A dual receiver
3. +5V to + 10V dual charge pump voltage converter.
CHAPTER 5
5. HARDWARE
J3 D2
R17
2200/50V
1 R9 C4
10MFD/63V1
2 IN5408
D6
IN5408 L9
D7
IN5408
As we all know any invention of latest technology cannot be activated without the
source of power. So, it this fast-moving world we deliberately need a proper power source
which will be apt for a particular requirement. All the electronic components starting from
diode to Intel IC’s only work with a DC supply ranging from +5v. We are utilizing for the
same, the most cheapest and commonly available energy source of 230v-50Hz and stepping
down, rectifying, filtering and regulating the voltage.
5.2 SENSORS
It is quiet nature that a third person may enter in a exchange without prior permission and
request from the authorities, which may create hazardous problem for his life, in such case a
sensor is required to find out that case and to keep in form to the computer for further actions.
We use INFRARED EMITTER and DETECTOR to overcome the problem. In early days to
find out human entry in unauthorized places achieved by using LDR'S and LIGHT
OPERATED SYSTEM, which had a problem, that may work in sunlight and cross-sectional
luminaries and provides false information to monitoring station.
To avoid this we are using invisible INFRARED RADIATION SYSTEM, which is harmless.
In basic I.R. rays has highest wavelength than the existing VIBGYOR color spectrum.
According to manufacturer's instruction we found that applying electric current to GALLIUM
ARSENIDE semiconductor material can generate I.R. rays.
3
Here we are using a current limiting resistor to safeguard I.R. EMITTER as well as to
produce enough ray’s density, which is necessary to drive I.R. DETECTOR. We have used
1K resistor from 5V dc to the I.R. EMITTER to restrict current flow beyond 5mA. Even
though I.R. EMITTER can withstand up to 35mA, we have used 5mA due to shortest
distance. If the distance is more we have to increase the current flow to the emitter. Beyond
the limitation of I.R. EMITTER can be achieved by using additional lenses (OPTICAL
SYSTEM) in front of the emitter.
I.R. DETECTOR is having reverse characteristics of the I.R. EMITTER. That is we cannot
consume more current from it on account of positive sensitivity. For the above grounds we
have used 100K from the supply Voltage. So, the sink current will be as per the OHM's
LAW I=V/R. So, 5/100K will be less than a microampere which may improve the detecting
characteristics. I.R. DETECTOR will conduct as long as the rays falls on it. So, the level will
be low which may goes to CUT OFF RANGE, whenever there is no rays. Status will be
high. From the above we are clearly known that if there is no entry signal will be low, if there
is entry signal will be high. I.R. DETECTOR drives a NPN transistor which provides inverse
output at collector end and given to a two stages SCHMITT TRIGGER. Which will give at
ultimate inversion of the I.R. DETECTOR. (If there is no entry = high). If there is any entry
the signal output of SCHMITT TRIGGER will be low, which creates a false information to
the computer.
Early emitters, both visible and infrared, suffered from low power output
deterioration(degradation) when compared to present day devices. Emitter chip materials,
commonly referred to as III-V compounds, are combinations of elements from the III and V
columns of the periodic chart. The P-N junction is formed by either diffusing or epitaxially
growing the junction. Typical materials used for emitters include GALLIUM ARSENIDE 3
and GALLIUM ALUMINUM ARSENIDE, among others.
When a forward bias current flows through the emitter's P-N junction, photons are emitted.
The total output power is a function of the forward current, and is measured in mW.
Likewise, the axial radiant intensity of an emitting device, which is the portion of the total
emitted power radiated within a specified cone angle directly on axis, is also a function of
this forward current, and is measured in mW per steradian. Motorola's line of emitter does
operate at wavelengths of either 660,850, or 940 nanometers. This encompasses the red and
the near I.R. portions of the electromagnetic frequency spectrum. Emitters of various
wavelengths are produced for the purpose of optimizing system with a variety of applications
and environments. The 940nm emitters are the most cost effective, however, their spectral
emission is not ideally matched to that of the Silicon detectors. Most applications can
tolerate certain justified by the devices lower price. Almost all optoisolators, for example,
use the 940nm emitter.
The 850nm emitters are not well matched to silicon, but are ideal or use in plastic fiber optic
systems. Plastic fiber has a characteristic attenuation curve, which reaches a minimum at
660nm. This attenuation is the predominant factor to consider when designing a plastic fiber
system. The above emitters find wide usage in a variety of isolating, remote control and fiber
optic applications.
Newly developed materials and refinements in chip processing and handling have led to more
efficient and more reliable emitters. New packaging techniques have made low-cost plastic
devices suitable for applications formerly requiting glass-lensed units, by providing efficient
modeled-in lenses. In this way, higher on-axis radiant intensities can be achieved, for a given
amount of total radiated power. A narrow radiation angle provides for a lower drive current
when operating in a configuration where the opto detector is on-axis with the power into an
optical fiber. When a very wide or off-axis viewing angle is required, such as in remote-
control emitters are generally used.
Motorola's selection of emitters includes the low-cost plastic Case 422A devices, such as
MLED91, MLED96 and MLED97. Also in a plastic package is the remote-control emitter,
MLED81. Metal and glass packages, such as the TO-18(MLED930) are utilized in
applications where high axial intensity or absolute hermetic are essential. Advances made in
emitter technology over the years have eliminated many of the problems of early-day devices.
Even the problem of degradation of emitter power output over time has been brought to a
level, which is tolerable and predictable. When coupled to a silicon detector, today's 3
devices can be expected to lead a long and useful life.
DETECTORS:
As emitters have developed over the years, photo detectors have also advanced dramatically.
Early phototransistors and photo diodes were soon joined by photo darlington detectors, and
then by light-activated SCRs. Innovations in design have created devices having higher
sensitivity, speed and voltage capabilities.
Recent developments in detector technology have led to larger and more complex circuit
integration. Photo detectors incorporating SCHMITT TRIGGER logic outputs are becoming
increasingly popular in applications requiring very fast speed, hysteresis for noise immunity,
and logic level outputs.
Motorola introduced the world's first photo-triac driver, a planar silicon device capable of
controlling loads on an ac power line. The zero-crossing triac driver, also a Motorola
development, followed this. This device stands as a classic circuitry, photo-optic technology;
high voltage solid-state physics and field effect transistor (FET) technology are all
incorporated on a monolithic integrated circuit chip inside this device.
Future trends point to even higher performance characteristics and more circuit integration in
photo detectors. Detectors, are like emitters, are available in plastic and in lensed metal
packages.
3
A stepper motor can be considered as a digital electro mechanical device where each step
command pulse results in a movement of the shaft by a discrete angle a called step angle of
the motor. Stepper motor is a device, which converts digital pulses into precise angular steps.
Because of the simple control and compatibility with digital systems, the stepper motor is
used.
Types of stepper motor
The large varieties of stepper motors can be divided into three categories.
(i) Variable reluctance stepper motor.
(ii) Permanent magnet stepper motor.
(iii) Hybrid stepper motor.
1. They are compatible with digital systems and do not require digital to analog conversion
at the input, as do conventional servos, when used with digital system or a computer.
2. While simple open loop control is good enough for the control of position and speed, it
can also be used in closed loop position and speed control systems with either analog or
digital feedback.
3. A wide range of step angles is available off the shelf from most manufacturers in the
range of 1.8o to 90o. The range of Torque is 1NM to 50NM.
4. Bi-directional control is available.
5. Maximum torque occurs at low pulse rates. The stepper motor can therefore accelerate 3
its load easily.
6. Low speed is possible without a reduction gear.
7. Moment of Inertia is usually low.
8. The starting current is low.
9. Multiple stepper motors driven from the same source can maintain perfect
synchronization.
SPECIFICATIONS:
Stepper motors do as their name suggests they “step” a little bit at a time. Stepper
motors differ them DC motors in their torque speed relationship DC motors generally are not
very good at producing high torque at low speeds, without the air of generating mechanism.
Stepper motors, on the other hand work in the opposite manner. They produce the higher
torque at low speeds.
Stepper motors also have another characteristics holding torque, which is not present
in DC motors. Holding torque allows a stepper motor to hold its position firmly when not
turning. Stepper motors don’t simply responding to a OK signals. They have several
windings, which need to be energized in the correct sequence before the motor shaft will 3
rotate.
Reversing the order of the sequence will cause the sequence will cause the motor to
rotate the other way considering a single permanent magnet rotor with a signal north south
pole and a four-tooth starter, driven by a pair of winding, connected to a DC supply voltage
and ground respectively. The loop tooth becomes a north pole and becomes a south pole.
This pushes the rotor into a stable position at 45 o, where rotor poles line up between opposite
poles of two windings.
When polarity of winding is reversed by switching supply voltage and ground, the
rotor advances 90o to new stable position at 45o. This means that has 90o step angle. The
number of sequence steps and switching pattern will vary with motor construction and the
manufacturer.
The proceeding sequence is called full step mode because each step advances the
stepper by the amount specified as its step angle. A step motor can be made to rotate one half
step angle by operating it in the half step mode. If only one step winding is energized, the
motor will come to equilibrium directly under its opposite pole half way between two fuel
steps shown. 90o step angle motor is now a 45o step angle motor. In the half step mode only
one coil is energized every other step to give a eight step sequence.
Sequential switching of supply to the two phases of the motor causes the stepping
action. Bifilar winding of stepper motor has certain advantages. Each of the 2 phases of
motor has double winding with a centre tap switching the supply from 1 side to another of a
phase causes reversal of magnetic polarity without actual reversing the polarity of supply 4
step input sequences gives 1.8o.
The specified torque of any stepping motor is the torque at standstill. This torque is
directly proportional to the current in the winding as the switching sequence starts, the
inductive reactance of the winding, which increases with the frequency of switching, oppose
the rise of current to desired level within the time given for one step depending upon the
speed of stepping. This is mainly due to l/r tike constant of winding. The drop is current
level causes drop in torque as the speed increases. In order to improve torque at high speed it
is necessary to maintain current at the desired level.
Opto-coupler:
It consists of opto-emitter and phototransistor in opto-emitter exists infrared radiation which
in turn drives the phototransistor.
Pre-driver:
We cannot directly couple the TIP122 (NPN) to the opto-coupler since it requires large
current for driving. We use the driver SL100 to boost the current level.
Driver:
The main principle of the driver is to amplify the current. It amplifies the 50mA current to2A,
which is needed to drive the motor.
Control logic:
It consists of an SL100 and relays. Whenever we need to rotate the stepper motor we input
high level through Ports of PIC microcontroller to SL100 70msec before. So SL100 produce
logic low. Now the coil is energized and the 24v is connected to the coil of the driver by the
relay.
10kohms resistor is used. It is used to verify the input of pre-driver stage which is
low. When the IR detector is not conducting, the collector to emitter is high. Now the input
at pre driver (SL100) may be high or low. But it should be low to make it sure we are using
pull down resistor.
When the TIP 122 transistor have high input signal its base collector to emitter
resistance is relatively low. So it produces a low output signal. When the output signal is low
the coil is energized. Now the motor can move forward (or) reverse as per the pattern given
in the software routine.
An reverse biased diode is connected is parallel with the coil. When the coil is
demagnetizing it produces high back emf, which can destroy TIP 122, which is in the cut off
state. This can be avoided by this diode.
It has a LED driving a photo transistor. This is a much more sensitive opto-coupler
than the LED photo diode. The idea is that any change in Vs produces changes in LED
current, which changes the current through the transistor. In turn this produces a changing
voltage across the collector-emitter terminals. Therefore a signal voltage is coupled from the
input circuit to the output circuit.
The big advantage of an opto coupler is the electrical isolation between the input and output
circuits. Stated another way the common for the input circuit is different from the common
for the output circuit. Because of this, no conductive path exists between the two circuits.
This means that you can ground one of the circuits floats the other. For instance the input
circuit can be grounded to the chassis of the equipment while the common of the output side
is ungrounded.
It consists of Opto-emitter and Phototransistor. An Opto coupler is essential to
prevent the computer from hazardous conditions like voltage transients, back emf, and high
voltage spikes.
We use Stepper motors for our gate operations. Normally when we pass DC current to a coil;
it will get Electro-magnetized. When we pass the DC source it won’t get demagnetize. If it
is not demagnetized, back EMF is produced which can create kick back current to subsequent
devices or associated circuits. To avoid the above problems we require a device, which can
isolate electrically & couples by other means. Opto-emitters anode is connected to 5v supply
(Logic 1). The cathode is connected to the buffers output. When logic 1 is given to the input
of LS7406 we get logic 0 as the output. Sink current of Opto-emitter is lower than that of
LS7406.
Now this Opto-emitter emits IR rays. This drives the phototransistor whose collector is
forced to 24v. When IR rays are emitted from the Opto-emitter the phototransistor conducts.
The collector to emitter resistance becomes low, so the 24v will appear to emitter. It is given
as input for the pre driver (CL100). We have used CNY 17-2 Opto-coupler. It consists of
Gallium Arsenide IR emitting diode optically coupled to a monolithic silicon phototransistor
detector.
Advantages are:
1) Closely matched current transfer ratio (CTR) that has less conversion losses.
2) Guaranteed 70 volts V (Br.) CEO minimum.
4
Application:
1) Feedback control circuits.
2) General purpose switching circuits.
3) Interfacing and coupling systems of different potentials and references.
The Opto-coupler gets the output from PIC. The Opto consists of two transducers one at the
input and other at the output. The input transducer is an LED or photodiode, which converts
digital output into light signal. The light signal is then observed by the phototransistor, which
is the output of transducer. The phototransistor then converts the light signal into
corresponding analog signal. The main advantage of the Opto coupler is to provide isolation
between the PIC and the stepper driver such that the back emf produced by the stepper motor
is being prevented from affecting the PIC chip and PC.
The pre driver receives the output from the Opto-coupler. The pre driver is a transistor
(CL100), which boosts the current. It is an NPN transistor, which gets the output from the
opto coupler from its base. The transistor is on when the output from the opto coupler is more
than 24V. The output from the transistor is low and +24V is grounded.
The power driver accepts the negative analog signal from the pre driver and amplifier
it to the required level. The +ve voltage from the power supply unit is fed to the power driver
by means of relay, which is set on the receiver’s negative voltage from the transistor control
logic and +ve from the power supply unit. The power driver runs the stepper motor in
response to the current pulses received by it. The stepper motor is filled in mechanical model
for gate control.
The detector may be photo conductor, photo diode, Photo FET, photo triac, photo SCR or
integrated photo diode amplifier. Various results in a wide variety of input characteristics.
Characteristics such as coupling efficiency [effect of IRED (Infra-red emitting Diode) current
on the output device), speed of response, voltage drops, current capability and VI – curves
vary from model to model. The characteristics must be considered especially when
performing substitutions.
The only common characteristics is that input is dielectrically isolated from the output. The
opto coupler is designed as a solid-state replacement for mechanical relays and pulse
transformers. Functionally, the opto coupler is similar to its older mechanical counter part
because it offers high degree of isolation between the inputs and output terminals. Some of 4
the improvements offered by the solid-state devices are as follows:
Faster operating speed
Positive (no bounce) action.
Small size
Insensitivity to vibration and shock.
No moving parts to stick
Compatibility with many logic and microprocessor circuits
Frequency response from DC to 100 KHz.
Isolation is a very important factor of the opto coupler.
OPTO-COUPLER
The input stage of a opto coupler consists of an efficient GAAS. Infra-red emiting diode
(IRED). The output stage of the basic optocoupler is a photo transistor. One method of
dielectric isolation has a thin layer between the input and output stages; another method uses
air gap to attain greater electrical isolation. Regardless of whether an air gap or IR
transmitting glass is used to separate the input and output circuits, the operating
characteristics are basically identical
power system and isolates that parts from the healthy part from the healthy part of system and
isolates.
The relays used in this project are compact, self-contained devices which respond to
abnormal conditions (relays can distinguish normal and abnormal condition).
SENSORS
IR sensor, hall effect proximity sensors are used for this project to identify the
train crossing and Gate closing. Whenever the train is passed the sensor position logical info
will be passed to embedded system. Similarly whenever there is a obstacle while the Gate is
closing info is passed to the embedded controller.
All the sensors and transducers need not produce direct electrical output e.g.
LDR, thermistor. In our project we have used two types of passive transducer which needs
external excitation power source. The sensor may produce resistance as a output for physical
variations. So this need a conversion when it is to be connected to a electronic circuit. Some
sensors may produce direct electrical/electronic output which may have some unwanted
transducers tied with it. Before giving to a controller all sorts of cut off transducers is 4
essential. This is called conditioning.
SCHIMITT TRIGGERS
They are regenerative comparatives which work between two thresholds. This is to
avoid linear change in logic ckt (0 or1).
MCT2E is used in our project to create isolation between stepper motor Circuit and
embedded circuit optocouplers create galvanic isolation between two electronic circuit. This
is necessary to avoid Back emf’s, which may be generated by stepper motor while switching
off.
STEPPER MOTOR:
It is a inertia use motor which can be started and stopped with full rpm (instant start and stop)
(time determination (FB))
Signaling output:
Simulation LED’s.
Relays:
Whenever motor operation is not required, the PS will be stopped. Switched off. Because
stepper motor will consume enormous current. when it is stopped.
4
RS232:
All PIC’s series of embedded has build in USART is used to convert Parallel data to serial
and series to parallel. But when serial data is to be transmitted to long distance. USART will
not respond for that.
When a embedded system to be integrated with the computer that must meet a standard called
RS 232 (recommended Std 232). Accounting and Rs.232 two different CPU’s can be joined
within 50 feet’s. For our project we use RS 232 to give a real time demo with the computer.
Pre driver:
Pre driver transistor is used to protect the opto coupler from overloading as well as to switch
the power from (SL100) which requires 1mA for its base and can amplify the current up to
250mA. This is used as a switching inverting amplifier.
Power Driver:
Which receives signals from pre driver and amplifies up to 5000mA transistor used for this
application is TIP 122. Base current requirement is 10mA. This is suitable to drive small
motor to 70Kg/Cm motor. To improve still higher version, we can use BOX 132 transistor
which can work at higher speed. BOX 132 is 60 amps 200 V transistor.
Diagnostic LED’s:
LED play’s vital role in fault timing and circuit operation. We can deliver pulse from the PC
whenever pulses given to the motor, thin LED’s glows whenever this LEDs are perfectly
glowing. We can ensure the electronics pan of the Robot.
Relay driver:
Relay is essential for power saving of the robotics. Whenever the motor is not in operation,
the motor can be put off to reduce power, otherwise two coils of each motor will be energized
continuously even the motor is not running power should not be put off in case of Robot is
working against the Gravity.
4
CHAPTER 6
VISUAL BASIC 6
FEATURES:
Improved performance
A data base creation tool
Visual data access with the data control so that it is possible to create data
browsing application without writing code.
A new OLE (object linking and embedding) control that allows in place editing.
A collection of common dialog boxes that streamline common user interface
tasks.
The ability to create pop-up menus anywhere in the application.
4
FLOWCHART
START
Exit END
Y/N
5
CHAPTER 7
[Link] DIAGRAMS
As we all know any invention of latest technology cannot be activated without the source of
power. So it this fast-moving world we deliberately need a proper power source which will be
apt for a particular requirement. All the electronic components starting from diode to Intel
IC’s only work with a DC supply ranging from -+5v to -+12v. We are utilizing for the
same, the cheapest and commonly available energy source of 230v-50Hz and stepping down,
rectifying, filtering and regulating the voltage. This will be dealt briefly in the forth-coming
sections.
RECTIFIER UNIT:
In the power supply unit, rectification is normally achieved using a solid state diode.
Diode has the property that will let the electron flow easily in one direction at proper
biasing condition. As AC is applied to the diode, electrons only flow when the anode and
cathode is negative. Reversing the polarity of voltage will not permit electron flow.
A commonly used circuit for supplying large amounts of DC power is the bridge
rectifier. A bridge rectifier of four diodes (4*IN4007) are used to achieve full wave
rectification. Two diodes will conduct during the negative cycle and the other two will
conduct during the positive half cycle. The DC voltage appearing across the output
terminals of the bridge rectifier will be somewhat less than 90% of the applied rms value.
Normally one alteration of the input voltage will reverse the polarities. Opposite ends of
the transformer will therefore always be 180 deg out of phase with each other.
For a positive cycle, two diodes are connected to the positive voltage at the top
winding and only one diode conducts. At the same time one of the other two diodes
conducts for the negative voltage that is applied from the bottom winding due to the
forward bias for that diode. In this circuit due to positive half cycleD1 & D2 will conduct
to give 10.8v pulsating DC. The DC output has a ripple frequency of 100Hz. Since each
altercation produces a resulting output pulse, frequency = 2*50 Hz. The output obtained
is not a pure DC and therefore filtration has to be done.
FILTERING UNIT:
5
Filter circuits which are usually capacitors acting as a surge arrester always follow
the rectifier unit. This capacitor is also called as a decoupling capacitor or a bypassing
capacitor, is used not only to ‘short’ the ripple with frequency of 120Hz to ground but
also to leave the frequency of the DC to appear at the output. A load resistor R1 is
connected so that a reference to the ground is maintained. C1R1 is for bypassing ripples.
C2R2 is used as a low pass filter, i.e., it passes only low frequency signals and bypasses
high frequency signals. The load resistor should be 1% to 2.5% of the load.
10f/25v : for maintaining the stability of the voltage at the load side.
VOLTAGE REGULATORS:
The voltage regulators play an important role in any power supply unit. The primary
purpose of a regulator is to aid the rectifier and filter circuit in providing a constant DC
voltage to the device. Power supplies without regulators have an inherent problem of
changing DC voltage values due to variations in the load or due to fluctuations in the AC
liner voltage. With a regulator connected to the DC output, the voltage can be maintained
within a close tolerant region of the desired output. IC7805, IC7812 and IC7912 is used
in this project for providing +05V, +12v and –12v DC supply.
Specifications:
Without capacitor:
Vavg = (15-1.2) v = 13.8c pulsating DC
Frequency = 100Hz
With capacitor:
V=Vavg *1.414(form factor) = 19.51v.
Frequency = 0Hz
From the circuit it can be seen that the reference analog supply after being regulated by the
9v regulator enters the zener diode through the resistance R4 where it is again regulated to 5v
since the zener diode used here has a cut off of 5v. Thus, we have a double regulated
completely filtered analog reference source. R6 is a potential divider used for setting the 5
dynamic response range of the reference supply. This means that the reference 5v can be used
as it is or it can be made into a fraction of the 5v for example 1v so that readings in this range
can be read with more precision. This is because the ADC has 10-bit resolution, which can be
totally used for representing the 1v rather than 5v.
The pins 2-5, 7-10, 35 and 36 are used as the 10 channels of the ADC. To these pins the
analog inputs to be processed by the ADC are given. Y1 is the crystal oscillator used. It is of
10 MHz and gives a baud rate of 9600 bits/s. The capacitors C2 and C3 are used as
decoupling capacitors to remove the high frequency noise signals.
The capacitor C1 is in the off condition when power is switched off. When the power is
switched on or reset then this capacitor gets charged through the resistor R2 and then through
R1 this appears at the MCLR pin of the PIC. This is the memory clear pin and thus the
memory is cleared and is ready for use as soon as power is switched on. S1 is the
synchronous switch which is also used for the same operation and for PC and PIC
synchronous operation.
Sensor:
IR emitter:
Symbol and operation of IR Emitter is very similar to ordinary LED, Light Emitting Diode. LED
emits ordinary light. IR emitter generates infrared. IR emitter is made up of Gallium arsenide. If we
pass the current to gallium arsenide it produces IR rays. Current applied to the sensor is directly
proportional to the rays emitted. We’ve connected 1k resistors to +5v and to the emitter.
I = 5v/1k = 5m amps.
If we decrease the resistance, current will increase thereby rays production will also increase. More
ray’s density allows for the longer length operation. More than IR, if we use lens in front of the IR
emitter it allows us work with 10m also.
The rays emitted are sent to IR detector, which is placed straight to the (90) IR emitter. IR detector
concept is, whenever rays are incident, it conducts. Resistance b/w anode and cathode reduces. When
no rays are incident the anode and cathode resistance is infinite.
A 100k resistor is used to pull-up the detector, when it doesn’t get IR. When ray’s incident, anode of
the detector is low. When no rays, anode is high.
NPN transistor coupled with the detector conducts only when the Base gets logic high. Whenever no
interruption transistor will be Cut-off, status of the collector is logical high. Output of the Schmitt
trigger is logic low.
During interruption, IR detector is cut-off and anode is pulled high. Transistor conducts, status of the
collector is low. Final o/p of the Schmitt is logic high.
When no interruption - low
When interruption - high
5
If we decrease the resistance, current will increase thereby rays production will also increase. More ray’s
density allows for the longer length operation. More than IR, if we use lens in front of the IR emitter it
allows us work with 10m also.
The rays emitted are sent to IR detector, which is placed straight to the (90) IR emitter. IR 5 detector
concept is, whenever rays are incident, it conducts. Resistance b/w anode and cathode reduces. When no
rays are incident the anode and cathode resistance is infinite.
A 100k resistor is used to pull-up the detector, when it doesn’t get IR. When ray’s incident, anode of the
detector is low. When no rays, anode is high.
NPN transistor coupled with the detector conducts only when the Base gets logic high. Whenever no
interruption transistor will be Cut-off, status of the collector is logical high. Output of the Schmitt trigger is
logic low.
During interruption, IR detector is cut-off and anode is pulled high. Transistor conducts, status of the
collector is low. Final o/p of the Schmitt is logic high.
CHAPTER 8
CODING
EMBEDDED PROGRAM:
PROCESSOR PIC16F877A
#include "[Link]"
BYTE0EQU 0X2D
BYTE1EQU 0X2E
BYTE2EQU 0X2F
BYTE3EQU 0X30
ORG 0X0000
GOTO START
ORG 0X0004
GOTO GetPACK
ORG 0X0020
NosofAN
ADDWF PCL,F
RETLW 0X86
RETLW 0X8E
RETLW 0X80
RETLW 0X84
RETLW 0X80
RETLW 0X82
RETLW 0X89
RETLW 0X80 6
RETLW 0X06
ORG 0X0035
GetPACK
BTFSSPCKSTA,0
GOTO ItsSTA
MOVLW '}'
SUBWF RCREG,W
BTFSSSTATUS,Z
GOTO StVALUE
BSF PCKEND,0
BCF PCKSTA,0
GOTO ExINT
StVALUE
BTFSSRCREG,6
GOTO StNUM
MOVLW 0X0F
ANDWF RCREG,0
ADDLW 0X09
StNOW
MOVWF INDF
INCF FSR,F
GOTO ExINT
StNUM
MOVLW 0X0F
ANDWF RCREG, W
GOTO StNOW
ItsSTA
MOVLW '{'
SUBWF RCREG, W
BTFSSSTATUS, Z
GOTO ExINT
BSF PCKSTA,0
MOVLW 0X20
MOVWF FSR
ExINT
RETFIE
ORG 0X0100
START
CLRWDT
BSF INTCON, PEIE
;;; Buffer Clear ;;; 6
MOVLW 0X0020
MOVWF FSR
CLRF INDF
INCF FSR,F
BTFSSFSR,4
GOTO $-3
BSF STATUS,RP0
MOVLW 0XFF
MOVWF TRISD
MOVLW 0XFF
MOVWF TRISB
MOVLW 0X3F
MOVWF TRISA
MOVLW 0X07
MOVWF TRISE
MOVLW 0XBF
MOVWF TRISC
MOVLW 0X80
MOVWF ADCON1
BCF STATUS,RP0
MOVLW 0X81
MOVWF ADCON0
MOVLW 0X90
MOVWF RCSTA
BSF STATUS,RP0
MOVLW 0X26
MOVWF TXSTA
MOVLW 0X40
MOVWF SPBRG
BSF PIE1,RCIE
BSF INTCON,GIE
6
BCF STATUS,RP0
CALL SNDMSG
WaitPCK
BTFSSPCKEND,0
GOTO WaitPCK
MOVLW 0X01
SUBWF BUFFER1,W
BTFSSSTATUS,Z
GOTO IIndPCK
MOVLW 0X0A
SUBWF BUFFER2,W
BTFSSSTATUS,Z
GOTO InitB
SWAPF BUFFER3,W
IORWF BUFFER4,W
BSF STATUS,RP0
MOVWF TRISA
BCF STATUS,RP0
InitB
MOVLW 0X0B
SUBWF BUFFER2,W
BTFSSSTATUS,Z
GOTO InitC
SWAPF BUFFER3,W
IORWF BUFFER4,W
BSF STATUS,RP0
MOVWF TRISB
BCF STATUS,RP0
InitC
MOVLW 0X0C
SUBWF BUFFER2,W
BTFSSSTATUS,Z
GOTO InitD
SWAPF BUFFER3,W
IORWF BUFFER4,W
6
BSF STATUS,RP0
MOVWF TRISC
BCF STATUS,RP0
InitD
MOVLW 0X0D
SUBWF BUFFER2,W
BTFSSSTATUS,Z
GOTO InitE
SWAPF BUFFER3,W
IORWF BUFFER4,W
BSF STATUS,RP0
MOVWF TRISD
BCF STATUS,RP0
InitE
MOVLW 0X0E
SUBWF BUFFER2,W
BTFSSSTATUS,Z
GOTO ExINIT0
SWAPF BUFFER3,W
IORWF BUFFER4,W
BSF STATUS,RP0
MOVWF TRISE
BCF STATUS,RP0
ExINIT0
GOTO ExfrmPCK
IIndPCK
MOVLW 0X02
SUBWF BUFFER1,W
BTFSSSTATUS,Z
GOTO IIIrdPCK
MOVFBUFFER2,W
CALL NosofAN
BSF STATUS,RP0
MOVWF ADCON1
BCF STATUS,RP0
GOTO ExfrmPCK 6
IIIrdPCK
MOVLW 0X03
SUBWF BUFFER1,W
BTFSSSTATUS,Z
GOTO IVthPCK
BSF STATUS,RP0
DrWAITS
BTFSSTXSTA,TRMT
GOTO DrWAITS
BCF STATUS,RP0
MOVLW '{'
MOVWF TXREG
MOVLW 0X0A
SUBWF BUFFER2,W
BTFSSSTATUS,Z
GOTO SndB
BSF STATUS,RP0
DrWAITA
BTFSSTXSTA,TRMT
GOTO DrWAITA
BCF STATUS,RP0
MOVFPORTA,W
MOVWF TXREG
GOTO ExDRPCK
SndB
MOVLW 0X0B
SUBWF BUFFER2,W
BTFSSSTATUS,Z
GOTO SndC
BSF STATUS,RP0
DrWAITB
BTFSSTXSTA,TRMT
GOTO DrWAITB
BCF STATUS,RP0
MOVFPORTB,W
MOVWF TXREG
GOTO ExDRPCK
6
SndC
MOVLW 0X0C
SUBWF BUFFER2,W
BTFSSSTATUS,Z
GOTO SndD
BSF STATUS,RP0
DrWAITC
BTFSSTXSTA,TRMT
GOTO DrWAITC
BCF STATUS,RP0
MOVFPORTC,W
MOVWF TXREG
GOTO ExDRPCK
SndD
MOVLW 0X0D
SUBWF BUFFER2,W
BTFSSSTATUS,Z
GOTO SndE
BSF STATUS,RP0
DrWAITD
BTFSSTXSTA,TRMT
GOTO DrWAITD
BCF STATUS,RP0
MOVFPORTD,W
MOVWF TXREG
GOTO ExDRPCK
SndE
MOVLW 0X0E
SUBWF BUFFER2,W
BTFSSSTATUS,Z
GOTO ExDRPCK
BSF STATUS,RP0
DrWAITE
BTFSSTXSTA,TRMT
GOTO DrWAITE
BCF STATUS,RP0
MOVFPORTE,W
MOVWF TXREG
ExDRPCK
BSF STATUS,RP0
DrWAITL
BTFSSTXSTA,TRMT
GOTO DrWAITL
BCF STATUS,RP0 6
MOVLW '}'
MOVWF TXREG
GOTO ExfrmPCK
IVthPCK
MOVLW 0X04
SUBWF BUFFER1,W
BTFSSSTATUS,Z
GOTO VthPCK
BSF STATUS,RP0
ArWAITS
BTFSSTXSTA,TRMT
GOTO ArWAITS
BCF STATUS,RP0
MOVLW '{'
MOVWF TXREG
BCF STATUS,C
RLF BUFFER2,F
RLF BUFFER2,F
RLF BUFFER2,W
ANDLW 0X38
IORLW 0X81
MOVWF ADCON0
MOVLW 0X00
MOVWF TEMP
ArACQT
DECFSZ TEMP,F
GOTO ArACQT
BSF ADCON0,GO
ConWAIT
BTFSC ADCON0,GO
GOTO ConWAIT
MOVFADRESH,W ;
MOVWF H_BYTE ;
BSF STATUS,RP0 6
MOVFADRESL,W ;
BCF STATUS,RP0
MOVWF L_BYTE ; H_BYTE:L_BYTE =
ADRESH:ADRESL
BSF STATUS,RP0
ArWAITE
BTFSSTXSTA,TRMT
GOTO ArWAITE
BCF STATUS,RP0
MOVLW '}'
MOVWF TXREG
GOTO ExfrmPCK
VthPCK
MOVLW 0X05
SUBWF BUFFER1,W
BTFSSSTATUS,Z
GOTO ExfrmPCK
MOVLW 0X0A
SUBWF BUFFER2,W
BTFSSSTATUS,Z
GOTO SndtoB
SWAPF BUFFER3,W
IORWF BUFFER4,W
MOVWF PORTA
SndtoB
MOVLW 0X0B
SUBWF BUFFER2,W
BTFSSSTATUS,Z
GOTO SndtoC
SWAPF BUFFER3,W
IORWF BUFFER4,W
MOVWF PORTB
SndtoC 6
MOVLW 0X0C
SUBWF BUFFER2,W
BTFSSSTATUS,Z
GOTO SndtoD
SWAPF BUFFER3,W
IORWF BUFFER4,W
MOVWF PORTC
SndtoD
MOVLW 0X0D
SUBWF BUFFER2,W
BTFSSSTATUS,Z
GOTO SndtoE
SWAPF BUFFER3,W
IORWF BUFFER4,W
MOVWF PORTD
SndtoE
MOVLW 0X0E
SUBWF BUFFER2,W
BTFSSSTATUS,Z
GOTO ExfrmPCK
SWAPF BUFFER3,W
IORWF BUFFER4,W
MOVWF PORTE
ExfrmPCK
BCF PCKEND,0
GOTO WaitPCK
UP_CNV_SIG
MOVFR2,W
ANDLW 0X0F
ADDLW 0X30
MOVWF BYTE0
SWAPF R2,W
ANDLW 0X0F
ADDLW 0X30
MOVWF BYTE1
MOVFR1,W
ANDLW 0X0F
ADDLW 0X30 7
MOVWF BYTE2
SWAPF R1,W
ANDLW 0X0F
ADDLW 0X30
MOVWF BYTE3
RETURN
TRANS_SIG
BSF STATUS,RP0 ;SELECT BANK1
TS0
BTFSSTXSTA,TRMT
GOTO TS0
BCF STATUS,RP0 ;SELECT BANK0
MOVFBYTE3,W
MOVWF TXREG
B2_BCD
SNDMSG
MWAIT0
BTFSSPIR1,TXIF 7
GOTO MWAIT0
MOVLW '{'
MOVWF TXREG
MOVLW 0X00
MOVWF TEMP
SGW1
DECFSZ TEMP,F
GOTO SGW1
MWAIT1
BTFSSPIR1,TXIF
GOTO MWAIT1
MOVLW '1'
MOVWF TXREG
MOVLW 0X00
MOVWF TEMP
SGW2
DECFSZ TEMP,F
GOTO SGW2
MWAIT2
BTFSSPIR1,TXIF
GOTO MWAIT2 7
MOVLW '6'
MOVWF TXREG
MOVLW 0X00
MOVWF TEMP
SGW3
DECFSZ TEMP,F
GOTO SGW3
MWAIT3
BTFSSPIR1,TXIF
GOTO MWAIT3
MOVLW 'F'
MOVWF TXREG
MOVLW 0X00
MOVWF TEMP
SGW4
DECFSZ TEMP,F
GOTO SGW4
MWAIT4
BTFSSPIR1,TXIF
GOTO MWAIT4
7
MOVLW '8'
MOVWF TXREG
MOVLW 0X00
MOVWF TEMP
SGW5
DECFSZ TEMP,F
GOTO SGW5
MWAIT5
BTFSSPIR1,TXIF
GOTO MWAIT5
MOVLW '7'
MOVWF TXREG
MOVLW 0X00
MOVWF TEMP
SGW6
DECFSZ TEMP,F
GOTO SGW6
MWAIT6
BTFSSPIR1,TXIF
GOTO MWAIT6
MOVLW '7' 7
MOVWF TXREG
MOVLW 0X00
MOVWF TEMP
SGW7
DECFSZ TEMP,F
GOTO SGW7
MWAIT7
BTFSSPIR1,TXIF
GOTO MWAIT7
MOVLW 'A'
MOVWF TXREG
MOVLW 0X00
MOVWF TEMP
SGW8
DECFSZ TEMP,F
GOTO SGW8
MWAIT8
BTFSSPIR1,TXIF
GOTO MWAIT8
MOVLW '}'
MOVWF TXREG
MOVLW 0X00
MOVWF TEMP
SGW9
DECFSZ TEMP,F
GOTO SGW9
RETURN
END
7
CHAPTER 9
9 FUTURE ENHANCEMENT
We have wider scopes for developing this project. The primary enhancement is the tract
diversion technique, which can be achieved using the same embedded controller.
Synchronized mimic panel can be expanded such that the annunciation of all the ongoing
trains can be monitored from the centralized control department.
7
Enhanced version of this project is that transmitters and receivers replace the cable
connecting the sensors. During implementation of this project it can be done by using the
satellites. There are more than 24 satellites round the globe, which are used only for the
positioning and locating the objects exactly up to 30 meters. Placing the tiny GPS receiver in
or on the object one can locate or position the distant or lost objects.
CHAPTER 10
10 CONCLUSION
The automatic traction system at the unmanned railway gate, which uses the advanced
features of the micro controller together with the IR sensors and the metal detectors, proves to
be effective in achieving the objectives.
7
Saving human life, protection against accidents and the communicable mechanical
system are the salient features and the added advantage of this project. It is cost effective.
Expensive hardware and non-reliability of cables due to temperature drift are the only
limitations of this project.
CHAPTER 11
11 APPENDIX 8
CIRCUIT DIAGRAM
VCC
VCC 5
3
4
R43 L1 1
2
J1 R29
U5
1 R15 RL1
2 1 2
3
3 R1 J4
4 2 Q1
5 R30
6 5 1
R16 U5 UREG 3 2
7
1
8 3 4 4 3
R2 R44 L2
3
9 1 4
10 2 Q2 2 5
R31 6
U1
U5 7
R17 1 16 8
RL2
3 1
5 6 2 1B 1C 15 9
R3 2B 2C
3 14 10
2 Q3 R32 4 3B 3C 13
5 4B 4C 12
R18 U5 6 5B 5C 11 5 CON10
6B 6C
3 1
9 8 7 10 3
R4 7B 7C 4
2 Q4 9 R45 L3 1
COM 8
R33 2
R19 U5
1
11 10
R5 RL3
3
2 Q5
R34
R20 U5
5
1
13 12 3
R6
3
4
2 Q6 R35 R46 L4 1
2
U6
R21
3 1
1 2
R7
RL4
2 Q7
R36
R22 U6
1
3 4
R8
3
5
2 Q8 3
R37 4
R47 L1 1
R23 U6 2
1
5 6
R9
3
2 Q9
R38 RL5
R24 U6
3 1
9 8
R10
5
2 Q10 3
R39
4
U6 R48 L2 1
R25
3 1
11 10 2 J5
R11
J2 2 Q11 1
R40 RL6 2
1 3
2 R26 U6 4
1
3 13 12 5
4 R12
3
6
5 VCC 2 Q12 5 7
6 R41 3 8
7 U7 U7 4 9
8 UREG R27 R49 L3 1 10
3 1
9 1 2 3 4 2
R13
10
2 Q13
R42
RL7
R28 H1
1
3 1
R14 2
2 Q14 3
1
U7 U7
5 6 9 8
H2
1
2
3
5
3
4
R50 L1 1
2
RL8
1
U4 3
2
5
3
4
R51 L2 1
4 2
U4 6 U2
5
1
1B 1C
16 RL9
7408 2 15
3 2B 2C 14
4 3B 3C 13
5 4B 4C 12
6 5B 5C 11 5
7 6B 6C 10 3
7B 7C 4
9 R52 L3 1
COM 8
2
RL10
5
3
UREG 4
R53 L4 1
2
U3
RL15
1 16 H3 RL11
1B 1C 5
2 15 3 1
3 2B 2C 14 2
3B 3C 4
4 13 1 3
5 4B 4C 12
5B 5C 2
6 11
7 6B 6C 10 5
7B 7C 3
9 4
COM 8 R54 L1 1
RL16 2
J7
5
3 1
4 2 RL12
1 3
2
5 J6
3
4 1
R55 L2 1 2
R58 2 3
R57
4
5
L1 RL13 6
L1
7
8
9
10
5
3
4
R56 L3 1
2
RL14
VCC
8
12 BIBILIOGRAPHY
REFERENCE BOOKS
2. Electrical Engineering
- B.L. THERAJA
WEBSITE REFERENCES
1. [Link]
2. [Link]
3. [Link]
8