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

CHAPTER-1

INTRODUCTION

This project is designed so that we can understand the technology used in the nowadays
driver less metro train which is used in most of the developed countries like Germany,
France, and Japan etc. These trains are equipped with the CPU, which control the train.
The train is programmed for the specific path. Every station on the path is defined;
stoppage timing of the train and distance between the two stations is predefined. This is
very wonderful project to control the working of the train without driver. These trains are
equipped with the CPU which controls the train.
In this project we try to give the same prototype for this type of trains. We are using
ARDUINO board having microcontroller ATMEGA168 to control all the functions as
CPU. Microcontroller controls the rotation of motor. First the motor is controlled and
name of each station is displayed over LCD and accordingly the different delay for each
station is provided. So this project works for metro train without driver. The motion of
the train is controlled by the Stepper Motor, for displaying message in the train we are
using Intelligent LCD Display of two lines. The train is designed for three stations,
named as Pari Chowk, G.L. Bajaj and Jagat Farm. The Stoppage time is of 4 sec and
time between two consecutive stations is 3 sec. There is a LCD display for showing
various messages in the train for passengers. There are indicators, which are used to show
the train direction i.e. UP path and DOWN path. Before stopping at station the train
blows the buzzer. It also includes an emergency brake system due to which the train stops
as soon as the brakes are applied and resumes journey when the emergency situation is
over.

1
CHAPTER-2

EMBEDDED TECHNOLOGY

Embedded technology is software or hardware that is hidden embedded in a large device


or system. It typically refers to a fixed function device, as compared with a PC, which
runs general purpose application. Embedded technology is nothing new. It all around us
and has been for years. An early example of embedded technology is the engine control
unit in a car, which measures what setting to give the engine. Your coffee maker has
embedded technology in the form of a microcontroller, which is what tells it to make the
coffee at 6 a.m. the vending machine has it too. Overall, billions of devices woven into
everyday life use embedded technology .In the past embedded technology existed in
standalone device vending machines and copiers that did their jobs with little regard for
what went on around them,. But as technology has learned to connect device to the
internet and to each other, embedded technology potential has grown. Suddenly it is and
what actions those connections let them perform. Cell phone companies figured that out a
long time ago, which is why cell phones are cheap and the service, plans are expensive. It
is not the phone itself that matters, but the connectivity to a vast network of other phones,
other people and the internet. Until you download software that lets you find a
local restaurant or mange your finances. Let say you make freezers the big, expensive
kind that grocery stores buy. You sell them and you are done with that customer. When it
brakes the customer calls a service person, which probably comes from somewhere other
than your company. But let us say that freezer knows that it is about to go on the fritz. Let
say three refrigerator alerts the customer before it breaks. Better yet, let us say the freezer
alerts the manufacturer and you are able to send a service person to do preventative work
and save a lot of Hagen- daze from melting. Embedded technology allows all of that to
happen. You, the freezer company have transformed yourself from a product company to
product and services company. The possibilities go beyond that programming device to
communicate with businesses can eliminate the need for costly call centers. Copy
machines that can order their own replacement cartridges will save businesses time and
money. Remember, the fact the technology is embedded is not what important, and
neither is the device.
2
2.1 APPLICATIONS

Telecom
Mobile phone systems (handsets and base stations), modems, routers

Automotive application
Braking system, Traction control, Airbag release system, Management units, and Steer-
by-wire systems.

Domestic application
Dishwasher, television, washing machines, microwave ovens, Video recorders, Security
system, Garage door controllers, Calculators, Digital watches, VCRs, Digital cameras,
Remote Controls, Treadmills

Robotic
Fire fighting robot, Automatic floor cleaner, robotic arm

Aerospace application
Flight control system, Engine controllers, Autopilots, Passenger entertainment system

Medical equipment
Anesthesia monitoring system, ECG monitors, Pacemakers, Drug delivery systems, MRI
scanners

Defense system
Radar systems, Fighter aircraft flight control system, Radio system, Missile guidance
systems

3
CHAPTER - 3

COMPONENTS

The components used in the project are as follows:


1. ARDUINO Board
2. ATMEGA168
3. Transformer
4. Voltage Regulator
5. LCD display 16X2
6. Crystal Oscillator
7. Brushless DC motor
8. Diode bridge
9. Switch
10. LED
11. Resistors
12. Capacitors
Figure 3.1- Model of the metro

4
3.1. COMPONENT DESCRIPTION
3.1.1 ARDUINO:
Arduino is an open-source computer hardware and software company, project and user
community that designs and manufactures kits for building digital devices and interactive
objects that can sense and control the physical world. Arduino boards may be purchased
pre assembled, or as do-it-yourself kits; at the same time, the hardware design
information is available for those who would like to assemble an Arduino from scratch.
The project is based on a family of microcontroller board designs manufactured
primarily by Smart Projects in Italy, and also by several other vendors, using various 8-
bit Atmel AVR microcontrollers or 32-bit Atmel ARM processors. These systems
provide sets of digital and analog I/O pins that can be interfaced to various extension
boards and other circuits. The boards feature serial communications interfaces,
including USB on some models, for loading programs from personal computers. For
programming the microcontrollers, the Arduino platform provides an integrated
development environment (IDE) based on the Processing project, which includes support
for C and C++ programming languages.
The first Arduino was introduced in 2005. The project leaders sought to provide an
inexpensive and easy way for hobbyists, students, and professionals to create devices that
interact with their environment using sensors and actuators. Common examples for
beginner hobbyists include simple robots, thermostats and motion detectors.

Figure 3.2- Arduino Board

5
3.1.2 ATMEGA 168:

