Вы находитесь на странице: 1из 55

1

CHAPTER 1

1.1- INTRODUCTION
We know that the railway network of India is the biggest in south Asia and perhaps the most
complicated in all over the world. There are so many different types of trains local, fast,
super-fast, passenger, goods. etc. and there so many multiple routs. Although the time table
is perfect it is not at all possible to maintain it. And thats why the train accidents are
becoming more and more usual. So why not we add a kind of intelligence to the train engines
itself so that it tries to avoid accidents.
The idea is to design such a system through which the railway crossing closes itself when a
train seems to be coming. Using simple electronic components we have tried to automate the
control of railway gates. This project is a standalone automatic unmanned railway gate
control system using AT89C51 microcontroller. The main aim of this project is atomizing the
unmanned railway gate. i.e., the gate is closed automatically whenever the train comes and
gate is opened after the train leaves the railway road crossing.
The system comprises of two IR Transmitter-Receiver pairs. One IR TX Rx pair is located
at one end of the railway gate. The second pair is located at another end of the gate. In each
pair the TX and Rx are arranged face to face across the railway track. i.e., TX is placed at one
side of the track and the receiver RX at another side of track. The Rx should continuously get
the signal from the transmitter.
Whenever any train is arriving on the track, the IR signal gets disturbed due to the
interruption of the train. Thus the micro controller identifies the arriving of train. Before
closing the gate the microcontroller gives siren to alert the people who are on the track. After
30 sec, the controller will close the gate by rotating the stepper motor. For the opening of the
gate, the micro controller should know whether the train has left the crossing or not. The
second IR pair is used for this purpose.
The second IR pair identifies the train since the IR signal gets disturbed when it comes in
between TX and RX. The microcontroller will wait till the last compartment and when it left
the IR pair, the receiver again gets IR signal. Hence the microcontroller knows that the train
left the gate. Till this time the gate is closed. Now, after the train left the crossing, the
microcontroller will open the gate by rotating the stepper motor. LCD displays the status of
the train.
This project uses regulated 5V, 500mA power supply. 7805 three terminal voltage regulator
is used for voltage regulation. Bridge type full wave rectifier is used to rectify the ac output
of secondary of 230/12V step down transformer.




2

1.1.1 BLOCK DIAGRAM OF THE PROJECT










Figure 1.1 BLOCK DIAGRAM OF PROJECT
MICROCONTROLLER: A microcontroller is a small computer on single integrated circuit
containing a processor core, memory and programmable input/output peripherals. They are
designed for embedded applications like automatically controlled devices such as automobile
engine control systems, appliances, etc.
IR SENSOR :The feature of the IR led almost same(however rays are not visible) as LED so
to make the transmitter include a series resistance of 220 ohm- 1.5 K-ohm then apply the
desired potential 5V or 9 V. Check the transmitter using the camera. The IR led should be
connected in forward bias (that its positive should be connected to positive and negative to
the negative).
MOTOR DRIVER : The L293D is an integrated circuit motor driver that can be used for
simultaneous, bi-directional control of two small motors (small means small). The L293D is
limited to 600 mA, but in reality can only handle much small currents unless you have done
some serious heat sinking to keep the case temperature down.
DC MOTOR:
From the start, DC motors seem quite simple. Apply a voltage to both terminals, and it spins.
But if you want to control which direction the motor spins, you reverse the wires. Now if you
want the motor to spin at half that speed You would use less voltage.
SENSOR 2
DC MOTOR
SENSOR 1
MICROCONTROLLER

MOTOR DRIVER



3

1.1.2 SCHEMATIC DIGRAM OF PROJECT


Figure 1.2 SCHEMATIC DIAGRAM OF PROJECT

1.1 PART LIST

MODULE QUANTITY
1. Microcontroller(AT89S8253) 1
2. IR Receiver 2
3. IR Transmitter 2
4. Micro switch 1
5. Crystal Oscillator 1
6. Resistors 10
7. Regulator IC(7805) 3
8. Motor driver circuit 1
9. D.C. Motor 1
10. Connector 3



4


1.3 PART DESCRIPTION

1.3.1 MICROCONTROLLER Atmel AT89S8253
The AT89S8253 is a low-power high-performance CMOS 8-bit microcontroller with 12K
bytes of In-System Programmable (ISP) Flash program memory and 2K bytes of EEPROM
data memory. The device is manufactured using Atmels high-density non- volatile memory
technology and is compatible with the industry-standard MCS-51 instruction set and pin out.
The on-chip downloadable Flash allows the program memory to be reprogrammed in system
through an SPI serial interface or by a conventional nonvolatile memory programmer. By
combining a versatile 8-bit CPU with downloadable Flash on a monolithic chip, the Atmel
AT89S8253 is a powerful microcontroller which provides a highly-flexible and cost-
effective solution to many embedded control applications.
The AT89S8253 provides the following standard features: 12K bytes of In-System
Programmable Flash,2Kbytes of EEPROM,256 bytes of RAM,32I/O lines, programmable
watch dog timer, two data pointers,three16-bit timer/counters, a six-vector four-level
interrupt architecture ,a full duplex serial port, on-chip oscillator and clock circuitry In
addition,theAT89S8253 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 function until the next external interrupt or hardware
reset.
The on-board Flash/EEPROM is accessible through the SPI serial interface. Holding
RESET active forces the SPI bus in to a serial programming interface and allows the
program memory to be written to or read from unless one or more clock bits have been
activated.

Features:
Compatible with MCS-51 Products



5

12Kbytes of In-System Programmable (ISP) Flash Program Memory
SPI Serial Interface for Program Downloading
Endurance: 10,000Write/Erase Cycles
2K Bytes EEPROM Data Memory
Endurance: 100,000 Write/Erase Cycles
64-byte User Signature Array
2.7V to 5.5V Operating Range
Fully Static Operation: 0Hz to 24 MHz
Three-level Program Memory Lock
256x8 bit Internal RAM
32 Programmable I/O Lines
Three 16-bitTimer/Counters
Nine Interrupt Sources
Enhanced UART Serial Port with Framing Error Detection and Automatic
Address Recognition
Enhanced SPI (Double Write/Read Buffered) Serial Interface
Low-power Idle and Power-down Modes
Interrupt Recovery from Power-down Mode
Programmable Watch dog Timer
Dual Data Pointer
Power-off Flag
Flexible ISP Programming (Byte and Page Modes)
Page Mode: 64 Bytes/Page for Code Memory, 32Bytes/Page for Data Memory



6

Four-level Enhanced Interrupt Controller
Programmable and Fuse ablex2 Clock Option
Internal Power-on Reset
42-pin PDIP Package Option for Reduced EMCE mission
Green (Pb/Halide-free) Packaging Option








Figure 1.3 PIN DIAGRAM OF Micro Controller (AT89S8253)

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



7

Port 1
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers can
sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull-ups. Port 1 also receives the
low-order address bytes during Flash programming and verification.
Port 2
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers can
sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputsPort 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-
order address byte during fetches from external program memory and during accesses to
external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application, it
uses strong internal pull-ups when emitting 1s. During accesses to external data memory that
uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function
Register. Port 2 also receives the high-order address bits and some control signals during
Flash programming and verification.
Port 3
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers can
sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being
pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions
of various special features of the AT89C51 as listed below:
Port Pin Alternate Functions
P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)



