Vous êtes sur la page 1sur 46

Railway Track Structural Heath Monitoring System

Chapter 1
INTRODUCTION
Railways being the largest cheapest mode of public transportation, still it is most
safe and easy way of transport. On average more than 10 million people use the railway
services annually. Railway is facing major challenges in its operation. In recent days due
to increase in railway traffic a large number of accidents are happening due to the crack
on the track, obstacles on the track , so it is necessary to implement an automated system
that will overcome the human errors and overcome the railway accidents. This automated
system will help in saving the human life from accidents.
There are many reasons why rail tracks crack. In bygone days, it was common for
a rail crack to start near the joint between discrete rail segments. Manufacturing defects in
rail can cause fissures. Wheel burns can also contribute to rail cracks by changing the
metallurgy of a rail. Rails are also more likely to crack when the weather is cold, when
the ballast and ties/sleepers aren't providing as much support as they should, and when
ground or drainage condition is such that 'pumping' occurs under heavy load. All of these
conditions can contribute to a broken rail, and in turn a possible derailment.
The quality of rail steel has improved dramatically since the early days of
railroading. The trend toward using welded rail requires a higher quality rail, due to the
cyclic thermal expansion and contraction stresses that a CWR would be required to
endure. In addition, rail operations in general have been trending toward higher speed and
higher axle-load operation. Under these operating conditions, rail pieces rolled in the 19th
century would likely break at an unacceptable rate. Despite the improved rail quality and
rail metallurgy, if impurities find their way into rail steel and are not detected by the
quality assurance process, they can cause rail breaks under certain conditions.
Recent rail-making processes have also been trending toward a harder rail,
requiring less frequent replacements under heavy loads. This has the side-effect of
making the rail more brittle, and thus more susceptible to brittle fracture rather than
plastic deformation. It is therefore imperative that unintentional impurities in rail be
minimized.
Railway track crack detection system
This module is used to overcome the disaster from railway track crack using a
processor and the IR sensor. The module involves transmitting message through GSM
once it detects the crack and sends it to the higher authority for further proceeding.
Dept. Of ECE, BTI 2016-17
Railway Track Structural Heath Monitoring System
Obstacle Detection
This module is designed to avoid accidents due to the presence of the obstacles.
To detect obstacle on the track the proposed system consists of a ultrasonic sensor which
generates high frequency sound waves and evaluate the echo which is received back by
the sensor. Sensors calculate the time interval between sending the signal and receiving
the echo to determine the distance to an object.
Automatic railway gate control system
The module is designed using microcontroller to avoid railway accidents
happening at unattended railway gates. This project utilizes two powerful proximity
sensors, which is used to control the railway gate automatically. An alarm is set before the
train arrival which will automatically alerts the public and shuts the railway gate.
This project aims at the development of a prototype which consist of railway track crack
detection, automatic opening and closing of railway gate and also to implement object
detection in railways at a minimized cost.

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System

Chapter 2
LITERATURE SURVEY
[1] Prevention of Train Accidents using Android supported Embedded
Systems
Author: G Kohila Warnan, R Balamurugan
This paper presented a new technology with the embedded systems. For obstacle
detection to prevent the accidents the ultrasonic module is incorporated. This paper is
published in May 2016 at Indian Journal of Science and Technology.
This article discusses on how to prevent major train accidents. The development in
railway sector resulted in an increase in railway traffic. Due to absence of technology the
number of accidents in railway has increased. In this paper, the proposed system uses
Android supported embedded systems which aim at alerting the drivers/ Railway loco
pilot to prevent the collisions.
The proposed system would overcome the existing wireless sensors based Anti-
Collision Device. The proposed system makes use of the Android device for visual
display, Wireless sensors and Microcontrollers. It also uses the GPS system for location
tracking and GSM technology for wireless transmission. The proposed system aims at
maintaining a safe distance of 1Km between the trains, and object collision avoidance. On
detection of a fault/upcoming collision the device will alert the drivers/Railway loco
pilots and shows a visual display on the Android device about the upcoming fault and the
distance between them. This further improvement in the system also aims at prevention of
other train accidents such as fire accidents, object collision, etc. This system provides
speed controllers, alerts on signal over jumping.

[2] Crack Detection and Collision Avoidance in Railway using ARM


CORTEXT
Author: Rajesh L V, Manjunath G Asuti, Mukunda Swamy M S
This paper utilizes the benefits of embedded system and sensors to replace
traditional crack detection system. Detecting crack and collision avoidance will be
analyzed in the simulation platform using embedded system. We have opted GSM and
GPS technology. This paper was published in June 2016 at proceedings of 26th IRF
International Conference.
Dept. Of ECE, BTI 2016-17
Railway Track Structural Heath Monitoring System
Most of the transportation and commercial activities are carried by railway
network. Any trouble in this transportation increases crucial damage to the society also
loss of human life. The proposed system is used to overcome the disaster from railway
cracks and collision between two stations using ARM CORTEX processor. The cracks are
detected through IR sensor and Collisions are detected by the ultra-sonic sensor between
two stations. Four wheel smart trolley is used in the place of train. The project also
involves transmitting message through GSM by the android application and sends it to the
higher authority automatically for further proceedings.

[3] Railway Track Structural Health Monitoring System


Authors: Fathima Imdad,Muhammed Tabish Naiz and Hyung Seok
Kim
This paper presents a prototype for monitoring the structural health of the railway
tracks. The prototype is still under development with many new sensors to be
incorporated for efficient study and monitoring of railway tracks. We plan on
incorporating an IR module. This paper was published in the year 2015 at 15 th
International Conference on Control, Automation and System in BEXCO of Korea.
This paper illustrates a prototype system, designed for continuous monitoring of railway
tracks using a combination of sensors.
For railway system to operate flawlessly constant monitoring and inspection of
railway tracks is required. Currently railway track inspection and monitoring is done
manually which is time taking and not accurate, due to the high chance of human error
occurrence. Moreover, practically it is impossible to inspect and monitor the railway track
manually as they run thousands of miles. The sensor used collects the data and through
computational analysis, faults in the railway tracks are identified. The collected data can
help in finding cracks in the tracks and catastrophic accidents can be avoided.

[4] Sensor Based Automatic Control Of Railway Gates


Author: Karthik Krishnamurthi, Monica Bobby, Vidya V, Edwin Baby
This paper presents Automatic railway gate control system is centered on the idea
of reducing human involvement for closing and opening the railway gate which allows
and prevents cars and humans from crossing railway tracks.

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
This paper was published in 2015 Feb. at International Journal of Advanced
Research in Computer Engineering & Technology.
The present work attempts to automate the opening and closing of gates at a
railway level crossing. In general, level crossing gates are operated manually by a gate
keeper. The gate keeper receives the information about the train arrival from a near
station. When the train starts to leave the station, the station in-charge delivers this
information to the closest gatekeeper to get ready. This human intervention can be
avoided by automating the process. In situations where the train is late due to some
reason, the gates remain closed for long durations causing dense traffic jam near the
gates. This too can be prevented by automation. The proposed system uses infrared
sensors to detect the arrival and departure of trains at the railway level crossing and
Arduino to control the opening/closing of gates. The system uses two IR sensors to detect
the arrival of the train and a third IR sensor to detect the departure of the train.
When the arrival of the train is sensed, signals are provided to the traffic
indicating the arrival of the train on the track. When the second sensor detects the train
then the signal turns red and the motor operates to close the gate. The gate remains closed
until the train completely moves away from the level cross. When the departure of the
train is detected by the third sensor, the traffic signal turns green and the motor operates
to open the gate. Thus automation of the gate operations at the railway level cross is
achieved using sensors.

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System