Features:
High performance, low power Atmel AVR 8-bit microcontroller
Advanced RISC architecture
131 powerful instructions most single clock cycle execution
32 8 general purpose working registers
Fully static operation
Up to 20 MIPS throughput at 20MHz
On-chip 2-cycle multiplier
High endurance non-volatile memory segments
4/8/16 Kbytes of in-system self-programmable flash program memory
256/512/512 bytes EEPROM
512/1K/1Kbytes internal SRAM
Write/erase cycles: 10,000 flash/100,000 EEPROM
Data retention: 20 years at 85C/100 years at 25C
Optional boot code section with independent lock bits
In-system programming by on-chip boot program
True read-while-write operation
Programming locks for software security
Q Touch library support
Capacitive touch buttons, sliders and wheels
Q Touch and Q Matrix acquisition
Up to 64 sense channels
Peripheral features
Two 8-bit timer/counters with separate pre scalar and compare mode
One 16-bit timer/counter with separate pre scalar, compare mode, and capture
mode
Real time counters with separate oscillator
Six PWM channels
6
8-channel 10-bit ADC in TQFP and QFN/MLF package
6-channel 10-bit ADC in PDIP Package
Programmable serial USART
Master/slave SPI serial interface
Byte-oriented 2-wire serial interface (Philips I2C compatible)
Programmable watchdog timer with separate on-chip oscillator
On-chip analog comparator
Interrupt and wake-up on pin change
Special microcontroller features
Debug WIRE on-chip debug system
Power-on reset and programmable brown-out detection
Internal calibrated oscillator
External and internal interrupt sources
Five sleep modes: Idle, ADC noise reduction, power-save, power-down, and
standby
I/O and packages
23 programmable I/O lines
28-pin PDIP, 32-lead TQFP, 28-pad QFN/MLF and 32-pad QFN/MLF
Operating voltage:
1.8V - 5.5V for Atmel ATmega48V/88V/168V
2.7V - 5.5V for Atmel ATmega48/88/168
Temperature range:
-40C to 85C
Speed grade:
ATmega48V/88V/168V: 0 - 4MHz @ 1.8V - 5.5V, 0 - 10MHz @ 2.7V - 5.5V
ATmega48/88/168: 0 - 10MHz @ 2.7V - 5.5V, 0 - 20MHz @ 4.5V - 5.5V
Low power consumption
Active mode: 250A at 1MHz, 1.8V
15A at 32 kHz, 1.8V (including oscillator)
Power-down mode: 0.1A at 1.8V

7
Fig 3.3- Pin Configuration of ATMEGA168

Pin Descriptions:
a) VCC
Digital supply voltage

b) GND
Ground
c) Port B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2:
Port B is an 8-bit bi-directional I/O port with internal pull-up resistors. The Port B
output buffers have symmetrical drive characteristics with both high sink and source
Capability .As inputs, Port B pins that are externally pulled low will source current if the
pull-up resistors are activated. The Port B pins are tri-stated when a reset condition
becomes active, Even if the clock is not running. Depending on the clock selection fuse

8
settings, PB6 can be used as input to the inverting Oscillator amplifier and input to the
internal clock operating circuit. Depending on the clock selection fuse settings, PB7 can
be used as output from the inverting Oscillator amplifier. If the Internal Calibrated RC
Oscillator is used as chip clock source, PB7 .6 is used as TOSC2. 1 input for the
Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set.

d) Port C (PC5:0)
Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for each
bit). The PC5.0 output buffers have symmetrical drive characteristics with both high
sink and source capability. As inputs, Port C pins that are externally pulled low will
source current if the pull-up resistors are activated. The Port C pins are tri-stated when a
reset condition becomes active, even if the clock is not running.

e) PC6/RESET
If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the
electrical characteristics of PC6 differ from those of the other pins of Port C. If the
RSTDISBL Fuse is unprogrammed, PC6 is used as a Reset input. A low level on this pin
for longer than the minimum pulse length will generate a Reset, even if the clock is not
running. Shorter pulses are not guaranteed.

f) Port D (PD7:0)
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for
each bit). The Port D output buffers have symmetrical drive characteristics with both high
sink and source capability. As inputs, Port D pins that are externally pulled low will
source current if the pull-up resistors are activated. The Port D pins are tri-stated when a
reset condition becomes active, even if the clock is not running.

g) AVCC
AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7:6. It should
be externally connected to VCC, even if the ADC is not used. If the ADC is used, it

9
should be connected to VCC through a low-pass filter. Note that PC6.4 use digital supply
voltage, VCC.

h) AREF
AREF is the analog reference pin for the A/D Converter.

i) ADC7: (TQFP and QFN/MLF package only)


In the TQFP and QFN/MLF package, ADC7:6 serve as analog inputs to the A/D
converter. These pins are powered from the analog supply and serve as 10-bit ADC
channels.

3.1.3 Transformer:
A transformer is used to step down the supply voltage from 220V to 12V for use of the
Arduino board and for the motor driver board. The instrument transformer thus used is a
step-down transformer. The transformer used in this project is centre tapped type. The
output of the transformer is then given to the full bridge rectifier and the output of the
rectifier is then given to the filter circuit to remove the ripples and the filtered supply is
then applied to the voltage regulator which gives a 5V regulated output on the circuit.
A Centre Tapped transformer works in more or less the same way as a usual transformer.
The difference lies in just the fact that its secondary winding is divided into two parts, so
two individual voltages can be acquired across the two line ends.
The internal process is the same, which is when an alternating current is supplied to the
primary winding of the transformer it creates a magnetic flux in the core, and when the
secondary winding is brought near, an alternating magnetic flux is also induced in the
secondary winding as the flux flows through the ferromagnetic iron core and changes its
direction with each and every cycle of the alternating current. In this way an alternating
current also flows through the two halves of the secondary winding of the transformer
and flows to the external circuit.

10
Figure 3.4- Voltages in Centre Tapped transformer

Figure 3.5- Centre Tapped transformer

3.1.4 Motors:
A DC motor is designed to run on DC electric power. Two examples of pure DC designs
are Michael Faraday's homo-polar motor (which is uncommon), and the ball bearing
motor, which is (so far) a novelty. By far the most common DC motor types are the
brushed and brushless types, which use internal and external commutation respectively to
create an oscillating AC current from the DC sourceso they are not purely DC
machines in a strict sense.

3.1.4.1 Brushed dc motor

The classic DC motor design generates an oscillating current in a wound rotor,


or armature, with a split ring commutator, and either a wound or permanent magnet
stator. A rotor consists of one or more coils of wire wound around a core on a shaft; an
electrical power source is connected to the rotor coil through the commutator and its

11
brushes, causing current to flow in it, producing electromagnetism. The commutator
causes the current in the coils to be switched as the rotor turns, keeping the magnetic
poles of the rotor from ever fully aligning with the magnetic poles of the stator field, so
that the rotor never stops (like a compass needle does) but rather keeps rotating
indefinitely (as long as power is applied and is sufficient for the motor to overcome the
shaft torque load and internal losses due to friction, etc.)