8

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.
ALE/PROG
Address Latch Enable output pulse for latching the low byte of the address during accesses to
external memory. This pin is also the program pulse input (PROG) during Flash
programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator
frequency, and may be used for external timing or clocking purposes. Note, however, that one
ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation
can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only
during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the
ALE-disable bit has no effect if the micro controller is in external execution mode.
PSEN
Program Store Enable is the read strobe to external program memory. When the AT89C51 is
executing code from external program memory, PSEN is activated twice each machine cycle,
except that two PSEN activations are skipped during each access to external data memory.
EA/VPP
External Access Enable (EA) must be strapped to GND in order to enable the device to fetch
code from external program memory locations starting at 0000H up to FFFFH. Note,
however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should
be strapped to VCC for internal program executions. This pin also receives the 12-volt
programming enable voltage (VPP) during Flash programming, for parts that require 12-volt
VPP.




9

XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2
It is the output from the inverting oscillator amplifier.
1.3.2 POWER SUPPLY
The input is 230V AC which is step down using the
transformer (12-0-12) .The 12V ac input is fed to the
bridge diode to gives 12V pulsating DC. This DC
voltage is filtered through the capacitor to remove the
ripples. The filtered DC is fed to 7805 regulator to
fetch +5v regulated output. This regulated voltage is
given to all the components to function properly.

Battery
A nine-volt battery, also called a PP3 battery, is shaped as a rounded rectangular prism and
has a nominal output of nine volts. Its nominal dimensions are 48 mm 25 mm 15 mm.
9V batteries are commonly used in pocket transistor radios, smoke detectors, carbon
monoxide alarms, guitar effect units, and radio-controlled vehicle controllers. They are also
used as backup power to keep the time in digital clocks and alarm clocks.

Figure 1.5 Battery
Figure 1.4 POWER SUPPLY



10

ADAPTERS

The adapters are the device that has inbuilt circuitry for converting the 230V
AC in to desired DC like +5V adapter, +12V adapter, +9V adapter and many
more. This consists of inbuilt circuit for HIGH AC to low voltage DC
conversion.
POWER JACK

Power Jack is basically a connector to connect the adapter output to the board directly. It
has the proper connection designed to connect with the adapter as well as out connection to
connect to the board. It has three terminals output 1 Vcc, 2 GND and 3 No connection.
Figure 1.7 POWER JACK



CONNECTERS

Connectors are wire connection and interface to connect two
different points. It has different configuration like 2- pin
connector, 3 -pin connector, 4- pin connector and many more.


1.3.3MOTOR DRIVER L293D

The L293D is an integrated circuit motor driver that can be used for simultaneous, bi-
directional control of two small motors (small means small). The L293D is limited to 600
mA, but in reality can only handle much small currents unless you have done some serious
heat sinking to keep the case temperature down.

Figure 1.6
ADAPTERS
Figure 1.8 CONNECTERS



11

The L293D is a quadruple high-current half-H driver designed to provide bidirectional
drive currents of up to 600-mA at voltages from 4.5 V to36 V. It is designed to drive
inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other
high-current/high-voltage loads in positive-supply applications.
L293D is a bipolar motor driver IC. This is a high voltage, high current push pull four
channel driver compatible to TTL logic levels and drive inductive loads. It has 600 mA
output current capabilities per channel and internal clamp diodes. The L293 is designed to
provide bidirectional drive currents of up to 1A at voltages from 4.5 V to 36 V. The L293D
is designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V
to 36 V.
Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4
enabled by 3,4EN. When enable input high is given then the associated drivers are enabled,
and their outputs are active and in phase with their inputs. When the enable input is low,
those drivers are disabled, and their outputs are off and in the high-impedance state. With
the proper data inputs, each pair of drivers forms a full-H (or bridge) reversible drive
suitable for solenoid or motor applications.

Pin diagram
Drivers are enabled in pairs with drivers 1 and 2enabled by
1,2EN and drivers 3 and 4 enabled b3, 4 EN. When enable
input is high, the associated drivers are enabled, with
their and their outputs are active and in phase inputs.
External high-speed output clamp diodes should be used
for inductive transient suppression. When the enable input
is low, those drivers are disabled, and their outputs are off
and in a high-impedance state. With the proper data inputs,
each pair of drivers forms a full-H (or bridge) reversible
drive suitable for solenoid or motor applications.

Figure 1.9 PIN DIAGRAM OF L293D IC.




12

Features
600-mA Output Current Capability Per Driver
Pulsed Current 1.2-A Per Driver
Output Clamp Diodes for Inductive
Transient Suppression
Wide Supply Voltage Range
4.5 V to 36 V
Separate Input-Logic Supply
Thermal Shutdown
Internal ESD Protection
High-Noise-Immunity Inputs
Functional Replacement for SGS L293D

Motor driving



Figure 1.10 MOTOR DRIVING CIRCUITS




13

1.3.4 CRYSTAL OSCILLATOR
A crystal oscillator is an electronic circuit that uses the mechanical resonance of a vibrating
crystal of piezoelectric material to create an electrical signal with a very precise frequency.
This frequency is commonly used to keep track of time (as in quartz wristwatches), to
provide a stable clock signal for digitalintegrated circuits, and to stabilize frequencies for
radio transmitters and receivers. The most common type of piezoelectric resonator used is the
quartz crystal, so oscillator circuits designed around them were called "crystal oscillators".

1.11 Picture of crystal oscillator
A crystal oscillator is an electronic circuit that produces electrical oscillations at a particular
designed frequency determined by the physical characteristics of one or more crystals,
generally of quartz, positioned in the circuit feedback loop. A piezoelectric effect causes a
crystal such as quartz to vibrate and resonate at a particular frequency. The quartz crystal
naturally oscillates at a particular frequency, its fundamental frequency that can be hundreds
of megahertz. The crystal oscillator is generally used in various forms such as a frequency
generator, a frequency modulator and a frequency converter. The crystal oscillator utilizes
crystal having excellent piezoelectric characteristics, in which crystal functions as a stable
mechanical vibrator. There are many types of crystal oscillators. One of them is a crystal
oscillator employing an inverting amplifier including a CMOS (complementary metal oxide
semiconductor) circuit, and used, for example, as a reference signal source of a PLL (phase-
pocked poop) circuit of a mobile phone. Crystal oscillator circuits using crystal have a
number of advantages in actual application since crystals show high frequency stability and
stable temperature characteristic as well as excellent processing ability. Temperature-
compensated crystal oscillators, in which variation in oscillation frequency that arises from
the frequency-temperature characteristic of the quartz-crystal unit is compensated, find
particularly wide use in devices such as wireless phones used in a mobile environment. A
surface mounting crystal oscillator is used mainly as a frequency reference source particularly



14

