Sie sind auf Seite 1von 44

Eurekasoft Electronics Solutions

Pvt
Limited
Industrial Training Project
EMBEDED SYSTEMS USING PIC MICROCONTROLLER
Held at: Baba Banda Singh Bahadur Engineering College
,Fatehgarh Sahib ,Punjab

Submitted By: Sandeep Singh.


B.Tech. (Electronics Engineering)
Roll no. 1402487
Baba Banda Singh Bahadur Engineering
College,

Fatehgarh Sahib,Punjab
ACKNOWLEDGEMENT

It was a great opportunity for me to work with EESPL Training division, pioneers in the
field of ELECTRONICS . I am extremely grateful to the entire team of EESPL who has
shared their expertise and knowledge with me and without whom the completion of this
project and my industrial training would have been virtually impossible.
My sincere gratitude to Mr. Ashish Sethi (my mentor) for providing me with an
opportunity to work with them as a trainee who has provided me with the necessary
information and his valuable suggestion and comments on bringing out this report in the
best possible way.
I am also very thankful to my friends, partners during the training period and all the
teachers , who helped me in the completion of my project. I am thankful to the power
that always inspires me to take right step in the journey of success my life.

Sandeep Singh.

INDEX

COMPANY PROFILE

POWER SUPPLY DESCRIPTION

THE MICROCONTROLLER

LED

DC MOTOR

RELAY

STEPPER MOTOR

SEVEN SEGMENTS

LCD

AUTOMATIC STREET LIGHT CONTROL SYSTEM

CONCLUSION

Company Profile

EUREKA ELECTROSOFT SOLUTIONS PVT. LTD (EESPL)


..making IT happen
Augmentation is a dream virtue of every performer we at EESPL envisaged
on a theme for providing a new epitome of IT solutions in the embedded Telecom &
Software based Product development services. Our edge right from the start was
creating a perceptible differentiation among the plethora of communized IT solutions.
EESPL - where progress is a winning habit
Eureka ElectroSoft Solutions Pvt. Ltd. (EESPL) is primarily operating as a registered R
& D lab for the development and conception of Advanced Automation related
software and hardware solutions. Our expertise includes electronics and software based
stand alone solutions as well as combined integrated solutions termed as Electrosoft
Solutions. At EESPL over the years we

have developed a

core competency to

maximize the quality & innovation parameter while working on any task. Our proven
values have made us as a prime leader in providing customized solutions. It is our stiff
endeavor to amplify our clients viewpoints and to carve up their thoughts. This in
turn is transformed into factual scenario working models with a collection of prime
technological aspects. All this is and much more in the shortest turnaround period.
EESPL the background and essence of operations
The year 2002 witnessed the birth of a visualization which was to impart economy
with a pinnacle swiftness of innovation in contemporary Industrial IT Solutions. There
came EESPL and a new chapter of imparting excellence
in IT techniques came into subsistence. That
road voyaged

was the foundation and today the

by EESPL encompasses years of reliance, accomplishments and

above all unlimited bonds. Bonds that speak for themselves, relationships that

reflect factual progress. Triumph at EESPL is defined as the never ending smile on
our dear customers face. At EESPL we do not impart conception, we create
endearing teams.

Indulging within minds, Imparting technologies


Understanding the pulsation of a customer forms our principal challenge. Assurances
that mean results, efforts that capitulate advancement and outcomes that move
imaginings form the spirit of our day after day working. Timeliness is of chief value to us
and understanding the modern day race for time, we deliver the maximum in minimum
and that too with precision. Our approach of operation also constitutes of a
dedicated Registered
Research and Development lab to make available the final deliverables with thread bare
technologies. Our precedence is often devised on the scale of our customers desires.
After carefully analyzing on the need based approach we craft a well planned set of
operations each fragment is build with an in depth focus on customers requirements.

Vision & Mission:


Our corporate vision is to provide a fully functional IT platform to all
complex tasks thereby inducing a greater sense of effectiveness and to
consistently create value for money, by providing solutions which enable our
customers to achieve excellence and sustainable competitive edge.
Mission target
Our mission statement is to provide endearing technologies of future in the
present era and for that we are committed to develop innovative and the
most valuable solutions to our customers as our motto is Changing Ideas
into Reality.
Our Core Values:
Innovation
Flexibility is the key to our offerings, and intrinsic to this flexibility, is the
spirit of
Innovation that we bring to our products and services - from the very first
stage of design to implementation and customer support.
Competence
At EESPL we always pride ourselves on the vision, skills, expertise and
professionalism of our team. Our team members make use of their keen
Competence to foresee industry trends and meet demanding customer
needs. And the working of their collective minds in a highly supportive
environment ensures that our products and services retain a competitive edge
at all times.
Quality Objectives
Quality forms the basis of our work culture. To impart the right and the
Analysis team makes sure that the minutest details are met with precision.
We fully understand the global quality perspective and we follow in tandem
with the same.
QUALITY TESTING
Extensive industry exposure, expanded skills and comprehensive experience
in executing key projects for reputed global companies enable us to bring
world-class technology, true-value professional expertise & immense
knowledge of successful project management.