Many of the limitations of the classic commutator DC motor are due to the need for
brushes to press against the commutator. This creates friction. At higher speeds, brushes
have increasing difficulty in maintaining contact. Brushes may bounce off the
irregularities in the commutator surface, creating sparks. (Sparks are also created
inevitably by the brushes making and breaking circuits through the rotor coils as the
brushes cross the insulating gaps between commutator sections. Depending on the
commutator design, this may include the brushes shorting together adjacent sections
and hence coil endsmomentarily while crossing the gaps. Furthermore,
the inductance of the rotor coils causes the voltage across each to rise when its circuit is
opened, increasing the sparking of the brushes.) This sparking limits the maximum speed
of the machine, as too-rapid sparking will overheat, erode, or even melt the commutator.
The current density per unit area of the brushes, in combination with their resistivity,
limits the output of the motor. The making and breaking of electric contact also
causes electrical noise, and the sparks additionally cause RFI. Brushes eventually wear
out and require replacement, and the commutator itself is subject to wear and
maintenance (on larger motors) or replacement (on small motors). The commutator
assembly on a large machine is a costly element, requiring precision assembly of many
parts. On small motors, the commutator is usually permanently integrated into the rotor,
so replacing it usually requires replacing the whole rotor.

Large brushes are desired for a larger brush contact area to maximize motor output, but
small brushes are desired for low mass to maximize the speed at which the motor can run
without the brushes excessively bouncing and sparking (comparable to the problem of
"valve float" in internal combustion engines). (Small brushes are also desirable for lower
cost.) Stiffer brush springs can also be used to make brushes of a given mass work at a
higher speed, but at the cost of greater friction losses (lower efficiency) and accelerated

12
brush and commutator wear. Therefore, DC motor brush design entails a trade-off
between output power, speed, and efficiency/wear.

Types of Brushed dc motor:

1. DC shunt wound motor

2. DC series wound motor

3. DC compound motor (two configurations):

4. Cumulative compound

Differentially compounded

D. Permanent Magnet DC Motor

5. Separately-excited.

3.1.4.2 Brushless dc motor:

Some of the problems of the brushed DC motor are eliminated in the brushless design. In
this motor, the mechanical "rotating switch" or commutator/brush gear assembly is
replaced by an external electronic switch synchronized to the rotor's position. Brushless
motors are typically 85-90% efficient or more (higher efficiency for a brushless electric
motor of up to 96.5% were reported by researchers at the Tokai University in
Japan whereas DC motors with brush gear are typically 75-80% efficient.
Midway between ordinary DC motors and stepper motors lays the realm of the brushless
DC motor. Built in a fashion very similar to stepper motors, these often use a permanent
magnet external rotor, three phases of driving coils, one or more Hall Effect sensors to
sense the position rotor, and the associated drive electronics. The coils are activated, one
phase after the other, by the drive electronics as cued by the signals from either Hall
effect sensors or from the back EMF (electromotive force) of the driven coils. In effect,
they act as three-phase synchronous motors containing their own variable-frequency
drive electronics. A specialized class of brushless DC motor controllers utilizes EMF

13
feedback through the main phase connections instead of Hall Effect sensors to determine
position and velocity. These motors are used extensively in electric radio-
controlled vehicles. When configured with the magnets on the outside, these are referred
to by moderators as out-runner motors.
Brushless DC motors are commonly used where precise speed control is necessary, as in
computer disk drives or in video cassette recorders, the spindles within CD, CD-
ROM (etc.) drives, and mechanisms within office products such as fans, laser
printers and photocopiers. They have several advantages over conventional motors:

Compared to AC fans using shaded-pole motors, they are very efficient,


running much cooler than the equivalent AC motors. This cool operation leads
to much-improved life of the fan's bearings.
Without a commutator to wear out, the life of a DC brushless motor can be
significantly longer compared to a DC motor using brushes and a commutator.
Commutation also tends to cause a great deal of electrical and RF noise;
without a commutator or brushes, a brushless motor may be used in
electrically sensitive devices like audio equipment or computers.
The same Hall Effect sensors that provide the commutation can also provide a
convenient tachometer signal for closed-loop control (servo-controlled)
applications. In fans, the tachometer signal can be used to derive a "fan OK"
signal.
The motor can be easily synchronized to an internal or external clock, leading
to precise speed control.
Brushless motors have no chance of sparking, unlike brushed motors, making
them better suited to environments with volatile chemicals and fuels. Also,
sparking generates ozone which can accumulate in poorly ventilated buildings
risking harm to occupants' health.
Brushless motors are usually used in small equipment such as computers and
are generally used to get rid of unwanted heat.
They are also very quiet motors which is an advantage if being used in
equipment that is affected by vibrations.

14
Modern DC brushless motors range in power from a fraction of a watt to
many kilowatts. Larger brushless motors up to about 100 kW rating are used
in electric vehicles. They also find significant use in high-performance electric
model aircraft.

3.4.1.3 Iron or Coreless dc motor:

Nothing in the design of any of the motors described above requires that the iron (steel)
portions of the rotor actually rotate; torque is exerted only on the windings of the
electromagnets. Taking advantage of this fact is the coreless or ironless DC motor, a
specialized form of a brush or brushless DC motor. Optimized for rapid acceleration,
these motors have a rotor that is constructed without any iron core. The rotor can take the
form of a winding-filled cylinder, or a self-supporting structure comprising only the
magnet wire and the bonding material. The rotor can fit inside the stator magnets; a
magnetically-soft stationary cylinder inside the rotor provides a return path for the stator
magnetic flux. A second arrangement has the rotor winding basket surrounding the stator
magnets. In that design, the rotor fits inside a magnetically-soft cylinder that can serve as
the housing for the motor, and likewise provides a return path for the flux.

Because the rotor is much lighter in weight (mass) than a conventional rotor formed
from copper windings on steel laminations, the rotor can accelerate much more rapidly,
often achieving a mechanical time constant less than 1 millisecond. This is especially true
if the windings use aluminum rather than the heavier copper. But because there is no
metal mass in the rotor to act as a heat sink, even small coreless motors must often be
cooled by forced air.

Related limited-travel actuators have no core and a bonded coil placed between the poles
of high-flux thin permanent magnets. These are the fast head position retainer for rigid-
disk ("hard disk") drives.

3.1.4.4 Printed Armature or Pancake DC Motors

A rather unique motor design the pancake/printed armature motor has the windings
shaped as a disc running between arrays of high-flux magnets, arranged in a circle, facing
the rotor and forming an axial air gap. This design is commonly known the pancake

15
motor because of its extremely flat profile, although the technology has had many brand
names since its inception, such as Servo Disc.

The printed armature (originally formed on a printed circuit board) in a printed armature
motor is made from punched copper sheets that are laminated together using advanced
composites to form a thin rigid disc. The printed armature has a unique construction, in
the brushed motor world, in that is does not have a separate ring commutator. The
brushes run directly on the armature surface making the whole design very compact.

An alternative manufacturing method is to use wound copper wire laid flat with a central
conventional commutator, in a flower and petal shape. The windings are typically
stabilized by being impregnated with electrical epoxy potting systems. These are filled
epoxies that have moderate mixed viscosity and a long gel time. They are highlighted by
low shrinkage and low Exo-thermal, and are typically UL 1446 recognized as a potting
compound for use up to 180C.

The unique advantage of ironless DC motors is that there is no cogging (vibration caused
by attraction between the iron and the magnets) and parasitic eddy currents cannot form
in the rotor as it is totally ironless. This can greatly improve efficiency, but variable-
speed controllers must use a higher switching rate (>40 KHz) or direct current because of
the decreased electromagnetic induction.

These motors were originally invented to drive the capstan(s) of magnetic tape drives, in
the burgeoning computer industry. Pancake motors are still widely used in high-
performance servo-controlled systems, humanoid robotic systems, industrial automation
and medical devices. Due to the variety of constructions now available the technology is
used in applications from high temperature military to low cost pump and basic servo
applications.

NOTE: Here we used GEARED DC motor.

16
Figure 3.6- Geared dc Motor

4. 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

17
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.

4.1 Actual Capacitance:

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

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 use 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.

18
4.2 Breakdown Voltage

When using a capacitor, you must pay attention to the maximum voltage which can be
used. This is the "breakdown voltage." The breakdown voltage depends on the kind of
capacitor being used. You must be especially careful with electrolytic capacitors because
the breakdown voltage is comparatively low. The breakdown voltage of electrolytic
capacitors is displayed as Working Voltage.

The breakdown voltage is the voltage that when exceeded will cause the dielectric
(insulator) inside the capacitor to break down and conduct. When this happens, the failure
can be catastrophic.

4.3 Types of Capacitor:

There are various types of capacitors available in the market. Some of them are as
follows:

a) Mica Capacitor