for a variety of portable electronic devices such as portable telephones because of its compact
size and light weight.
Commonly used crystal frequencies
Crystals can be manufactured for oscillation over a wide range of frequencies, from a few
kilohertz up to several hundred megahertz. Many applications call for a crystal oscillator
frequency conveniently related to some other desired frequency, so certain crystal frequencies
are made in large quantities and stocked by electronics distributors.
Crystal oscillators of different frequencies along the uses
Frequency
(MHz)
Primary uses
0.032768
Real-time clocks, quartz watches and clocks; allows binary division to
1 Hz signal (2
15
1 Hz)
1.8432
UART clock; allows integer division to common baud rates. (= 2
13

3
2
5
2
. 16 115200 baud or 96 16 1200 baud)
2.4576
UART clock; allows integer division to common baud rates up to
38400
3.2768 Allows binary division to 100 Hz (32768 100 Hz, or 2
15
100 Hz)
3.575611 PALM color subcarrier
3.579545
NTSC M color subcarrier. Because these are very common and
inexpensive they are used in many other applications, for example
DTMF generators
3.582056 PALN color subcarrier
3.686400
UART clock (2 1.8432 MHz); allows integer division to common
baud rates



15

4.096000 Allows binary division to 1 kHz (2
12
1 kHz)
0.5-200 MHz can be used for crystals with higher frequencies, up to 50 MHz
Table no. 1.1
Crystal oscillator circuit used in microcontroller
A microcontroller is disclosed that includes a crystal oscillator circuit that is programmable to
provide multiple different levels of startup current. In the present embodiment, the crystal
oscillator circuit includes logic devices for receiving programming indicating one of a
plurality of different startup current levels and a resistor chain. The logic devices are coupled
to the resistor chain for controlling the resistance of the oscillator circuit such that, upon
receiving programming indicating a particular startup current level, the crystal oscillator
circuit generates a corresponding startup current. In addition, the crystal oscillator circuit
includes provision for selecting one of a plurality of different levels of capacitance.
Furthermore, the crystal oscillator circuit includes a pass gate that includes circuitry for
assuring predetermined startup conditions are met. A feedback loop that includes an amplifier
provides for steady-state operations that have low power consumption.
1.3.5 CERAMIC CAPACITOR
The ceramic dielectric materials are made from earth under extreme heat. By use of titanium
dioxide or several types of silicates, very high values of dielectric constant can be obtained.


1.12 Ceramic Capacitor



16

In the disk form, silver is fired onto both side of the ceramic, to form the conductor plates.
For tabular ceramics, the hollow ceramic tube has a silver coating plates on the inside and
outside surfaces. The temperature coefficient is given in parts per million per degree Celsius
with the reference of 25C. Ceramic capacitors are often used for the temperature
compensation, to increase or decrease capacitance with the rise in the temperature.
1.3.6 IR SENSORS
Infrared (IR) light is electromagnetic radiation with longer wavelengths than those
of visible light, extending from the nominal red edge of the visible spectrum at 0.74 micro-
meters (m) to 300 m. This range of wavelengths corresponds to a frequency range of
approximately 1 to 400 THz, and includes most of the thermal radiation emitted by objects
near room temperature. Infrared light is absorbed by molecules when they change their
rotational-vibration movements. Infrared light is used in industrial, scientific, and medical
applications. Night-vision devices using
infrared illumination allow people or animals
to be observed without the observer being
detected. In astronomy, imaging at infrared
wavelengths allows observation of objects
obscured by interstellar dust. Infrared
imaging cameras are used to detect heat loss
in insulated systems, to observe changing
blood flow in the skin, and to detect
overheating of electrical apparatus.
This sensor finds wide applications.
This consists of an IR transmitter and
photo-diode as IR receiver. When we
apply a potential across the transmitter it transmits IR rays. It should be noted that IR is not
a visible ray so one cannot test the IR easily that whether it is transmitting or not. Implant
the proper potential across the IR transmitter and see the transmission using a camera.
The feature of the IR led almost same(however rays are not visible) as LED so to
make the transmitter include a series resistance of 220 ohm- 1.5 K-ohm then apply the
desired potential 5V or 9 V. Check the transmitter using the camera. The IR led should be
Figure 1.13 IR SENSORS




17

connected in forward bias (that its positive should be connected to positive and negative to
the negative).
The IR receiver is an electronic component whose resistance decreases with
increasing IR intensity. It is also called as Photo diode The photodiode is reversed biased
so the depletion region of the junction is very thick thus the resistance. When IR having
energy falls on such a junction more electron hole pairs is generated increasing the
conductance making the depletion region thin? Due to this additional energy, these
electrons/holes become free and jump in to the conduction band. Due to these charge
carriers, the conductivity of the device increases, decreasing its resistivity.


IR Transmitter

Figure 1.14 IR TRANSMITER
IR Transmitter is a Arduino breakout for a simple and clear infrared LED on it. These
Infrared lED operates around 940nm and work well for generic IR systems including
remote control and touch-less object sensing. Pair them with any of our IR receivers.
IR Receiver

Figure 1.15 IR RECIEVER



18

IR receiver is a breakout board with IR detector mounting on it.IR detector is little
microchips with a photocell that are tuned to listen to infrared light at 38KHz. They are
almost always used for remote control detection - every TV and DVD player has one of
these in the front to listen for the IR signal from the clicker.
Applications

This sensor is used in variations applications commercial as well as industrial.
Security system
Colour detection (white black)
Object detection.
Intruder detection
Conveyor belts and metro station gates.
TV remote control
One of the drawbacks of this sensor is that it detects the IR of the sun also. So applications
with this sensor have to be used ignoring sunlight. To remove this drawback we can use
TSOP1738, MOC3041 but they receive the IR intensity at particular frequency only. So
the transmitter should transmit at that particular frequency.
Measuring the Resistance Variation

Design the transmitter source first than put the receiver in front
of the transmitter
Put the multi-meter knob on the proper resistance range and put
the cathode and anode terminal on the terminal of the IR
receiver. Put the IR source in front of the photodiode and check
the resistance and then put off the IR source and check the
resistance. Also vary the IR intensity and check the resistance.


1.3.7 Voltage Regulator

A voltage regulator is designed to automatically maintain a constant voltage level. A
voltage regulator may be a simple "feed-forward" design or may include negative feedback
Figure 1.16 IR
TRANSMITTERS
AND RECEIVER



19

control loops. It may use an electromechanical mechanism, or electronic components.
Depending on the design, it may be used to regulate one or more AC or DC voltages.

3-Terminal 1a Positive Voltage Regulators

Output Current up to 1A.
Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V.
Thermal Overload Protection.
Short Circuit Protection.
Output Transistor Safe Operating Area Protection.

PIN Architecture
7805, It is a voltage regulator the 78 indicates a
positive regulator the 05 indicates the voltage
output. At 1 amp if adequate heats sink is
provided. Never fear it has thermal protection to
shut it down only if the internal heating exceeds
the safety zone. It will not destroy itself by
removing or reducing the load it will come- back
alive after cooling.

