You are on page 1of 108

Eureka Electrosoft Solutions Pvt. Ltd.

E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 1



Company Profile













Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 2
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 was the foundation and today the road voyaged 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.
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 3

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.













Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 4
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:
I nnovation
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
leading technology, we follow the most rigorous norms. Each of our product
stage goes through multi check points. Every possible situation is thought of
and a remedial action is built in. The presence of our dedicated Quality
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 5
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
ticket number will be issued for future reference).

Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 6
After the project delivery, each customer is requested to provide feedback on
a number of relevant criteria such as delivery schedule, product quality,
issue resolution, communication, risk management, knowledge and
professionalism. After obtaining the critical information through 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
foremost, we never compromise on quality. Any and all work, big or small,
is important to us. We believe in delivering high quality products that
exceeds 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 Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 7






















Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 8
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 Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 9

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.














Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 10


Eureka Smart Software Solutions(E3S) :
Placing Thoughts into Implementation
Software Development at E3S forms a perceptible and exceedingly expertised service
which gratifies to the requirements of landmark technology projects for software
companies and large enterprise clients. The spotlight of this function is to generate a
eminent conception with faster time to-market and condensed engineering costs. Working
hand in glove with our clientele, their personalized wants for product development
projects are met with absolute knack.
Another pioneering concept envisaged by E3S is the provision of software architecture
analysis to make certain the solution being offered can be capably designed, developed
and supported. E3S proficiency extents to various industry facades and technology
spectrums. Our association with customers inculcates an innovative wave of product
development which in turn creates intelligent solutions that drastically cut down
operating costs. All this momentum adds to greater induced efficiency. Some real life
technologies covered by us in software development are: Desktop and Web
applications, Client/Server based applications, Telecom related software tools
development, Biometric based identification and account solutions, RFID based
applications, Biomedical Viewers and related software development, Image
processing and enhancement tools, GSM/CDMA based bulk SMS alerting systems,
Reengineering and Migration etc.








Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 11

Eureka Embedded & Advanced Software Trainings(EEAST)
Preparing the Visionaries of Tomorrow Today
Right from origin Eureka Electrosoft Solutions emerged as a futurist leader in industrial,
corporate training and engineering project assistance. Covering the grounds of embedded
and advanced software technologies it was aptly christened as ElectroSoft Embedded &
Advanced Software Technologies (EEAST).
EEAST is a name to reckon with for the engineering project guidance workshops and
trainings. In trainings the foremost emphasis is laid on covering the gap between the
theoretical and real practical aspects of the technology.
What is done by mind is seldom forgotten, but, what is done by hand is remembered a
lifetime. Based on this principle our Training & Project oriented workshops create a
foundation of real time project based culture. All this goes a long way in creating learning
by doing methodology wherein the wisdom is mastered perfectly.
Since the invent of copious training kits and development boards is completely in-
house, hence there is no dearth of functional training resources. Provision flexible
training modules ranging from one month to six months durations, provide a success
oriented launcpad. Each module is carefully crafted to nurture the students with practical
aspects as well as the theoretical concepts which they have harvested during the general
curriculum process. In campus and corporate trainings also form the serviceable phase of
EEAST.








Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 12

Eureka Human Resources & Turnkey Support Solutions(EHRTSS)
Fostering Proficient I ntellect
Todays contemporary industry requires dexterous wits to work on extensive global
dares. We fully recognize the types of individuals required for high end IT programmes.
Human resources form the base of every organization and we also have a share in putting
weight to this base. We provide capable man power in fine execution of complexed IT
programmes. Noted professionals from various fields are on our database, hence we have
distinguished corporates, like Vodafone and Spice Telecommunications on our client
list.
Benefits to an operator
prompt deployment of resources
complete compliant with local work regulations
Provision of unrestricted series of skills
Existence of skilled consultants with training on precise equipment & software.
The alternative also exists wherein the entire project can be executed by us on turn key
basis. Examples of turnkey work we provide are Line Of Sight Survey, RF and TR
Planning, Pre-Bid and Swap-outs










Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 13


Eureka Project Kits and Spares (EPKS)
For an Uninterrupted Performance & Adept Learning
EEAST is today a well trusted partner of thousands of hobbyists, OEMs, Colleges, schools,
repair shops and Government Organizations for electronics kits and spares. Our wide range of
stock comprises of everything ranging from electronics components to test instruments and
extending to educational kits. Principally we deal in Project oriented Hardware kits, Robotic
kits, Device Programmers, Development Boards, Software tools, Components etc. These
inventive kits are of leading advantage for engineering students from all branches. Their projects
can be developed with simplicity using these kits as they are very undemanding to grasp and
employ. Component resourcing for the students at their own places with the minimum market
cost is also undertaken by us.
















Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 14




Training Modules










Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 15


Introduction
Technology has rapidly grown in past two-three decades. An engineer without
practical knowledge and skills cannot survive in this technical era. Theoretical
knowledge does matter but it is the practical knowledge that is the difference
between the best and the better. Organizations also prefer experienced engineers
than fresher ones due to practical knowledge and industrial exposure of the
former. So industrial exposure is mandatory for engineers nowadays. The practical
training is highly conductive for solid foundation for:
1) Knowledge and personality. 2) Confidence building 3) Enhancement of
creativity.
Embedded Systems are present every where around us like from a simple digital
wrist watch to the most complex satellite space ships. All entities involving
automation are equipped with embedded systems.
At the core of every embedded system there is either a microprocessor or a
microcontroller or any other programmable intelligent unit that works with the
other interfaced units to make a complete working product. So in ongoing
cutthroat competition it is mandatory for every engineer to understand and become
proficient in this upcoming technology.
Embedded systems are computers which are part of special-purpose devices. Due
to the limited duties these systems can be highly optimized to the particular needs.
Traditionally most of these systems are used for control and process measurement,
as a side-effect of higher integration of integrated circuits more complex
applications can be solved by embedded systems. To be able to solve these
problems, embedded systems are commonly equipped with various kinds of
peripherals. Early applications of embedded devices include the guidance
computer of the Minuteman I missiles and the Apollo guidance computer. The
Minuteman I & II missiles are intercontinental ballistic nuclear warheads,
produced by Boeing in the 1960s. Due to the large quantities of ICs used in the
guidance system of Minuteman II missiles, prices for ICs fell from 1000$ each to
3$ each. This lead to wide adoption of embedded systems in consumer electronics
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 16
in the 1980s. Nowadays embedded systems can be found in devices from digital
watches to traffic-control systems. The broad range of applications with totally
different requirements lead to various implementation approaches. The range of
hardware used in embedded systems reaches from FPGAs to full blown desktop
CPUs which are accompanied by special purpose ICs such as DSPs. On the
software side, depending on the needs, everything, from logic fully implemented
in hardware, to systems with own operating system and different applications
running on it, can be found.

















'



Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 17


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 used
in 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

TRANSFORMER

SHUNT
CAPACITOR

BRIDGE
RECTIFIER

VOLTAGE
REGULATOR
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 18
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.



1N4007

12-0-12 V

1000uF


O/P
16 V

TRANSFORMER





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
7805
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 19
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 starts
conducting 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.