b) Paper Capacitor

c) Ceramic Capacitor

d) Variable Capacitor

e) Electrolytic Capacitor

f) Tantalum Capacitor

g) Film Capacitor

Here we used only two types of capacitor i.e. ceramic capacitor & electrolytic capacitor.

i) Polarized capacitors

ii) Un-polarized capacitors

4.3.1 Polarized Capacitors:

19
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 oftheir 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 circuit.

Figure 3.7-Polarized Capacitor

4.3.2 Unpolarized Capacitor:

Small 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.

20
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 3.8- Unpolarized Capacitor

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.

4.3.3 Variables Capacitors:

Variable capacitors are mostly used in radio tuning circuits and they are sometimes called
'tuning capacitors'. They have very small capacitance values, typically between
100pF and 500pF (100pF = 0.0001F).

Many variable capacitors have very short spindles which are not suitable for the standard
knobs used for variable resistors and rotary switches. It would be wise to check that a
suitable knob is available before ordering a variable capacitor.

Figure 3.9- Variable Capacitor

21
4.3.4 Methods of Making of Capacitors:

One way of making capacitors is to use the two poly-silicon layers in our process. We
create a parallel plate capacitor with poly1 and poly2 (electrode) forming the two
parallel sides. The silicon dioxide between the two poly layers is thin enough to yield
good capacitance values per unit area. This is called a poly-poly capacitor.

The other way would be to use the gate oxide and actually build a transistor whose gate
area (W x L) would actually give us the capacitance. These are called MOS capacitors,
and they only work properly when the transistor is strongly inverted or depleted.
Otherwise, the capacitance can vary with the voltage across it.

5. 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 digital integrated 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".

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
22
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 for a variety
of portable electronic devices such as portable telephones because of its compact size and
light weight.

Figure 3.10- Crystal Oscillator

5.1 Crystal Oscillators used in Microcontrollers:

A microcontroller is disclosed that includes a crystal oscillator circuit that is


programmable to provide multiple different levels of start-up current. In the present
embodiment, the crystal oscillator circuit includes logic devices for receiving
programming indicating one of a plurality of different start-up 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 start-up current level, the crystal oscillator circuit generates a corresponding
start-up current. In addition, the crystal oscillator circuit includes provision for selecting

23
one of a plurality of different levels of capacitance. Furthermore, the crystal oscillator
circuit includes a gate pass that includes circuitry for assuring predetermined start-up
conditions are met. A feedback loop that includes an amplifier provides for steady state
operations that have low power consumptions.

5.2 Applications:
A crystal oscillator is an electronic oscillator 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 digital integrated circuits, and
to stabilize frequencies for radio transmitters and receivers.

6. Diode Bridge:
A diode bridge is an arrangement of four (or more) diodes in a bridge
circuit configuration that provides the same polarity of output for either polarity of
input. When used in its most common application, for conversion of an alternating
current (AC) input into a direct current (DC) output, it is known as a bridge rectifier. A
bridge rectifier provides full-wave rectification from a two-wire AC input, resulting in
lower cost and weight as compared to a rectifier with a 3-wire input from
a transformer with a center-tapped secondary winding.
The essential feature of a diode bridge is that the polarity of the output is the same
regardless of the polarity at the input. The diode bridge circuit is also known as
the Graetz circuit after its inventor, physicist Leo Graetz.

Figure 3.11- Diode Bridge

24
6.1 Basic Operation:
According to the conventional model of current flow originally established by Benjamin
Franklin and still followed by most engineers today, current is assumed to flow
through electrical conductors from the positive to the negative pole. In actuality, free
electrons in a conductor nearly always flow from the negative to the positive pole. In the
vast majority of applications, however, the actual direction of current flow is irrelevant.
Therefore, in the discussion below the conventional model is retained.
In the diagrams below, when the input connected to the left corner of the diamond
is positive, and the input connected to the right corner is negative, current flows from the
upper supply terminal to the right along the red (positive) path to the output, and returns
to the lower supply terminal via the blue (negative) path.