NOTE Every voltage regulator has minimum voltage threshold and Maximum voltage
threshold. The minimum threshold input voltage is the should be greater than the output
voltage of the regulator like for 7805 it should be greater than +5V. Similarly, the
maximum threshold input is also defined for the regulator till which the voltages can be
regulated to give the desired output else due to excessive heat the regulator can destroy
since beside the regulated voltage the remaining voltage goes as heat loss. So the
regulators have heat sink also. Always refer the datasheet for maximum thresholds. Try to
put the input voltage minimum as per the requirement like if you require 5 V then put the
source of 6V or 9V so that minimum heat is dissipated.

Figure1.17
VOLTAGE
REGULATOR
Figure 1.18 PIN ARCHITECTURE



20

1.3.8 DC Motor
From the start, DC motors seem quite simple. Apply a voltage to both terminals, and it spins.
But what if you want to control which direction the motor spins? Correct, you reverse the
wires. Now what if you want the motor to spin at half that speed? You would use less
voltage. But how would you get a robot to do those things autonomously? How would you
know what voltage a motor should get? Why not 50V instead of 12V? What about motor
overheating? Operating motors can be much more complicated than you think.
Voltages
You probably know that DC motors are non-polarized - meaning that you can reverse voltage
without any bad things happening. Typical DC motors are rated from about 6V-12V. The
larger ones are often 24V or more. But for the purposes of a robot, you probably will stay in
the 6V-12V range. So why do motors operate at different voltages? As we all know (or
should), voltage is directly related to motor torque. More voltage, higher the torque. But don't
go running your motor at 100V cause thats just not nice. A DC motor is rated at the
voltage it is most efficient at running. If you apply too few volts, it just wont work. If you
apply too much, it will overheat and the coils will melt. So the general rule is, try to apply as
close to the rated voltage of the motor as you can. Also, although a 24V motor might be
stronger, do you really want your robot to carry a 24V battery (which is heavier and bigger)
around? My recommendation is do not surpass 12V motors unless you really really need the
torque.

Figure 1.19 DC Motor



21

Current
As with all circuitry, you must pay attention to current. Too little, and it just won't work. Too
much, and you have meltdown. When buying a motor, there are two current ratings you
should pay attention to. The first is operating current. This is the average amount of current
the motor is expected to draw under a typical torque. Multiply this number by the rated
voltage and you will get the average power draw required to run the motor. The other current
rating which you need to pay attention to is the stall current. This is when you power up the
motor, but you put enough torque on it to force it to stop rotating. This is the maximum
amount of current the motor will ever draw, and hence the maximum amount of power too.
So you must design all control circuitry capable of handling this stall current. Also, if you
plan to constantly run your motor, or run it higher than the rated voltage, it is wise to heat
sink you motor to keep the coils from melting.
How high of a voltage can you over apply to a motor? Well, all motors are (or at least should
be) rated at a certain wattage. Wattage is energy. Inefficiency of energy conversion directly
relates to heat output. Too much heat, the motor coils melt. So the manufacturers of [higher
quality] motors know how much wattage will cause motor failure, and post this on the motor
spec sheets. Do experimental tests to see how much current your motor will draw at a desired
voltage.
The equation is:
Power (watts) = Voltage * Current
Power Spikes
There is a special case for DC motors that change directions. To reverse the direction of the
motor, you must also reverse the voltage. However the motor has a built up inductance and
momentum which resists this voltage change. So for the short period of time it takes for the
motor to reverse direction, there is a large power spike. The voltage will spike double the
operating voltage. The current will go to around stall current. The moral of this is design your
robot power regulation circuitry properly to handle any voltage spikes.





22

Torque
When buying a DC motor, there are two torque value ratings which you must pay attention
to. The first is operating torque. This is the torque the motor was designed to give. Usually
it is the listed torque value. The other rated value is stall torque.
This is the torque required to stop the motor from rotating. You normally would want to
design using only the operating torque value, but there are occasions when you want to know
how far you can push your motor. If you are designing a wheeled robot, good torque means
good acceleration. My personal rule is if you have 2 motors on your robot, make sure the stall
torque on each is enough to lift the weight of your entire robot times your wheel radius.
Always favor torque over velocity.
Remember, as stated above, your torque ratings can change depending on the voltage
applied. So if you need a little more torque to crush that cute kitten, going 20% above the
rated motor voltage value is fairly safe (for you, not the kitten). Just remember that this is less
efficient, and that you should heat sink your motor.
Velocity is very complex when it comes to DC motors. The general rule is, motors run the
most efficient when run at the highest possible speeds. Obviously however this is not
possible. There are times we want our robot to run slowly.
So first you want gearing - this way the motor can run fast, yet you can still get good torque
out of it.
Unfortunately gearing automatically reduces efficiency no higher than about 90%. So include
a 90% speed and torque reduction for every gear meshing when you calculate gearing. For
example, if you have 3 spur gears, therefore meshing together twice, you will get a 90% x
90% = 81% efficiency. The voltage and applied torque resistance obviously also affects
speed.
Control Methods
The most important of DC motor control techniques is the H-Bridge. After you have your H-
Bridge hooked up to your motor, to determine your wheel velocity/position you must use an
encoder. And lastly, you should read up on good DC Motor Braking methods.



23

1.3.9 H- Bridge







Figure 1.20 H Bridge

BASIC THEORY
H-bridge. Sometimes called a "full bridge" the H-bridge is so named because it has four
switching elements at the "corners" of the H and the motor forms the cross bar.
The letter H doesn't have the top and bottom joined together. This four switching elements
within the bridge. These four elements are often called, high side left, high side right, low
side right, and low side left (when traversing in clockwise order).
The switches are turned on in pairs, either high left and lower right, or lower left and high
right, but never both switches on the same "side" of the bridge. If both switches on one side
of a bridge are turned on it creates a short circuit between the battery plus and battery minus
terminals. This phenomenon is called shoot through in the Switch-Mode Power Supply
(SMPS) literature. If the bridge is sufficiently powerful it will absorb that load and your
batteries will simply drain quickly. Usually however the switches in question melt.
To power the motor, you turn on two switches that are diagonally opposed. In the picture to
the right, imagine that the high side left and low side right switches are turned on.The current
flows and the motor begins to turn in a "positive" direction. What happens if you turn on the




24

high side right and low side left switches? You guessed it, current flows the other direction
through the motor and the motor turns in the opposite direction.
The tricky part comes in when we decide what to use for switches. Anything that can carry a
current will work, from four SPST switches, one DPDT switch, relays, transistors, to
enhancement mode power MOSFETs.
If each switch can be controlled independently then you can do some interesting things with
the bridge, it is also known as a "four quadrant device" (4QD). If you built it out of a single
DPDT relay, you can really only control forward or reverse. We can build a small truth table
that tells us for each of the switch's states, what the bridge will do. As each switch has one of
two states, and there are four switches, there are 16 possible states. However, since any state
that turns both switches on one side on is "bad" (smoke issues forth), there are in fact only
four useful states (the four quadrants) where the transistors are turned on.


High
Side
Left
High
Side
Right
Lower
Left
Lower
Right Quadrant Description
On Off Off On Motor goes Clockwise
Off On On Off Motor goes Counter-clockwise
On On Off Off Motor "brakes" and decelerates
Off Off
On On
Motor "brakes" and decelerates