The voltage regulator regulates the supply if the supply if the line voltage
increases or decreases. The series 78xx regulators provide fixed regulated
voltages from 5 to 24 volts. An unregulated input voltage is applied at the IC
Input pin i.e. pin 1 which is filtered by capacitor. The out terminal of the IC
i.e. pin 3 provides a regular output. The third terminal is connected to
ground. While the input voltage may vary over some permissible voltage
1
2
3
VIN
G
N
D
VOUT
- -
1
N
4
0
0
7
+
I\P(12V)
-
+
O
U
T
P
U
T
G
R
O
U
N
D
+
-
7805
470 E
LED
T1
220 V AC
1 5
4 8
J2
1
2
D1
-
D2
O\P(5V)
-
-
+
+
C1
1
0
0
0
U
F
D3
+
D4
+
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 20
range, and the output voltage remains constant within specified voltage
variation limit. The 78xx ICs are positive voltage regulators whereas 79xx
ICs are negative voltage regulators.

These voltage regulators are integrated circuits designed as fixed voltage
regulators for a wide variety of applications. These regulators employ
current limiting, thermal shutdown and safe area compensation. With
adequate heat sinking they can deliver output currents in excess of 1 A.
These regulators have internal thermal overload protection. It uses output
transistor safe area compensation and the output voltage offered is in 2% and
4% tolerance.












Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 21
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
embedded together on the chip: therefore, the designer cannot add any
external memory, I/O, or timer to it. The fixed amount of on chip RAM,
ROM, and number of I/O ports in microcontrollers make them ideal for
many applications in which cost and space are critical. In many applications,
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 22
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.

EXTERNAL
INTERRUPTS











TXD RXD

MICROCONTROLLER BLOCK DIAGRAM



INTERRUPT CONTROL
ON-CHIP ROM for
program code
ON-CHIP RAM

ETC.

TIMER 0

TIMER 1
SERIAL
PORT
4 I/O
PORTS
BUS
CONTROL
OSC
CPU
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 23
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 (or
microcontroller) 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,
network 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 microprocessor for the high end of the
embedded market.



Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 24
INTRODUCTION TO 8051
In 1981, Intel Corporation introduced an 8-bit microcontroller called the
8051. This microcontroller had 128 bytes of RAM, 4K bytes of on-chip
ROM, two timers, one serial port, and four ports (8-bit) all on a single chip.
The 8051 is an 8-bit processor, meaning the CPU can work on only 8- bit
pieces to be processed by the CPU. The 8051 has a total of four I/O ports,
each 8- bit wide. Although 8051 can have a maximum of 64K bytes of on-
chip ROM, many manufacturers put only 4K bytes on the chip.
The 8051 became widely popular after Intel
allowed other manufacturers to make any flavor of the 8051 they please with
the condition that they remain code compatible with the 8051. This has led
to many versions of the 8051 with different speeds and amount of on-chip
ROM marketed by more than half a dozen manufacturers. It is important to
know that although there are different flavors of the 8051, they are all
compatible with the original 8051 as far as the instructions are concerned.
This means that if you write your program for one, it will run on any one of
them regardless of the manufacturer. The major 8051 manufacturers are
Intel, Atmel, Dallas Semiconductors, Philips Corporation, Infineon.
AT89C51 FROM ATMEL CORPORATION
This popular 8051 chip has on-chip ROM in the form of flash memory. This
is ideal for fast development since flash memory can be erased in seconds
compared to twenty minutes or more needed for the earlier versions of the
8051. To use the AT89C51 to develop a microcontroller-based system
requires a ROM burner that supports flash memory: However, a ROM eraser
is not needed. Notice that in flash memory you must erase the entire contents
of ROM in order to program it again. The PROM burner does this erasing of
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 25
flash itself and this is why a separate burner is not needed. To eliminate the
need for a PROM burner Atmel is working on a version of the AT89C51
that can be programmed by the serial COM port of the PC.
FEATURES OF AT89C51
- 4K on-chip ROM
- 128 bytes internal RAM (8-bit)
- 32 I/O pins
- Two 16-bit timers
- Six Interrupts
- Serial programming facility
- 40 pin Dual-in-line Package

PIN DESCRIPTION
The 89C51 have a total of 40 pins that are dedicated for various functions
such as I/O, RD, WR, address and interrupts. Out of 40 pins, a total of 32
pins are set aside for the four ports P0, P1, P2, and P3, where each port takes
8 pins. The rest of the pins are designated as Vcc, GND, XTAL1, XTAL,
RST, EA, and PSEN. All these pins except PSEN and ALE are used by all
members of the 8051 and 8031 families. In other words, they must be
connected in order for the system to work, regardless of whether the
microcontroller is of the 8051 or the 8031 family. The other two pins, PSEN
and ALE are used mainly in 8031 based systems.
Vcc
Pin 40 provides supply voltage to the chip. The voltage source is +5 V.
GND
Pin 20 is the ground.
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 26
XTAL1 and XTAL2
The 8051 have an on-chip oscillator but requires external
clock to run it. Most often a quartz crystal oscillator is connected to input
XTAL1 (pin 19) and XTAL2 (pin 18). The quartz crystal oscillator
connected to XTAL1 and XTAL2 also needs two capacitors of 30 pF value.
One side of each capacitor is connected to the ground.
C2
XTAL2
C1
XTAL1

GND

It must be noted that there are various speeds of the 8051 family. Speed
refers to the maximum oscillator frequency connected to the XTAL. For
example, a 12 MHz chip must be connected to a crystal with 12 MHz
frequency or less. Likewise, a 20 MHz microcontroller requires a crystal
frequency of no more than 20 MHz. When the 8051 is connected to a crystal
oscillator and is powered up, we can observe the frequency on the XTAL2
pin using oscilloscope.
RST
Pin 9 is the reset pin. It is an input and is active high (normally low).
Upon applying a high pulse to this pin, the microcontroller will reset and
terminate all activities. This is often referred to as a power on reset.
Activating a power-on reset will cause all values in the registers to be lost.
Notice that the value of Program Counter is 0000 upon reset, forcing the
CPU to fetch the first code from ROM memory location 0000. This means
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 27
that we must place the first line of source code in ROM location 0000 that is
where the CPU wakes up and expects to find the first instruction. In order to
RESET input to be effective, it must have a minimum duration of 2 machine
cycles. In other words, the high pulse must be high for a minimum of 2
machine cycles before it is allowed to go low.
EA
All the 8051 family members come with on-chip ROM to store programs. In
such cases, the EA pin is connected to the Vcc. For family members such as
8031 and 8032 in which there is no on-chip ROM, code is stored on an
external ROM and is fetched by the 8031/32. Therefore for the 8031 the EA
pin must be connected to ground to indicate that the code is stored
externally. EA, which stands for external access, is pin number 31 in the
DIP packages. It is input pin and must be connected to either Vcc or GND.
In other words, it cannot be left unconnected.
PSEN
This is an output pin. PSEN stands for program store enable. It is
the read strobe to external program memory. When the microcontroller is
executing from external memory, PSEN is activated twice each machine
cycle.
ALE
ALE (Address latch enable) is an output pin and is active high. When
connecting a microcontroller to external memory, potr 0 provides both
address and data. In other words the microcontroller multiplexes address and
data through port 0 to save pins. The ALE pin is used for de-multiplexing
the address and data by connecting to the G pin of the 74LS373 chip.

Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 28
I/O port pins and their functions
The four ports P0, P1, P2, and P3 each use 8 pins, making them
8-bit ports. All the ports upon RESET are configured as output, ready to be
used as output ports. To use any of these as input port, it must be
programmed.
Port 0
Port 0 occupies a total of 8 pins (pins 32 to 39). It can be used
for input or output. To use the pins of port 0 as both input and output
ports, each pin must be connected externally to a 10K-ohm pull-up
resistor. This is due to fact that port 0 is an open drain, unlike P1, P2
and P3. With external pull-up resistors connected upon reset, port 0 is
configured as output port. In order to make port 0 an input, the port
must be programmed by writing 1 to all the bits of it. Port 0 is also
designated as AD0-AD7, allowing it to be used for both data and
address. When connecting a microcontroller to an external memory,
port 0 provides both address and data. The microcontroller
multiplexes address and data through port 0 to save pins. ALE
indicates if P0 has address or data. When ALE=0, it provides data D0-
D7, but when ALE=1 it has address A0-A7. Therefore, ALE is used
for de-multiplexing address and data with the help of latch 74LS373.
Port 1
Port 1 occupies a total of 8 pins (pins 1 to 8). It can be used as
input or output. In contrast to port 0, this port does not require pull-up
resistors since it has already pull-up resistors internally. Upon reset,
port 1 is configures as an output port. Similar to port 0, port 1 can be
used as an input port by writing 1 to all its bits.
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 29
Port 2
Port 2 occupies a total of 8 pins (pins 21 to 28). It can be used
as input or output. Just like P1, port 2 does not need any pull-up
resistors since it has pull-up resistors internally. Upon reset port 2 is
configured as output port. To make port 2 input, it must be
programmed as such by writing 1s to it.
Port 3
Port 3 occupies a total of 8 pins (pins 10 to 17). It can be used
as input or output. P3 does not need any pull-up resistors, the same as
P1 and P2 did not. Although port 3 is configured as output port upon
reset, this is not the way it is most commonly used. Port 3 has an
additional function of providing some extremely important signals
such as interrupts. Some of the alternate functions of P3 are listed
below:
P3.0 RXD (Serial input)
P3.1 TXD (Serial output)
P3.2 INT0 (External interrupt 0)
P3.3 INT1 (External interrupt 1)
P3.4 T0 (Timer 0 external input)
P3.5 T1 (Timer 1 external input)
P3.6 WR (External memory write strobe)
P3.7 RD (External memory read strobe)



Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 30
MODULE -2
LED INTERFACING