Chapter 3
BLOCK DIAGRAM DESCRIPTION
For the purpose of detecting railway track crack and obstacle detection many
hardware components are used as shown in Fig 3.1. IR sensors used to detect the crack in
railway track. Two IR sensors are fixed in front of the train is used to find out the crack
on the rail. Each sensor will produce the signal related position with the rail. Infrared
transmitter is one type of LED which emits infrared rays generally called as IR
transmitter. Similarly, IR Receiver is used to receive the IR rays transmitted both IR
transmitter. One important point is both IR transmitter and receiver should be placed
straight line to each other.

Fig 3.1 Railway Track Crack and Obstacle Detection


If the track is normal on its position both the sensor gives the constant Sensed
output. If anyone misses their output condition to fail then there is defect on that side. It
will inform this by giving alarm
The GPS module is being used to send the current latitude and longitude data to
the relevant authority as an SMS through GSM. The importance of this project is
applicable both day & night time detection process.The ultrasonic sensor is used to sense
the obstacle in front of the train.

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
Ultrasonic sensors generate high frequency sound waves and evaluate the echo
which is received back by the sensor. Sensors calculate the time interval between sending
the signal and receiving the echo to determine the distance to an object.
The illustration of the block diagram in Fig 3.2 indicates the operation of
Automatic control of Railway Gate, 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.

Fig 3.2 Automatic Control of Railway Gate


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 after
side sensors. When after side receiver gets activated motor turns in opposite direction and
gate opens and motor stops. Buzzer will immediately sound at the fore side receiver
activation and gate will close after 5 seconds, so giving time to drivers to clear gate area
in order to avoid trapping between the gates and stop sound after the train has crossed.
The gate opening and closing can be done with the help of DC motor by the
specific instruction of microcontroller.

3.2 CONTROL UNIT


In our project the main device is micro controller. It is help to control the whole
unit of this project.

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
In this project we are using the motor, solenoid valve, RS 232 and IR sensor. The
motor is used to move the vehicle, the IR sensor is detect the crack in the railway track,
the RS 232 is a device to pass the signal from micro controller to mobile and the solenoid
valve is used to mark the pain on the cracking area of the railway track. The two set of IR
transmitter and IR receiver are arranged on the equipment the signal from IR transmitter
to IR receiver is provided only it contacts the crack area the signal passed from IR
transmitter to IR receiver. The sensor sense this area and send the signal to the control
unit then the control unit operates the solenoid valve to mark the paint on the cracking
area and also send the SMS to the specified mobile. The control unit gets power from the
battery.
Microcontrollers are destined to play an increasingly important role in
revolutionizing various industries and influencing our day to day life more strongly than
one can imagine. Since its emergence in the early 1980's the microcontroller has been
recognized as a general purpose building block for intelligent digital systems. It is finding
using diverse area, starting from simple children's toys to highly complex spacecraft.
Because of its versatility and many advantages, the application domain has spread in all
conceivable directions, making it ubiquitous.
As a consequence, it has generate a great deal of interest and enthusiasm among students,
teachers and practicing engineers, creating an acute education need for imparting the
knowledge of microcontroller based system design and development. It identifies the vital
features responsible for their tremendous impact; the acute educational need created by
them and provides a glimpse of the major application area.

3.3 IR SENSOR

A Infrared sensor is an electronic device that measures infrared light radiating


from objects in its field of view. Apparent motion is detected when an infrared source
with one temperature, such as a human, passes in front of an infrared source with another
temperature, such as a wall. All objects emit what is known as black body radiation. It is
usually infrared radiation that is invisible to the human eye but can be detected by
electronic devices designed for such a purpose.

Infra meaning below our ability to detect it visually, and Red because this
color represents the lowest energy level that our eyes can sense before it becomes

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
invisible. Thus, infrared means below the energy level of the color red, and applies to
many sources of invisible energy.

Infrared transmitter is one type of LED which emits infrared rays generally called
as IR Transmitter. Similarly IR Receiver is used to receive the IR rays transmitted by the
IR transmitter. One important point is both IR transmitter and receiver should be placed
straight line to each other.

The transmitted signal is given to IR transmitter whenever the signal is high, the
IR transmitter LED is conducting it passes the IR rays to the receiver.

When receiver receives the signal from the transmitter it resistance value is low.it
resistance value become high when the signal was cut. By this sensor sense the value.

3.4 ULTRASONIC SENSOR:


Ultrasonic refers to any study or application of sound waves that are higher frequency
than the human audible range.

Fig 3.3: Frequency representation of Ultrasonic Sensor


Music and common sounds that we consider pleasant are typically 12 kHz or less,
while some humans can hear frequencies up to 20 kHz. Ultrasonic waves consist of
frequencies greater than 20 kHz and exist in excess of 25 MHz. Ultrasonic waves are used
in many applications including plastic welding, medicine, jewelry cleaning, and
nondestructive test. Within nondestructive test, ultrasonic waves give us the ability to see
through opaque material and detect surface or internal flaws without affecting the
material in an adverse manner.
3.5 PROXIMITY SENSOR
A proximity sensor detects an object when the object approaches within the

detection boundary of the sensor. Proximity sensors are used in various facets of

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
manufacturing for detecting the approach of metal objects. Various types of proximity
sensors are used for detecting the presence or absence of an object.
The design of a proximity sensor can be based on a number of principles of
operation, some examples include: variable reluctance, eddy current loss, saturated core,
and Hall effect. Depending on the principle of operation, each type of sensor will have
different performance levels for sensing different types of objects. Common types of non-
contact proximity sensors include inductive proximity sensors, capacitive proximity
sensors, ultrasonic proximity sensors, and photoelectric sensors. Hall-effect sensors detect
a change in a polarity of a magnetic field. Variable reluctance sensors typically include a
U-type core and coils wound around the core legs. Inductive proximity sensors have a
lossy resonant circuit at the input side whose loss resistance can be changed by the
proximity of an electrically conductive medium.
An electrical capacitance proximity sensor converts a variation in electrostatic
capacitance between a detecting electrode and a ground electrode caused by approaching
the nearby object into a variation in an oscillation frequency, transforms or linearizes the
oscillation frequency into a direct current voltage, and compares the direct current voltage
with a predetermined threshold value to detect the nearby object. Ultrasonic sensing
systems provide a much more efficient and effective method of longer range detection.
These sensors require the use of a transducer to produce ultrasonic signals. Eddy-current
proximity sensors are well known and operate on the principle that the impedance of an
ac-excited electrical coil is subject to change as the coil is brought in close proximity to a
metallic object. Proximity sensors often are employed in manufacturing industries in
which the sensors are exposed to harsh environmental conditions.
Inductive proximity sensors are used in automation engineering to define
operating states in automating plants, production systems and process engineering plants.
Magnetic proximity detectors are commonly used on ski lifts and tramways for detecting
a de-rope condition of the steel cable used as a haul line or haul rope. Proximity sensors
are widely used in the automotive industry to automate the control of power accessories.
For instance, proximity sensors are often used in power window controllers to detect the
presence of obstructions in the window frame when the window pane is being directed to
the closed position.
A proximity sensor is a sensor able to detect the presence of nearby objects
without any physical contact. A proximity sensor often emits an electromagnetic or
electrostatic field, or a beam of electromagnetic radiation, and looks for changes in the
Dept. Of ECE, BTI 2016-17
Railway Track Structural Heath Monitoring System
field or return signal. The object being sensed is often referred to as the proximity sensor's
target.
Different proximity sensor targets demand different sensors. For example, a
capacitive or photoelectric sensor might be suitable for a plastic target; an inductive
proximity sensor requires a metal target. The maximum distance that this sensor can
detect is defined "nominal range". Some sensors have adjustments of the nominal range
or means to report a graduated detection distance.
Proximity sensors can have a high reliability and long functional life because of
the absence of mechanical parts and lack of physical contact between sensor and the
sensed object.
Proximity sensors are also used in machine vibration monitoring to measure the
variation in distance between a shaft and its support bearing. This is common in large
steam turbines, compressors, and motors that use sleeve-type bearings. IEC 60947-5-2
defines the technical details of proximity sensors. A proximity sensor adjusted to a very
short range is often used as a touch switch. A proximity sensor is divided in two halves
and if the two halves move away from each other, then a signal is activated. A proximity
sensor can be used in windows, and when the window opens an alarm is activated.
3.6 GSM
This GSM SIM800 Modem can accept any GSM network operator SIM card and
act just like a mobile phone with its own unique phone number. Advantage of using this
modem will be that you can use its RS232 port to communicate and develop embedded
applications. Applications like SMS Control, data transfer, remote control and logging
can be developed easily.
GSM/GPRS MODEM is a class of wireless MODEM devices that are designed
for communication of a computer with the GSM and GPRS network. It requires a SIM
card just like mobile phones to activate communication with the network. Also they have
International Mobile Equipment Identity number similar to mobile phones for their
identification. A GSM/GPRS MODEM can perform the following operations:
1. Receive, send or delete SMS messages in a SIM.
2. Read, add, search phonebook entries of the SIM.
3. Make, Receive, or reject a voice call.
The MODEM needs AT commands, for interacting with processor or controller,
which are communicated through serial communication. These commands are sent by the

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
controller/processor. The MODEM sends back a result after it receives a command.
Different AT commands supported by the MODEM can be sent by the
processor/controller/computer to interact with the GSM and GPRS cellular network.
SIM800 module is needed only if you need those additional features that are not
present in SIM900 series modules, like the Bluetooth functionality which was missing in
SIM900 series. SIM800 and SIM900 can be operated worldwide because they can operate
in all four GSM bands used across the world.