The last two rows describe a maneuver where you "short circuit" the motor which causes the
motors generator effect to work against itself. The turning motor generates a voltage which
tries to force the motor to turn the opposite direction. This causes the motor to rapidly stop
spinning and is called "braking" on a lot of H-bridge designs.
There is also the state where all the transistors are turned off. In this case the motor coasts if
it was spinning and does nothing if it was doing nothing.




25

1.3.10 Micro Switch
A micro switch, also known as snap-action switch, is a generic term used to refer to an
electric switch that is actuated by very little physical force, through the use of a tipping-point
mechanism. They are very common due to their low cost and durability, greater than 1
million cycles and up to 10 million cycles for heavy duty models. This durability is a natural
consequence of the design. Internally a stiff metal strip must be bent to activate the switch.
This produces a very distinctive clicking sound and a very crisp feel. When pressure is
removed the metal strip springs back to its original state. Common applications of micro
switches include the door interlock on a microwave oven, levelling and safety switches in
elevators, vending machines, and to detect paper jams or other faults in photocopiers. Micro
switches are commonly used in tamper switches on gate valves on fire sprinkler systems and
other water pipe systems, where it is necessary to know if a valve has been opened or shut.
The defining feature of micro switches is that a relatively small movement at the actuator
button produces a relative large movement at the electrical contacts, which occurs at high
speed (regardless of the speed of actuation). Most successful designs also exhibit hysteresis,
meaning that a small reversal of the actuator is insufficient to reverse the contacts; there must
be a significant movement in the opposite direction. Both of these characteristics help to
achieve a clean and reliable interruption to the switched circuit.

Figure 1.21 Micro Switch
The first micro switch was invented by Peter McGall in 1932 in Freeport, Illinois. McGall
was an employee of the Burgess Battery Company at the time. In 1937 he started the
company MICRO SWITCH, which still exists as of 2009. The company and the Micro



26

Switch trademark has been owned by Honeywell Sensing and Control since 1950.The
trademark has become a widely used description for snap-action switches. Companies other
than Honeywell now manufacture miniature snap-action switches.
Micro switches are applied in appliances, machinery, industrial controls, vehicles, and many
other places for control of electrical circuits. Micro switches are usually rated to carry current
in control circuits only, although some switches can be directly used to control small motors,
solenoids, lamps, or other devices. Micro switches may be directly operated by a mechanism,
or may be packaged as part of a pressure, flow, or temperature switch, operated by a sensing
mechanism such as a Bourdon tube. A motor driven cam and one or more micro switches
form a timer mechanism. The snap-switch mechanism can be enclosed in a metal housing
including actuating levers, plungers or rollers, forming a limit switch useful for control of
machine tools or electrically-driven machinery.
1.3.11 RESISTORS
Resistance is inserted into a circuit in order to reduce the current or to produce a desired IR
voltage drop. The components for these uses, manufactured with the specific R, are resistors.
The two main characteristics of a resistor are its R in ohms and the voltage rating. Resistors
are available in a wide range of R values, from a fraction of ohm to many mega ohms. The
power rating may be as high as several 100watts.
The power rating is important because it specifies the maximum wattage the resistance can
dissipate without excessive heat. Wire wound resistors are used where the power dissipation
is about 5 watts or more. For 2 watt or less, the carbon and wire wound resistors can be either
fixed or variable. A fixed resistor has a specific R that cannot be adjusted. A variable resistor
can be adjusted for any value between its 0ohms and its maximum R. An application for a
variable wire wound resistor is to divide the voltage from a power supply. A carbon
composition variable resistor is commonly used for control such as volume control in a radio.
Hence there are many types of resistors some of them are :
Wire wound resistors
Carbon composition resistors
Carbon film resistors
Metal film resistors
Variable resistors



27

Resistors Color Codes
COMPOSITION TYPE RESISTORS



FILM TYPE RESISTORS


NOTE: BANDS "A" TO "D" ARE OF EQUAL WIDTH

B and A: The first significant figure of the resistance value.
B and B: The second significant value of the resistance value.
B and C: The multiplier is the factor by which the two significant figures are multiplied to
yield the nominal resistance value.
B and D: The resistors tolerance
B and E: When used on composition resistors, band E indicates the established reliability
failure rate level. On film resistors, this band is approximately 1.5 times the width of the
other bands, and indicates type of terminal.




28

1.3.12 LIGHT EMITTING DIODE (LED)
LEDs are special diodes that emit light. LED devices are becoming popular because they
consume very less power than other light device. LEDs have been used in electronics circuit
for long time. They are available in red, yellow, green and multicolor and mainly used as
indicators in electronic devices. But the new technological makes it possible to have white
LEDs.

Figure 1.22 Light Emitting Diode (LED)
Super bright LEDs made it possible to get more light with very low power consumption.
Therefore now LEDs find its use as a light source. LEDs are so far used in digital display ,
indicator on electronic instruments like TV, Computer. But now they started finding
application in making bulb, torch, and emergency lamps, traffic signal, street lights and so on.
LEDs are diode, which emits photons. They gives lights when current is passed through
them. Since it does not required heating of filament or gas, it does not have the problem of
burning out. Polarity of LED is indicated by size of its leads, lead with longer lead is positive
and lead with short length is negative. Super flux LED's one corner is flat that is called
negative. In this project we used red LED.
SYMBOL & STRUCTURE OF LED



Figure 1.23 Symbol of LED




29


Figure 1.24 Structure of LED
MEASUREMENTS OF LED

Figure 1.25 Measurements of LEDs
Types of LEDs


Figure 1.26 Types of LEDs



30

DESCRIPTION
5mm Red LED diode (Super brightness/water clear) specifications:
Item:FLR-50T03-SR5
Size : 5.0mmx8.7mm(with flange)
Emitting color :Red
Material : AlGaInP
Polarity: P/N
Lens color water clear
Wavelength:620-625nm
Forward Voltage:1.9-2.1-2.4VF
Luminous intensity:1000-1500mcd
50% Power Angle: 45deg5
Forward Current: 20 mA
Reverse Voltage: -5Vr
Reverse Current : 10 uA
ADVANTAGES
1) A Range of colors: - LED are available in variety of colors like a violet, blue, yellow,
green, orange, red and white.
2) Efficiency: - LED consumes very less energy they are very efficient than Incandescent
bulb.
3) Low maintenance: - LED does not necessarily need maintenance. Their rated life is
10000 hrs.
4) Durability: - LEDs are extremely resistance to shock, vibration.
5) The low operation voltage of LEDs eliminates sparks.
DISADVANTAGES
1) The viewing angle is less.
2) Direct viewing into LED may damage your eyes.



31

1.3.13 Capacitor