Like a normal diode, an LED consists of a chip of semiconducting material
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.
LEDs are usually built on an n-type substrate, with an electrode attached to
the p-type layer deposited on its surface. P-type substrates, while less
common, occur as well. Many commercial LEDs, especially GaN/InGaN,
also use sapphire substrate. Substrates that are transparent to the emitted
wavelength, and backed by a reflective layer, increase the LED efficiency.
The refractive index of the package material should match the index of the
semiconductor, otherwise the produced light gets partially reflected back
into the semiconductor, where it may be absorbed and turned into additional
heat, thus lowering the efficiency. This type of reflection also occurs at the
surface of the package if the LED is coupled to a medium with a different
refractive index such as a glass fiber or air. The refractive index of most
LED semiconductors is quite high, so in almost all cases the LED is coupled
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 31
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 dome-
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.
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 of the surface to
reduce the reflectance, either by introducing 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
gallium indium nitride (AlGaInN) near to far ultraviolet (down to
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 32
210 nm) With this wide variety of colors, arrays of multicolor LEDs can be
designed to produce unconventional color patterns.


CIRCUIT Diagram








D3
LED
C?
CAP NP
D7
LED
D4
LED
D5
LED
D8
LED
U?
AT89C52
9
18
19 29
30
31
1
2
3
4
5
6
7
8
21
22
23
24
25
26
27
28
10
11
12
13
14
15
16
17
39
38
37
36
35
34
33
32
RST
XTAL2
XTAL1 PSEN
ALE/PROG
EA/VPP
P1.0/T2
P1.1/T2-EX
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
P2.0/A8
P2.1/A9
P2.2/A10
P2.3/A11
P2.4/A12
P2.5/A13
P2.6/A14
P2.7/A15
P3.0/RXD
P3.1/TXD
P3.2/INTO
P3.3/INT1
P3.4/TO
P3.5/T1
P3.6/WR
P3.7/RD
P0.0/AD0
P0.1/AD1
P0.2/AD2
P0.3/AD3
P0.4/AD4
P0.5/AD5
P0.6/AD6
P0.7/AD7
D1
LED
R1
R
40
D2
LED
Y?
CRYSTAL
VCC
D6
LED
20
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 33
FOUR ON FOUR OFF PATTERN

#include<reg51.h> // This file contains the Ports and SFR
address of 8051
#include<delay.h> // This file is used to produce seconds and
milliseconds delay
#define led P1 // 'P1' is given the another name as led, u can use
'led' Or directly 'P1'
//for programming

void main() // main program starts from here
{
while (1) // Repeat forever
{
led=0xf0; // light on lower 4 leds '0'-> ON (11110000)
secdelay(1); // 1 secdelay
led=0x0f; // light on upper 4 leds '1'-> OFF (00001111)
secdelay (1);
}
}




Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 34
LEDS Programs
ON OFF PATTERN
#include<reg51.h> //This file contains the Ports and SFR address of
8051
#include<delay.h> //This file is used to produce seconds and
milliseconds delay
#define led P1 // 'P1' is given the another name as 'led' ,u can use
'led' Or directly 'P1'
//for programming

void main() // main program starts from here
{
while(1) // Infinite Loop for infinite rotation
{
led=0x00; // light on All 8-leds '0'-> ON
secdelay(1); // 1 secdelay
led=0xff; // light OFF All 8-leds '1'-> OFF
secdelay(1);
}
}



Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 35

LEDS +SWITCHES
#include<reg51.h> //This file contains the Ports and SFR address
of 8051
#include<delay.h> //This file is used to produce seconds and
miliseconds delay
#define led P1 // 'P1' is given the another name as 'led' ,u can use
'led' Or directly 'P1'
//for programming

sbit s1=P3^2; // define only single bit using sbit syntex
sbit s2=P3^3;
sbit s3=P3^4;


void main() // main program starts from here
{
led=0xff;
while(1) // Infinite Loop for infinite rotation
{
if(s1==0)
{
led=0x00;
secdelay(1);
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 36
led=0xff;
secdelay(1);
}
else if(s2==0)
{
led=0xf0;
secdelay(1);
led=0x0f;
secdelay(1);
}
else if(s3==0)
{
led=0xaa;
secdelay(1);
led=0x55;
secdelay(1);
}
else
{
led=0xff;
}
}
}
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 37

MODULE -3
DC MOTOR
Circuit Diagram


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
1 2
VCC
Y1
GROUND
10UF
U1
8051
31
19
18
9
12
13
14
15
1
2
3
4
5
6
7
8
39
38
37
36
35
34
33
32
21
22
23
24
25
26
27
28
17
16
29
30 11
10
40
20
EA/VP
X1
X2
RESET
INT0
INT1
T0
T1
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.6
P0.7
P2.0
P2.1
P2.2
P2.3
P2.4
P2.5
P2.6
P2.7
RD
WR
PSEN
ALE/P TXD
RXD
VCC
VSS
SW1
R
E
S
E
T

S
/
W
1
2
VCC
C2
1 2
S3
10K
S1
1 2
S2
MG2
MOTOR DC
1
2
U5
UL2003
1
2
3
4
5
6
7
8 9
10
11
12
13
14
15
16
IN1
IN2
IN3
IN4
IN5
IN6
IN7
GRD VCC
OUT7
OUT6
OUT5
OUT4
OUT3
OUT2
OUT1
DEVICE
K1
RELAY SPDT
3
5
4
1
2
C3
C
R2
RESISTOR SIP 10
1 2
3
4
5
6
7
8
9
10
33PF
CRYSTAL 33PF
VCC
C1
R1
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 38
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 :
B1=B1
max
. sin(wt)
B2=B2
max
. sin(wt + )
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:
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 39

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.