Quality Assurance
is one of the key focus areas and once a solution is developed, our Software
Testing Team steps in to perform the rigorous rituals, required to deliver a robust,
flawless product/application. Software testing at Olive is performed at several points in
the Software Development Life Cycle (SDLC), as an application is constructed
component

by component into a functioning system. Our qualified testers carry out

intense testing for bugs and flaws and fix the same - all within the strictest time
frame.

CUSTOMER SUPPORT AND FEEDBACK


REVIEW
EESPL at your doorstep
Ensuring total

customer satisfaction is

EESPLs forte and

the company has

implemented an effective customer relationship management strategy for increased


efficiency and overall success. From project kick-off to customer sign-off, Eureka's
dedicated Managers will work in tandem with you and provide round-the-clock
updates on project status. They also solve problems, answer queries and give instant
feedback. Eureka provides 24x7 online support, proposed (each customer query will
be immediately recorded and a After the project delivery, each customer is requested to
provide feedback on a number of relevant criteria such as delivery schedule, product
quality, issue
professionalism.

resolution, communication,
After

obtaining

the

risk management,
critical information

knowledge
through

and

relevant

questionnaires, we make an in-depth analysis of the valuable data and measure


customer satisfaction at all levels. EESPL also encourages peer reviews for
enhancing cross-functional co-ordination and strengthening quality initiatives Olive
believes in partnerships - partnerships that

develop into mutually beneficial

symbiotic relationships brandishing the competitive edges of both. With Olive's Internet
technology as expertise, you can compete with the world's premium e-business
solution providers and develop a technology EESPL not just delivers online presence
but specializes in employing its technology to help clients make the most of their
online presence. We strategize and impart technical applications, marketing and
design skills required maximizing a company's online potential.

WHY EESPL
Well, its got to be somebody. Why not us? Of course, you are the best judge when it
comes to choosing a technology partner and we leave that for you to decide. Our goal is
only to provide a clear and detailed insight into your project work and possible
expansion plan when the time comes. First and oremost, we never compromise on
quality. Any and all work, big or small,is important to us. We believe in delivering
high quality products that xceeds clients expectations. Second, our experienced
architects help you design a product that is far more powerful and open when it
comes to enhancements. Third, we are delivery oriented and believe in delivering no
matter what it takes. We provide cost effect solutions at competitive prices to ensure
your ROI is high and budget is well under control. With those said, we leave the call on
you to decide Why us?

Eureka Electronics & Embedded Solutions (E3S):


Mastering the art of aptness
Electronic product design is the result of integrated proficiency covering both
the software and the electronic/hardware design facets. With our proficient Design
Centre on the anvil, a panel of devoted experienced engineers works as a team to
provide a highly receptive and customized service solutions. Each perspective of
customer service is performed with paramount flawlessness thereby inducing a path
full of aptness. At E3S order goes hand in hand with the final conclusion. We very well
understand the throb of the client and it is our primary intent to form a cohesive plan of
action. Understanding on a common platform with the client forms the chief medium of
our achievement.
Components of our Project work putting able brains to work
Converting simple ideas to real time products
Enhancing the performance aptitude of existing products
In depth investigations into offered technologies
Testing & Verifications of numerous assignments
The Execution Schedule implementing the knowledge minds
What we require is simply a brief of the requirements, which can be documented or
can be the result of an able discussion. The upshot of the same is a firm proposal from
our side which is entirely Free of cost.
Eureka Telecom & Infrastructure Services(ETIS):
Connecting Emotions
Our venture into the turf of Telecom Network Services has been under the aegis of
Eureka Telecom Solutions. Our principal focal point in this sphere is to fuse diverse
expertise for catering to Telecom Networking, Communication & Infrastructure
maintenance needs of globally distributed Enterprises and Telecom Carriers (GSM &
CDMA).
Our laurels in segment sector include associations with variety of renowned Telecom
players such as SPICE, VODAFONE, RELIANCE, ERICSSON, SIEMENS, NOKIA
and ZTE. On the offerings are telecom site installation and commissioning, BSC
&

Transcoder Installation & Commissioning, BSS support and Maintenance, Installation


of MSCs, Electrical resourcing and installation. In addition to above utilities, we are
also diligently developing hardware and software based automation gear for
TELECOM sector.

Module -1
POWER SUPPLY DESCRIPTION:
The power supply circuit comprises of four basic parts: The transformer steps down the
220 V a/c. into 12 V a/c. The transformer work on the principle of magnetic
induction, where two coils: primary and secondary are wound around an iron core.
The two coils are physically insulated from each other in such a way that passing an
a/c. current through the primary coil creates a changing voltage in the primary coil
and a changing magnetic field in the core. This in turn induces a varying a/c.
voltage in the secondary coil.
The a/c. voltage is then fed to the bridge rectifier. The rectifier circuit is usedin most
electronic power supplies is the single-phase bridge rectifier with capacitor filtering,
usually followed by a linear voltage regulator. A rectifier circuit is necessary to convert a
signal having zero average value into a non- zero average value. A rectifier transforms
alternating current into direct current by limiting or regulating the direction of flow of
current. The output resulting from a rectifier is a pulsating D.C. voltage. This voltage
is not appropriate for the components that are going to work through it.
The ripple of the D.C. voltage is smoothened using a filter capacitor of 1000 microF
25V. The filter capacitor stores electrical charge. If it is large enough the capacitor will
store charge as the voltage rises and give up the charge as the voltage falls. This has
the effect of smoothing out the waveform and provides steadier voltage output. A
filter capacitor is connected at the rectifier output and the d.c voltage is obtained
across the capacitor. When this capacitor is used in this project, it should be twice the
supply voltage. When the filter is used, the RC charge time of the filter capacitor must
be short and the RC discharge time must be long to eliminate ripple action. In other
words the capacitor must charge up fast, preferably with no discharge.
When the rectifier output voltage is increasing, the capacitor charges to the peak
voltage Vm. Just past the positive peak, the rectifier output voltage starts to fall but
at this point the capacitor has +Vm voltage across it. Since the source voltage becomes

slightly less than Vm, the capacitor will try to send current back through the diode of
rectifier. This reverse biases the diode. The diode disconnects or separates the source
the source form load.

The capacitor starts to discharge through load. This prevents the load voltage from falling
to zero. The capacitor continues to discharge until source voltage becomes more
than capacitor voltage. The diode again startsconducting and the capacitor is again
charged to peak value Vm. When capacitor is charging the rectifier supplies the
charging through capacitor branch as well as load current, the capacitor sends currents
through the load. The rate at which capacitor discharge depends upon time constant RC.
The longer the time constant, the steadier is the output voltage. An increase in load
current i.e. decrease in resistance makes time constant of discharge path smaller.

The

ripple increase and d.c output voltage V dc decreases. Maximum capacity cannot
exceed a certain limit because the larger the capacitance the greater is the current
required to charge the capacitor.

MODULE 2:
THE MICROCONTROLER:
In our day to day life the role of micro-controllers has been immense. They are used in a
variety of applications ranging from home appliances, FAX machines, Video games,
Camera,

Exercise equipment,

Cellular phones musical Instruments to

Computers,

engine control, aeronautics, security systems and the list goes on.

MICROCONTROLLERS VERSUS MICROPROCESSORS


What is

the difference

between a microprocessor

and microcontroller?

The

microprocessors (such as 8086,80286,68000 etc.) contain no RAM, no ROM and no I/O


ports on the chip itself. For this reason they are referred as general- purpose
microprocessors. A system designer using general- purpose microprocessor must add
external RAM, ROM, I/O ports and timers to make them functional. Although

the

addition of external RAM, ROM, and I/O ports make the system bulkier and much
more expensive, they have the advantage of versatility such that the designer can decide
on the amount of RAM, ROM and I/o ports needed to fit the task at hand. This is the not
the case with microcontrollers. A microcontroller has a CPU (a microprocessor) in addition
to the fixed amount of RAM, ROM, I/O ports, and timer are all for example a TV
remote control, there is no need for the computing power of a 486 or even a 8086
microprocessor. In many applications, the space it takes, the power it consumes, and the
price per unit are much more critical considerations than the computing power. These
applications most often require some I/O operations to read signals and turn on and off
certain bits. It is interesting to know that some microcontrollers manufactures have gone
as far as integrating an ADC and other peripherals into the microcontrollers.

MICROCONTROLLERS FOR EMBEDDED SYSTEMS


In the literature discussing microprocessors, we often see a term embedded system.
Microprocessors and microcontrollers are widely used in embedded system products.
An

embedded product uses a

microprocessor (ormicrocontroller) to do one task

and one task only. A printer is an example of embedded system since the processor
inside it performs one task only: namely, get data and print it. Contrasting this with
a IBM PC which can be used for a number of applications such as word processor,
print server, etwork server, video game player, or internet terminal. Software for a
variety of applications can be loaded and run. Of course the reason a PC can perform
myriad tasks is that it has RAM memory and an operating system that loads the
application software into RAM and lets the CPU run it. In an embedded system, there is
only one application software that is burned into ROM. An PC contains or is connected
to various embedded products such as the keyboard, printer, modem, disk controller,
sound card, CD-ROM driver, mouse and so on. Each one of these peripherals has a
microcontroller inside it that performs only one task. For example, inside every mouse
there is a microcontroller to perform the task of finding the mouse position and
sending it to the PC Although microcontrollers are the preferred choice for many
embedded systems, there are times that a microcontroller is inadequate for the task. For
this reason,

in many

years the manufacturers for general-purpose

microprocessors have targeted their microprocessors.

MODULE -3
LED INTERFACING
Like a normal diode, an LED consists of a chip of semiconducting material
designed to produce unconventional color pattern
impregnated, or doped, with impurities to create a p-n junction. As in other
diodes, current flows easily from the p-side, or anode, to the n-side, or
cathode, but not in the reverse direction. Charge-carrierselectrons and
holesflow into the junction from electrodes with different voltages. When
an electron meets a hole, it falls into a lower energy level, and releases
energy in the form of a photon.
The wavelength of the light emitted, and therefore its color, depends on the
band gap energy of the materials forming the p-n junction. In silicon or
germanium diodes, the electrons and holes recombine by a non-radiative
transition which produces no optical emission, because these are indirect
band gap materials. The materials used for an LED have a direct band gap
with energies corresponding to near-infrared, visible or near-ultraviolet light.
LED development began with infrared and red devices made with gallium
arsenide. Advances in materials science have made possible the production
of devices with ever-shorter wavelengths, producing light in a variety of
colors. into a much lower-index medium. The large index difference makes
the reflection quite substantial (per the Fresnel coefficients), and this is usually
one of the dominant causes of LED inefficiency. Often more than half of the
emitted

light

is reflected

back

at

the

LED-package

and package-air

interfaces. The reflection is most commonly reduced by using a dom shaped


(half-sphere) package with the diode in the center so that the
outgoing light rays strike the surface perpendicularly, at which angle the
reflection is minimized. An anti-reflection coating may be added as well.

LEDS Program
#include<reg51.h>
8051
#include<delay.h>
milliseconds delay
'led' Or directly 'P1'

//This file contains the Ports and SFR address of


//This file is used to produce seconds and
// 'P1' is given the another name as 'led' ,u can use

//for programming
// main program starts from here
#define led P1
void main()

// Infinite Loop for infinite rotation

{
//
//
secdelay(1);
led=0xff;

ON OFF PATTERN

light on All 8-leds '0'-> ON


1 secdelay

{while(1)
led=0x00;
//light OFF All 8-leds '1'-> OFF
secdelay(1);

}
}

The package may be cheap plastic, which may be colored, but this is only for
cosmetic reasons or to

improve the contrast ratio; the color of the

packaging does not substantially affect the color of the light emitted. Other
strategies for

reducing

the impact

of the

interface reflections

include

designing the LED to reabsorb and reemit the reflected light (called photon
recycling) and manipulating the microscopic structure
reduce the

reflectance, either

by introducing

of the surface to

random roughness or

by

creating programmed moth eye surface patterns. Conventional LEDs are made
from a variety of inorganic semiconductor materials, producing the following
colors: Aluminium gallium arsenide (AlGaAs) red and infrared Aluminium
gallium phosphide (AlGaP) green Aluminium gallium indium phosphide
(AlGaInP)

high-brightness orange-red, orange, yellow, and green Gallium

arsenide phosphide (GaAsP) red, orange-red, orange, and yellow Gallium


phosphide (GaP) red, yellow and green Gallium nitride (GaN) green, pure
green (or emerald green), and blue also white (if it has an AlGaN Quantum
Barrier) Indium gallium nitride (InGaN) near ultraviolet, bluish-green and
blue Silicon carbide (SiC) as substrate blue Silicon (Si) as substrate blue
(under development) Sapphire (Al2O3) as substrate blue Zinc selenide (ZnSe)
blue Diamond (C) ultraviolet Aluminium nitride (AlN), aluminium
gallium nitride (AlGaN), aluminium

MODULE -4
DC MOTOR

Working Principle:
The principle upon which the d.c. motor works is very simple . If a
current carrying

conductor is placed in

a magnetic field,

mechanical force is experienced on the conductor, the direction of


which is given by the Fleming's left hand rule and hence the
conductor moves in the direction of force. The magnitude of the
mechanical force experienced on the conductor is given by:
F = B Ic Lc newtons
where B is the field strength in teslas ,
Ic is the current flowing through the conductor in amperes
and Lc is the length of the conductor in metres.
When the motor is connected

to the d.c. supply mains

a direct

current passes through the brushes and the


commutator to the armature winding ; while it passes through the
commutator it is converetd into a.c. so that the group of conductors
under successive field poles carry currrent in the opposite
direction. Also the direction of the currrent in the individual
conductors reverse as they pass away from the influence of one
pole to that of the next.
The split phase arrangement of the motor creates two fluxes B1and B2
which induces voltage around them in the rotor and under the influence of
these induced voltages current flows in the rotor. The current i1 produced by
flux B1 reacts with flux B2 and develops force F1.The quantities are going
to be expressed as :
max

B1=B1

. sin(wt)

B2=B2 . sin(wt + )
max
It may be assumed with negligible error thet the paths in which the
rotor current flow has negligible self-inductance and hence the
rotor currents are in phase with their respective voltages.

i1(db1/dt)=.B1max.cos wt
i2(db2/dt)=K. B2 max.cos (wt +X)
Since the two forces (f1and f2 ) developed are in opposition
.Therefore the net force F acting on the movable element is given
as:

F=F2-F1(B2.i1-i2.b1)
F=K B1 max.B2 max sin r)
EMF Equation:
Back EMF, Eb=Flux *ZNP/60A
where
Z= total number of armature cunductors
N= Speed in r.p.m
P= total number of poles
A= Total number of parallel paths.
V= Eb + IaRa
Ia= (V - Eb)/Ra
where
V = Terminal voltage
Ia= Armature current
Ra= Armature resistance
Eb= back e.m.f.