Working
Unlike mobile phones, a GSM modem doesnt have a keypad and display to
interact with. It just accepts certain commands through a serial interface and
acknowledges for those. These commands are called as AT commands. There are a list of
AT commands to instruct the modem to perform its functions. Every command starts with
"AT". Thats why they are called as AT commands. AT stands for attention.
In our simple project, the program waits for the mobile number to be entered
through the keyboard. When a ten digit mobile number is provided, the program instructs
the modem to send the text message using a sequence of AT commands.
Testing the GSM modem
The GSM modem can be tested by connecting it with a PC. The modem is equipped
with a RS232 cable. Just use a Serial to USB converter and connect it with the PC.
Now you can proceed with sending the commands to the modem using any serial
communication program like HyperTerminal, minicom etc.
Ensure the serial parameters are configured to 8N1 and the baud rate is set to
9600bps.
For each command you send the modem acknowledges with a message. Example:
Just try sending "AT" to the modem. It sends back a result code
"OK" which states that the modem is responding. If its not working fine, it sends
"ERROR".
3.7 G P S
Global positing system is a device. It is determine the precise of the location by
the vehicle. it is attached and to record the position of the asset at regular intervals. The
recorded location data can be stored within the tracking unit, or it may be transmitted to a
central location data base, or internet-connected computer, a GPS receiver and a mobile
phone sit side-by-side in the same box, powered by the same battery. At regular intervals,
the phone sends a text message via SMS, containing the data from the GPS receiver.
Dept. Of ECE, BTI 2016-17
Railway Track Structural Heath Monitoring System

3.8 MOTOR
A machine that converts direct current power into mechanical power is known as
D.C Motor.
Its generation is based on the principle that when a current carrying conductor is
placed in a magnetic field, the conductor experiences a mechanical force. The direction if
this force is given by Flemings left hand rule.
WORKING OF A DC MOTOR
Consider a part of a multipolar dc motor as shown in fig. when the terminals of the
motor are connected to an external source of dc supply;
(i) The field magnets are excited developing alternate N and S poles.
(ii) The armature conductors carry currents. All conductors under N-pole carry
currents in one direction while all the conductors under S-pole carry currents
in the opposite direction.
Suppose the conductors under N-pole carry currents into the plane of paper and those
under S-pole carry current out of the plane of paper as shown in fig. Since each armature
conductor is carrying current and is placed in the magnetic field, mechanical force acts on
it. Applying Flemings left hand rule, it is clear that force on each conductor is tending to
rotate the armature in anticlockwise direction.
All these forces add together to produce a driving torque which sets the armature
rotating. When the conductor moves from one side of the brush to the other, current in the
conductor is received and at the same time it comes under the influence of next pole
which is of opposite polarity. Consequently the direction of force on the conductor
remains same.
Principles Of Operation
In any electric motor, operation is based on simple electromagnetism. A current-
carrying conductor generates a magnetic field; when this is then placed in an external
magnetic field, it will experience a force proportional to the current in the conductor, and
to the strength of the external magnetic field. As kids play with magnets as a kid, opposite
polarities attract, while like polarities repel.
The internal configuration of a DC motor is designed to harness the magnetic
interaction between a current-carrying conductor and an external magnetic field to
generate rotational motion. A simple 2-pole DC electric motor is explained.

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
Every DC motor has six basic parts axle, rotor, stator, commutator, field magnets,
and brushes. In most common DC motors, the external magnetic field is produced by
high-strength permanent magnets.
The stator is the stationary part of the motor this includes the motor casing, as well
as two or more permanent magnet pole pieces. The rotor rotates with respect to the stator.
A cross sectional view of DC motor is shown in the Fig. The DC motor has a rotor
which consists of windings, the windings being electrically connected to the commutator.
The above diagram shows a common motor layout with the rotor inside the stator
magnets.

Fig: Cross-sectional view of DC motor


The geometry of the brushes, commutator contacts, and rotor windings are such that
when power is applied, the polarities of the energized winding and the stator magnets are
misaligned, and the rotor will rotate until it is almost aligned with the stator's field
magnets. As the rotor reaches alignment, the brushes move to the next commutator
contacts, and energize the next winding.

Fig: Two-Pole DC Motor

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
The example of a two-pole motor, the rotation reverses the direction of current
through the rotor winding, leading to a "flip" of the rotor's magnetic field, driving it to
continue rotating. The two pole motor is shown in Fig. In real life, though, DC motors
will always have more than two poles. In particular, this avoids "dead spots" in the
commutator. With the example of two-pole motor, if the rotor is exactly at the middle of
its rotation, it will get "stuck" there.
Meanwhile, with a two-pole motor, there is a moment where the commutator
shorts out the power supply. This is bad for the power supply, waste energy, and damage
motor components as well. Another disadvantage of such a simple motor is that it would
exhibit a high amount of torque "ripple".
So since most small DC motors are of a three-pole design as shown in Fig and the
workings of one via an interactive animation is been displayed:

Fig: Three-Pole DC Motor