Types of D.C. motor:
(i) Permanent magnet motors: It consists of an armature and one or
several permanent magnets encircling the armature . Field coils are
usually notrequired. However some of these motors do have coils
wound on the poles .
If they exist , these coils are intended only for recharging the
magnets in the event that they loose their strength.

(ii) Seperately excited D.C. motors: These motors have field coils
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 40
similar to those of a shunt wound machine, but the armature and
field coils are fed from diferent supply sources and may have
different voltage ratings.
(iii) Series wound D.C. motor: As the name indicates, the field
coils,
consisting of few turns of a thick wire are connected in series with
the armature. The cross-sectional area of the wire used for the field
has to be fairly large to carry the armature current ,but owing to the
higher current , the number of turns of wire in them need not be
large.
(iv) Shunt wound D.C. motor: These motors are so named because
they basically operate with field coils connected in parallel with
the armature. The field winding consists of a large number of turns
of comparatively fine wire so as to provide large resistance. The
field current is much less than the armature current, sometimes as
low as 5%.
(v) Compound wound D.C. motor : A compound wound D.C.
motor has both shunt and series field coils. The shunt field is
normally stronger of the two. Compound wound motors are of two
types:.
(a) Cumalative compound wound motor.
(b) Differential compound wound motor.







Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 41
DC MOTOR PROGRAMS
Program for PWM
#include<reg51.h>
#include<delay.h>
sbit dc motor=P0^5; // define the motor using sbit as dc_motor
#define ON 1
#define OFF 0

void PWM(unsigned char Ton)
{
dc_motor=ON; // switch on the Dc motor for Ton
millisecond
ms_delay(Ton);
dc_motor=OFF; // switch oFF the Dc motor for (100-Ton)
millisecond
ms_delay(100-Ton);
}
void main()
{
while(1)
{
PWM(50);
}
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 42
}
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; // switch on the Dc motor
secdelay(3);
dc_motor=OFF; // switch OFF the Dc motor
secdelay(2);
}

}






Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 43
MODULE -4
RELAY
THE ELECTROMAGNETIC solenoid valve


Figure no 2.15: Electromagnetic Solenoid Valve

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 becomes
temporarily 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
source. 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.

Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 44

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 the
microcontroller 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
cc
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
cc
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.



Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 45
Circuit diagram









1 2
VCC
Y1
GROUND
10UF
U1
8051
31
19
18
9
12
13
14
15
1
2
3
4
5
6
7
8
39
38
37
36
35
34
33
32
21
22
23
24
25
26
27
28
17
16
29
30 11
10
40
20
EA/VP
X1
X2
RESET
INT0
INT1
T0
T1
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.6
P0.7
P2.0
P2.1
P2.2
P2.3
P2.4
P2.5
P2.6
P2.7
RD
WR
PSEN
ALE/P TXD
RXD
VCC
VSS
SW1
R
E
S
E
T

S
/
W
1
2
VCC
C2
1 2
S3
10K
S1
1 2
S2
MG2
MOTOR DC
1
2
U5
UL2003
1
2
3
4
5
6
7
8 9
10
11
12
13
14
15
16
IN1
IN2
IN3
IN4
IN5
IN6
IN7
GRD VCC
OUT7
OUT6
OUT5
OUT4
OUT3
OUT2
OUT1
DEVICE
K1
RELAY SPDT
3
5
4
1
2
C3
C
R2
RESISTOR SIP 10
1 2
3
4
5
6
7
8
9
10
33PF
CRYSTAL 33PF
VCC
C1
R1
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 46
SIMPLE RELAY CONTROL
#include<reg51.h>
#include<delay.h>
sbit dev=P0^6; // define the 220v device using sbit as dev
#define ON 1
#define OFF 0

void main()
{
while(1)
{
dev=ON;
secdelay(5);
dev=OFF;
secdelay(3);
}

}







Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 47
RELAY CONTROL WITH TIME
#include<reg51.h>
#include<delay.h>
#define seg_port P2 // define segment port
sbit s1=P3^2; // define the switches using sbit as s1,s2,s3
sbit s2=P3^3;
sbit s3=P3^4;
sbit dev=P0^6;
#define delay 60
#define ON 1
#define OFF 0
// 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 maxlen=0;
while(1)
{
seg_port=seg_array[maxlen]; // show '0' on 7 segment

while(s3!=0) // while u not pressed switch s3
the statement in this
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 48
{ //while loop
will execute
if(s1==0) // if u press s1
{
maxlen++; // then increment value of
maxlen by one
if(maxlen>9) // if maxlen is > 9 then store
'0' in maxlen
maxlen=0; //Note: The above step is
necessary because we can't
// show 2 digit value (ie. 10,11 etc
) on single 7 segment

ms_delay(223); // some delay for key
debouncing
}
else if(s2==0) // if u press s2
{
maxlen--; // then decrement maxlen by
one
if(maxlen==255) // if maxlen is equal to 255
then store '9' in maxlen
maxlen=9; // note :if u decrement an
unsigned char type variable
//when its value go below '0' the new
value 255 is stored in it
// so thats why the above step is
necessary
ms_delay(223);
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 49
}
secdelay(1);
seg_port=seg_array[maxlen]; // send corresponding
data vale from array
// to segment port
}
secdelay(1);
while(maxlen<10)
{
seg_port=seg_array[maxlen];
secdelay(2);
maxlen++;
}
dev=ON;
secdelay(delay);
dev=OFF;
}}





Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 50
MODULE -5
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 Brush,
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 [39].
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 [40].




Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 51
3.12.1Open 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
[39].
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

Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 52


Fig 3.20: 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
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 53
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.

Fig 3.21: Stator Windings Configuration
Step Winding A Winding B Winding C Winding D
1 0 1 1 1
2 1 0 1 1
3 1 1 0 1
4 1 1 1 0

Table 3.6: Input Sequence to the Windings

3.12.2 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].
Winding D
Winding B
1
2
3
456
Winding D Winding C
Winding A
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 54
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.











Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 55
Circuit diagram








R1
VCC
10K
Y1
33PF
VCC
S1
1 2
1 2
C1
U1
8051
31
19
18
9
12
13
14
15
1
2
3
4
5
6
7
8
39
38
37
36
35
34
33
32
21
22
23
24
25
26
27
28
17
16
29
30 11
10
40
20
EA/VP
X1
X2
RESET
INT0
INT1
T0
T1
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.6
P0.7
P2.0
P2.1
P2.2
P2.3
P2.4
P2.5
P2.6
P2.7
RD
WR
PSEN
ALE/P TXD
RXD
VCC
VSS
CRYSTAL
S2
C2
VCC
33PF
MG1
MOTOR STEPPER
1
2
3
456
1 2
C3
10UF
GROUND
S3
U5
UL2003
1
2
3
4
5
6
7
8 9
10
11
12
13
14
15
16
IN1
IN2
IN3
IN4
IN5
IN6
IN7
GRD VCC
OUT7
OUT6
OUT5
OUT4
OUT3
OUT2
OUT1
C
R2
RESISTOR SIP 10
1 2
3
4
5
6
7
8
9
10
SW1
R
E
S
E
T