The function of capacitors is to store electricity, or electrical energy. The capacitor also
functions as filter, passing AC, and blocking DC. The capacitor is constructed with two
electrode plates separated by insulator. They are also used in timing circuits because it
takes time for a capacitor to fill with charge. They can be used to smooth varying DC
supplies by acting as reservoir of charge.
The capacitor's function is to store electricity, or electrical energy. The capacitor also
functions as a filter, passing alternating current (AC), and blocking direct current (DC).
This symbol ( ) is used to indicate a capacitor in a circuit diagram. The capacitor is
constructed with two electrode plates facing each other but separated by an insulator.
When DC voltage is applied to the capacitor, an electric charge is stored on each electrode.
While the capacitor is charging up, current flows. The current will stop flowing when the
capacitor has fully charged.
Commercial capacitors are generally classified according to the dielectric. The most used
are mica, paper, electrolytic and ceramic capacitors. Electrolytic capacitors use a molecular
thin oxide film as the dielectric resulting in large capacitance values. There is no required
polarity, since either side can be the most positive plate, except for electrolytic capacitors.
These are marked to indicate which side must be positive to maintain the internal
electrolytic action that produces the dielectric required to form the capacitance. It should
be noted that the polarity of the charging source determines the polarity of the changing
source determines the polarity of the capacitor voltage.
This is a measure of a capacitors ability to store charge. A large capacitance means that
more charge can be stored. It is measured in farad, F. 1F is very large, so prefixes are used
to show the smaller values.
Three prefixes are used, u (micron), n (Nano), and p (Pico).
1uf=10
-6
f
1nf=10
-9
f
1pf=10
-12
f



32

Sometimes, a three-digit code is used to indicate the value of a capacitor. There are two
ways in which the capacitance can be written one uses letters and numbers, the other uses
only numbers. In either case, there are only three characters used. [10n] and [103] denote
the same value of capacitance. The method used differs depending on the capacitor
supplier. In the case that the value is displayed with the three-digit code, the 1st and 2nd
digits from the left show the 1st figure and the 2nd figure, and the 3rd digit is a multiplier
which determines how many zeros are to be added to the capacitance. Pico farad (pF) units
are written this way.
For example, when the code is [103], it indicates 10 x 103, or 10,000pF = 10 Nano-farad
(nF) = 0.01 microfarad (F).
If the code happened to be [224], it would be 22 x 104 = or 220,000pF = 220nF = 0.22F.
Values under 100pF are displayed with 2 digits only. For example, 47 would be 47pF.
The capacitor has an insulator (the dielectric) between 2 sheets of electrodes. Different
kinds of capacitors use different materials for the dielectric.
Type of capacitors
There are various types of capacitors available in the market. Some of them are as follows
Mica Capacitor
Paper Capacitor
Ceramic Capacitor
Variable Capacitor
Electrolytic Capacitor
Tantalum Capacitor
Film Capacitor
Here we used only one type of capacitor i.e. ceramic capacitor.






33

Polarized capacitors
These are the capacitors having polarity. Basically these are of larger values than 1uf. For
example below is the diagram of capacitor of 220 microfarad and having breakdown
voltage 25V.
Electrolytic capacitors are polarized and they must be
connected the correct way round, at least one of their leads
will be marked + or -. They are not damaged by heat when
soldering.
There are two designs of electrolytic capacitors; axial where the leads are attached to each
end (220F in picture) and radial where both leads are at the same end (10F in picture).
Radial capacitors tend to be a little smaller and they stand upright on the circuit board.
It is easy to find the value of electrolytic capacitors because they are clearly printed with
their capacitance and voltage rating. The voltage rating can be quite low (6V for example)
and it should always be checked when selecting an electrolytic capacitor. If the project
parts list does not specify a voltage, choose a capacitor with a rating which is greater than
the project's power supply voltage. 25V is a sensible minimum for most battery circuits.
Unpolarized Capacitors
Small value capacitors are un-polarized and may be connected either way round. They are
not damaged by heat when soldering, except for one unusual type (polystyrene). They have
high voltage ratings of at least 50V, usually 250V or so. It can be difficult to find the
values of these small capacitors because there are many types of them and several different
labeling systems.

Figure 1.28 UNPOLARIZED CAPACITORS

Many small value capacitors have their value printed but without a multiplier, so you need
to use experience to work out what the multiplier should be.
Figure 1.27 POLARIZED
CAPACITORS



34

For example 0.1 means 0.1F = 100nF.
Sometimes the multiplier is used in place of the decimal point
For example- 4n7 means 4.7nF.
1.3.14 Voltage Comparator IC (LM324)
These amplifiers are designed to specifically to operate from a solitary supply over a wide
range of voltages. Also can function when the difference between the two supplies is 3V to
30V and VCC is at least 1.5V more positive than the input common mode voltage.


Figure 1.29 Pin diagram of LM324
Pin Description
V+ = Supply voltage
GND = Gnd (0V) connection for supply voltage
Input(s) = Input to Op-Amp
Output(s) = Output of Op-Amp
Features
Supply voltage V + : +32VDC or +16VDC
Differential Input Voltage : 32VDC
Input Voltage : -0.3VDC to +32VDC
Power Dissipation : 570mW





35

Operating Temperature : 0 to 70C degree
Output Current Source : Typical 40mA
Output Current Source : Typical 40mA
Output Current Sink : Typical 20mA
Input Offset Voltage : Typical 2.0mVDC
Operates on a single supply over a range of voltages
Unique features
In the linear mode, the input common-mode voltage range includes ground and the output
voltage can also swing to ground, even though operated from only a single power supply
voltage. The unity gain crossover frequency and the input bias current are temperature-
compensated.
Applications
In Transducer amplifiers.
DC amplification blocks and conventional operations.
adapters from electronic devices that are no longer operating. To reuse adapters to power
Elementals LED lights, just be sure theyre 12V DC.












36

CHAPTER- 2
2.1 PCB

A printed circuit board, or PCB, is used to mechanically support and electrically
connect electronic components using conductive pathways, tracks or signal
traces etched from copper sheets laminated onto a non-conductive substrate. It is also referred
to as printed wiring board (PWB) or etched wiring board. Printed circuit boards are used in
virtually all but the simplest commercially produced electronic devices.
A PCB populated with electronic components is called a printed circuit
assembly (PCA), printed circuit board assembly or PCB Assembly (PCBA). In informal use
the term "PCB" is used both for bare and assembled boards, the context clarifying the
meaning.
Alternatives to PCBs include wire wrap and point-to-point construction. PCBs must initially
be designed and laid out, but become cheaper, faster to make, and potentially more reliable
for high-volume production since production and soldering of PCBs can be automated. Much
of the electronics industry's PCB design, assembly, and quality control needs are set by
standards published by the IPC organization.
PCBs are inexpensive, and can be highly reliable. They require much more layout effort and
higher initial cost than either wire-wrapped or point-to-point constructed circuits, but are
much cheaper and faster for high-volume production. Much of the electronics industry's PCB
design, assembly, and quality control needs are set by standards that are published by the IPC
organization.
Printed Circuit Boards are primarily an insulating material used as base, into which
conductive strips are printed. The base material is generally fiberglass, and the conductive
connections are e generally copper and are made through an etching process. The main PCB
board is called the motherboard; the smaller attachment PCB boards are called daughter
boards or daughter cards

2.1.1 PCB Design

PCB board design defines the electrical pathways between components. It is derived from a
schematic representation of the circuit. When it is derived, or imported from a schematic
design, it translates the schematic symbols and libraries into physical components and
connections



37