In each case, the upper right output remains positive and lower right output negative.
Since this is true whether the input is AC or DC, this circuit not only produces a DC
output from an AC input, it can also provide what is sometimes called "reverse polarity
protection".
7.2 Rectifiers:
A rectifier is an electrical device that converts alternating current (AC), which
periodically reverses direction, to direct current (DC), which flows in only one direction.
The process is known as rectification. The simple process of rectification produces a type
of DC characterized by pulsating voltages and currents (although still unidirectional).
6.1.1 HALF WAVE RECTIFICATION: In half wave rectification of a single-phase
supply, either the positive or negative half of the AC wave is passed, while the other half
is blocked. Because only one half of the input waveform reaches the output, mean voltage
is lower. Half-wave rectification requires a single diode in a single-phase supply, or three
in a three-phase supply. Rectifiers yield a unidirectional but pulsating direct current; half-
wave rectifiers produce far more ripple than full-wave rectifiers, and much more filtering
is needed to eliminate harmonics of the AC frequency from the output.

25
Figure 3.12- Half wave rectifier with input and output waveforms

6.1.2 FULL WAVE RECTIFICATION: A full-wave rectifier converts the whole of the
input waveform to one of constant polarity (positive or negative) at its output. Full-wave
rectification converts both polarities of the input waveform to DC (direct current), and
yields a higher mean output voltage. Two diodes and a center tapped transformer, or four
diodes in a bridge configuration and any AC source (including a transformer without
center tap), are needed. Single semiconductor diodes, double diodes with common
cathode or common anode, and four-diode bridges, are manufactured as single
components.

Figure 3.13- Full wave rectifier with input and output waveforms

6.1.3 BRIDGE RECTIFIER:


A bridge rectifier makes use of four diodes in a bridge arrangement to achieve full-wave
rectification. This is a widely used configuration, both with individual diodes wired as
shown and with single component bridges where the diode bridge is wired internally.

7. Buzzer:
A buzzer or beeper is an audio signaling device, which may be mechanical,
electromechanical, or piezoelectric. Typical uses of buzzers and beepers include alarm
devices, timers and confirmation of user input such as a mouse click or keystroke.

26
7.1 Mechanical
A joy buzzer is an example of a purely mechanical buzzer.

Figure 3.14- Mechanical Buzzer

7.2 Electro-mechanical
Early devices were based on an electromechanical system identical to an electric bell
without the metal gong. Similarly, a relay may be connected to interrupt its own actuating
current, causing the contacts to buzz. Often these units were anchored to a wall or ceiling
to use it as a sounding board. The word "buzzer" comes from the rasping noise that
electromechanical buzzers made.

Figure 3.15- Electromechanical Buzzer

7.3 Piezoelectric Buzzer


A piezoelectric element may be driven by an oscillating electronic circuit or other audio
signal source, driven with a piezoelectric audio amplifier. Sounds commonly used to
indicate that a button has been pressed are a click, a ring or a beep.

27
Figure 3.16- Piezoelectric Buzzer

7.4 Buzzer Interfacing:


If the proper potential is provided across the buzzer it generates the sound else not. It is of
two pin configuration that is anode (+) and cathode (-). For interfacing to any device like
controller etc. we directly connect the cathode to the GND and anode to the device like
controller .Now when signal on anode goes high buzzer activates else does-not. Vice-
versa is also true.

8. L293D (H- Bridge):

The most common method to drive DC motors in two directions under control of a
computer is with an H-bridge motor driver. H-bridges can be built from scratch with bi-
polar junction transistors (BJT) or with field effect transistors (FET), or can be purchased
as an integrated unit in a single integrated circuit package such as the L293. The L293 is
simplest and inexpensive for low current motors, for high current motors, it is less
expensive to build your own H-bridge from scratch.
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. Unsure about whether the L293D
will work with your motor? Hook up the circuit and run your motor while keeping your
finger on the chip. If it gets too hot to touch, you can't use it with your motor.
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

28
inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other
high-current/high-voltage loads in positive-supply applications .All inputs are TTL-
compatible. Each output is a complete totem-pole drive circuit with a Darlington
transistor as sink and a pseudo-Darlington as a source. 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, and their outputs are active and in phase
with their 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.
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. Both devices are 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. All inputs are TTL compatible. Each output is a
complete totem-pole drive circuit, with a Darlington transistor sink and a pseudo-
Darlington source.
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.

8.1 Features:

600-mA Output Current Capability Per Driver

Pulsed Current 1.2-A Per Driver

Output Clamp Diodes for Inductive


29
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

Figure 3.17- Pin Diagram

Drivers are enabled in pairs with drivers 1 and 2enabled by 1,2 EN and drivers 3 and 4
enabled b3, 4 EN. When enable input is high, the associated drivers are enabled, and their
outputs are active and in phase with their 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.

30
Figure 3.18- Logic Diagram

Figure 3.19 Fuctioning table of L293D

31
8.2 Motor Driving:

Figure 3.20- Internal Circuit Diagram of L293D

Figure 3.21- Motor Status table

32
9. LCD Display:

LCD (Liquid Crystal Display) screen is an electronic display module and find a wide
range of applications. A 16x2 LCD display is very basic module and is very commonly
used in various devices and circuits. These modules are preferred over seven segments
and other multi segment LEDs. The reasons being: LCDs are economical; easily
programmable; have no limitation of displaying special & even custom characters (unlike
in seven segments), animations and so on.

A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this
LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers,
namely, Command and Data. The command register stores the command instructions
given to the LCD. A command is an instruction given to LCD to do a predefined task like
initializing it, clearing its screen, setting the cursor position, controlling display etc. The
data register stores the data to be displayed on the LCD. The data is the ASCII value of
the character to be displayed on the LCD.

9.1 Features:-

5 x 8 dots with cursor

Built-in controller (KS 066 or Equivalent)

+ 5V power supply (Also available for + 3V)

1/16 duty cycle

B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K (LED)

N.V. optional for + 3V power supply

33
Figure 3.22- Pin Diagram

9.2 Sequence of writing to the LCD:

The sequence for writing to the LCD is:

1. To begin, E is low

2. Select the register to write to by setting RS high (data) or low (control)

3. Write the eight bits of data to the LCD

4. Set the Enable signal high then low again.