S
/
W
1
2
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 56
DIRECTION CONTROL
#include<reg51.h>
#include<delay.h>
sbit m1=P0^0; // define the four windigs of stepper motor using sbit
as m1,m2,m3,m4 sbit m2=P0^1;
sbit m3=P0^2;
sbit m4=P0^3;
void mov_clk()
{
m1=1;m2=0;m3=0;m4=0; //give high pulse to m1 motor
moves one step angle in
// clockwise
ms_delay(200);
m1=0;m2=1;m3=0;m4=0; //give high pulse to m2 motor
moves two step angle in
// clockwise
ms_delay(200);
m1=0;m2=0;m3=1;m4=0; //give high pulse to m3 motor
moves three step angle in
// clockwise
ms_delay(200);
m1=0;m2=0;m3=0;m4=1; //give high pulse to m4 motor
moves four step angle in // clockwise
ms_delay(200);
}
void mov_anticlk()
{
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 57
m1=0;m2=0;m3=0;m4=1; //give high pulse to m4 motor
moves one step angle in
// anti clockwise
ms_delay(200);
m1=0;m2=0;m3=1;m4=0;
ms_delay(200);
m1=0;m2=1;m3=0;m4=0;
ms_delay(200);
m1=1;m2=0;m3=0;m4=0;
ms_delay(200);
}
void motor_stop()
{
m1=0;m2=0;m3=0;m4=0;
}
void main()
{
while(1)
{
mov_clk(); // motor moves in clock wise
direction
motor_stop(); // motor stops
secdelay(2);
mov_anticlk(); // motor moves in anticlock wise
direction
motor_stop(); // motor stops
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 58
secdelay(2);
}
}

DIRECTION CONTROL +SWITCHES
#include<reg51.h>
#include<delay.h>
sbit m1=P0^0; //define the four windigs of stepper motor using
sbit as m1,m2,m3,m4
sbit m2=P0^1;
sbit m3=P0^2;
sbit m4=P0^3;
sbit s1=P3^2; //define the switches using sbit as s1,s2,s3
sbit s2=P3^3;
sbit s3=P3^4;
void mov_clk()
{
m1=1;m2=0;m3=0;m4=0; //give high pulse to m1 motor
moves one step angle in
// clockwise
ms_delay(200);
m1=0;m2=1;m3=0;m4=0; //give high pulse to m2 motor
moves two step angle in
// clockwise
ms_delay(200);
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 59
m1=0;m2=0;m3=1;m4=0; //give high pulse to m3 motor
moves three step angle in //clockwise
ms_delay(200);
m1=0;m2=0;m3=0;m4=1; //give high pulse to m4 motor
moves four step angle in
// clockwise
ms_delay(200);
}
void mov_anticlk()
{
m1=0;m2=0;m3=0;m4=1; //give high pulse to m4 motor
moves one step angle in
//anti clockwise

ms_delay(200);
m1=0;m2=0;m3=1;m4=0;
ms_delay(200);
m1=0;m2=1;m3=0;m4=0;
ms_delay(200);
m1=1;m2=0;m3=0;m4=0;
ms_delay(200);
}
void motor_stop()
{
m1=0;m2=0;m3=0;m4=0;
}
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 60
void main()
{
while(1)
{
if(s1==0)
{
mov_clk(); // motor moves in clock wise
direction
}
else if(s2==0)
{
mov_anticlk(); // motor moves in anticlock
wise direction
}
else if(s3==0)
{
mov_clk(); // motor moves in clock wise
direction
secdelay(1);
mov_anticlk(); // motor moves in anticlock
wise direction
secdelay(1);
}
else
{
motor_stop(); }}} // motor stops
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 61
MODULE -6
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.
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 62
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).









Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 63
Circuit diagram









VCC
U2
7-segment
54321
1
0
9 8 7 6
g
f
v
c
cab
h c v
c
c
d e
10UF
LED3
SW1
R
E
S
E
T

S
/
W
1
2
1 2
LED7
LED4
C2
LED2
10K
1 2
U1
8051
31
19
18
9
12
13
14
15
1
2
3
4
5
6
7
8
39
38
37
36
35
34
33
32
21
22
23
24
25
26
27
28
17
16
29
30 11
10
40
20
EA/VP
X1
X2
RESET
INT0
INT1
T0
T1
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.6
P0.7
P2.0
P2.1
P2.2
P2.3
P2.4
P2.5
P2.6
P2.7
RD
WR
PSEN
ALE/P TXD
RXD
VCC
VSS
S1
1 2
VCC
GROUND
CRYSTAL 33PF
LED1
33PF
Y1
R2
470 E
S2
LED5
S3
VCC(5V)
C3
LED8
R1
C1
LED6
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 64
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);
}
}
}


Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 65
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]; // send the corresponding value
of digit fom array to // port
secdelay(1);
}
}
}

Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 66
UP AND DOWN WITH SWITCH
#include<reg51.h>
#include<delay.h>
#define seg_port P2
sbit s1=P3^2; //define the switches using sbit as s1,s2,s3
sbit s2=P3^3;
sbit s3=P3^4;
// 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 maxlen=0,flag;
flag=0;
seg_port=seg_array[maxlen]; // show '0' on 7 segment
while(1)
{
while(s3!=0) // while u not pressed switch s3 the
statement in this
{ //while loop will
execute
if(s1==0) // if u press s1
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 67
{
maxlen++; // then increment value of maxlen by one
if(maxlen>9) // if maxlen is > 9 then store '0' in maxlen
maxlen=0; // Note: The above step is necessary because we
can't show two digit
// value (ie. 10,11 etc
) on single 7 segment
flag=0; // reset flag ie flag=0
ms_delay(223); // some delay for key
debouncing
}
else if(s2==0) // if u press s2
{
maxlen--; // then decrement maxlen by
one
if(maxlen<0) // if maxlen is equal to 255
then store '9' in maxlen
maxlen=9;
flag=1; // set flag ie flag=1;
ms_delay(223);
}
secdelay(1);
seg_port=seg_array[maxlen]; // send corresponding
data vale from array
// to segment port
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 68
}
secdelay(1);
if(flag==0) // if flag is reset (ie flag=0)
then increment value
{
while(maxlen<10)
{
seg_port=seg_array[maxlen];
secdelay(2);
maxlen++;
}
maxlen=9;flag=1;
}
else // if flag is set(ie flag=1) then
decrement value
{
while(maxlen>=0)
{
seg_port=seg_array[maxlen];
secdelay(2);
maxlen--;
} maxlen=0;flag=0;
}} }
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 69
MODULE 7
LCD
Liquid Crystal Display

3.2.12.1 LCD 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.


Fig 3.21 LCD Pin Description Diagram

V
CC
, V
SS
, V
EE

Vcc
16
15
14
13
12
11
10
9
8
6
5
4
3
2
1
7
16
15
14
13
12
11
10
9
8
6
5
4
3
2
1
7
D7
E
Vcc
D4
Contrast
RS
Gnd
R/W
Gnd
D0
D3
D6
D5
1
3
2
D2
D1
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 70
The voltage V
CC
and V
SS
provided by +5V and ground respectively while V
EE
is used for
controlling 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.


CODES COMMAND TO LCD INSTRUCTION

Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 71
(HEX) Register

1 Clear display screen
2 Return home
4 Decrement cursor(shift cursor to left)
6 Increment cursor(shift cursor to right)
5 Shift display right
7 Shift display left
8 Display off, cursor off

A Display off, cursor on
C Display on, cursor off