Units PCB Boards are primarily designed in imperial units (inches) as opposed to metric
units (mm). A thousands of an inch is called mil (not to be confused with mm), where 100
mils = 0.1 inch = 2.54 mm. The reason for using imperial units in a PCB document is
because most of the components were manufactured according to imperial pin spacing. The
practice continues even today!

2.2 WORKING ON PCB

A PCB layout is required to place components on the PCB so that the component area can
be minimized and the components can be placed in an efficient manner. The components
can be placed in two ways, either manually or by software. The manual procedure is quiet
cumbersome and is very inefficient. The other method is by the use of computer software.
This method is advantageous as it saves time and valuable copper area. There are various
softwares available for this purpose like-
Express PCB
Pad2pad
Protel PCB
PCB design etc.



Figure 2.1 WORKING ON EXPRESS PCB









38

Many of them are loaded with auto routing and auto placement facility. The software that we
have used here is EXPRESS PCB. This software has a good interface, easy editing options
and a wide range of components.
2.2.1 EXPRESS PCB

Express PCB is a very easy to use Windows application for laying out printed circuit
boards. There are two parts to Express PCB, Express SCH for drawing schematics and
Express PCB for designing circuit boards.
There are lots of functions available in the software. This software is free of cost and it is
very easy to use. The different layers of the PCB can be viewed by just a click of a button
on the interface. And we easily get its print on paper which is utilized for further
processing. We can design single sided PCB as well as Double Sided PCB with this
Software.
The side toolbar





39

The top toolbar


2.3 PCB LAYOUT


Fig 2.2 H BRIDGE PCB



40


Fig 2.3 Analog to digital converter PCB


Fig 2.4 Microcontroller PCB



41

2.5 SCREEN PRINTING
Screen printing is a printing technique that uses a woven mesh to support an ink-blocking .
The attached stencil forms open areas of mesh that transfer ink or other printable materials
which can be pressed through the mesh as a sharp-edged image onto a substrate. A fill
blade or squeegee is moved across the screen stencil, forcing or pumping ink into the mesh
openings for transfer by capillary action during the squeegee stroke. Basically, it is the
process of using a stencil to apply ink onto another material.
Screen printing is also a stencil method of print making in which a design is imposed on a
screen of polyester or other fine mesh, with blank areas coated with an impermeable
substance. Ink is forced into the mesh openings by the fill blade or squeegee and onto the
printing surface during the squeegee stroke. It is also known as silkscreen, serigraphy, and
serigraph printing. A number of screens can be used to produce a multicoloured image.
Method of stenciling that has increased in popularity over the past years is the photo
emulsion technique
Hand-painted color separation on transparent overlay by serigraph printer Csaba Markus
1. The original image is created on a transparent overlay, and the image may be drawn
or painted directly on the overlay, photocopied, or printed with a computer printer, but
making so that the areas to be inked are not transparent. A black-and-white positive may
also be used (projected on to the screen). However, unlike traditional platemaking, these
screens are normally exposed by using film positives.
2. A screen must then be selected. There are several different mesh counts that can be
used depending on the detail of the design being printed. Once a screen is selected, the
screen must be coated with emulsion and put to dry in a dark room. Once dry, it is then
possible to burn/expose the print.
3. The overlay is placed over the screen, and then exposed with a light source
containing ultraviolet light in the 350-420 nanometer spectrum.
4. The screen is washed off thoroughly. The areas of emulsion that were not exposed to
light dissolve and wash away, leaving a negative stencil of the image on the mesh.




42

2.6 GREEN MASKING

"Solder mask is green because when it was originally produced, the base resin was
brownish yellow in color and the hardener was very muddy brown and when you mixed
them together you got green. Also, laminates at that time were mostly green so it was easy
to accept the idea of green solder mask as well".
"The green color of solder mask was chosen after extensive testing by the US military at
the National Materials and Procurement Center in Cedar Bluffs Virginia in 1954 ... That
particular shade of green produced the right contrast with the white legend ink while being
tested under all types of adverse conditions. Every other color at that time failed to produce
the same contrast under the same extensive testing."
"Solder mask is green because green has been proven to be the color most visible to the
human eye. Individual colors have specific wavelengths, but combinations of wavelengths
produce differences in hues and intensities. Yellow and green colors are the easiest to see
in normal light. Thus green is the easiest color to see, the color easiest on the eyes and so
the color best suited for board inspectors and assemblers".

















43

Chapter-3

3.1 PRINTED CIRCUIT BOARD
A printed circuit board, or PCB, is used to mechanically support and electrically connect
electronic components using conductive pathways, tracks or signal traces etched from
copper sheets laminated onto a non-conductive substrate. It is also referred to as printed
wiring board (PWB) or etched wiring board. Printed circuit boards are used in virtually all
but the simplest commercially produced electronic devices.
3.2 PCB DESIGNING STEPS



















PROCESSING

CLEANSING
PRINTING
ETCHING


DRILLING


SOLDERING

MASKING




44