There are certain minimum timing requirements that must be followed when writing to
the LCD, such as data setup times and Enable signal pulse width. These are in the order
of tens and hundreds of nanoseconds. LCD displays have a busy flag that is set while it
is executing a control command. This flag is not accessible because the R/W line has
been tied low (write). This is not such a problem because all commands have a maximum
execution time. We simply wait for this time to pass before accessing the LCD again,
eliminating the need to check the flag and thereby saving on an I/O line. For example:
The Clear Display command has an execution time of approx. 1.6mS. After sending this
command to the LCD we simply wait 2mS before continuing on. This ensures that the
command has finished. Characters to be displayed are written into the LCDs data RAM
memory. The amount of RAM available depends on the type of LCD. Lets us consider a
LCD having 80 bytes of RAM. An internal address counter holds the address of the next
byte to write to. These 80 bytes are broken up into two blocks of 40 bytes. The address
range of the first block is from 00h to 27h and the second block from 40h to 67h.

34
After power up and initialization address 00h is the first character of the top line and
address 40h is the first character of the bottom line. The address counter is set to address
00h and is automatically incremented after each byte is written. Only the first 16 bytes of
each line are visible. If we now start writing data to the LCD it will be stored from
address 00h on but only the first 16 characters will be visible. To display the rest of the
characters we need to scroll the display.

Scrolling simply mean changing the start address of each line. If we scroll left one
position address 01h becomes the first character of the top line and address 41h the first
character of the bottom line. Scrolling right does the opposite addresses 27h and 67h
become the first characters of the top and bottom lines. Each block of addresses wrap
around in a circular manner. The next address after 27h is 00h; the next address after 67h
is 40h. If we scroll left 40 times we will bring address 00h back into view as the last
character on the top line.

The address ranges of each block are not continuous. There is a gap of 24 bytes between
the ends of the first block (27h) and the start of the second (40h). So, if we keep writing
characters to the display the first 40 will be stored in addresses 00h to 27h, the next 24
will be lost and the next 40 will be stored at addresses 40h to 67h.

The internal address counter is directly accessible so we can set the next address to write
to. This is how the characters are written to the second line of the LCD. For example, we
can send 5 characters to the first line, set the address counter to 40h and then start writing
characters to the second line.

35
Figure 3.23- LCD Interface Diagram:

Above is the connection diagram of LCD in 4-bit mode, where we only need 6 pins
to interface an LCD. D4-D7 is the data pins connection and Enable and Register select
are for LCD control pins. We are not using Read/Write (RW) Pin of the LCD, as we are
only writing on the LCD so we have made it grounded permanently. If you want to use it,
then you may connect it on your controller but that will only increase another pin and
does not make any big difference. Potentiometer RV1 is used to control
the LCD contrast. The unwanted data pins of LCD i.e. D0-D3 are connected to ground.

36
10. 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 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.
Electronic voltage regulators are found in devices such as computer power
supplies where they stabilize the DC voltages used by the processor and other elements.
In automobile alternators and central power station generator plants, voltage regulators
control the output of the plant. In an electric power distribution system, voltage regulators
may be installed at a substation or along distribution lines so that all customers receive
steady voltage independent of how much power is drawn from the line.
Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or variable
output voltages. The maximum current they can pass also rates them. Negative voltage
regulators are available, mainly for use in dual supplies. Most regulators include some
automatic protection from excessive current (over load protection) and over-heating
(thermal protection). Many of fixed voltage regulator ICs has 3 leads. They include a hole
for attaching a heat sink if necessary.
Figure 3.24- Voltage regulator

37
10.1 Three Terminal positive Voltage Regulator:
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

10.2 Description:
The KA78XX/KA78XXA series of three-terminal positive regulator are available in the
TO-220/D-PAK package and with several fixed output voltages, making them useful in a
wide range of applications. Each type employs internal current limiting, thermal shut
down and safe operating area protection, making it essentially indestructible. If adequate
heat sinking is provided, they can deliver over 1A output current. Although designed
primarily as fixed voltage regulators, these devices can be used with external components
to obtain adjustable voltages and currents.
The 78xx (sometimes LM78xx) is a family of self-contained fixed linear voltage
regulator integrated circuits. The 78xx family is commonly used in electronic circuits
requiring a regulated power supply due to their ease-of-use and low cost. For ICs within
the family, the xx is replaced with two digits, indicating the output voltage (for example,
the 7805 has a 5 volt output, while the 7812 produces 12 volts). The 78xx line is positive
voltage regulators: they produce a voltage that is positive relative to a common ground.
There is a related line of 79xx devices which are complementary negative voltage
regulators. 78xx and 79xx ICs can be used in combination to provide positive and
negative supply voltages in the same circuit.

10.3 Pin Configuration:

LM7805. 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.

38
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.

Figure 3.25- Pin out diagram of LM7805

Figure3. 26-Internal Block diagram

39
10.4 Features:
Output current in Excess of 1.0 A
No external component required
Internal thermal overload protection
Internal short circuit current limiting
Output transistor safe-area compensation
Output voltage offered in 2% and 4% tolerance
Available in surface mount D2PAK and standard 3-lead transistor packages

11. Resistances:
There is always some resistance in every circuit.
A circuit is always made up of some wire, so there will be some resistance there.
Even the battery has parts that offer resistance to the flow of electrons.
The only circuits that come near to zero resistance are superconductors.
This resistance that is from the parts of the circuit itself (especially the battery) is called
internal resistance.
This internal resistance is usually drawn into a circuit diagram (schematic) as shown in
Figure .
Notice the squiggly line just before the positive terminal of the battery? Thats to show
the internal resistance of the circuit.
That symbol, drawn any other place in the circuit, represents an actual resistor placed in
the circuit.
A resistor is a device found in circuits that has a certain amount of resistance. Why
would you ever want to add resistance to a circuit by using a resistor?
The most common reason is that we need to be able to adjust the current flowing
through a particular part of the circuit.
If voltage is constant, then we can change the resistor to change the current. I=V R If
V is constant and we change R, I will be different.

40
11.1 Actual Resistors:
The Example 1: What is the resistance of this resistor?
Notice that the colors on this resistor are (in order) Red, Green, Orange, and Silver.
1. The first line is the first digit Red = 2
2. The second line is the second digit Green = 5
3. The third line is the multiplier Orange = 103
4. The last line (if any) is the tolerance Silver = } 10%
So the final answer would be 25 x 103 10%
Yes, I know it's not proper scientific notation this way. You can also write it as 25000
(notice there are three zeros), or even 2.5 x 102 .