E Display on, cursor blinking
F Display on, cursor blinking
10 Shift cursor position to left
14 Shift cursor position to right

18 Shift the entire display to the left
1C Shift the entire display to the right
80 Force cursor to beginning of 1st line
C0 Force cursor to beginning of 2nd line
38 2 line and 5x 7 matrix







LCD pin description
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 72




Pin Symbol I/O Description
1 VSS - Ground
2 VCC - +5V power supply
3 VEE - Power supply to control contrast
4 RS I RS=0 to select command register, RS=1 to select data register.
5 R/W I R/W=0 for write, R/W=1 for read
6 E I/O Enable
7 PB0 I/O The 8 bit data bus
8 PB1 I/O The 8 bit data bus
9 DB2 I/O The 8 bit data bus
10 DB3 I/O The 8 bit data bus
11 DB4 I/O The 8 bit data bus
12 DB5 I/O The 8 bit data bus
13 DB6 I/O The 8 bit data bus
14 DB7 I/O The 8 bit data bus
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 73
Circuit diagram




























Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 74
LCD FUNCTION
#include<reg51.h>
#include<delay.h>
#define DATA P1 // define DATA and Control Pins of LCD
sbit RS=P3^5;
sbit RW=P3^6;
sbit E=P3^7;

void lcd_cmd(unsigned char datax) // function to write command at
lcd port
{
ms_delay(20);
DATA=datax;
RS=0; //clear RS (ie. RS=0) to write command
RW=0; // write operation
E=1; // send H-L pulse at E pin
ms_delay(5);
E=0;
}

void lcd_data (unsigned char datax) // function to write data at lcd
port
{
ms_delay(20);
DATA=datax;
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 75
RS=1; // set RS=1 to write DATA
RW=0; // write operation
E=1; // send H-L pulse at E pin

ms_delay (5);
E=0;
}

void lcd_init() // function to initialize the LCD at
power on time
{
lcd_cmd(0x38); // 2x16 display select
ms_delay(3);
lcd_cmd (0x38); // 2x16 display select
ms_delay(3);
lcd_cmd (0x0c); // display on cursor off command
ms_delay(3);
lcd_cmd (0x06); // automatic cursor movement to
right
ms_delay(3);
lcd_cmd (0x01); // lcd clear command
ms_delay(3);
lcd_cmd (0x80); // first row first coloumn select
command
ms_delay(3);
}
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 76

void lcd_puts(unsigned char *str) // function to display string to lcd
{
while(*str!='\0')
{
lcd_data(*str);
str++;
}
}

void displaypval(unsigned int datax) // function to display 3 digit
decimal value to lcd
{
unsigned int temp,temparr[3];
for(temp=3;temp>0;temp--)
{
temparr[temp-1]=datax%10;
datax=datax/10;
}
for(temp=0;temp<3;temp++)
{
lcd_data(temparr[temp]+48);
}
}
void main()
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 77
{
lcd_init();
while(1)
{
lcd_cmd(0x80);
lcd_puts("Value");
lcd_cmd(0xc0);
displaypval(123);
}

}














Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


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


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 79
RW=0; // write operation
E=1; // send H-L pulse at E pin
ms_delay (5);
E=0;
}

void lcd_init() // function to initialize the
lcd at power on time
{
lcd_cmd(0x38); // 2x16 display select
ms_delay(3);
lcd_cmd (0x38); // 2x16 display select
ms_delay(3);
lcd_cmd (0x0c); // display on cursor off
command
ms_delay(3);
lcd_cmd (0x06); // automatic cursor movement to
right
ms_delay(3);
lcd_cmd (0x01); // lcd clear command
ms_delay(3);
lcd_cmd (0x80); // first row first coloumn select
command
ms_delay(3);
}
void main()
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 80
{
lcd_init();
while(1)
{
lcd_cmd(0x80); // send address of 1st row ,1st col (0x80) as a
command to lcd
lcd_data('H'); // send data ('H') to lcd
lcd_data('E'); // send data ('E') to lcd
lcd_data('L'); // send data ('L') to lcd
lcd_data('L'); // send data ('L') to lcd
lcd_data('O'); // send data ('O') to lcd
}
}












Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


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

ms_delay(5);
E=0;
}

void lcd_data (unsigned char datax) // function to write data at
lcd port
{
ms_delay(20);
DATA=datax;
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 82
RS=1; // set RS=1 to write DATA
RW=0; // write operation
E=1; //send H-L pulse at E pin
ms_delay (5);
E=0;
}

void lcd_init() // function to initialize the LCD at
power on time
{
lcd_cmd(0x38); // 2x16 display select
ms_delay(3);
lcd_cmd (0x38); // 2x16 display select
ms_delay(3);
lcd_cmd (0x0c); // display on cursor off command
ms_delay(3);
lcd_cmd (0x06); // automatic cursor movement to
right
ms_delay(3);
lcd_cmd (0x01); // lcd clear command
ms_delay(3);
lcd_cmd (0x80); // first row first coloumn select
command
ms_delay(3);
}
void main()
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 83
{
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); // wait for one second
start_loc++; // increment start location

if(start_loc==0x90) // if the cursor is at 17th
location
start_loc=0xc0; // change the location to 0xc0
(2nd row 1st column)

if(start_loc==0xd0) // if the cursor is at 33rd
location then
{
lcd_cmd(0x01); //clear lcd and
start_loc=0x80; // change the location to 0x80
(1st row 1st column)
}
}
} }
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 84
A Z DISPLAY
#include<reg51.h>
#include<delay.h>
#define DATA P1 // define DATA and Control Pins of LCD
sbit RS=P3^5;
sbit RW=P3^6;
sbit E=P3^7;

void lcd_cmd(unsigned char datax) // function to write command at
lcd port
{
ms_delay(20);
DATA=datax;
RS=0; //clear RS (ie. RS=0) to write command
RW=0; // write operation
E=1; //send H-L pulse at E pin
ms_delay(5);
E=0;
}
void lcd_data (unsigned char datax) // function to write data at
lcd port
{
ms_delay(20);
DATA=datax;
RS=1; // set RS=1 to write DATA
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 85
RW=0; // write operation
E=1; // send H-L pulse at E pin

ms_delay (5);
E=0;
}