A few things from this namely, one pole is fully energized at a time. As each brush
transitions from one commutator contact to the next, one coil's field will rapidly collapse,
as the next coil's field will rapidly charge up. This is a direct result of the coil windings'
series wiring:
There's probably no better way to see how an average DC motor is put together,
than by just opening one up. Unfortunately this is tedious work, as well as requiring the
destruction of a perfectly good motor.
The guts of a disassembled Mabuchi FF-030-PN motor are available. This is a
basic 3-pole DC motor, with 2 brushes and three commutator contacts.
The use of an iron core armature is quite common, and has a number of
advantages. First off, the iron core provides a strong, rigid support for the windings a
particularly important consideration for high-torque motors. The core also conducts heat
away from the rotor windings, allowing the motor to be driven harder than might

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
otherwise be the case. Iron core construction is also relatively inexpensive compared with
other construction types.
But iron core construction also has several disadvantages. The iron armature has a
relatively high inertia which limits motor acceleration. This construction also results in
high winding inductances which limit brush and commutator life.
In small motors, an alternative design is often used which features a 'coreless'
armature winding. This design depends upon the coil wire itself for structural integrity. As
a result, the armature is hollow, and the permanent magnet can be mounted inside the
rotor coil. Coreless DC motors have much lower armature inductance than iron-core
motors of comparable size, extending brush and commutator life.
The coreless design also allows manufacturers to build smaller motors;
meanwhile, due to the lack of iron in their rotors, coreless motors are somewhat prone to
overheating. As a result, this design is generally used just in small, low-power motors.
Beamers will most often see coreless DC motors in the form of pager motors.

Fig: Coreless design of DC motor


Again, disassembling a coreless motor can be instructive in this case, my hapless
victim was a cheap pager vibrator motor. The guts of this disassembled motor are
available on 10 lines / cm graph paper. This is more accurately, was a 3-pole coreless DC
motor.
Signal Conditioning Unit
Signal conditioning means manipulating an analogue to manipulating an analogue
signal in such a way that it meets the requirements of the next stage for further
processing. The signal conditioning is the amplification necessary to bring the voltage
level up to that required by the ADC. Signal conditioning stage is a processing stage
carried out by an ADC and microcontroller.
Relay
Dept. Of ECE, BTI 2016-17
Railway Track Structural Heath Monitoring System
A relay is an electrically operated switch. Current flowing through the coil of the
relay creates a magnetic field which attracts a lever and changes the switch contacts. The
coil current can be on or off. So relays have two switch positions and they are double
throw switches. Relays allow one circuit to switch a second circuit which can be
completely separate from the first. The link is magnetic and mechanical. The coil of a
relay passes a relatively large current, typically 30mA for a 12V relay, but it can be as
much as 100mA for relays designed to operate from lower voltages.
Most ICs cannot provide this current and a transistor is usually used to amplify
the small IC current to the larger value required for the relay coil. The maximum output
current for the popular 555 timer IC is 200mA so these devices can supply relay coils
directly without amplification.
Relays are usually SPDT or DPDT but they can have many more sets of switch
contacts, for example relays with 4 sets of changeover contacts are readily available.
Most relays are designed for PCB mounting but you can solder wires directly to the pins
providing you take care to avoid melting the plastic case of the relay. The animated
picture shows a working relay with its coil and switch contacts. You can see a lever on the
left being attracted by magnetism when the coil is switched on. This lever moves the
switch contacts. There is one set of contacts SPDT in the foreground and another behind
them, making the relay DPDT.
Alarm
An alarm or beeper is a signaling device, usually electronic, typically used in
automobiles, household appliances such as a microwave oven, or game shows. It most
commonly consists of a number of switches or sensors connected to a control unit that
determines if and which button was pushed or a preset time has lapsed, and usually
illuminates a light on the appropriate button or control panel, and sounds a warning in the
form of a continuous or intermittent buzzing or beeping sound. Initially this device was
based on an electromechanical system which was identical to an electric bell without the
metal gong which makes the ringing noise.
Often these units were anchored to a wall or ceiling and used the ceiling or wall as
a sounding board. Another implementation with some AC-connected devices was to
implement a circuit to make the AC current into a noise loud enough to drive a
loudspeaker and hook this circuit up to a cheap 8-ohm speaker. Nowadays, it is more
popular to use a ceramic-based piezoelectric sounder like a Sonalert which makes a high-

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
pitched tone. Usually these were hooked up to "driver" circuits which varied the pitch of
the sound or pulsed the sound on and off.

Chapter 4
HARDWARE AND SOFTWARES REQUIRMENTS
4.1 Hardware:
4.1.1 Microcontroller-AT89S52

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System

Fig: Architecture of 89S52

The AT89S52 is designed with static logic for operation down to zero
frequency and supports two software selectable power saving modes. The Idle Mode
stops the CPU while allowing the RAM; timer/counters, serial port, and interrupt system
to continue functioning. The Power-down mode saves the RAM contents but freezes the
oscillator disabling all other chip functions until the next hardware reset.
Microcontroller is a true computer on a chip. The design incorporates all the
features found in a microprocessor CPU: arithmetic and logic unit, stack pointer, program

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
counter and registers. It was also added with some additional features like RAM, ROM,
serial I/O, counters and clock circuit. Like the microprocessor, a microcontroller is a
general purpose device, but one that is meant to read data, perform limited calculations on
that data and control its environment based those calculations.
The prime use of a microcontroller is to control the operation of a machine using
a fixed program that is stored in ROM and that does not change over the lifetime of the
system. The design approach of a microcontroller uses a more limited set of single byte
and double byte instructions that are used to move code and data from internal memory to
ALU. Many instructions are coupled with pins on the IC package; the pins are capable of
having several different functions depending on the wishes of the programmer. The
microcontroller is concerned with getting the data from and on to its own pins; the
architecture and instruction set are optimized to handle data in bit and byte size.
Introduction To Microcontroller
The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller
with 8K bytes of in-system programmable Flash memory. The device is manufactured
using Atmels high-density non-volatile memory technology and is compatible with the
Industry standard 80C51 instruction set and pin out. 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 in-system programmable
Flash on a monolithic chip, the Atmels AT89S52 is a powerful microcontroller which
provides a highly-flexible and cost-effective solution to many embedded control
application.
Features
Compatible with MCS-51 Products
8K Bytes of In-System Programmable (ISP) Flash Memory Endurance: 1000
write/Erase Cycles
4.0V to 5.5V Operating Range , Fully Static Operation: 0 Hz to 33 MHz
256 x 8-bit Internal RAM
32 Programmable I/O Lines
Three 16-bit Timer/Counters
Eight Interrupt Sources ,Three-level Program Memory Lock
Full Duplex UART Serial Channel
Low-power Idle and Power-down Modes
Interrupt Recovery from Power-down Mode
Dual Data Pointer
Power-off Flag

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
Fast Programming Time
Flexible In System Programming (Byte and Page Mode)

Pin Description
VCC: Supply voltage.
GND: ground
PORT 0:
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can
sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high-
impedance inputs. Port 0 can also be configured to be the multiplexed low-order
address/data bus during accesses to external program and data memory. In this mode, P0
has internal pull-ups. Port 0 also receives the code bytes during Flash programming and
outputs the code bytes during program verification. External pull-ups are required during
program verification.

PORT 1:
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output
buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are
pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that
are externally being pulled low will source current (IIL) because of the internal pull-ups.
In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count
input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown
below

PORT PIN ALTERNATE FUNCTIONS