Figure 3.27- Actual resistor

11.2 Variable Resistors


11.2.1 Adjustable resistors
A resistor may have one or more fixed tapping points so that the resistance can be
changed by moving the connecting wires to different terminals. Some wire wound power
resistors have a tapping point that can slide along the resistance element, allowing a
larger or smaller part of the resistance to be used.
Where continuous adjustment of the resistance value during operation of equipment is
required, the sliding resistance tap can be connected to a knob accessible to an operator.
Such a device is called a rheostat and has two terminals.

41
11.2.2 Potentiometers
A common element in electronic devices is a three-terminal resistor with a continuously

adjustable tapping point controlled by rotation of a shaft or knob. These variable resistors
are known as potentiometers when all three terminals are present, since they act as a
continuously adjustable voltage divider. A common example is a volume control for a
radio receiver.

11.3 Making of Resistors:


There are two main methods that are used to make resistors. The most common is to just
have a bunch of wire wound up inside that little cylinder. Known as wire-wound
resistors, they depend on the fact that a certain length of a certain piece of wire will have
a certain resistance. These resistors tend to be very reliable (with low tolerances), but cost
more because of the price of metals used in them and the machinery needed to carefully
cut and wind the wire. The other type of resistor is made of a piece of Carbon Known as a
composition resistor, they depend on the size of the piece of carbon, and the fact that
carbon is a metalloid (has some metal-like properties) that does conduct electricity.
Because they are made from cheap Carbon, composition resistors can cost much less than
similar wire-wound resistors. The drawback is that the carbon can be cracked while
making them, or become cracked in use. They have higher tolerances because of the
uncertainty in cutting the carbon.

In some cases it is necessary to have a circuit with resistors that you can adjust. These
resistors are known as potentiometers or variable resistors. Often they are just a modified
version of a wire-wound resistor, although newer versions use advanced electronics
instead. Youve used one if youve ever used a dimmer switch for lights in a room, or
played with an electric race car set. Most variable resistors are designed so that by turning
a dial or sliding a switch, you change the amount of conducting material the current has
to go through. The more conducting material the current has to go through, the higher the
resistance less material and the resistance is less.

42
11.4 Watt Rating of Resistor and its Use:
The watt rating for any resistors is very important factor. It defines that how much current
can flow across the resistor at particular voltage without damaging the resistor.
According to the watt rating the thickness of the resistor varies. Now we have to take in
consideration how much current is going to flow across the resistor and depending upon
the rating we can calculate the power or wattage rating of the resistor. Because of this
reason only the resistors having same value come in different wattages like 100ohm,
1/4watt (quarter watt), 100ohm, 1/2watt (half watt), 100ohm, 1watt and many more.

43
CHAPTER- 4

WORKING PRINCIPLE

In designing embedded robotic projects, interfacing DC motor to ARDUINO forms an


essential part. A well designed Arduino-DC motor system has essentially two parts. The
first part is suitable software to operate and second part is a suitable driver circuit.
Interfacing the DC motor directly to a microcontroller is not possible. Connecting DC
motor with microcontroller directly, causes many problems like voltage spikes produced
while reversing the direction of rotation could easily damage the microcontroller,
maximum current that can be sourced or sunk from a 8051 microcontroller is 15 mA at
5v. But a DC Motor needs more currents than the current delivered by microcontroller
and to operate motor, can only be fulfilled if the voltages are 6v, 12v, 24v etc, depending
upon the type of motor used .The proper functioning of the microcontroller is also
affected by the back emf produced by motor. Therefore to overcome such problem H-
bridge using freewheeling diode, transistor or clamp diodes are used. Clamp diodes are
used to overcome the effect of back emf. But using transistor, diodes makes our circuit
bulky. Hence to overcome this we use L293D drivers. It is a quadruple half H-bridge
driver. Such type of ICs neednt need to connect any transistor or diode. We can easily
control the switching of L293D using a microcontroller. And hence speed of DC motor is
controlled via microcontroller.
The IR sensor module is used to detect any obstacle in the path of train movement. If any
obstacle comes in the path of the metro train then the IR sensor output goes High which
in turn turns the motor input low and hence train is stopped. Once the obstacle is cleared
the output of IR sensor goes Low which in turn turns the motor input High.

44
Figure 28- Block diagram of the system

The opening and closing of the door is by controlling the stepper motor connected to the
door. Once a station is reached the output of the door motor goes High and thus opens the
door by operating in one direction and then after few seconds when passengers aboard the
train it operates in opposite direction to close the door. Its operation is controlled by
L293D which is controlled by the Arduino.
The supply from the mains is first stepped down to 12V using step-down transformer.
This 12V output of transformer is then fed to the rectifier which converts ac into dc. Now
the output of rectifier is fed to the filter circuit which filters the ripples in the supply.
Then the output of filter circuit is fed to voltage regulator LM7805 which converts 12V
to 5V. Now this supply is given to the microcontroller and the motor driver. The LCD
displays the name if the station. The stations are predefined and the time between two
consecutive stations is also predefined. For starting the train the input to the L293d
GOES High which turns ON the main train driving motors and the train starts moving.
The IR sensors keep on searching if an obstacle is detected. After 4seconds, First station
is reached. The train stops as soon as the main motors stop and at the same time (delay of
about 800ms) the door motor operates in one direction to open the door and after
2seconds the door motor operates in opposite direction to close the door. And the rain
again starts moving. This process is repeated again and again until the last station is
reached and in this project, only 3 stations have been defined .Thus after 3 rd station the
input to the main motors is such that it starts operating in opposite direction and the train
moves in reverse direction and the same process is repeated. In this way the train
operates.

45
CHAPTER-5

MICROCONTROLLER PROGRAMMING CODE

The microcontroller is programmed using ARDUINO software version 1.6.3 and the
code is given below:

CODE:
#include <LiquidCrystal.h>
int i=0;
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
#define IRsensorPin 9
#define D13ledPin 15
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.clear();
pinMode(15,OUTPUT);
pinMode(16,OUTPUT);
pinMode(17,OUTPUT);
pinMode(18,OUTPUT);
pinMode(10,OUTPUT);
pinMode(11,OUTPUT);
pinMode(12,OUTPUT);
pinMode(14,OUTPUT);
}