void lcd_init() // function to initialize the lcd
at power on time
{
lcd_cmd(0x38); // 2x16 display select
ms_delay(3);
lcd_cmd (0x38); // 2x16 display select
ms_delay(3);
lcd_cmd (0x0c); // display on cursor off
command
ms_delay(3);
lcd_cmd (0x06); // automatic cursor movement to
right
ms_delay(3);
lcd_cmd (0x01); // lcd clear command
ms_delay(3);
lcd_cmd (0x80); // first row first column select
command
ms_delay(3);
}
void main()
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 86
{
unsigned char start_loc=0x80,count,ch;
lcd_init();
while(1)
{
ch=65; // ASCII value of 'A' is 65 (u can
also write ch='A')
for(count=0;count<26;count++) // loop to count from 0 to 26 as
A-Z total 26 character
{
lcd_cmd(start_loc); // set start location as 0x80
lcd_data(ch+count); // add to the count to convert
it to ASCII value
secdelay(1); // wait for one second
start_loc++; // increment start location

if(start_loc==0x90) // if the cursior is at 17th
location
start_loc=0xc0; // change the location to 0xc0
(2nd row 1st column)

if(start_loc==0xd0) // if the cursor is at 33rd
location then
{
lcd_cmd(0x01); //clear lcd and
start_loc=0x80; }}}}
// change the location to 0x80 (1st row 1st column)
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 87
SOLDERING COMPONENTS INTO THE PCB
Bend the component leads at right angles with both bends at the same
distance apart as the PCB pad holes.
Ensure that both component leads and the copper PCB pads are clean
and free of oxidization.
Insert component leads into holes and bend leads at about 30 degrees
from vertical.
Using small angle cutters, cut the leads at about 0.1 - 0.2 of an inch
(about 2 - 4 mm) above copper pad.
Bring tinned soldering iron tip into contact with both the component
lead and the PCB pad. This ensures that both surfaces undergo the
same temperature rise.
Bring resin cored solder in contact with the lead and the copper
pad. Feed just enough solder to flow freely over the pad and the lead
without a blobbing effect. The final solder joint should be shiny and
concave indicating good wetting of both the copper pad and the
component lead. If a crack appears at the solder to metal interface
then the potential for forming a dry joint exists. If an unsatisfactory
joint is formed, suck all the solder off the joint using a solder sucker
or solder wick (braid) and start again.



Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 88
PRECAUTIONS
1. Mount the components at the approp places before soldering.
Follow the circuit discription and components details, leads
identification etc. Do not start soldering before making it confirm
that all the components are mounted at the right place.
2. Do not use a spread solder on the board, it may cause short circuit.
3. Do not sit under the fan while soldering.
4. Position the board so that gravity tends to keep the solder where
you want it.
5. Do not over heat the components at the board. Excess heat may
damage the components or board.
6. The board should not vibrate while soldering otherwise you have a
dry or a cold joint.
7. Do not put the kit under or over voltage source. Be sire about the
voltage either is d.c. or a.c. while operating the gadget.
8. Do spare the bare ends of the components leads otherwise it may
short circuit with the other components. To prevent this use sleeves
at the component leads or use sleeved wire for connections.
9. Do not use old dark colour solder. It may give dry joint. Be sure
that all the joints are clean and well shiny.
10. Do make loose wire connections specially with cell holder,
speaker, probes etc. Put knots while connections to the circuit
board, otherwise it may get loose.

Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 89






















Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 90



OTHER
ELECTRONICS
COMPONENTS
USED





Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g i e s ( E E A S T )
A T r a i n i n g U n i t o f E u r e k a E l e c t r o s o f t S o l u t i o n s P v t . L t d .


Page 91
RESISTOR
A resistor is an electrical component that limits or regulates the flow of
electrical current in an electronic circuit. Resistors can also be used to
provide a specific voltage for an active device such as a transistor.
All other factors being equal, in a direct-current (DC) circuit, the current
through a resistor is inversely proportional to its resistance, and directly
proportional to the voltage across it. This is the well-known Ohm's Law. In
alternating-current (AC) circuits, this rule also applies as long as the resistor
does not contain inductance or capacitance.
Resistors can be fabricated in a variety of ways. The most common type in
electronic devices and systems is the carbon-composition resistor. Fine
granulated carbon (graphite) is mixed with clay and hardened. The resistance
depends on the proportion of carbon to clay; the higher this ratio, the lower
the resistance.
Another type of resistor is made from winding Nichrome or similar wire on
an insulating form. This component, called a wirewound resistor, is able to
handle higher currents than a carbon-composition resistor of the same
physical size. However, because the wire is wound into a coil, the
component acts as an inductors as well as exhibiting resistance. This does
not affect performance in DC circuits, but can have an adverse effect in AC
circuits because inductance renders the device sensitive to changes in output.
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 92














Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 93
RESISTOR COLOUR CODE








Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 94

CAPACITOR
A capacitor is a tool consisting of two conductive plates, each of which hosts an
opposite charge. These plates are separated by a dielectric or other form of
insulator, which helps them maintain an electric charge. There are several types of
insulators used in capacitors. Examples include ceramic, polyester, tantalum air,
and polystyrene. Other common capacitor insulators include air, paper, and plastic.
Each effectively prevents the plates from touching each other.
A capacitor is often used to store analogue signals and digital data. Another type of
capacitor is used in the telecommunications equipment industry. This type of
capacitor is able to adjust the frequency and tuning of telecommunications
equipment and is often referred to a variable capacitor. A capacitor is also ideal
for storing an electron. A capacitor cannot, however, make electrons.
SYMBOL


SYMBOL OF ELECTROLYTIC CAPACITOR

A capacitor measures in voltage, which differs on each of the two interior plates.
Both plates of the capacitor are charged, but the current flows in opposite
directions. A capacitor contains 1.5 volts, which is the same voltage found in a
common AA battery. As voltage is used in a capacitor, one of the two plates
becomes filled with a steady flow of current. At the same time, the current flows
away from the other plate.
To understand the flow of voltage in a capacitor, it is helpful to look at naturally
occurring examples. Lightning, for example, is similar to a capacitor. The cloud
represents one of the plates and the ground represents the other. The lightning is
the charging factor moving between the ground and the cloud.
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 95


IMAGE OF ELECTROLYTIC CAPACITOR


UNPOLARISED CAPACITORS
A non-polarized ("non polar") capacitor is a type of capacitor that has no implicit
polarity -- it can be connected either way in a circuit. Ceramic, mica and some
electrolytic capacitors are non-polarized. You'll also sometimes hear people call
them "bipolar" capacitors.

SYMBOL OF NON POLARITY CAPACITOR
TRANSISTORS
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 96
A Transistor is an semiconductor which is a fundamental component in almost
all electronic devices. Transistors are often said to be the most significant invention
of the 20th Century. Transistors have many uses including switching,
voltage/current regulation, and amplification - all of which are useful in renewable
energy applications.

A transistor controls a large electrical output signal with changes to a small input
signal. This is analogous to the small amount of effort required to open a tap
(faucet) to release a large flow of water. Since a large amount of current can be
controlled by a small amount of current, a transistor acts as an amplifier.

A transistor acts as a switch which can open and close many times per second.
Bipolar Junction Transistors

The most common type of transistor is a bipolar junction transistor. This is made
up of three layers of a semi-conductor material in a sandwich. In one configuration
the outer two layers have extra electrons, and the middle layer has electrons
missing (holes). In the other configuration the two outer layers have the holes and
the middle layer has the extra electrons.

SYMBOL OF NPN & PNP TRANSISTOR
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 97

Layers with extra electrons are called N-Type, those with electrons missing called
P-Type. Therefore the bipolar junction transistors are more commonly known as
PNP transistors and NPN transistors respectively.

Bipolar junction transistors are typically made of silicon and so they are very
cheap to produce and purchase.
How do Transistors Work





A bipolar junction transistor has three terminals - Base, Collector, and Emitter
corresponding to the three semi-conductor layers of the transistor. The weak input
current is applied to the inner (base) layer. When there is a small change in the
current or voltage at the inner semiconductor layer (base), a rapid and far larger
change in current takes place throughout the whole transistor.

Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 98


Pictured above is a schematic diagram of the more common NPN transistor.
Below is an illustration of the same transistor using water rather than electricity to
illustrate the way it functions:


The illustration shows pipe work with three openings B (Base), C (Collector), and
E (Emitter). The reservoir of water at C is the supply voltage which is prevented
from getting though to E by a plunger. If water is poured into B, it pushes up the
plunger letting lots of water flow from C to E. If even more water is poured into B,
the plunger moves higher, and the flow of water from C to E increases.