P1.0 T2 (external count input to Timer/Counter 2), clock-out
P1.1 T2EX (Timer/Counter 2 capture/reload trigger and direction control)
P1.5 MOSI (used for In-System Programming)
P1.6 MISO (used for In-System Programming)
P1.7 SCK (used for In-System Programming)
PORT 2:
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output
buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are
pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that
Dept. Of ECE, BTI 2016-17
Railway Track Structural Heath Monitoring System
are externally being pulled low will source current (IIL) because of the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program memory
and during accesses to external data memory that uses 16-bit addresses (MOVX @
DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During
accesses to external data memories that use 8-bit addresses (MOVX @ RI), Port 2 emits
the contents of the P2 Special Function Register. Port 2 also receives the high-order
address bits and some control signals during Flash programming
PORT 3:
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output
buffers can sink/source four TTL inputs.
When 1s are written to Port 3 pins, they are pulled high by the internal pull-ups and can
be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source
current (IIL) because of the pull-ups. Port 3 receives some control signals for Flash
programming and verification. Port 3 also serves the functions of various special features
of the AT89S52, as shown in the following table
P3.0 RXD (serial input port)
P3.1 - TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)
Port 3 also receives some control signals for Flash programming and verification.
RST: Reset input.
A high on this pin for two machine cycles while the oscillator is running resets the
device. This pin drives high for 96 oscillator periods after the watch dog times out.
ALE/PROG:
Address Latch Enable is an output pulse for latching the low byte of the address
during accesses to external memory. This pin is also the program pulse input (PROG)
during programming.
In normal operation, ALE is emitted at a constant rate of 1/6th 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
Dept. Of ECE, BTI 2016-17
Railway Track Structural Heath Monitoring System
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
AT89S52 is executing code from external program memory, PSEN is activated twice each
machine cycle, except that two PSEN activations are skipped during each access to
external data memory.
EA/VPP:
External Access Enable. EA must be strapped to GND in order to enable the
device to fetch code from external program memory locations starting at 0000H up to
FFFFH. However that if lock bit 1 is programmed, EA will be internally latched on reset.
EA should be strapped to VCC for internal program executions. This pin also then
receives 12-volt programming enable voltage (VPP) during Flash programming when 12-
volt Programming is selected.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2:
Output from the inverting oscillator amplifier.

Special Function Registers