void loop() {

///FORWARD MOVEMENT

lcd.clear();
46
// PARI CHOWK
lcd.clear();
lcd.print("NOW PARI CHOWK");
lcd.noCursor();

//Door opening
digitalWrite(17,HIGH);
digitalWrite(18,LOW);
digitalWrite(12,HIGH);
delay(800);
//Door opened
digitalWrite(17,LOW);
digitalWrite(18,LOW);
digitalWrite(12,LOW);
digitalWrite(10,HIGH);
delay(2000);
//Door closing
digitalWrite(18,HIGH);
digitalWrite(17,LOW);
digitalWrite(12,HIGH);
digitalWrite(10,LOW);

delay(1500);
digitalWrite(18,LOW);
digitalWrite(17,LOW);
digitalWrite(12,LOW);
//Door closed
lcd.clear();
lcd.print("DEPARTING");
digitalWrite(10,LOW);
delay(2000);

47
lcd.clear();

//Main motor start


digitalWrite(15,HIGH);
digitalWrite(16,LOW);
//Checking for obstacle
ir();
for(i=0;i<=20;i++)
{
lcd.clear();
digitalWrite(15,HIGH);
digitalWrite(16,LOW);
lcd.print("NEXT STN IS ");
lcd.setCursor(0, 3);
lcd.print("G.L.BAJAJ");
lcd.noCursor();
ir();
delay(200);
}

lcd.clear();
lcd.print("APPROACHING STN");
lcd.noCursor();
delay(2000);

//GL BAJAJ

lcd.clear();
digitalWrite(15,LOW);
digitalWrite(16,LOW);
lcd.print("NOW G.L. BAJAJ");
lcd.noCursor();

48
delay(1000);
digitalWrite(17,HIGH);
digitalWrite(18,LOW);
digitalWrite(12,HIGH);
delay(900);
digitalWrite(17,LOW);
digitalWrite(18,LOW);

delay(3000);
digitalWrite(18,HIGH);
digitalWrite(17,LOW);
digitalWrite(12,LOW);
digitalWrite(10,HIGH);

delay(1500);
digitalWrite(18,LOW);
digitalWrite(17,LOW);
digitalWrite(10,LOW);

lcd.clear();
lcd.print("DEPARTING");
delay(2000);

//JAGAT FARM
digitalWrite(15,HIGH);
digitalWrite(16,LOW);
lcd.clear();

ir();
for(i=0;i<=20;i++)
{

49
lcd.clear();
digitalWrite(15,HIGH);
digitalWrite(16,LOW);
lcd.print("NEXT STN IS ");
lcd.setCursor(0, 3);
lcd.print("JAGAT FARM");
lcd.noCursor();
lcd.clear();
lcd.print("TRAIN WILL TER-");
lcd.setCursor(0, 3);
lcd.print("MINATE HERE");
lcd.noCursor();
ir();
delay(200);
}

lcd.noCursor();
delay(4000);

digitalWrite(15,LOW);
digitalWrite(16,LOW);
lcd.clear();
lcd.print("NOW JAGAT FARM");
lcd.noCursor();
delay(1000);
lcd.clear();
lcd.print("TRAIN TERMINATES");
lcd.setCursor(0,3);
lcd.print("HERE");
delay(9000);

50
//BACKWARD MOVEMENT

//JAGAT FARM

lcd.clear();
lcd.print("NOW JAGAT FARM");
lcd.noCursor();
delay(1000);
digitalWrite(17,HIGH);
digitalWrite(18,LOW);
digitalWrite(12,HIGH);

delay(900);
digitalWrite(17,LOW);
digitalWrite(18,LOW);
delay(3000);
digitalWrite(18,HIGH);
digitalWrite(17,LOW);
digitalWrite(12,LOW);
digitalWrite(10,HIGH);

delay(1500);
digitalWrite(18,LOW);
digitalWrite(17,LOW);
digitalWrite(10,LOW);

lcd.clear();
lcd.print("DEPARTING");

51
delay(2000);

//G.L. BAJAJ
lcd.clear();
digitalWrite(16,HIGH);
digitalWrite(15,LOW);

lcd.print("NEXT STN IS ");


lcd.setCursor(0, 3);
lcd.print("G.L.BAJAJ");
lcd.noCursor();
delay(3000);

lcd.clear();
lcd.print("APPROACHING STN");
lcd.noCursor();
delay(3000);

lcd.clear();
digitalWrite(15,LOW);
digitalWrite(16,LOW);
lcd.print("NOW G.L. BAJAJ");
lcd.noCursor();
delay(1000);
digitalWrite(17,HIGH);
digitalWrite(18,LOW);
delay(900);
digitalWrite(17,LOW);
digitalWrite(18,LOW);
delay(3000);
digitalWrite(18,HIGH);

52
digitalWrite(17,LOW);
delay(1000);
digitalWrite(18,LOW);
digitalWrite(17,LOW);
lcd.clear();
lcd.print("DEPARTING");
delay(2000);

//PARI CHOWK

digitalWrite(16,HIGH);
digitalWrite(15,LOW);

lcd.clear();
lcd.print("NEXT STN IS ");
lcd.setCursor(0, 3);
lcd.print("PARI CHOWK");
lcd.noCursor();
delay(3000);
lcd.clear();
lcd.print("APPROACHING STN");
lcd.noCursor();
delay(3000);

digitalWrite(15,LOW);
digitalWrite(16,LOW);
lcd.clear();
lcd.print("NOW PARI CHOWK");
lcd.noCursor();

53
delay(2000);
digitalWrite(17,HIGH);
digitalWrite(18,LOW);
delay(900);
digitalWrite(17,LOW);
digitalWrite(18,LOW);
delay(3000);
digitalWrite(18,HIGH);
digitalWrite(17,LOW);
delay (1500);
digitalWrite(18,LOW);
digitalWrite(17,LOW);
lcd.clear();
lcd.print("TRAIN TERMINATES");
lcd.setCursor(0,3);
lcd.print("HERE");
delay(10000);
}
//IR Sensor functioning code(Recursion function used)
int ir()
{
//Reading the output of IR sensor on pin 9
if (digitalRead(IRsensorPin)==LOW)
{
digitalWrite(D13ledPin, HIGH);
}
else {
lcd.clear();
lcd.print("OBSTACLE DETECTED");
digitalWrite(D13ledPin,LOW);
delay(900);
ir();}}

54

Вам также может понравиться