Therefore, a small input current of electricity to the Base leads to a large flow of
electricity from the Collector to the Emitter.
Transistor Gain
Looking at the water analogy again, if it takes 1 litre of water per minute poured
into B to control 100 litres of water per minute flowing from C to E, then the Gain
(or amplification factor) is 100. A real transistor with a gain of 100 can control
100mA of current from C to E with an input current of just 1mA to the base (B).
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 99

If the output power (current x voltage) are more than 1 Watt a Power Transistor
must be used. These let much more power flow through, and require a larger
controlling input current.



LDR

A Light Dependent Resistor (aka LDR, photoconductor, or photocell) is a device
which has a resistance which varies according to the amount of light falling on its
surface.




A typical light dependent resistor is pictured above together with (on the right hand
side) its circuit diagram symbol. Different LDR's have different specifications,
however the LDR's we sell in the REUK Shop are fairly standard and have a
resistance in total darkness of 1 MOhm, and a resistance of a couple of kOhm in
bright light (10-20kOhm @ 10 lux, 2-4kOhm @ 100 lux).
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 100
Uses for Light Dependent Resistors

Light dependent resistors are a vital component in any electric circuit which is to
be turned on and off automatically according to the level of ambient light - for
example, solar powered garden lights, and night security lighting.
An LDR can even be used in a simple remote control circuit using the backlight
of a mobile phone to turn on a device - call the mobile from anywhere in the
world, it lights up the LDR, and lighting (or a garden sprinkler) can be turned on
remotely!
DIODES

A diode is the simplest sort of semiconductor device. Broadly speaking, a
semiconductor is a material with a varying ability to conduct electrical current.
Most semiconductors are made of a poor conductor that has had impurities (atoms
of another material) added to it. The process of adding impurities is called doping.

SYMBOL OF DIODE


Circuit Symbol

Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 101


IMAGE OF DIODES

In the case of LEDs, the conductor material is typically aluminum-gallium-
arsenide (AlGaAs). In pure aluminum-gallium-arsenide, all of the atoms bond
perfectly to their neighbors, leaving no free electrons (negatively-charged
particles) to conduct electric current. In doped material, additional atoms change
the balance, either adding free electrons or creating holes where electrons can go.
Either of these additions make the material more conductive.
A semiconductor with extra electrons is called N-type material, since it has extra
negatively-charged particles. In N-type material, free electrons move from a
negatively-charged area to a positively charged area.
A semiconductor with extra holes is called P-type material, since it effectively has
extra positively-charged particles. Electrons can jump from hole to hole, moving
from a negatively-charged area to a positively-charged area. As a result, the holes
themselves appear to move from a positively-charged area to a negatively-charged
area.
A diode comprises a section of N-type material bonded to a section of P-type
material, with electrodes on each end. This arrangement conducts electricity in
only one direction. When no voltage is applied to the diode, electrons from the N-
type material fill holes from the P-type material along the junction between the
layers, forming a depletion zone. In a depletion zone, the semiconductor material
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 102
is returned to its original insulating state -- all of the holes are filled, so there are
no free electrons or empty spaces for electrons, and charge can't flow.



At the junction, free electrons from the N-type material fill holes
from the P-type material. This creates an insulating layer in the
middle of the diode called the depletion zone.



To get rid of the depletion zone, you have to get electrons moving from the N-type
area to the P-type area and holes moving in the reverse direction. To do this, you
connect the N-type side of the diode to the negative end of a circuit and the P-type
side to the positive end. The free electrons in the N-type material are repelled by
the negative electrode and drawn to the positive electrode. The holes in the P-type
material move the other way. When the voltage difference between the electrodes
is high enough, the electrons in the depletion zone are boosted out of their holes
and begin moving freely again. The depletion zone disappears, and charge moves
across the diode.


Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 103

When the negative end of the circuit is hooked up to the N-type layer and
the positive end is hooked up to P-type layer, electrons and holes start
moving and the depletion zone disappears.


If you try to run current the other way, with the P-type side connected to the
negative end of the circuit and the N-type side connected to the positive end,
current will not flow. The negative electrons in the N-type material are attracted to
the positive electrode. The positive holes in the P-type material are attracted to the
negative electrode. No current flows across the junction because the holes and the
electrons are each moving in the wrong direction. The depletion zone increases.
(See How Semiconductors Work for more information on the entire process.)
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 104

When the positive end of the circuit is hooked up to the N-type layer
and the negative end is hooked up to the P-type layer, free electrons
collect on one end of the diode and holes collect on the other. The
depletion zone gets bigger.

DIODES CHARACTERISTICS


Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 105
LED
A light-emitting diode (LED) is a semiconductor device that emits visible light
when an electric current passes through it. The light is not particularly bright, but
in most LEDs it is monochromatic, occurring at a single wavelength. The output
from an LED can range from red (at a wavelength of approximately 700
nanometers) to blue-violet (about 400 nanometers). Some LEDs emit infrared (IR)
energy (830 nanometers or longer); such a device is known as an infrared-emitting
diode (IRED).
An LED or IRED consists of two elements of processed material called P-type
semiconductors and N-type semiconductors. These two elements are placed in
direct contact, forming a region called the P-N junction. In this respect, the LED or
IRED resembles most other diode types, but there are important differences. The
LED or IRED has a transparent package, allowing visible or IR energy to pass
through. Also, the LED or IRED has a large PN-junction area whose shape is
tailored to the application.
SYMBOL OF LED

Circuit Symbol
Benefits of LEDs
Low power requirement: Most types can be operated with battery power
supplies.
High efficiency: Most of the power supplied to an LED or IRED is
converted into radiation in the desired form, with minimal heat production.
Long life: When properly installed, an LED or IRED can function for
decades.


Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 106
Typical Applications
Indicator lights: These can be two-state (i.e., on/off), bar-graph, or
alphabetic-numeric readouts.
LCD panel backlighting: Specialized white LEDs are used in flat-panel
computer displays.
Fiber optic data transmission: Ease of modulation allows wide
communications bandwidth with minimal noise, resulting in high speed and
accuracy.
Remote control: Most home-entertainment "remotes" use IREDs to
transmit data to the main unit.
optoisolator: Stages in an electronic system can be connected together
without unwanted interaction.


IMAGE OF DIFFERENT LEDS



Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 107
Project Modules
Detailed Cost
Modules Component Quantity Cost

Power Supply
Transformer 1A 1 100

Transformer 500
mA 1 50
Power Cord 1 20
Diodes 4 8
LM7805 1 13
Capacitor 1000 uF 1 8
led 1 1
Resistance 470 ohm 1 0.25
MCU Module
40 Pin Base 1 7
MCU 1 70
Crystal 11.0592 1 9
Capacitor 22uF 1 6
Resistance 10 Kohm 1 0.25
Capacitor 33 pf 2 4
SIP 1 9
Push Button 1 3
LED Job 0
leds 8 8
Resisance 470 ohm 1 0.25
Switches 0
Push Button 3 9
Seven Segment Job 0
Seven Segment 1 17
Resistance 470 ohm 1 0.25
Base 28 Pin 1 6
DC Motor, Stepper
Motor,Relay 0
ULN 2003 1 49
DC Motor 1 55
Stepper Motor 1 150
Base 16 Pin 1 4
Relay 1 25
Eureka Electrosoft Solutions Pvt. Ltd.


E u r e k a E m b e d d e d & A d v a n c e d S o f t w a r e T e c h n o l o g y ( E E A S T )

Page 108
lamp Holder 1 10
lamp 1 0
LCD 0
LCD 1 150
16 Pin Connector 0

You might also like