The AT89S52 operations that do not use the internal 256-byte RAM addresses
from 00h to 7fh are done by a group of specific internal registers, each called a special
function register (SFR), which may be addressed much like internal RAM, using
addresses from 80h to ffh. Some SFRs are also bit addressable, as is the case for the bit
area of RAM. This feature allows the programmer to change only what needs to be
altered, leaving the remaining bits in that SFR unchanged. Not all of the addresses from
80h to ffh are used for SFRs, and attempting to use an address that is not defined or
empty results in unpredictable results. PC is not part of the SFR and has no internal RAM
address. The names of the SFRs and their functions are given in the following list.
Dept. Of ECE, BTI 2016-17
Railway Track Structural Heath Monitoring System
List Of Special Function Registers
Name Function
A Accumulator
B Arithmetic
DPH Addressing external memory
DPL Addressing external memory
IE Interrupt enables control
IP Interrupt priority
P0 Input/output port latch
P1 Input/output port latch
P2 Input/output port latch
P3 Input/output port latch
PCON Power control
PSW Program status word
SCON Serial port control
SBUF Serial port data buffer
SP Stack pointer
TMOD Timer/counter mode control
TCON Timer/counter control
TL0 Timer 0 low byte
TH0 Timer 0 high byte
TL1 Timer 1 low byte
TH1 Timer 1 high byte
Interrupts
A computer program has only two ways to determine the condition that exist in
Internal and external circuits. One method uses software instructions that jump to
Subroutines on the states of flags and port pins. The second method responds to hardware
Signals, called interrupts that force the program to call a subroutine. Software techniques
use processor time that could be devoted to other tasks, interrupts take processor time
only when action by the program is needed. Most applications of microcontrollers involve
responding to events quickly enough to control the environment that generates the events.
Interrupts are often the only way in which real time programming can be done
successfully.

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
Interrupts may be generated by internal chip operations or provided by external
Sources. Any interrupt can cause the microcontroller to perform a hardware call to an
Interrupt handling sub-routine that is located at a predetermine absolute address in
Program memory.8 interrupts are provided in 89s52.Three of these are generated
automatically by internal operations: timer flag 0, timer flag1 and the serial port.
The AT89S52 has a total of six interrupt vectors: two external interrupts (INT0 and
INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt. Each of
these interrupt sources can be individually enabled or disabled by setting or clearing a bit
in Special Function Register IE. IE also contains a global disable bit, EA, which disables
all interrupts at once.
All interrupt functions are under the control of the program. The programmer is
able to alter the control bits in the Interrupt Enable register (IE), the Interrupt Priority
register (IP), and the Timer Control register (TCON). The program can block all or any
combination of the interrupts from acting on the program by suitably setting or clearing
bits in these registers.
After the interrupt has been handled by the interrupt subroutine, which is placed
by the programmer at the interrupt location in the program memory, the interrupted
program must resume operation at the instruction where the interrupt took place. Program
resumption is done by storing the interrupted PC address on the stack in RAM before
changing the PC to the interrupt address in ROM. The PC address will be restored from
the stack after an RET1 instruction is executed at the end of the interrupt subroutine.
Timer flag interrupt:
When a timer /counter overflows the corresponding timer flag TF0 or TF1 is set to
1. The flag is cleared to 0 when the resulting interrupt generates a program call to the
appropriate timer subroutine in memory.
Serial Port Interrupt
If a data byte is received, an interrupt bit. RI is set to 1 in the SCON register.
When a data byte has been transmitted an interrupt bit, T1, is set in SCON. These are
ORed together to provide a single interrupt to the processor which is the serial port
interrupt. These bits are not cleared when the interrupt generated program call is made by
the processor. The program that handles serial data communication must reset R1 or T1 to
0 to enable the next data communication operation.
External interrupts:

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
Pins INT0 and INT1 are used by external circuitry. Inputs on these pins can set the
interrupt flags IE0 and IE1 in the TCON register to 1 by two different methods. The IEX
flags may be set when the INTX pin signal reaches a low level, or the flags may be set
when a high to low transition takes place on the INTX pin. Bits IT0 and IT1 in TCON
program the INTX pins for low level interrupt when set to 0 and program the INTX pins
for transition interrupt when set to 1.
Flags IEX will be reset when a transition generated interrupt is accepted by the
processor and the interrupt subroutine is accessed. It is the responsibility of the system
designer and programmer to reset any level generated external interrupts when they are
serviced by the program. The external circuit must remove the low level before an RET1
is executed. Failure to remove the low will result in an immediate interrupt after RET1,
from the same source.
Reset
A reset can be considered to be the ultimate interrupt because the program may
not block the action of the voltage on the RST pin. This type of interrupt is often called
non-makeable, because no combination of bits in any register can stop, or mask, the reset
action. Unlike other interrupts, the PC is not stored for later program resumption. A reset
is an absolute command to jump to program address 0000h and commence running from
there. Whenever a high level is applied to the RST pin, the micro controller enters a reset
condition. Internal RAM contents may change during reset. Also the states of the internal
RAM bytes when power is first applied to micro controller are random. Register bank-0 is
selected on reset as all bits in PSW are 0.
Interrupt Control:
The program must be able, at critical times, to inhibit the action of some or all of
the interrupts so that critical operations can be finished. The IE register holds the
programmable bits that can enable or disable all the interrupts as a group, or if the group
is enabled, each individual interrupt source can be enabled or disabled.
It is desirable to be able to set priorities among competing interrupts that may
conceivably occur simultaneously. The IP register bits may be set by the program to
assign the priorities among various interrupt sources so that more important interrupts can
be serviced first should be two or more interrupts occur at the same time.
Interrupt Enable/Disable:

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
Bits in the IE register are set to 1 if the corresponding interrupt source is to be
enabled and set to 0 to disable the interrupt source. Bit EA is the master, or global bit that
can enable or disable all the interrupts.
Interrupt Priority:
Register IP bits determine if any interrupt is to have a high or low priority. Bits set
to 1 give the accompanying interrupt a high priority; 0 assigns a low priority. Interrupts
with a high priority can interrupt another interrupt with a low priority. The low priority
interrupt continues after the higher is finished.
Software Generated Interrupts:
When any interrupt flag is set to 1 by any means, an interrupt is generated unless
blocked. This means that the program itself can cause interrupts of any kind to be
generated simply by setting the desired interrupt flag to 1using a program instruction
Program Counter And Data Pointer:
The AT89S52 contains two 16-bit registers, the program counter (PC) and the data
pointer (DPTR). Each is used to hold the address of a byte in memory. Program
instructions bytes are fetched from locations in memory that are addressed by the PC.
Program ROM may be on the chip at addresses 0000h to 0FFFh, external to the chip for
addresses that exceed 0FFFh, or totally external for all addresses from 0000h to FFFFh.
The PC is automatically incremented after every instruction byte is fetched and may also
be altered by certain instructions. The PC is the only register that does not have an
internal address.
The DPTR register is made up of two 8-bit registers, named DPH and DPL, which
are used to furnish memory addresses for internal and external code access and external
data access. The DPTR is under the control of program instructions and can be specified
by its 16-bit name, DPTR, or by each individual byte name, DPH and DPL. DPTR does
not have a single internal address; DPH and DPL are each assigned an address.
A and B CPU Registers:
AT89S52 contains 34 general purpose, or working registers. Two of these registers
A and B, hold results of many instructions, particularly math and logical operations, of
the 8052 central processing unit. The other 32 are arranged as part of internal RAM in
four banks, B-0 to B-3 of 8 registers and comprise the mathematical core.
The A register is the most versatile of the two CPU registers and is used for many
operations, including addition, subtraction, integer multiplication and division, and
Boolean bit manipulations. The A register is also used for all data transfers between the
Dept. Of ECE, BTI 2016-17
Railway Track Structural Heath Monitoring System
8052 and any external memory. The B register is used with the A register for
multiplication and division operations and has no other function other than as a location
where data may be stored.
Flags and the Program Status Word
Flags are 1-bit registers provided to store the results of certain program
instructions. Other instructions can test the condition of the flags and make decisions
based on the flag states. In order that the flags may be conveniently addresses, they are
grouped inside the program status word (PSW) and the power control (PCON) registers.
The AT89S52 has 4 math flags that respond automatically to the outcomes of math
operations and 3 general purpose user flags that can be set to 1 or cleared to 0 by the
programmer as desired. The math flags include carry (C), auxiliary carry (AC), overflow
(OV) and parity (P). User flags are named F0, GF0 and GF1. They are general purpose
flags that may be used by the programmer to record some event in the program. However
math flags are also affected by the math operations.
The PSW contains the math flags, user program flag(F0) and the register select
bits that identify which of the four general purpose register banks is currently used by the
program. The remaining 2 user flags, GF0 and GF1 are stored in PCON.
Internal RAM and ROM:
The 256 byte internal RAM is organized into 3 distinct areas. 32 bytes from 00h to
1Fh that make up 32 working registers are organized as 4 banks of 8 registers each. The 4
register banks are numbered 0 to 3 and are made up of 8 registers R0 to R7. Each register
can be addressed by the name of the bank or by its RAM address. Thus R0 of bank-3 is
R0 (if bank-3 is currently selected) or address 18h (whether bank-3 is selected or not).
Bits RS0 and RS1 in the PSW determine which bank of registers is currently in use at any
time when the program is running. Register banks not selected can be used as general
purpose RAM. Bank-0 is selected on reset.
A bit addressable area of 16 bytes occupies RAM byte addresses 20h to 2Fh,
forming a total of 128 addressable bits. An addressable bit may be specified by its bit
address of 00h to 7Fh, or 8 bits may form any byte address from 20h to 2Fh. Addressable
bits are useful when the program need only remember a binary event.
The AT89S52 is organized so that data memory and program core memory can be
in two entirely different physical memory entities. Each has the same address ranges. The
corresponding block of internal program code, contained in an internal ROM, occupies
code address space 0000h to 0FFFh. The PC is ordinarily used to address program code
Dept. Of ECE, BTI 2016-17
Railway Track Structural Heath Monitoring System
bytes from addresses 0000h to FFFFh. Program addresses higher than 0FFFh, which
exceed the internal ROM capacity, will cause the micro controller to automatically fetch
program code bytes from external program memory. The PC does not care where the code
is, whether it is in internal ROM totally or totally in external ROM or in a combination of
internal and external ROM.
Stack And Stack Pointer:
The stack refers to an area of internal RAM that is used in conjunction with
certain opcodes to store and retrieve data quickly. The 8 bit stack pointer (SP) register is
used by the micro controller to hold an internal RAM address that is called the top of the
stack. The address held in the SP register is the location in the internal RAM with the last
byte of data was stored by the stack operation.
When data is to be placed on the stack, the SP increments before storing data on the stack
so that the stack grows up as the data is stored. As the data is retrieved from the stack the
byte is read from the stack, and then the SP decrements to point to the next available byte
of stored data.
The SP is set to 07h when the micro controller is reset and can be changed to any
internal RAM address by the programmer, using a data move command. The stack is
normally placed high in internal RAM, by an appropriate choice of the number placed in
SP register, to avoid conflict with the register, bit and scratch pad internal RAM areas.
The heart of the AT89S52 is the circuitry that generates the clock pulses by which
all internal operations are synchronized. Pins XTAL1 and XTAL2 are provided for
connecting a resonant network to form an oscillator typically a quartz crystal and
capacitors are employed. The crystal frequency is the basic internal clock frequency of
the micro controller. The manufacturers make available 8052 designs that can run at
specified maximum and minimum frequencies, typically 1MHz to 16MHz. Minimum
frequencies imply that some internal memories are dynamic and must always operate
above a minimum frequency or data will be lost.
Serial data communication needs often dictate the frequency of the oscillator
because of the requirement that internal counters must divide the basic clock rate to yield
standard communication bit per second (baud) rates.
Ceramic resonators may be used as a low cost alternative to crystal resonators.
However, decreases in frequency stability and accuracy make the ceramic resonator a
poor choice if high speed serial data communication with other systems, or critical

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
timing, is to be done. The oscillator formed by the crystal, capacitors and an on-chip
inverter generates a pulse train at the frequency of the crystal.
The clock frequency establishes the smallest interval of time within the micro
controller called the pulse time. The smallest interval of time to accomplish any simple
instruction, or part of a complex instruction, is the machine cycle. The machine cycle is
itself made up of 6 states. A state is the basic time interval for discrete operations of the
micro controller such as fetching an opcode byte, decoding an opcode, executing an
opcode, or writing a data byte. Two oscillator pulses define each state.
Program instructions may require one, two or four machine cycles to be executed,
depending on the type of instruction. Instructions are fetched and executed by the micro
controller automatically beginning with the instruction located at ROM memory address
0000h at the time the micro controller is first reset.
Modes of Operation
Idle Mode
In idle mode, the CPU puts itself to sleep while all the on chip peripherals remain
active. The mode is invoked by software. The content of the on-chip RAM and all the
special functions registers remain unchanged during this mode.
The idle mode can be terminated by any enabled interrupt or by a hardware reset.
When idle mode is terminated by a hardware reset, the device normally resumes program
execution from where it left off, up to two machine cycles before the internal reset
algorithm takes control.
On-chip hardware inhibits access to internal RAM in this event, but access to the
port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin
when idle mode is terminated by a reset, the instruction following the one that invokes
idle mode should not write to a port pin or to external memory.
Power-Down Mode:
In the power-down mode, the oscillator is stopped, and the instruction that invokes
power-down is the last instruction executed. The on-chip RAM and Special Function
Registers retain their values until the power-down mode is terminated. The only exit from
power-down is a hardware reset. Reset redefines the SFRs but does not change the on-
chip RAM. The reset should not be activated before VCC is restored to its normal
operating level and must be held active long enough to allow the oscillator to restart and
stabilize.

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System

Addressing Modes
The CPU can access data in various ways. The data could be in a register or in
memory or to be provided as an immediate value. The various ways of accessing data are
called addressing modes.
The various ways of the addressing modes of a microprocessor are determined when
designed and therefore cant be changed by the programmer. The 89S52 provides a total
of 5 addressing modes. They are as follows:
1. Immediate addressing mode:
In this addressing mode the source operand is a constant. In this mode the operand
comes immediately after the opcode. The immediate data must be preceded by # sign.
This mode can be used to load information into any of the registers.
Ex. Mov ro, #5h
2. Register addressing mode:
This mode involves the use of the registers to hold the data to be executed. It
should be noted that the source and the destination registers must match in size. We can
move data between register and accumulator but movement of data between registers is
not possible.
3. Direct addressing mode:
In this mode the data is in a RAM memory location whose address is known and
this address is given as a part of the instruction.
We can use direct or indirect addressing modes to access data stored either in the
RAM or registers of the 89S52.
4. Register indirect addressing mode:
In this addressing mode a register is used as a pointer to the data. If the data is
inside the CPU, only the registers R0 and R1 are used for the purpose.
In other words R2-R7 cannot be used to hold the address of an operand located in
RAM.
5. Indexed addressing mode:
This mode is widely used in accessing the data elements of lookup table entries
located in the programmed ROM space of the 89S52.The instruction used for this purpose
is MOVC A, @A+DPTR. The DPTR and the register A are used to form the address of
data element stored on the on-chip memory.
Absolute Maximum Ratings:

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
Operating temperature : -55 oC to +125 o C
Storage temperature : -65 oC to +150 oC
Voltage on any pin with respect to ground : -1.0V to +7.0V
Maximum operating voltage : 6.6V
DC output current : 15.0mA.

4.2 IR Sensor
Infrared transmitter is one type of LED which emits infrared rays generally called
as IR Transmitter. Similarly IR Receiver is used to receive the IR rays transmitted by the
IR transmitter. One important point is both IR transmitter and receiver should be placed
straight line to each other.
The transmitted signal is given to IR transmitter whenever the signal is high, the
IR transmitter LED is conducting it passes the IR rays to the receiver. The IR receiver is
connected with comparator. The comparator is constructed with LM 741 operational
amplifier. In the comparator circuit the reference voltage is given to inverting input
terminal. The non inverting input terminal is connected IR receiver. When interrupt the IR
rays between the IR transmitter and receiver, the IR receiver is not conducting. So the
comparator non inverting input terminal voltage is higher than inverting input. Now the
comparator output is in the range of +12V. This voltage is given to base of the transistor
Q1. Hence the transistor is conducting. Here the transistor is act as switch so the collector
and emitter will be closed. The output is taken from collector terminal. Now the output is
zero.

IR TRANSMITTER IR RECEVER

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
When IR transmitter passes the rays to receiver, the IR receiver is conducting due
to that non inverting input voltage is lower than inverting input. Now the comparator
output is -12V so the transistor is cutoff region. The 5v is given to 40106 IC which is the
inverter with buffer.
The inverter output is given to microcontroller or PC. This circuit is mainly used
to for counting application, intruder detector etc.
4.1.3 Ultrasonic Sensor
Ultrasonic Ranging Module HC - SR04
Features
Power Supply :+5V DC
Quiescent Current : <2mA
Working Current: 15mA
Effectual Angle: <15
Ranging Distance : 2cm 400 cm/1 13ft
Resolution : 0.3 cm
Measuring Angle: 30 degree
Trigger Input Pulse width: 10uS
Dimension: 45mm x 20mm x 15mm

Pins:

VCC: +5VDC
Trig : Trigger (INPUT)

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
Echo: Echo (OUTPUT)
GND: GND

4.1.4 Proximity sensor


Proximity switches are employed in any place where fast, maintenance-free, wear-
resistant detection of objects is requested. These are typical and increasingly important
requirements in all automation processes.
Without physical contact and independent of form, inductive proximity switches detect all

Parameters Normal Range


Open circuit voltage 8.2 VDC 0.1V 7 to 9VDC
Output resistance 1000 10 550 to 1010
Ambient temperature 20C 2C -
Line resistance - Max. 50
Switching point 1.65mA 1.2 to 2.1 mA
Hysteresis 0.2 mA -
Short circuit monitoring, trigger level - 100 1 360
open circuit monitoring, trigger level - 0.05mA 1 0.15mA
ferrous and non-ferrous metallic objects within their active zone and give out a
corresponding control signal.
Characteristic features of proximity switches:
Maintenance free and wear resistance
No physical contact
Contactless, hence bounce-free
High operating frequencies
Installable in any position
Lifetime independent of operating frequency
Insensitive to vibrations
Insensitive to dirt collection
Waterproof
Widely resistant to chemicals

Technical description

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System

4.1.5 Motor driver L293D:-

Fig: Ciruit Diagram of Two Phase Motor Driver

Pin Description:
Pin
Function Name
No
1 Enable pin for Motor 1; active high Enable 1,2
2 Input 1 for Motor 1 Input 1
3 Output 1 for Motor 1 Output 1
4 Ground (0V) Ground
5 Ground (0V) Ground
6 Output 2 for Motor 1 Output 2
Dept. Of ECE, BTI 2016-17
Railway Track Structural Heath Monitoring System
7 Input 2 for Motor 1 Input 2
8 Supply voltage for Motors; 9-12V (up to 36V) Vcc 2
9 Enable pin for Motor 2; active high Enable 3,4
10 Input 1 for Motor 1 Input 3
11 Output 1 for Motor 1 Output 3
12 Ground (0V) Ground
13 Ground (0V) Ground
14 Output 2 for Motor 1 Output 4
15 Input2 for Motor 1 Input 4
16 Supply voltage; 5V Vcc1

4.1.6 GPS
The GPS receiver is to be optimized for low power applications, providing minimal
power consumption and time to first fix under cold start conditions. However in some
applications the GPS receiver is operated continuously, under control of the 3rd party
application, with anticipated increased position solution accuracy. Operating
requirements are as follows:
Power Consumption: 180 mW typical, 200 mW maximum.
Cold Start TTFF: < 45 seconds @ 95% success rate.
Cold Start Accuracy: 99% < 10 meters.
Message Format: Minimum NMEA GGA, RMC, GSV and GSA
message types, at a rate configurable by the application processor.
Information: location, speed, heading and time (desirable: odometer).
Information Rate: Each message type sent once per second by default,
changeable by command.
GPS receiver must be able to be commanded to operate in the following modes:
2D/3D Automatic: The position solution can be of type 2D, though the
GPS receiver provides 3D position solutions when possible.
3D Only: A position solution is provided to the application processor
only if it is of the 3D type (latitude, longitude, altitude) using a minimum of 4 GPS
satellites.
At the GPS antenna port, the interface specification is as follows:
Input Impedance: 50
VSWR: 2.0 maximum
Output Voltage: 3.0 0.3 VDC

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
Output Power: 20 mA maximum
ESD: 8 KV
4.1.7 GSM
The SIM800 modem has a SIM800 GSM chip and RS232 interface while enables
easy connection with the computer or laptop using the USB to Serial connector or to the
microcontroller using the RS232 to TTL converter.
SIM800 - GSM/GPRS module Designed for global market, SIM800 is a quad-
band GSM/GPRS module that works on frequencies GSM 850MHz, EGSM 900MHz,
DCS 1800MHz and PCS 1900MHz.
Specifications:
SIM800 Quad Band GSM Module
Voltage Supply Required- 9VDC to 12VDC with atleast 2A Peak Current
Capability
TTL Rx and TTL Tx and DB9 Connector Based RS232 Outputs
External Finger type antenna
Switching Regulator Based Power Supply
Features:
Bands: GSM 850MHz, EGSM 900MHz, DCS 1800MHz, PCS 1900MHz
Coding schemes: CS-1, CS-2, CS-3, CS-4 Tx power: Class 4 (2W), Class 1 (1W)
Small package: 23 * 23 * 3mm
Low power: down to 1mA in sleep mode
TCP/IP AT firmware
Operating temperature: -40C to +85C
Audio channels which include a microphone input and a receiver output.
One SIM card interface.

4.2 Software
4.2.1 Keil uVision
The Keil Development Tools are designed for the professional software developer,
however programmers of all levels can use them to get the most out of the embedded
microcontroller architectures that are supported.
Tools developed by Keil endorse the most popular microcontrollers and are distributed in
several packages and configurations, dependent on the architecture.
In addition to the software packages, Keil offers a variety of evaluation boards, USB-
JTAG adapters, emulators, and third-party tools, which completes the range of products.

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
Like all software based on Keils Vision IDE, the toolsets provide a powerful, easy to
use and easy to learn environment for developing embedded applications. They include
the components you need to create, debug, and assemble your C/C++ source files, and
incorporate simulation for microcontrollers and related peripherals. The RTX RTOS
Kernel helps you to implement complex and time-critical software.
The Keil Vision Integrated Development Environment supports three major
microcontroller architectures and sustains the development of a wide range of
applications.
8-bit (classic and extended 8051) devices include an efficient interrupt system
designed for real-time performance and are found in more than 65% of all 8-bit
applications. Over 1000 variants are available, with peripherals that include analog
I/O, timer/counters, PWM, serial interfaces like UART, I2C, LIN, SPI, USB, CAN,
and on-chip RF transmitter supporting low-power wireless applications. Some
architecture extensions provide up to 16MB memory with an enriched 16/32-bit
instruction set. The Vision IDE supports the latest trends, like custom chip designs
based on IP cores, which integrate application-specific peripherals on a single chip.
16-bit devices are tuned for optimum real-time and interrupt performance and provide
a rich set of on-chip peripherals closely coupled with the microcontroller core. They
include a Peripheral Event Controller for high speed data collection with little or no
microcontroller overhead. These devices are the best choice for applications requiring
extremely fast responses to external events.
32-bit devices support complex applications, which require greater processing power.
These cores provide high-speed 32bit arithmetic within a 4GB address space. The
RISC instruction set has been extended with a Thumb mode for high code density.
ARM7 and ARM9 devices provide separate stack spaces for high-speed context
switching enabling efficient multi-tasking operating systems. Bit addressing and
dedicated peripheral address spaces are not supported. Only two interrupt priority
levels, - Interrupt Request and Fast Interrupt Request, are available.
32-bit devices combine the cost benefits of 8-bit and 16-bit devices with the
flexibility and performance of 32-bit devices at extremely low power consumption.
The architecture delivers state of the art implementations for FPGAs and SoCs. With
the improved Thumb2 instruction set, Cortex-Mx1 based microcontrollers support a
4GB address space, provide bit-addressing, and several interrupts with at least 8
interrupt priority levels.

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System

Chapter 5
WORKING PRINCIPLE
The project consists of two models; one is Railway Track Crack and Obstacle
Detection using IR sensor and Ultrasonic Sensor. The second one is the Automatic control
of Railway Gate using the pair of Proximity Sensors.

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
The first model consists of Micro controller, IR sensor, SCU, Alarm, GPS, GSM,
Relay and DC motor. This model pertains to a process for monitoring the condition of rail
on train tracks and more specifically has the object of the identification of defects
detected by monitoring equipment on the tracks to be checked to allow maintenance
crews to subsequently find these defects.
When we give the supply to the device, the DC motor gets start through relay
driver circuit. Two IR sensors are fixed in front of the train is used to find out the crack on
the rail. Each sensor will produce the signal related position with the rail. If the track is
normal on its position both the sensor gives the constant sensed output. If anyone misses
their output condition to fail then there is defect on that side. It will inform this by giving
alarm. Then the GPS is used to track the location of the crack in the track and send the
information to the given number. The ultrasonic sensor is used to sense the object in front
of the train.
The second model consists of Microcontroller, Proximity sensor, SCU, Relay, DC
Motor, To avoid railway accidents happening at unattended railway gates, if implemented
in spirit. This model utilizes two powerful proximity sensors, which is used to control the
railway gate automatically.
When foreside sensor gets sensed, the gate motor is turned on in one direction and
the gate is closed and stays closed until the train crosses the gate and reaches aft side
sensors. When aft side sensor gets sensed, motor turns in opposite direction and gate
opens and motor stops. 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. The gate opening and closing can be done
with the help of DC motor by the specific instruction of microcontroller.

Chapter 6
Flowchart and Algorithm
6.1 Railway track crack and obstacle detection

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System

Railway Track Crack and Obstacle Detection

6.1Progress Algorithm
Input Power supply 12V Batteries
Crack detection-IR sensor Programming
Obstacle detection-Ultrasonic sensor programming
Analyzing hardware and software components
Interfacing Microcontroller
End

6.2 Automatic railway gate control

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System

Automatic railway gate control

6.2.1 Progress Algorithm


Input power supply 12V and 5V
Gate model-proximity sensor programming
Analysing hardware and software components
Interfacing Microcontroller
End

Snapshots:

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
CONCLUSION
This project presents a prototype for the automatic monitoring of the railway track
for the cracks and obstacle on it, also it includes the automatic operation of gate. The
prototype contains a four-wheel trolley which is shown as a train which contains sensors
that continuously senses the track for the cracks and obstacles on it and finds the exact
fault location in rail track and which will takes the remedy action immediately so that
time many people lives can be saved. Also, sensors are used to detect the arrival of the
train kilometers ahead and passes a message in the form of an alarm at the crossing. Then
after a delay the railway gate closes automatically and after the train passes automatically
the railway gate is opened. This prototype is used for the safety of railways at the low cost
and can be implemented in the real time. Hence it is expected that, major train mishaps
can be prevented and human life saved if this system is implemented.

Dept. Of ECE, BTI 2016-17


Railway Track Structural Heath Monitoring System
REFERENCES
[1] G. Kohila Warnan and R. Balamurugan, Prevention of Train Accidents using Android supported
Embedded Systems, Indian Journal of Science and Technology 2016.
[2] Rajesh L V, Manjunath G Asuti and Mukunda Swamy M S, Crack Detection and Collision
Avoidance in Railway using ARM CORTEX, IRF International conference 2016.
[3] Pranav Lad and Mansi Pawar, Evolution of Railway Track Crack Detection System, Robotics
and Manufacturing Automation(ROMA), 2nd IEEE international symposium, 2016.
[4] Fatima Imdad, Muhammad Tabish Niaz and Hyung Seok Kim, Railway Track Structural
Health Monitoring System, 15th International Conference on Control, Automation and Systems 2015.
[5] Karthik Krishnamurthi, Monica Bobby, Vidya V and Edwin Baby, Sensor based automatic
control of railway gates International Journal of Advanced Research in Computer Engineering &
Technology 2015.

Dept. Of ECE, BTI 2016-17

Vous aimerez peut-être aussi