DC MOTOR PROGRAMS

ON -OFF DC MOTOR
#include<reg51.h>
#include<delay.h>
/* define the motor using sbit as dc motor */
sbit dc_motor=P0^5;
#define ON 1
#define OFF 0
void main()
{
while(1)
{
dc_motor=ON;
secdelay(3);
// switch on the Dc motor
dc_motor=OFF;
secdelay(2);
// switch OFF the Dc motor
}

MODULE -5
RELAY
THE ELECTROMAGNETIC solenoid valve
As there are always some chances of high voltage spikes back from the switching
circuit i.e. heater so an optocoupler/isolator MCT2e is used. It provides and electrical isolation
between themicrocontroller and the heater. MCT2e is a 6-pin IC with a combination of
optical transmitter LED and an optical receiver as phototransistor. Microcontroller is
connected to pin no 2 of MCT2e through a 470-ohm resistor. Pin no.1 is given +5V supply and
pin no.4 is grounded. To handle the current drawn by the heater a power transistor BC-369 is
used as a current driver. Pin no.5 of optocoupler is connected to the base of transistor. It takes
all its output to V and activates the heater through relay circuit. The electromagnetic relay
consists of a multi-turn coil, wound on an iron core, to form an electromagnet. When the coil is
energized, by passing current through it, the core becomes temporarily magnetized. The
magnetized core attracts the iron armature. The armature is pivoted which causes it to operate
one or more sets of contacts. When the coil is de-energised the armature and contacts are
released. Relays can generate a very high voltage across the coil when switched off. This can
damage other components in the circuit. To prevent this a diode is connected across the coil.
Relay has five points. Out of the 2 operating points one is permanently connected to the
ground and the other point is connected to the collector side of the power transistor. When V
reaches the collector side i.e. signal is given to the operating points the coil gets magnetized
and attracts the iron armature. The iron plate moves from normally connected (NC) position to
normally open (NO) position. Thus the heater gets the phase signal and is ON. To remove the
base leakage voltage when no signal is present a 470-ohm resistance is used.
The electromagnetic relay consists of a multi-turn coil, wound on an iron core, to
form an electromagnet. When the coil is energised, by passing current through it, the core
becomestemporarily magnetised. The magnetised core attracts the iron armature. The armature
is pivoted which causes it to operate one or more sets of contacts.
When the coil is de-energised the armature and contacts are released. The coil can be
energised from a low power source such as a transistor while the contacts can switch high
powers such as the mains supply. The relay can also be situated remotely from the control
system.

SIMPLE RELAY CONTROL

#include<reg51.h>
#include<delay.h>
sbit dev=P0^6;
#define ON 1
// define the 220v device using sbit as dev
#define OFF 0
void main()
{
while(1)
{
dev=ON;
secdelay(5);
dev=OFF;
secdelay(3);
}
}

MODULE -6
STEPPER MOTOR
Motion Control, in electronic terms, means to accurately control the movement of an object based
on either speed, distance, load, inertia or a combination of all these factors. There are numerous
types of motion control systems, including; Stepper

Motor, Linear Step Motor, DC

Brushless, Servo, Brushless Servo and more.


A stepper motor is an electromechanical device which converts electrical pulses into
discrete mechanical movements. Stepper motor is a form of ac. motor .The shaft or spindle of
a stepper motor rotates in discrete step increments when electrical command pulses are applied
to it in the proper sequence. The motors rotation has several direct relationships to these
applied input pulses. The sequence of the applied pulses is directly related to the direction
of motor shafts rotation. The speed of the motor shafts rotation is directly related to the
frequency of the input pulses and the length of rotation is directly related to the number of input
pulses applied.
For every input pulse, the motor shaft turns through a specified number of degrees, called a step.
Its working principle is one step rotation for one input pulse. The range of step size may vary
from 0.72 degree to 90 degree. In position control application, if the number of input pulses sent
to the motor is known, the actual position of the driven job can be obtained. A stepper motor
differs from a conventional motor (CM) as under:
a.

Input to SM is in the form of electric pulses whereas input to a CM is invariably from a

constant voltage source.


b. A CM has a free running shaft whereas shaft of SM moves through angular steps.
c.

In control system applications, no feedback loop is required when SM is used but a


feedback loop is required when CM is used.

d. A SM is a digital electromechanical device whereas a CM is an analog electromechanical


device.

Open Loop Operation


One of the most significant advantages of a stepper motor is its ability to be accurately controlled
in an open loop system. Open loop control means no feedback information about position is
needed. This type of control eliminates the need for expensive sensing and feedback devices such
as optical encoders. Control position is known simply by keeping track of the input step pulses
Every stepper motor has a permanent magnet rotor (shaft) surrounded by a stator. The most
common stepper motor has four

stator windings that are paired with a center-tapped

common. This type of stepper motor is commonly referred to as a four- phase stepper motor.
The center tap allows a change of current direction in each of two coils when a winding is
grounded, thereby resulting in a polarity change of the stator. Notice that while a conventional
motor shaft runs freely, the stepper motor shaft moves in a fixed repeatable increment which
allows one to move it to a precise position. This repeatable process goes on.

Rotor Alignment
fixed movement is possible as a result of basic magnetic theory where poles of the Same
polarity
repel and opposite poles attract. The direction of the rotation is dictated by the stator poles. The
stator poles are determined by the current sent through the wire coils. As the direction of the
current is changed, the polarity is also changed causing the reverse motion of the rotor. The
stepper motor used here has a total of 5 leads: 4 leads representing the four stator windings and
1 common for the center tapped leads. As the sequence of power is applied to each stator
winding, the rotor will rotate. There are several widely used sequences where each has a different
degree of precision. Table shows the normal 4-step sequence. For clockwise go for step 1 to 4 &
for counter clockwise go for step 4 to 1.
Step Angle & Steps per Revolution
Movement associated with a single step, depends on the internal construction of the motor, in
particular the number of teeth on the stator and the rotor. The step angle is the minimum degree
of rotation associated with a single step.
Step per revolution is the total number of steps needed to rotate one complete rotation or 360
degrees (e.g., 180 steps * 2 degree = 360) [31].
Since the stepper motor is not ordinary motor

and has four separate coils, which have to

be energized one by one in a stepwise fashion. We term them as coil A, B, C and D. At a


particular instant the coil A should get supply and then after some delay the coil B should get a
supply and then coil C and then coil D and so on the cycle continues. The more the delay
is introduced between the energizing of the coils the lesser is the speed of the stepper motor

and vice versa.

MODULE -7
Seven Segment
The seven-segment LED display has four individual digits, each with a decimal point. Each
of the seven segments (and the decimal point) in a given digit contains an individual LED.
When a suitable voltage is applied to a given segment LED, current flows through and
illuminates that segment LED. By choosing which segments to illuminate, any of the nine
digits can be shown. For example, as shown in the figure below, a 2 can be displayed
by illuminating segments a, b, d, e, and g. Seven segment displays come in two varieties common anode (CA) and common cathode (CC). In a CA display, the anodes for the seven
segments and the decimal point are joined into a single circuit node. To illuminate a
segment in a CA display, the voltage on a cathode must be at a suitably lower voltage (about
.7V) than the anode. In a CC display, the cathodes are joined together, and the segments are
illuminated by bringing the anode voltage higher than the cathode node (again, by about .
7V). The Digilab board uses CA displays. The seven LEDs in each digit are labelled a-g. Since
the Digilab board uses CA displays, the anodes for each of the four digits are connected
in a common node, so that four separate anode circuit nodes exist (one per digit). Similar
cathode leads from each digit have also been tied together to form seven common circuit
nodes, so that one node exists for each segment type. These four anode and seven cathode
circuit nodes are available at the J2 connector pins labelled A1-A4 and CA-CG. With this
scheme, any segment of any digit can be driven individually. For example, to illuminate
segments b and c in the second digit, the b and c cathode nodes would be brought to a
suitable low voltage (by connecting the corresponding circuit node available at the J2 connector
to ground), and anode 2 would be brought to a suitable high voltage (by connecting the
corresponding circuit node available at the J2 connector to Vdd).

SEVEN SEGMENT DISPLAY PROGRAMS

UP COUNTER
#include<reg51.h>
#include<delay.h>
#define seg_port P2
//define segment port
// array is used to store the value of data to be sent on the port to display
// any digit on seven segment as below
unsigned
char
seg_array[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
void main()
{
unsigned char count;
while(1)
{
for(count=0;count<10;count++)
{
seg_port=seg_array[count];
// put array digit value from
array to the port
secdelay(1);
}
}
}

DOWN COUNTER
#include<reg51.h>
#include<delay.h>
#define seg_port P2
// define segment port
// array is used to store the value of data to be sent on the port to display
// any digit on seven segment as below
unsigned
char
seg_array[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
void main()
{
char count;
while(1)
{
for(count=9;count>=0;count--)
{
seg_port=seg_array[count];
of digit fom array to
// send the corresponding value
// port
secdelay(1);
}
}
}

MODULE 8
LCD
Liquid Crystal Display

Liquid crystal displays (LCD) are widely used in recent years as compares to LEDs.
This is due to the

declining prices

of LCD, the

ability to

display numbers,

characters and graphics, incorporation of a refreshing controller into the LCD, their
by relieving the CPU of the task of refreshing the LCD and also the ease of
programming for characters and graphics. HD 44780 based LCDs are most commonly
used.
LCD pin description
The LCD discuss in this section has the most common connector used for the
Hitatchi 44780 based LCD is 14 pins in a row and modes of operation and how to
program and interface with microcontroller is describes in this section.
The voltage VCC and VSS provided by +5V and ground respectively while VEE
is used forcontrolling LCD contrast.

Variable voltage between Ground and Vcc is

used to specify the contrast (or "darkness") of the characters on the LCD screen.
RS (register select)
There are two important registers inside the LCD. The RS pin is used for their
selection as follows. If RS=0, the instruction command code register is selected, then
allowing to user to send a command such as clear display, cursor at home etc.. If
RS=1, the data register is selected, allowing the user to send data to be displayed on the
LCD.
R/W (read/write)
The R/W (read/write) input allowing the user to write information from it. R/W=1,
when it read and R/W=0, when it writing.
EN (enable)
The enable pin is used by the LCD to latch information presented to its data pins.
When data is supplied to data pins, a high power, a high-to-low pulse must be applied to
this pin in order to for the LCD to latch in the data presented at the data pins.

D0-D7 (data lines)


The 8-bit data pins, D0-D7, are used to send information to the LCD or read the
contents of the LCDs internal registers. To displays the letters and numbers, we send
ASCII codes for the letters A-Z, a-z, and numbers 0-9 to these pins while making RS
=1. There are also command codes that can be sent to clear the display or force the cursor
to the home position or blink the cursor.
We also use RS =0 to check the busy flag bit to see if the LCD is ready to
receive the information. The busy flag is D7 and can be read when R/W =1 and RS =0,
as follows: if R/W =1 and RS =0, when D7 =1(busy flag =1), the LCD is busy taking
care of internal operations and will not accept any information. When D7 =0, the LCD
is ready to receive new information.

LCD PROGRAM

NUMBER DISPLAY
#include<reg51.h>
#include<delay.h>
#define DATA P1
of LCD
// define DATA and Control Pins
// function to write command at
//clear RS (ie. RS=0) to write
sbit RS=P3^5;
sbit RW=P3^6;
sbit E=P3^7;
void lcd_cmd(unsigned char datax)
lcd port
{
ms_delay(20);
DATA=datax;
RS=0;
command
RW=0;
E=1;
// write operation
// send H-L pulse at E pin
ms_delay(5);
E=0;
}

void lcd_data (unsigned char datax)


lcd port
// function to write data at
{
ms_delay(20);
DATA=datax;
RS=1;
// set RS=1 to write DATA
RW=0;
E=1;
// write operation
//send H-L pulse at E pin
ms_delay (5);
E=0;
}
void lcd_init()
power on time
// function to initialize the LCD at
{
lcd_cmd(0x38);
// 2x16 display select
ms_delay(3);
lcd_cmd (0x38);
ms_delay(3);
// 2x16 display select
lcd_cmd (0x0c);
ms_delay(3);

// display on cursor off command


// automatic cursor movement to
lcd_cmd (0x06);
right
ms_delay(3);
lcd_cmd (0x01);
ms_delay(3);
// lcd clear command
lcd_cmd (0x80);
// first row first coloumn select
command
ms_delay(3);
}
void main()
{
unsigned char start_loc=0x80,count;
lcd_init();
while(1)

{
for(count=0;count<10;count++)
// loop to count from 0 to 9
{
lcd_cmd(start_loc);
// set start location as 0x80

lcd_data(count+48);
// add 48 to the count to
convert it to ASCII value
secdelay(1);
start_loc++;
// wait for one second
// increment start location
if(start_loc==0x90)
location
// if the cursor is at 17th
// change the location to 0xc0
start_loc=0xc0;
(2nd row 1st column)
if(start_loc==0xd0)
location then
// if the cursor is at 33rd
{
lcd_cmd(0x01);
//clear lcd and
start_loc=0x80;
// change the location to 0x80
(1st row 1st column)
}
}
} }

AUTOMATIC STREET LIGHT CONTROL SYSTEM


(MINOR PROJECT)

Generally, the street lights are switched on just before the sun set and switched off in the
morning. Most commonly found street lights are HID or High Intensity Discharge lamps,
which consume a lot of power. As all the controls are manual, the street lights continue to
glow at full intensity, even when not required, until they are manually turned off. By
reducing the intensity of these lamps when the traffic is less or early morning, energy can
be saved. This can be further extended to automation process.
The concept of automatic control of street lights is not a new one but it has been less
frequently implemented than it must be.The aim of this project is to explain Auto
Intensity Control of Street Lights using a PIC microcontroller. The circuit is implemented
with both LDR and Real Time clock.
In order to save energy, the circuit is designed with high intensity LEDs in place of HID
lamps. Normal street lights can also be used by making some changes to the circuit,
which is also shown in the article.

Component Description
PIC16F877A
The microcontroller used in the circuit is a PIC16F877A. It is an 8 bit microcontroller
that reads the voltage across LDR and also checks the time in Real Time Clock IC. Based
on the readings, the LEDs are switched on or off.
Circuit Design of Auto Intensity Control of Street Lights using a PIC Microcontroller
The microcontroller used in the circuit is a PIC16F877A. The Master Clear (MCLR) is
an active low pin. Hence, for normal operation, this pin (Pin 1) is connected to Vcc via a
pull up resistor.Additionally, a bypass switch/button is connected to ground from this pin
and when the button is pushed, the microcontroller is reset. A 8MHz crystal oscillator is
connected between the pins OSC1 and OSC2 (Pins 13 and 14).In order to control the
street lights based on the intensity of the light, an LDR is used. The resistance of the LDR
depends on the intensity of the light incident on it.When connected in a voltage divider
manner, the voltage across the LDR is directly proportional to the light intensity. The
output of the LDR is connected to the microcontroller at RA0 (Pin 2).An RTC (Real Time
Clock) IC is used in order to maintain the clock. With the help of RTC, the street lights
can be switched on or off at any preset time. The RTC IC used in the circuit is DS 1307.
It is an 8-pin IC. DS 1307 requires its own crystal oscillator in order to work.
A 32.7 KHz crystal is connected across its X1 and X2 pins. The oscillator circuit of the
RTC doesnt require any external capacitors. An external battery is connected to the
VBAT pin of the DS 1307 so that the clock runs even when the main power is out.The
two important pins are SDA (Serial Data Input/Output) and SCL (Serial Clock Input).
Both these pins are connected to the respective pins of the microcontroller (Pins 23 and
18).These pins must be pulled high through pull up resistors. The communication
between the RTC and the microcontroller is via I2C protocol.A 4X4 array of high
intensity LEDs is used as the street light. In order to drive the LEDs, two transistors are
used. A BJT BC 547 and a Power MOSFET IRF 520. An LCD is used to display the
current date and time.

Operation Principle of Auto Intensity Control of Street Lights using a


PIC Microcontroller

The aim of the circuit is to achieve auto intensity control of street lights using a PIC
microcontroller. All the components and their connections are explained above. The
working of the circuit is as follows.We use both LDR and RTC in the circuit for the
following reason: if only LDR is used, then there is no chance of saving any energy as the
street lights will glow as soon as the intensity of light on LDR decreases and when the
intensity increases, the street lights are turned off
The microcontroller waits for the signal from LDR and when the intensity of light on
LDR decreases, the output of the microcontroller is activated and the street lights start to
glow. This event occurs only when the current time is in the range of preset time i.e. only
after 5PM.The lights continue to glow at full intensity up to 3 AM. When the time
reaches 3 AM, the intensity of the street light gradually decreases and will turn off either
at 6 AM or when the light on LDR in increasing, whichever is first.Hence, the auto
intensity control of street lights is achieved with the above circuit which has an LDR, an
RTC, a PIC microcontroller and an LED array.
CODE
Code for this project is written in Mikro C and 8Mhz crystal is used in this project.
int light;
void read_ldr()
{
unsigned int adc_value=0;
adc_value=ADC_Read(0);
light = 100 adc_value/10.24;
if(light>=80) // SWITCH of the light when light is 80 percent

{
PORTB.F1=0;
}

else
{
PORTB.F1=1;
}
}
void main()
{
TRISB=0X00;
PORTB=0X00;
Adc_Init();
while (1)
{
read_ldr();}

APPLICATION

1.
The circuit can be used in automation of street light control thereby
reducing manual
control and human errors.
2.
When integrated with IR sensors, the same circuit can be used to control
the street lights
depending on the traffic

In sunny and rainy days, on and off time differ notice which is one of the
major disadvantages of using timer circuit or manual operation for switching
the street light system.

CONCLUSION

The Streetlight controller using ldr based Light intensity & traffic density, in the todays up growing
countries will be more effective in case of cost, manpower and security as compare with today's
running complicated and complex light controlling systems. Automatic Street Light Controlling
System puts up a very user friendly approach and could increase the power
This paper elaborates the design and construction of automatic street control system circuit. Circuit
works properly to turn street lamp ON/OFF. After designing the circuit which controls the light of
the street as illustrated in the previous sections. LDR sensor and the photoelectric sensors are the
two main conditions in working the circuit. If the two conditions have been satisfied the circuit will
do the desired work according to specific program. Each sensor controls the turning ON or OFF the
lighting column. The street lights has been successfully controlled by microcontroller. With
commands from the controller the lights will be ON in the places of the movement when it's dark.
furthermore the drawback of the street light system using timer controller has been overcome, where
the system depends on photoelectric sensor. Finally this control circuit can be used in a long
roadways between the big states.

FUTURE SCOPE
We can save the energy for the future use and we can control the losses of the power
.We can implemnted this project for the home lamp or night lamp of the room. This
is also used for the signals.

Das könnte Ihnen auch gefallen