3.2.1 Processing
The layout of a PCB has to incorporate all the information on the board before one can go
on to the artwork preparation. This means that a concept that clearly defines all the details
of the circuit and partly also of the final equipment, is a prerequisite before the actual
layout can start. The detail circuit diagram is very important for the layout designer and he
must also be familiar with the design concept and with the philosophy behind the
equipment. The General Considerations are-
Layout scale - Depending on the accuracy required, artwork should be produced at a 11
or 21 or even 41 scale. The layout is best prepared on the same scale as the artwork. This
prevents all the problems which might be caused by redrawing of layout to the artwork
scale.
Grid system or Graph Paper - It is commonly accepted practice to use these for
designing.
Board types-There are two side of a PCB board Component side & Solder side.
Depending on these board are classified as-
Single-sided Boards - These are used where costs have to be kept at a minimum & a
particular Circuit can be accommodated on such board. To jump over conductor tracks,
components have to be utilized. If this is not feasible, jumper wires are used. (Jumper wires
should be less otherwise double-sided PCB should be considered.
Double-sided Boards - These are made with or without plated through holes. Plated
through holes are fairly expensive.
3.2.2 Cleaning
The cleaning of the copper surface prior to resist application is an essential step for any
type of PCB process using etches or plating resist. After scrubbing with the abrasive, a
water rinse will remove most of the remaining slurry.



45




3.2.3 Etching
It is of utmost importance to choose a suitable Etchant
Systems. There are many factors to be considered-
Etching speed
Copper solving capacity
Etchant price
Pollution character

Reactions Involved
FeCl
3
+ 3H
2
O Fe(OH)
3
+3HCl (Free acid attack to copper)
FeCl
3
+ Cu FeCl
2
+ CuCl
FeCl
3
+ CuCl FeCl
2
+ CuCl
2

CuCl
2
+ Cu 2CuCl




Scrubbing
Water Rinse
Wet Brushing
Acid dip
Final Rinse
Drying
Pumice/ Acid Slurry
Tap Water
Tap Water
Hydrochloric Acid-HCl
De-ionized Water
Oven or Blowing of air.
Figure 3.1 ETCHING



46

3.2.4 Drilling
Drilling is a cutting process that uses a drill bit to cut or
enlarge a hole of circular cross-section in solid materials. The
drill bit is a rotary cutting tool, often multipoint. The bit
is pressed against the work-piece and rotated at rates from
hundreds to thousands of revolutions per minute. This forces
the cutting edge against the work-piece, cutting
off chips from what will become the hole being drilled.
Exceptionally, specially-shaped bits can cut holes of non-
circular cross-section; a square cross-section is possible
The importance of hole drilling into PCBs has further gone
with electronic component miniaturization and its need for
smaller holes diameters (diameters less than half the board thickness) and higher package
density.
The following hole diameter tolerances have been generally accepted wherever no other
specifications are mentioned.
Hole Diameter (D) <= 1mm + / - 0.05 mm
Hole Diameter (D) > 3 mm + / 0.1 mm
Drill bits are made up of high-speed steel (HSS), Glass epoxy material, Tungsten Carbide.

3.2.5 Component placement
Component placement is an extremely important function of the designer.
Components should be placed according to their connections to other components,
thermal considerations, mechanical requirements, as well as signal integrity and
rout- ability.
Components which have connections to each other should be placed in the same
vicinity.
For example, a processor should be placed very close to the RAM and Flash ICs on
which it relies.
Components should also be placed on a grid, usually a 100 mil grid, in order to
provide for a symmetric flow of routing where tracks and components are lined
up.
Figure 3.2 DRILLING



47

3.2.6 Soldering
Soldering is a process in which two or more metal items
are joined together by melting and then flow a filler
metal (solder) into the joint, the filler metal having a
lower melting point than the work-piece. Soldering differs
from welding in that soldering does not involve melting the
work pieces. In brazing, the filler metal melts at a higher
temperature, but the work piece metal does not melt.
Formerly nearly all solders contained lead, but environmental concerns have increasingly
dictated use of lead-free alloys for electronics and plumbing purposes. Flux should be
removed after Soldering. It is done through washing by 0.51 % HCl followed by
Neutralization in dilute alkali to remove corrosive flux. On-corrosive is removed by
Isopropanol.
Electronic soldering connects electrical wiring and electronic components to printed circuit
boards (PCBs). Soldering filler materials are available in many different alloys for
differing applications. In electronics assembly, the eutectic alloy of 63% tin and 37% lead
(or 60/40, which is almost identical in melting point) has been the alloy of choice.

3.2.7 Masking
It is done for the protection of conductor track from
Oxidation. Solder mask or solder resist is a lacquer-like
layer of polymer that provides a permanent protective
coating for the copper traces of a printed circuit
board (PCB) and prevents solder from bridging between
conductors, thereby preventing short circuits.





Figure 3.3 SOLDERING
Figure 3.4 MASKING



48

Chapter-4

4.1 TESTING
After assembling the circuit components on the PCB and soldering them according to the
layout, testing is the next step to be taken. Testing includes measurement of the parameters
such as current, voltage, clock frequency and comparing them with the standard values
provided with the circuit. Any sort of deviation from the actual values should be measured
and corrected accordingly. This part is known as troubleshooting.
4.2 Problem faced & Trouble shooting
Selection of a project as final year project was a great problem. We were seeking for a project
that we would be able to learn something during project as well as it must have a good
application in the real world. We went through many web sites and took advice of faculties
and seniors in selecting the project.
After the project has been selected we submitted three synopses to Mr.A.K Mauraya and
after studying the synopses he allotted this project to us. The project had been allotted we
started working on it. The first process of project was making PCB layout of the project.
However the layout was not available with the project, so we made layout with the help of
Express PCB software. Here main problem is availability of component in the library of
Express PCB software. Thus this stage of the project is very difficult stage.
After the layout was prepared, we sought for PCB printing press to print the layout on the
CCB. Then we etched the CCB. It took one and a half hour for etching the PCB. After
cleaning the PCB with thinner the PCB was ready for further processing. Then we checked
all tracks for continuity and found no track broken. Thus this step was also cleared.
IT DOESNT WORK WHAT DO I DO?
1. Check that all components are in their correct place and the correct way around.
2. Check for unsoldered joints and solder bridges or splashes.
3. Is the 5V supply OK?
4. Any IC legs bent up under the IC body?



49

Chapter-5

5.1 COST ESTIMATION



5.2 Conclusion
We can finally conclude that this technology is the technology of present and future. As this
technology is very useful in preventing the railway accidents, it is globally acclaimed for its
effectiveness. In future each and every train will be equipped with this technology to make
the railway journey safe and secure.
In future anti-collision system can also be implemented on the road transport to prevent the
road accident.



Parts Quantity Price Per Unit Total Cost
Micro Controller
89S8253
1 300 300
7805 2 60 120
Crystal Oscillator 1 80 80
LM324 1 350 350
Capacitor(CERAMIC) 5 3 15
Resistor 5 6 30
Pin Connector 10 6 60
Bridge Rectifier 3 25 75
PCB 2 300 600
Printing 2 200 400
IC Base 6 10 60



50

5.2.1 ADVANTAGES
1. Fully Automatic
2. Easy and hassle free control
3. Low maintenance cost
4. Running cost is low
5. Eco friendly
6. There is no time lag to operate the device.
7. Accuracy.
8. Simulation is provided to reflect the present status of the system.
9. End user can operate this without knowing about electronics.
5.2.2APPLICATION
1. Express trains
2. Mail wagons
3. Passenger trains
4. Metro railways
5. Goods trains

5.2.3 Future Scope
In future each and every train will be equipped with this technology to make the railway
journey safe and secure.
In future anti-collision system can also be implemented on the road transport to prevent the
road accident.
This project is developed in order to help the INDIAN RAILWAYS in making its
present working system a better one, by eliminating some of the loopholes existing in it.
Based on the responses and reports obtained as a result of the significant development
in the working system of INDIAN RAILWAYS, this project can be further extended to meet
the demands according to situation.



51

This can be further implemented to have control room to regulate the working of the
system. Thus becomes the user friendliness.
This circuit can be expanded and used in a station with any number of platforms as
per the usage.
Additional modules can be added without affecting the remaining modules. This
allows the flexibility and easy maintenance of the developed system.



















52









APPENDIX-I
PROGRAMMING










53

PROGRAMMING
void main()
{
p0=0x00;
while (1) // infinite loop
{
if((p1_0==1)&&(p1_1==1))
{
p0=0;
}
if((p1_0==0)&&(p1_1==1))
{
p0=0x01;
delay_ms(400);
p0=0;
while((p1_0==0)&&(p1_1==1));
}
if((p1_0==1)&&(p1_1==0))
{
p0=0x02;
delay_ms(400);
p0=0;
while((p1_0==1)&&(p1_1==0));
}
}
}




54







APPENDIX II
DATASHEET














55



REFERENCES AND BIBLIOGRAPHY
1. www.alldatasheet.com
2. www.microcontrollerworld.com
3. Printed Circuit Boards, Walter C Bosshart ,Mc Graw Hill Book
4. Mazeedi, Embedded System In 8051 Microcontroller
5. Deshmukh Ajay, 8051 Microcontroller
6. Electronic devices and circuit theory. By Robert L. Boylestad Louis
Nashelsky Sixth edition, prentice hall of India private limited, 2000