Sie sind auf Seite 1von 96

2019

PROJECT/TRAINI
NG
REPORT

ON EMBEDDED

SYSTEM

POOJA
ROLL NO: 16257551
SSIET,JALANDHAR
A PROJECT REPORT
On
EMBEDDED SYSTEM

Submitted in partial fulfilment of the requirement for the


award of the degree of
Bachelor of Technology
In
Electronics & Communication Engineering course of

St. Soldier Institutes Of Technology & Engineering,


Jalandhar, Punjab
(Affiliated to Punjab Technical University, Jalandhar)
SESSION (2016-2019)

At
INFOWIZ
Chandigarh

ER. Neeraj Sharma Name: POOJA


(HOD of ECE) Roll No: 1625755
BTECH ECE 7TH SEM

2
ACKNOWLEDGEMENT

I wish to express my sincere gratitude to Mr.Kamaljot Kansal (CEO), Director of


INFOWIZ and for providing me an opportunity to do my project work on “Arduino
Based Robot Car”.

This project bears on imprint of many people. I sincerely thank my project guide Er.
Amit Solanki from INFOWIZ for guidance and encouragement in carrying out this
project work.

I also wish to express my gratitude to the officials of “INFOWIZ ’’ who rendered


their help during the period of my project work and their kind co-operation to the
completion of my project work. Last but not least I wish to avail myself of this
opportunity, express a sense of gratitude and love to my friends and my beloved
parents for their manual support, strength, help and for everything.

Place: Chandigarh
Date: ,2019

3
EMBEDDED SYSTEMS

TABLE OF CONTENTS

Company Profile ……………………………......………….11–1

(1) Introduction to Electronic Devices....................................16

1.1 Electronic Device............................................................17

1.2 Electronic Resistance......................................................17-20

1.2.1 Resistance in Series & Parallel Circuit........................20-22

1.3 Capacitor..........................................................................23-24

1.3.1 Energy Storage.............................................................25

1.3.2 Capacitor in series........................................................25

1.3.3 Capacitor in parallel.....................................................25-26

1.3.4 Capacitor Types............................................................26-27

1.3.5 Usage of Capacitor.......................................................27-28

1.3.6 Current..........................................................................28

1.3.7 Voltage..........................................................................28

1.3.8 Resistance.....................................................................28

1.3.9 Ohm’s low..................................................................29

1.4 Measurement Instrument.................................................29

1.4.1 Voltmeter......................................................................29-30

1.4.2 Ammeter.......................................................................30-31

1.4.3 Ohmmeter.....................................................................31-32

1.4.4 Diodes...........................................................................32-34

4
1.5 Light Emitting Diode......................................................34-35

1.5.1 Advantages of using LEDs...........................................35-36

1.5.2 Connecting LEDs in series...........................................36

1.5.3 Size & Shapes of LEDs................................................37

1.5.4 Colours of LEDs...........................................................37-38

1.5.5 List of LEDs Applications............................................38-40

1.6 Relay................................................................................40

1.6.1 Operation....................................................................40-41

1.6.2 Application.................................................................41-42

1.7 Alternating Current.......................................................42

1.7.1 Direct Current............................................................42

1.7.2 Alternating Vs Direct Current...................................43-44

(2) LOGIC GATES 44

2.1 Digital Electronic............................................................45-46

2.2 Logic Levels....................................................................46-46

2.2.1 Logic Gates...................................................................46-50

(3) EMBEDDED SYSTEM 51

3.1 Introduction to embedded system...................................51-53

(4) SOFTWARE DISCRIPTION 54

4.1 Kiel..................................................................................55-55

5
4.1.1 p Vision 3 IDE..............................................................55-56

4.2 Kiel Software...................................................................57-57

4.2.1 Advanced Analysis Tools.............................................57-58

4.2.2 Executing......................................................................59-59

4.2.3 Advanced Analysis Tools.............................................59-60

(5) ABOUT C 61

5.1 Steps in learning..............................................................62-63

5.2 Expression and Operators................................................63-64

5.3 Special Characters...........................................................64-68

5.4 Command Used................................................................69-70

5.5 Proteus design suit...........................................................71-72

5.6 PCB Design......................................................................72-73

5.7 3D Verification................................................................73-74

5.8 ARDUNINO IDE.............................................................74-75

5.9 What is ARDUNINO.......................................................75-76

5.10 Why ARDUNINO use...................................................76-77

(6) Density based traffic signal system 77

6.1 Definition.........................................................................77-78

6.2 Objective..........................................................................78-78

(7) Description of H/W 79

6
7.1 Block diagram & Components........................................79-79

7.2 Component Requirement.................................................79-90

(8) SOFTWARE DESIGN & HARDWARE RESULT 90

8.1 Installing tools for C programming.................................90-91

8.2 Simulation process...........................................................91-92

8.3 Conclusion.......................................................................92-93

8.4 Future Scope.....................................................................93-93

8.5 References........................................................................93-94

7
Content of Figures

(1) Electronic Devices 10

1.1 Electric Resistance 13

1.2 Series circuit 16

1.3 Parallel circuit 17

1.4 Capacitor 19

1.5 Capacitor in series 24

1.6 Capacitor in parallel 25

1.7 Diodes 32

1.8 LEDs schematic symbol 33

1.9 Connecting LEDs in series 35

1.10 LEDs shape & size 36

(2) Logic Gates 46

8
2.1 AND Gate 47

2.2 OR Gate 48

2.3 NOT Gate 48

2.4 NAND Gate 49

2.5 NOR Gate 49

2.6 X-NOR Gate 50

(3) Software Description 56

3.1 Kiel software 57

(4) About C 61

4.1 Steps in learning 62

4.2 Proteus design suits 71

4.3 ARDUINO IDE 74

(5) Description of Hardware 79

5.1 Traffic light signal block diagram 79

5.2 ARDUINO NANO 80

5.3 IR Sensor 81

5.4 LEDs 82

5.5 How to work LEDs 83

5.6 Resistance 84

5.7 IR Transmitter Sensor 86

9
5.8 Jumper Wire 87

5.9 Power Supply 88

Content of Table

1.1 Electrical resistance 18

2.1 AND Gate 47


2.2 OR Gate 48
2.3 NOT Gate 48
2.4 NAND Gate 49
2.5 NOR Gate 49
2.6 X-NOR Gate 50

3.1 Arithmetic Operators 66


3.2 Logic Connector 67
3.3 Special Character 69
3.4 Proteus design suits 72
3.5 ARDUINO IDE

10
Introduction

About ‘INFOWIZ ’
INFOWIZ was formed in 2009 with the mission to provide Industrial training to
aspiring Engineers and technical support to industries. Within a short span of 9
years “INFOWIZ” has become one of the leading organizations which offer state of
art professional IT solutions, Industrial trainings, technical support and consultancy
to software companies in India and abroad. Due to quality assurance and high level
of commitments in our services, we have won quite a few accolades and are
associated with reputed universities and popular corporates, in the field. We strive
to impart personalized, professional and contemporary experiential trainings on all
the engineering streams that are necessary for the career, success and growth for
both students & industry respectively.

Business Overview

Founded as industrial lab for providing industrial training to undergraduate


engineers, INFOWIZ” has grown progressively to become vertically
integrated company in the industrial training arena. The core business of
the company is to deliver range of industrial trainings in various engineering
streams to students, IT solutions, software consultancy and support to small
and big companies. ’INFOWIZ’ enjoys the distinction of being Unique &
Positive in the tri-city (Chandigarh, Panchkula Mohali) with extensive
steams of software & engineering subjects. “INFOWIZ” is in a strong
`position to work with reputed Universities and Corporates

Company Strategy

11
Vision:
• To provide unique & high quality trainings that exceeds the expectations
of our esteemed Students and Clients.

Purpose:
• To be a leader in the Industrial training industry by providing enhanced
relationship and profitability .

Mission statement:
• To build long term relationships with our students and clients and provide
exceptional customer services by pursuing business through innovation
and advanced technology.

Core values:
• We believe in treating our students & customers with respect and faith,
• We grow through creativity, research and innovation,
• We integrate honesty, integrity and business ethics into all aspects of our
business functioning

Goals:
• Regional & National expansion in the field of trainings/software consultancy
and develop a strong base of students & corporates.
• Increase the assets and investments of the company to support the
development of services.
• To build good reputation in the field of Industrial trainings & software
consultancy and become a key player in the industry.

Accolade
INFOWIZ won the NATIONAL AWARD for 3 consecutive years 2014-
2015,2015-2016 & 2016-2017 for BEST Industrial Training
• Best Education Provider Award 2017 from Punjab Education Minister
S Dalijit Singh Cheema.
• Best Industrial Training Award 2016 from Honorable GOVERNER of
Punjab & Haryana.

12
• Best Industrial Training Award 2015 from Dr .Udit Raj (MP) & Mrs.
Vimla Mehra (IPS Delhi)

Product Portfolio

• Web Development (PHP & .NET)

• JAVA (Core & Advance)

• Embedded systems (AVR, PIC & ARM)

• I-phone & Android application development

• Networking (MCSE,MCITP, CCNA, CCNP & RHSE)

• CCDP certification

• Robotics

• Ethical Hacking & Cloud Computing

• SEO & Bidding

• Automation ( Scada,PLC ,Pannel, Drives )

• MATLAB

• AUTOCAD Civil and Mechanical (2D & 3D)

• Solid Works,Catia,Pro-E,NX-10,Cre-o,Cnc Programming

• Staad Pro,3Ds MAX,Revit,Prima Vera

• C/C++/Data structure

• Short term/long term Industrial training

• Technical Support & Consultancy

• BBA,MBA (MARKETING,HR & FINANCE)

13
Business Information
Business Type: Industrial Training on Engineering courses, IT Solutions,
Implementation
State: Chandigarh (UT) Location(s): Chandigarh, Bhatinda Country:
India
Employee Count: 50 (Including CEO & MD)
Delivery Lead-time: depend on the type of course and training
Business Name:INFOWIZ
Business Address: SCO 118-120, Basement, Sector 34A, Chandigarh
Business Email: info@HYPERLINK "mailto:info@INFOWIZ
.co.in"INFOWIZ.HYPERLINK "mailto:info@infowiz .co.in"co.HYPERLINK
"mailto:info@infowiz.co.in"in
Business Tel: +91172-4567-88HYPERLINK "tel:172-4567-888" +91 9888-
500-888 +91 9888-600-888

Principal Customers
Sno URL's
Projects Country
.
1 Viva Sales www.INFOWIZ .in/viva sales UK
2 Mds Creative www.mdscreative.com Germany
3 Liddle TV www.filmon.com UK
Paradigms(Androi Ongoing
4
d) Australia
5 Print cost www.popgraphics.net UK
6 PSTDO Bootstrap www.bootstrap.achieversperfect.com USA
7 Essence software www.essencesoftwares.com Australia
Dashboard Ongoing
8
(WordPress) USA
9 Real state www.realstate.INFOWIZ .in Russia
Deal www.dealpartners.co.uk.gridhosted.c
10 partners(Word o.uk
Press) UK

14
Management & leadership
INFOWIZ is led by a team of professionals and technicians who are honest,
committed and always ready to accept contemporary challenges. The leadership
roles are

Mr . Kamaljot kansal(CEO).1

Mr. Kansal has been turning ideas into realities ever since he has taken up the
task of promoting INFOWIZ. In his own words “I never dreamt about success I
worked for It.” reflects that he believes in talk less and work more theory. No
doubt under his leadership INFOWIZ has become one of strongest companies in
the field of IT solutions in less than a decade. His management fundamental is
“team work” as he takes along, talks along all his team members and appreciates
and attributes their contribution to the success of INFOWIZ. He is determined
to bring INFOWIZ in the top 5 companies in the country

Dr.Seema (Managing Director) .2

Dr. Seema has with more than 9 years of practical experience in the field is one of
the strongest pillars of INFOWIZ. Her management style is unique and well
accepted by the students and associates. She believes in taking new challenges and
.implementing rational strategies for the benefit of organization

ROADMAP OF FUTURE

IFOWIZ future plans include regional and national expansion through both
COCO and FOFO business models. Our 1st COCO branch is already operational
at Bhatinda. Being an ISO certified company and member of CII we have
attained very high level of accomplishments in the Industrial training business
that we would want to take to masses. INFOWIZ is committed to develop its
strengths & core competencies with continues research & technical excellence. It
would never cease to embrace and add latest technological advancements in the
field of trainings and pass the same to the students as and when demand will
arise, creating the best and most modern atmosphere for learning.

15
16
17
1.1 ELECTRONIC DEVICES

An electronic component is any indivisible electronic building block packaged in a


discrete form with two or more connecting leads or metallic pads. Components are
intended to be connected together, usually by soldering to a printed circuit board,
to create an electronic circuit with a particular function (for example an amplifier,
radio receiver, or oscillator). Components may be packaged singly (resistor,
capacitor, transistor, diode etc.) or in more or less complex groups as integrated
circuits (operational amplifier, resistor array, logic gate etc). Active components are
sometimes called devices rather than components.

1.2 ELECTRICAL RESISTANCE:

Electrical resistance is a measure of the degree to which an object opposes the


passage of an electric current. The Sl unit of electrical resistance is the ohm,

Figure 1.1.1

The quantity of resistance in an electric circuit determines the amount of current


flowing in the circuit for any given voltage applied to the circuit.

R=V / I
where
R is the resistance of the object, usually measured in ohms, equivalent to
J.s/C2

V is the potential difference across the object, usually measured in volts


/ is the current passing through the object, usually measured in amperes

18
Resistors are two-terminal devices that restrict, or resist, the flow of current. The
larger the resistor, the less current can flow through it for a given voltage (an
equation known as Ohm's law, V=113, relates current, resistance, and voltage).
Electrical resistance within the resistor body is caused by the collisions of electrons
in motion through the resistor. Such collisions cause energy to be dissipated in the
form of heat or light (as in a toaster or light bulb). Resistance is measured in Ohms
- a 1 Ohm resistor is relatively small, and a 100KOhm resistor is relatively large.
Resistors find many uses in electronic systems, On the Digital board, resistors are
used to limit the current that flows into an output LED (so they don't burn too
bright and destroy themselves) and to limit the current that flows in response to a
button or switch input being activated. The Digital board uses several different
resistor values. Of course, the correct resistor must be loaded in the correct place
on the PCB.

Resistors come in many shapes and sizes, and depending on their size and
construction technology, they can dissipate differing amounts of power (the
amount of power dissipated in a resistor can be calculated using the equation P=I 2
R, where I is the current flowing through the resistor and R is the resistance).
Typically, resistors used in digital systems encounter relatively low voltages and
currents, and therefore, they can be relatively small. The Digital resistors are rated
to dissipate 250mW of power, or 1/4 Watt. Resistors that can dissipate more than
1/4 Watt are physically larger. For example, power resistors that can dissipate
several Watts or more can be cigar-sized or even larger. For small resistors, resistor
values are "encoded" as a series of coloured bands on the resistor body.

To determine the value of a small resistor (i.e., 1/8 Watt or 1/4 Watt), first locate
the tolerance band on one end of the resistor - it will typically be either gold (59%
tolerance) or silver (10% tolerance). The colour band at the other end of the
resistor is band1. Use the table below to find the two-digit number associated with
the colours of bands 1 and 2. The band nearest the tolerance band is the multiplier
(or exponent) band - the digits associated with the first two colour bands are

19
multiplied by 10 raised to the power indicated by the colour of the multiplier band.
The following table associates band colours to digits and multiplier factors. Simply
multiply the two-digit value by the multiplier, and you’ve got the resistor value.

BAND 1st and 2nd band Multiplier Tolerance


COLOR digits
Black 0 100 1%
Brown 1 101 2%
Red 2 102 3%
Orange 3 103 4%
Yellow 4 104 N/A
Green 5 105 N/A
Blue 6 106 N/A
Violet 7 107 N/A
Grey 8 108 N/A
White 9 109 N/A
Gold N/A .1 5%
Silver N/A .01 10%
No colour N/A N/A 20%
Resistor schematic
Symbol

Table 1.1.1

Resistors are manufactured with many body colours, with tan or light brown being
the most typical. The only significant resistor body colours are white and blue;
these colours signify a non flammable or fusible resistor. Such resistors are used in
circuits where overheating might pose a safety risk. In circuit schematics and in
parts lists, resistor reference designators always begin with an "R". You can see
several rectangular white boxes with "R-" on the Digital board silk-screen. The
schematic symbol for a resistor is shown above. Resistors are non-polarised, so
they can be placed in a PCB in any orientation.

20
For a wide variety of materials and conditions, the electrical resistance does not
depend on the amount of current flowing or the amount of applied voltage. V can
either be measured directly across the object or calculated from a subtraction of
voltages relative to a reference point. The former method is simpler for a single
object and is likely to be more accurate. There may also be problems with the
latter method if the voltage supply is AC and the two measurements from the
reference point are not in phase with each other.

1.2.1 RESISTANCE IN SERIES AND PARALLEL CIRCUITS

1.2.2 Series circuits

A series circuit is a circuit in which resistors are arranged in a chain, so the current
has only one path to take. The current is the same through each resistor. The total
resistance of the circuit is found by simply adding up the resistance values of the
individual resistors:

equivalent resistance of resistors in series : R = R1 + R2 + R3 + ...

Figure 1.3.1

A series circuit is shown in the diagram above.

With a 10 V battery, by V = I R the total current in the circuit is:

I = V / R = 10 / 20 = 0.5 A. The current through each resistor would be 0.5 A.

21
1.2.3 PARALLEL CIRCUITS

A parallel circuit is a circuit in which the resistors are arranged with their heads
connected together, and their tails connected together. The current in a parallel
circuit breaks up, with some flowing along each parallel branch and re-combining
when the branches meet again. The voltage across each resistor in parallel is the
same.

The total resistance of a set of resistors in parallel is found by adding up the


reciprocals of the resistance values, and then taking the reciprocal of the total:

Equivalent resistance of resistors in parallel: 1 / R = 1 / R1 + 1 / R2 + 1 / R3 +...

Figure 1.3.2

A parallel circuit is shown in the diagram above. In this case the current supplied by
the battery splits up, and the amount going through each resistor depends on the
resistance. If the values of the three resistors are:

With a 10 V battery, by V = I R the total current in the circuit is: I = V / R = 10 / 2 = 5


A.

The individual currents can also be found using I = V / R. The voltage across each
resistor is 10 V, so:

22
I1 = 10 / 8 = 1.25 A
I2 = 10 / 8 = 1.25 A
I3=10 / 4 = 2.5 A

Note that the currents add together to 5A, the total current.

A parallel resistor short-cut

If the resistors in parallel are identical, it can be very easy to work out the
equivalent resistance. In this case the equivalent resistance of N identical resistors
is the resistance of one resistor divided by N, the number of resistors. So, two 40-
ohm resistors in parallel are equivalent to one 20-ohm resistor; five 50-ohm
resistors in parallel are equivalent to one 10-ohm resistor, etc.

When calculating the equivalent resistance of a set of parallel resistors people


often forget to flip the 1/R upside down, putting 1/5 of an ohm instead of 5 ohms,
for instance. Here's a way to check your answer. If you have two or more resistors
in parallel, look for the one with the smallest resistance. The equivalent resistance
will always be between the smallest resistance divided by the number of resistors,
and the smallest resistance. Here's an example.

You have three resistors in parallel, with values 6 ohms, 9 ohms, and 18 ohms. The
smallest resistance is 6 ohms, so the equivalent resistance must be between 2
ohms and 6 ohms (2 = 6 /3, where 3 is the number of resistors).

Doing the calculation gives 1/6 + 1/12 + 1/18 = 6/18. Flipping this upside down
gives 18/6 = 3 ohms, which is certainly between 2 and 6.

1.3 CAPACITORS

23
A capacitor is an electrical device that can store energy in the electric field between
a pair of closely-spaced conductors (called 'plates). When voltage is applied to the
capacitor, electric charges of equal magnitude, but opposite polarity, build up on
each plate.
A capacitor is a two-terminal device that can store electric energy in the form of
charged particles. You can think of a capacitor as a reservoir of charge that takes
time to fill or empty. The voltage across a capacitor is proportional to the amount
of charge it is storing - since it is not possible to instantaneously move charge to or
from a capacitor, it is not possible to instantaneously change the voltage across a
capacitor. It is this property that makes capacitors useful on the Digital board.

Figure 1.3.1

Capacitance is measured in Farads - a one Farad capacitor can store one Coloumb
of charge at one volt. For engineering on a small scale (i.e., hand-held or desk-top
devices), a one Farad capacitor stores far too much charge to be of general use (it
would be like a car having a 1000 gallon gas tank). More useful capacitors are
measured in micro-farads (uF) or pico-farads (pF). The terms "milli-farad" and
"nano-farad" are rarely used. Large capacitors often have their value printed
plainly on them, such as "10 uF (for 10 microfards). Smaller capacitors, appearing

24
as small disks or wafers, often have their values printed on them in an encoded
manner (similar to the resistor packs discussed above). For these capacitors, a
three digit number indicates the capacitor value in Pico farads. The first two digits
provides the "base" number, and the third digit provides an exponent of 10 (so, for
example, "104" printed on a capacitor indicates a capacitance value of 10 x 10 4 or
100000 pF). Occasionally, a capacitor will only show a two digit number, in which
case that number is simply the capacitor value in pF. (To be complete, if a capacitor
shows a three digit number and the third digit is 8 or 9, then the first two digits are
multiplied by .01 and .1 respectively). Often, a single letter is appended to the
capacitance value -this letter indicates the quality of the capacitor.

Capacitors are used on the Digital board to keep the voltage supplies and some
signals stable regardless of circuit activity, and to store charge when inputs are
activated in order to slow their assertion times. Twenty-seven capacitors of three
different types and values are used on the Digital board. The majority of the
capacitors (24 out of 27) are used to decouple Digitals integrated circuits from the
power supply. These 24 bypass capacitors are placed on the board very close to the
Vdd pins of all chips, where they can supply the short-term electrical current needs
of the chips. Without such bypass capacitors, individual chips could cause the Vdd
supply across the entire Digital board to dip below 5V during times of heavy
current demand. Nearly every chip in every digital system uses bypass capacitors.
Bypass capacitor value can be determined if the worst-case current requirements
are known (by using the formula I = C dv/dt), but more typically, capacitors in the
range 0.01uF to 0.1uF are used without regard to the actual current requirements.
The Digital board uses 0.047uF bypass capacitors. The board also uses a bulk
bypass capacitor (C27) to provide charge storage for the entire circuit board - this
large 47uF capacitor can supply the individual bypass capacitors during times of
exceptional need.

1.3.1 ENERGY STORAGE

25
A capacitor can store electric energy when disconnected from its charging circuit,
so it can be used like a temporary battery. Capacitors are common used in
electronic devices to maintain power supply while batteries are being changed.
(This prevents loss of information in volatile memory.)

Capacitors are used in power supplies where they smooth the output of a full or
half wave rectifier. They can also be used in charge pump circuits as the energy
storage element in the generation of higher voltages than the input voltage,

Capacitors are connected in parallel with the power circuits of most electronic
devices and larger systems (such as factories) to shunt away and conceal current
fluctuations from the primary power source to provide a "clean" power supply for
signal or control circuits. Audio equipment, for example, uses several capacitors in
this way, to shunt away power line hum before it gets into the signal circuitry. The
capacitors act as a local reserve for the DC power source, and bypass AC currents
from the power supply. This is used in car audio applications, when a stiffening
capacitor compensates for the inductance and resistance of the leads to the
lead-acid car battery.

1.3.2 CAPACITORS IN SERIES

The total capacitance of the above circuit is:

1 1 1 1
   ...... 
Ceq C1 C2 Cn

1.3.3 CAPACITORS IN PARALLEL

26
Figure 1.3.1

The total capacitance of this circuit will be:

Ceq = C1 + C2 + ….. + Cn

1.3.4 CAPACITOR TYPES

 Metal film: Made from high quality polymer foil (usually polycarbonate,
polystyrene, polypropylene, polyester (Mylar), and for high quality
capacitors polysulfone), with a layer of metal deposited on surface. They
have good quality and stability, and are suitable for timer circuits. Suitable
for high frequencies.

 Mica: Similar to metal film. Often high voltage. Suitable for high
frequencies. Expensive.

 Paper: Used for high voltages

 Glass: Used for high voltages. Expensive. Stable temperature coefficient in a


wide range of temperatures.

 Ceramic: Chips of altering layers of metal and ceramic. Depending on their


dielectric, whether Class 1 or Class 2, their degree of temperature/capacity
dependence varies. They often have (especially the class 2) high dissipation

27
factor, high frequency coefficient of dissipation, their capacity depends on
applied voltage, and their capacity changes with aging. However they find
massive use in common low-precision coupling and filtering applications.
Suitable for high frequencies.

 Electrolytic: Polarized Construction ally similar to metal film, but the


electrodes are made of aluminum etched to acquire much higher surfaces,
and the dielectric is soaked with liquid electrolyte. They suffer from high
tolerances, high instability, gradual loss of capacity especially when
subjected to heat, and high leakage. Special types with low equivalent
series resistance are available. Tend to lose capacity in low temperatures.
Can achieve high capacities.

 Tantalum: Like electrolytic. Polarized. Better performance with higher


frequencies. High dielectric absorption. High leakage. Have much better
performance in low temperatures.

 Super capacitors : Made from carbon aerogel, carbon nanotubes, or highly


porous electrode materials. Extremely high capacity. Can be used in some
applications instead of rechargeable batteries.

1.3.5 USES OF CAPACITORS

Capacitors are used for several purposes:

 Timing - for example with a 555 timer IC controlling the charging and
discharging.

 Smoothing - for example in a power supply.

28
 Coupling - for example between stages of an audio system and to connect
aloud speaker.

 Filtering - for example in the tone control of an audio system.

 Tuning - for example in a radio system.

 Storing energy - for example in a camera flash circuit

1.3.6 CURRENT

Electric current Is by definition the flow of electric charge. The Sl unit of electric
current Is the ampere (A), which Is equal to a flow of one coulomb of charge per
second.

1.3.7 VOLTAGE

Voltage is the difference of electrical potential between two points of an electronic


circuit, expressed in volts. It measures the capacity (not the technical meaning) of
an electric field to cause an electric current in an electrical conductor. Depending
on the difference of electrical potential it is called extra low voltage, low voltage,
high voltage or extra high voltage

1.3.8 RESISTANCE

Electrical resistance is a measure of the degree to which an object opposes the


passage of an electric current. The SI unit of electrical resistance is the ohm.
1.3.9 OHM'S LAW

29
Ohm's law predicts the current in an (ideal) resistor (or other ohmic device) to be
applied voltage divided by resistance:
I=V/R

Where

/is the current, measured in amperes


V is the potential difference measured in volts
R is the resistance measured in ohms

1.4 MEASURING INSTRUMENTS

A measuring instrument is a device for measuring a physical quantity. In


the physical sciences, quality assurance,
and engineering, measurement is the activity of obtaining and
comparing physical quantities of real-world objects and events.
Established standard objects and events are used as units, and the
process of measurement gives a number relating the item under study
and the referenced unit of measurement. Measuring instruments, and
formal test methods which define the instrument's use, are the means
by which these relations of numbers are obtained. All measuring
instruments are subject to varying degrees of instrument
error and measurement uncertainty.

1.4.1 VOLTMETER

A voltmeter is an instrument used for measuring the potential difference between


two points in an electric circuit.

The voltage can be measured by allowing it to pass a current through a resistance;


therefore, a voltmeter can be seen as a very high resistance ammeter. One of the

30
design objectives of the instrument is to disturb the circuit as little as possible and
hence the instrument should draw a minimum of electric current to operate. This is
achieved by using a sensitive ammeter or micrometer in series with a high
resistance.
The moving coil galvanometer is one example of this type of voltmeter. It employs
a small coil of fine wire suspended in a strong magnetic field. When an electrical
current is applied, the galvanometer's indicator rotates and compresses a small
spring. The angular rotation is proportional to the current that is flowing through
the coil For use as a voltmeter, a series resistance is added so that the angular
rotation becomes proportional to the applied voltage

1.4.2 AMMETER

An ammeter is a measuring instrument used to measure the flow of electric


current in a circuit. Electric currents are measured in amperes, hence the name.
The word "ammeter" is commonly misspelled or mispronounced as "amp meter"
by some.
The earliest design is the D'Arsonval galvanometer or moving coil ammeter. It uses
magnetic deflection, where current passing through a coil causes the coil to move
in a magnetic field. The voltage drop across the coil is kept to a minimum to
minimize resistance across the ammeter in any circuit into which the it is inserted.

Moving iron ammeters use a piece or pieces of iron which move when acted upon
by the electromagnetic force of a fixed coil of (usually heavy gauge) wire. This type
of meter responds to both direct and alternating currents (as opposed to the
moving coil ammeter, which works on direct current only).

To measure larger currents, a resistor called a shunt is placed in parallel with the
meter. Most of the current flows through the shunt, and only a small fraction flow
through the meter. With this solution, arbitrarily large currents can be measured
with a single meter. Traditionally, the meter used with a shunt reaches full-scale

31
deflection when a voltage of 50mV is placed across its coil, so shunts are typically
designed to produce a voltage drop of 50mV when carrying their full rated current.

More modern ammeter designs are non-mechanical, or digital, and use an analog
to digital converter to measure the voltage across the shunt resistor. The ADC is
read by a microcomputer that performs the calculations to display the current
through the resistor.

One problem with the use of an ammeter is the need for the meter to be inserted
into the circuit and become part of it. Mistakenly placing the ammeter in parallel
with a circuit will blow the fuse, possibly damaging the meter and causing injury. In
AC circuits, an inductive coupling adapter converts the magnetic field around a
conductor into a small AC current that can be easily read by a meter. See clamp
meter. In a similar way, accurate DC non-contact arnmeters have been constructed
using Hall effect magnetic field sensors

1.4.3 OHMMETER

An Ohmmeter is an electrical measuring instrument that measures electrical


resistance, the opposition to the flow of an electric current.

The original design of an ohmmeter provided a small battery to apply a voltage to a


resistance. It used a galvanometer to measure the electric current through the
resistance. The scale of the galvanometer was marked in ohms, because the fixed
voltage from the battery assured that as resistance decreased, the current through
the meter would increase.

A more accurate type of ohmmeter has an electronic circuit that passes a constant
current I through the resistance, and another circuit that measures the voltage V
across the resistance. According to the following equation, derived from Ohm's
Law, the value of the resistance R is given by:

32
R= V/1

For high-precision measurements the above types of meter are inadequate, This is
because the meter's reading is the sum of the resistance of the measuring leads,
the contact resistances and the resistance being measured. To reduce this effect, a
precision ohmmeter has four terminals, called Kelvin contacts. Two terminals carry
the current from the meter, while the other two allow the meter to measure the
voltage across the resistor. With this type of meter, any current drop due to the
resistance of the first pair of leads and their contact resistances is ignored by the
meter. This four terminal measurement technique is called Kelvin sensing, after
William Thomson, Lord Kelvin, who invented the Kelvin bridge in 1861 to measure
very low resistances.

1.4.4 DIODES

Diodes are constructed from the same type of silicon as transistors, but they are
simpler devices that have only two terminals. Called the anode and cathode, the
two ends of the diode are constructed of positively doped silicon (the anode)
joined directly to negatively doped silicon (the cathode). This pn junction exhibits
the unique characteristic of allowing current to flow in only one direction (from the
anode to the cathode). Diodes have a minimum threshold voltage (or Vth, usually
around 0.7V) that must be present between the anode and cathode in order for
current to flow. If the anode voltage is not at least Vth greater than the cathode
voltage, no current will flow. Likewise, if the cathode voltage is greater than the
anode voltage, the diode is said to be reverse-biased and no current will flow. In an
ideal diode, if the diode voltage equals the threshold voltage (plus a small
amount), then unlimited current can flow without causing the voltage across the
diode to increase. And, if the diode is reversed-biased, no current will flow
regardless of reverse-voltage magnitude.

33
Figure 1.4.1
Diodes

Diodes have many uses in electronic circuits. As examples, they are frequently
employed in power supply circuits to turn alternating current (AC) into direct
current (DC), they are used to limit the amount of over-voltage that can be applied
to a given circuit node, and they are used to force given circuit nodes to remain at
or below a certain voltage. On the Digital board, three individual diodes are used
to limit the voltages applied to the Red, Blue, and Green pins of the VGA connector
(M) to 0.7VDC or less.

Note the identification methods used to mark a diode's cathode -terminal: the
schematic symbol has a line at the point of the triangle; the physical diode has a
dark line on the plastic component housing; and the silk-screen pattern has both a
line at the cathode end and a square pad for the cathode lead. When loading a
diode into a circuit board, make sure that the dark line on the diode matches the
line in the silk-screen pattern. Remember that since diodes allow current to flow in
only one direction, a backwards diode will cause the circuit to malfunction.

34
LED SCHEMATIC SYMBOL
Figure 1.4.2
Diodes locations on the circuit board are typically denoted with a "D-" reference
designator

1.5 Light Emitting Diode (LED)

A light-emitting diode (LED) is a semiconductor device that emits incoherent


narrow-spectrum light when electrically biased in the forward direction. This effect
is a form of electro luminescence. The colour of the emitted light depends on the
composition and condition of the semi conducting material used, and can be
infrared, visible or near-ultraviolet. Rubin Braunstein of the Radio Corporation of
America first reported on infrared emission from gallium arsenide (GaAs) and other
semiconductor alloys in 1955. Experimenters at Texas Instruments, Bob Board [1]
and Gary Pittman, found in 1961 that gallium arsenide gave off infrared (invisible)
light when electric, current was applied. Board and Pittman were able to establish
the priority of their work and received the patent for the infrared light emitting
diode. Nick Holonyak Jr. of the General Electric Company developed the first
practical visible-spectrum LED in 1962.

LEDs are available in a wide variety of sizes and shapes. The 'standard' LED has a
round cross-section of 5mm diameter and this is probably the best type for general
use, but 3mm round LEDs are also popular.
Round cross-section LEDs are frequently used and they are very easy to install on
boxes by drilling a hole of the LED diameter, adding a spot of glue will help to hold
the LED if necessary. LED clips are also available to secure LEDs in holes. Other
cross-section shapes include square, rectangular and triangular.

35
As well as a variety of colours, sizes and shapes, LEDs also vary in their viewing
angle. This tells you how much the beam of light spreads out. Standard LEDs have a
viewing angle of 600 but others have a narrow beam of 300 or less.

Rapid Electronics stock a wide selection of LEDs and their catalogue is a good guide
to the range available.

1.5.1 ADVANTAGES OF USING LEDS

 LEDs produce more light per Watt than do incandescent bulbs; this is useful
in battery powered devices.
 LEDs can emit light of an intended colour without the use of colour filters
that traditional lighting methods require. This is more efficient and can
lower initial costs.
 The solid package of an LED can be designed to focus its light. Incandescent
and fluorescent sources often require an external reflector to collect light
and direct it in a usable manner.
 When used in applications where dimming is required, LEDs do not change
their colour tint as the current passing through them is lowered, unlike
incandescent lamps, which yellow.
 LEDs are built i1nside solid cases that protect them, unlike incandescent
and discharge sources, making them extremely durable.
 LEDs have an extremely long life span: upwards of 100,000 hours, twice as
long as the best fluorescent bulbs and twenty times longer than the best
incandescent bulbs. (Incandescent bulbs can also be made to last an
extremely long time by running at lower than normal voltage, but only at a
huge cost in efficiency; LEDs have a long life when operated at their rated
power.)
 Further, LEDs mostly fail by dimming over time, rather than the abrupt
burn-out of incandescent bulbs,

36
 LEDs light up very quickly. A typical red indicator LED will achieve full
brightness in microseconds; LEDs used in communications devices can have
even faster response times.
 LEDs can be very small and are easily populated onto printed circuit boards.

1.5.2 Connecting LEDs in series

If you wish to have several LEDs on at the same time it may be possible to connect
them in series. This prolongs battery life by lighting several LEDs with the same
current as just one LED.

Figure 1.5.1

All the LEDs connected in series pass the same current so it is best if they are all the
same type. The power supply must have sufficient voltage to provide about 2V for
each LED (4V for blue and white) plus at least another 2V for the resistor. To work
out a value for the resistor you must add up all the LED voltages

37
1.5.3 SIZE AND SHAPES

Figure 1.5.2
LEDs are produced in a staggering array of shapes and sizes, The 5 mm cylindrical
package (red, fifth from the left) is the most common, estimated at 80% of world
production. The colour of the plastic lens is often the same as the actual colour of
light emitted, but not always. For instance, purple plastic is often used for infrared
LEDs, and most blue devices have clear housings. There are also LEDs in extremely
tiny packages, such as those found on blinking.

1.5.4 Colours of LEDs

LEDs are available in red, orange, amber, yellow, green, blue and white. Blue and
white LEDs are much more expensive than the other colours.

Figure 1.5.3

38
The colour of an LED is determined by the semiconductor material, not by the
colouring of the 'package' (the plastic body). LEDs of all colours are available in
uncoloured packages which may be diffused (milky) or clear (often described as I
water clear'). The coloured packages are also available as diffused (the standard
type) or transparent

1.5.5 LIST OF LED APPLICATIONS

Some of these applications are further elaborated upon in the following text.

 Architectural lighting.
 Status indicators on all sorts of equipment.
 Traffic lights and signals.
 Exit signs.
 Motorcycle and Bicycle lights.
 Toys and recreational sporting goods.
 Railroad crossing signals.
 Light bars on emergency vehicles.
 Elevator Push Button Lighting.

 Thin, lightweight message displays at airports and railway stations and as


destination displays for trains, buses, trams and ferries.

 Red or yellow LEDs are used in indicator and alphanumeric displays in


environments where night vision must be retained: aircraft cockpits,
submarine and ship bridges, astronomy observatories, and in the field, e.g.
night time animal watching and military field use.

 Red, yellow, green, and blue LEDs can be used for model railroading
applications.

39
 Remote controls, such as for TVs and VCRs, often use infrared LEDs.

 In dot matrix arrangements for displaying messages.

 Glow lights, as a more expensive but longer lasting and reusable alternative
to Glow sticks.

 Movement sensors, for example in optical computer mice.

 Because of their long life and fast switching times, LEDs have been used for
automotive high-mounted brake lights and truck and bus brake lights and
turn signals for some time, but many high-end vehicles are now starting to
use LEDs for their entire rear light clusters. Besides the gain in reliability,
this has styling advantages because LEDs are capable of forming much
thinner lights than incandescent lamps with parabolic reflectors. The
significant improvement in the time taken to light up (perhaps 0.5s faster
than an incandescent bulb) improves safety by giving drivers more time to
react.

 Backlighting for LCD televisions and displays. The availability of LEDs in


specific colours (RGB) enables a full-spectrum light source which expands
the colour gamut by as much as 45%.

 New stage lighting equipment is being developed with LED sources in


primary red-green-blue arrangements.

 LED phototherapy for acne using blue or red LEDs has been proven to
significantly reduce acne over a 3 month period.

40
 As Voltage Reference in electronic circuits. The constant voltage drop (e.g.
1.7 V for a normal red LED) can be used instead of a Zener diode in
low-voltage regulators. Zener diodes are not available below voltages of
about 3 V.

1.6 RELAY

A relay is an electrical switch that opens and closes under control of another
electrical circuit. In the original form, the switch is operated by an electromagnet
to open or close one or many sets of contacts. It was invented by Joseph Henry in
1835. Because a relay is able to control an output circuit of higher power than the
input circuit, it can be considered, in a broad sense, to be a form of electrical
amplifier

1.6.1 OPERATION

When a current flows through the coil, the resulting magnetic field attracts an
armature that is mechanically linked to a moving contact. The movement either
makes or breaks a connection with a fixed contact. When the current to the coil is
switched off, the armature is returned by a force approximately half as strong as
the magnetic force to its relaxed position. Usually this is a spring, but gravity is also
used commonly in industrial motor starters. Most relays are manufactured to
operate quickly. In a low voltage application, this is to reduce noise. In a high
voltage or high current application, this is to reduce arcing.

If the coil is energized with DC, a diode is frequently installed across the coil, to
dissipate the energy from the collapsing magnetic field at deactivation, which
would otherwise generate a spike of voltage and might cause damage to circuit
components. If the coil is designed to be energized with AC, a small copper ring
can be crimped to the end of the solenoid. This "shading ring" creates a small out-

41
of-phase current, which increases the minimum pull on the armature during the
AC cycle. [1]

By analogy with the functions of the original electromagnetic device, a solid-state


relay is made with a thyristor or other solid-state switching device. To achieve
electrical isolation, a light emitting diode (LED) is used with a photo transistor.

1.6.2 APPLICATIONS

Relays are used:

 to control a high-voltage circuit with a low-voltage signal, as in some types


of modems,

 to control a high-current circuit with a low-current signal, as in the starter


solenoid of an automobile,

 to detect and isolate faults on transmission and distribution lines by


opening and closing circuit breakers (protection relays),

 to isolate the controlling circuit from the controlled circuit when the two
are at different potentials, for example when controlling a mains-powered
device from a low-voltage switch. The latter is often applied to control
office lighting as the low voltage wires are easily installed in partitions,
which may be often moved as needs change. They may also be controlled
by room occupancy detectors in an effort to conserve energy,

 to perform logic functions. For example, the boolean AND function is


realised by connecting NO relay contacts in series, the OR function by
connecting NO contacts in parallel. The change-over or Form C contacts
perform the XOR (exclusive or) function. Similar functions; for NAND and

42
NOR are accomplished using NC contacts. Due to the failure modes of a
relay compared with a semiconductor, they are widely used in safety critical
logic, such as the control panels of radioactive waste handling machinery.

1.7 ALTERNATING CURRENT

An alternating current (AC) is an electrical current whose magnitude and direction


vary cyclically, as opposed to direct current, whose direction remains constant. The
usual waveform of an AC power circuit is a sine wave, as this result in the most
efficient transmission of energy. However in certain applications different
waveforms are used, such as triangular or square waves.

Used generically, AC refers to the form in which electricity is delivered to


businesses and residences. However, audio and radio signals carried on electrical
wire are also examples of alternating current. In these applications, an important
goal is often the recovery of information encoded (or modulated) onto the AC
signal.

1.7.1 DIRECT CURRENT

Direct current (DC or "continuous current") is considered as the constant flow of


electrons in the single direction from low to high potential. This is typically in a
conductor such as a wire, but can also be through semiconductors, insulators, or
even through a vacuum as in electron or ion beams. In direct current, the electric
charges flow in the same direction, distinguishing it from alternating current (AC).
A term formerly used for direct current was Galvanic current.

43
1.7.2 ALTERNATING VS DIRECT CURRENT

So far we have been talking about a constant supply of voltage - one that doesn't
change over time, such as a battery before it starts to run down. This is what is
commonly know of as direct current or DC which is to say that there is no change in
voltage over a period of time. This is not the kind of electricity found coming out of
the sockets in your wall at home. The electricity supplied by the hydro company
changes over short periods of time (it changes over long periods of time as well,
but that's an entirely different story...) Every second, the voltage difference
between the two terminals in your wall socket fluctuates between about -170 V
and 170 V sixty times a second (if you live in North America, at least ...). This brings
up two important points to discuss.

Firstly, the negative voltage... All a negative voltage means is that the electrons are
flowing in a direction opposite to that being measured. There are more electrons in
the tested point in the circuit than there are in the reference point, therefore more
negative charge. If you think of this in terms of the two tanks of water - if we're
sitting at the bottom of the empty tank, and we measure the relative pressure of
the full one, its pressure will be more, and therefore positive relative to your
reference. If you're at the bottom of the full tank and you measure the pressure at
the bottom of the empty one, you'll find that it's less than your reference and
therefore negative. (Two other analogies to completely confuse you.., it's like
describing someone by their height. It doesn't matter how tall or short someone is
- if you say they're tall, it probably means that they're taller than you.

Secondly, the idea that the voltage is fluctuating. When you plug your coffee maker
into the wall, you'll notice that the plug has two terminals. One is a reference
voltage which stays constant (normally called a "cold" wire in this case ...) and one
is the "hot" wire which changes in voltage realtive to the cold wire. The device in
the coffee maker which is doing the work is connected with each of these two
wires. When the voltage in the hot wire is positive in comparison to the cold wire,

44
the current flows from hot through the coffee maker to cold. One one-hundred and
twentieth of a second later the hot wire is negative compared to the cold, the
current flows from cold to hot. This is commonly known as alternating current or
AC.

So remember, alternating current means that both the voltage and the current are
changing in time.

45
46
2.1 DIGITAL ELECTRONICS

Digital electronics are those electronics systems that use a digital signal instead of
an analog signal. Digital electronics are the most common representation of
Boolean algebra and are the basis of all digital circuits for computers, mobile
phones, and numerous other consumer products.
The most common "fundamental unit" of digital electronics is the logic gate. By
combining numerous logic gates (from tens to hundreds of thousands) more
complex systems can be created. The complex system of digital electronics is
collectively referred to as a digital circuit.

To most electronic engineers, the terms "digital circuit", "digital system" and
"logic" are interchangeable in the context of digital circuits

2.1.1 ADVANTAGES

The usual advantages of digital circuits when compared to analog circuits are,

 Digital systems interface well with computers and are easy to control with
software. It is often possible to add new features to a digital system without
changing hardware, and to do this remotely, just by uploading new
software. Design errors or bugs can be worked-around with a software
upgrade, after the product is in customer hands.

 Information storage can be much easier in digital systems than in analog


ones. In particular, the great noise-immunity of digital systems makes it
possible to store data and retrieve it later without degradation. In an analog
system, aging and wear and tear will degrade the information in storage,
but in a digital system, as long as the wear and tear is below a certain level,
the information can be recovered perfectly.

47
2.2 LOGIC LEVELS

A Boolean logical input or output always takes one of two logic levels, These logic
levels can go by many names Including: on / off, high (H) / low (L), one (1) / zero
(0), true (T) / false (F), positive / negative, positive / ground, open circuit / close
circuit, potential difference I no difference, yes / no. For consistency, the names 1
and 0 will be used below

2.2.1 LOGIC GATE

A logic gate performs a logical operation on one or more logic inputs and produces
a single logic output. The logic normally performed is Boolean logic and is most
commonly found in digital circuits. Logic gates are primarily implemented
electronically using diodes or transistors, but can also be constructed using
electromagnetic relays, fluidics, optical or even mechanical elements.

A logic gate is an elementary building block of a digital circuit. Most logic gates
have two inputs and one output. At any given moment, every terminal is in one of
the two binary conditions low (0) or high (1), represented by different voltage
levels. The logic state of a terminal can, and generally does, change often, as the
circuit processes data. In most logic gates, the low state is approximately zero volts
(0 V), while the high state is approximately five volts positive (+5 V).There are
seven basic logic gates: AND, OR, XDR, NOT, NAND, NOR, and XNOR.

AND GATE

The AND gate is so named because, if 0 is called "false" and 1 is called "true," the
gate acts in the same way as the logical "and" operator. The following illustration
and table show the circuit symbol and logic combinations for an AND gate. (In the

48
symbol, the input terminals are at left and the output terminal is at right.) The
output is "true" when both inputs are "true." Otherwise, the output is "false."

Symbol

Figure 2.2.1

Input 1 Input 2 Output


0 0 0
0 1 0
1 0 0
1 1 1

Table 2.2.1

OR GATE

The OR gate gets its name from the fact that it behaves after the fashion of the
logical inclusive "or." The output is "true" if either or both of the inputs are "true."
If both inputs are "false," then the output is "false."

Symbol

49
Figure 2.2.2

Input 1 Input 2 Output


0 0 0
0 1 1
1 0 1
1 1 1

Table 2.2.2
NOT GATE

The NOT gate or inverter is a digital logic gate that implements logical negation. It
behaves according to the truth table to the right. A HIGH output (1) results if the
inputs is LOW (0). If the input is HIGH (1), a LOW output (0) results.

Symbol

Figure 2.2.3

Input Input
1 0
0 1

Table 2.2.3

NAND GATE

50
The NAND gate operates as an AND gate followed by a NOT gate. It acts in the
manner of the logical operation "and" followed by negation. The output "false" if
both inputs are "true." Otherwise, the output is "true."

Symbol

Figure 2.2.4

Input 1 Input 2 Output


0 0 1
0 1 1
1 0 1
1 1 0

Table 2.2.4

NOR GATE

The NOR gate is a combination OR gate followed by an inverter, its output is “true”
if both inputs are “false”. Otherwise, the output is “false.”

Symbol

51
Figure 2.2.5

Input 1 Input 2 Output


0 0 1
0 1 0
1 0 0
1 1 0

Table 2.2.5

XNOR GATE

The XNOR (exclusive-NOR) gate is a combination XOR gate following by an inverter.


Its output is “true” if inputs are the same and “false” if the inputs are different.

Figure 2.2.6

Input 1 Input 2 Output


0 0 1
0 1 0
1 0 0
1 1 1

52
Table 2.2.6

Using combinations of logic gates, complex operations can be performed. In theory,


there is no limit to the number of gates that can be arrayed together in a single
device. But in practice, there is a limit to the number of gates that can be, packed
into a given physical space. Arrays of logic gates are found in digital integrated
circuits (ICs). As IC technology advances, the required physical volume for each
individual logic gate decreases and digital devices of the same or smaller size
become capable of performing ever-more-complicated operations at
ever-increasing speeds.

53
54
3.1 INTRODUCTION TO EMBEDDED SYSTEM

A specialized computer system that is part of a larger system or machine. Typically,


an embedded system is housed on a single microprocessor board with the
programs stored in ROM. Virtually all appliances that have a digital Interface --
watches, microwaves, VCRs, cars -- utilize embedded systems. Some embedded
systems include an operating system, but many are so specialized that the entire
logic can be implemented as a single program. Embedded systems programming is
the development of programs intended to be part of a larger operating system or,
in a somewhat different usage, to be incorporated on a microprocessor that can
then be included as part of a variety of hardware devices. Several other definitions
are:
 A combination of computer hardware and software, and perhaps additional
mechanical or other parts, designed to perform a dedicated function. In
some cases, embedded systems are part of a larger system or product, as in
the case of an antilock braking system in a car. Contrast with
general-purpose computer.
 A specialized computer system which is dedicated to a specific task.
Embedded systems range in size from a single processing board to systems
with operating systems (ex, Linux, Windows® NT Embedded). Examples of
embedded systems are medical equipment and manufacturing equipment.
 A computer system that is a component of a larger machine or system.
Embedded systems can respond to events in real time. Most digital
appliances, such as watches or cars, utilize an embedded system.
 Hardware and software that forms a component of some larger system and
is expected to function without human intervention. Typically an embedded
system consists of a single-board microcomputer with software in ROM,
which starts running a dedicated application as soon as power is turned on
and does not stop until power is turned off.

55
 An embedded system is some combination of computer hardware and
software, either fixed in capability or programmable, that is specifically
designed for a particular kind of application device. Industrial machines,
automobiles, medical equipment, cameras, household appliances,
airplanes, vending machines, and toys (as well as the more obvious cellular
phone and PDA) are among the myriad possible hosts of an embedded
system.

 A phrase that refers to a device that contains computer logic on a chip


Inside it. Such equipment is electrical or battery powered. The chip controls
one or more functions of the equipment, such as remembering how long it
has been since the device last received maintenance,

 An embedded system is a special-purpose computer system, which is


completely encapsulated by the device it controls. An embedded system
has specific requirements and performs pre-defined tasks, unlike a
general-purpose personal computer.

56
57
Keil

4.1 keil

Keil Software makes C compilers, macro assemblers, real-time kernels, debuggers,


simulators, integrated environments, and evaluation boards for the 8051, 251,
ARM, and XC16x/Cl6x/ST10 microcontroller families

Keil don’t make a compiler for every different microcontroller architecture. They
concentrate on just a few chip families that they can support very well. That's why
most of Keil customers will agree that they have the best development tools for
ARM, XC1 6x/C1 6x/ST1 0, 251 and 8051 microcontroller families. Since they have
fewer product lines to support, Keil can dedicate more time to better supporting
each tool chain. That allows them to improve their tools and product support
faster than other vendors.

4.1.1 pVision3 IDE

pVision3, the new IDE from Keil Software, combines project management, make
facilities, source code editing, program debugging, and complete simulation in one
powerful environment, pVision3 helps you get programs working faster than ever
while providing an easy-to-use development platform. The editor and debugger are
integrated into a single application and provide a seamless embedded project
development environment.

pVision3 provides unique features like

58
 The Device Database which automatically sets the assembler, compiler, and
linker options for the chip you select. This prevents you from wasting your
time configuring the tools and helps you get started writing code faster.

 A robust Project Manager which lets you create several different


configurations of your target from a single project file. Only the Keil
pVision3 IDE allows you to create an output file for simulating, an output
file for debugging with an emulator, and an output file for programming an
EPROM--all from the same Project file.

 An integrated Make facility with automatic dependency generation. You


don't have to figure out which header files and include files are used by
which source files. The Keil compilers and assemblers do that automatically.

 Interactive error correction. As your project compiles, errors and warnings


appear in an output window. You may make corrections to the files in your
project while pVision3 continues to compile in the background. Line
numbers associated with each error or warning are automatically
resynchronized when you make changes to the source.

59
4.2 Keil Software

Figure 4.2.1

4.2.1 pVision Debugger

The pVision Debugger from Keil supports simulation using only your PC or laptop,
and debugging using your target system and a debugger interface. pVision includes
traditional features like simple and complex breakpoints, watch windows, and
execution control as well as sophisticated features like trace capture, execution
profiler, code coverage, and logic analyzer. Viewing Code & Data

The pVision Debugger provides a number of ways to display variables and program
objects.

60
 Source Code Windows display your high-level language and assembly
program source code.

 The Disassembly Window shows mixed high-level language and assembly


code.

 The Registers Tab of the Project Workspace shows system registers.

 The Symbol Window heir archly displays program symbols in your


application.

 The Output Window displays the output of various debugger commands.

 The Memory Window displays up to four regions of code or data memory.

 The Watch Window displays local variables, user-defined watch expression


lists, and the call stack.

4.2.2 Executing

pVision offers several ways you can control and manipulate program execution.

 Reset - It is possible to debug reset conditions using the pVision Simulator.

 Run/Stop - Buttons and Commands make starting and stopping program


execution is easy.

 Single-Stepping - pVision supports various methods of single-stepping


through your target program.

61
 Execution Trace - Execution trace information for each executed instruction
is stored by pVision.

 Breakpoints - Both simple and complex breakpoints are supported by the


pVision Debugger.

4.2.3 Advanced Analysis Tools

Advanced analysis' tools are available to help you test and debug your embedded
applications.

 Code Coverage helps you determine how much of your program has been
tested.

 The Performance Analyser shows how functions and code blocks in your
program perform.

 The Execution Profiler shows execution counts and time for each line of
code or instruction.

 The Logic Analyser shows how various signals and variables in your program
change over time.

4.2.4 Simulation

Simulation capabilities make it possible to test your target system without target
hardware.

62
 Instruction Simulation simulates the exact effects and timing of each IVICU
instruction.
 Interrupt Simulation simulates the cause and effect of a system or
peripheral interrupt.
 Peripheral Simulation simulates the effects of on-chip peripherals including
special function registers.
 Debugger Functions allow you to expand the command scope of the
debugger and create and respond to stimuli.
 Toolbox Buttons are a convenient way for you to connect debugger
functions buttons on the user-interface.

4.2.5 Target Debugging

Target debug drivers allow you to test programs running on target hardware.

 JTAG Debugging uses external hardware to interface your PC to your target


system.
 A Target Monitor interfaces your PC to your target system using RS-232 and
software.
 Flash Programming uses a target interface to download your target program
to Flash memory.
 AGDl Drivers interface the  Vision Debugger to third-party hardware or
provide additional debugger features.

63
ABOUT C

As a programming language, C is rather like Pascal or Fortran Values are stored in


variables. Programs are structured by defining and calling functions. Program flow
is controlled using loops, if statements and function calls. Input and output can be
directed to the terminal or to files. Related data can be stored together in arrays or
structures.

Of the three languages, C allows the most precise control of input and output. C is
also rather more terse than Fortran or Pascal. This can result in short efficient
programs, where the programmer has made wise use of C's range of powerful'
operators. It also allows the programmer to produce programs, which are
impossible to understand.

Programmers who are familiar with the use of pointers (or indirect addressing, to
use the correct term) will welcome the ease of use compared with some other
languages. Undisciplined use of pointers can lead to errors, which are very hard to
trace. This course only deals with the simplest applications of pointers.

It is hoped that newcomers will find C a useful and friendly language. Care must be
taken in using C. Many of the extra facilities, which it offers, can lead to extra types
of programming error. You will have to learn to deal with these to successfully
make the transition to being a C programmer.

C is a programming language developed at AT& T's Bell Laboratories of USA in


1972.

It was designed and written by a man named Dennis Ritche. In late seventies C
begin to replace the more familiar languages of that time like ALGOL etc. Ritche
seems to have been rather surprised that so many programmers preferred C to

64
older languages like FORTRAN or PL/I or the newer like Pascal and APL. But, that's
what happened.

5.1 STEPS IN LEARNING C

Alphabets, Constants,
digits, special variables, Instructions Program
symbols keywords

Figure 5.1.1

5.1.1 USAGE

C's primary use is for "system programming", including implementing operating


systems and embedded system applications, due to a combination of desirable
characteristics such as code portability and efficiency, ability to access specific
hardware addresses, ability to "pun" types to , match externally imposed data
access, requirements, and low runtime demand on system resources.

C has also been widely used to implement end-user applications, although as


applications became larger much of that development shifted to other, higher level
languages.

One consequence of C's wide acceptance and efficiency is that the compilers,
libraries, and interpreters of other higher-level languages are often implemented in
C.

C is used as an intermediate language by some higher-level languages.

"hello, world" example

65
The following simple application appeared in the first edition of K&R, and has
become the model for an introductory program in most programming textbooks,
regardless of programming language. The program prints out "hello, world" to the
standard output, which is usually a terminal or screen display. Standard output
might also be a file or some other- hardware device, depending on how standard
output is mapped at the time the program is executed.

Main()
{
printf(“hello, world\n”);
}

The above program will compile on most modern compilers that are not in
compliance mode, but does not meet the requirements of either C89 or C99.
Compiling this program in C99 compliance mode will result in warning or error
messages. 151 A compliant version of the above program follows:

#include <stdio.h>
int main(void)
{
printf(“hello, world\n”);
return 0;
}

A Very Simple Program

This program which will print out the message This is a C program
#include <stdio.h>
main()
{

66
printf(“This is a C program\n”);
}

Though the program is very simple, a few points are worthy of note.

Every C program contains a function called main. This is the start point of the
program.

#include <stdio.h> allows the program to interact with the screen, keyboard and
file system of your computer. You will find it at the beginning of almost every C
program.

Main() declares the start of the function, while the two curly brackets show the
start and finish of the function. Curly brackets in C are used to group statements
together as in a function, or in the body of a loop. Such a grouping is known as a
compound statement or a block.

printf("This is a C program\n");
prints the words on the screen. The text to be printed is enclosed in double quotes.
The \n at the end of the text tells the program to print a newline as part of the
output.

5.1.2 Expressions and Operators

One reason for the power of C is its wide range of useful operators. An operator is
a function which is applied to values to give a result. You should be familiar with
operators such as+,-,/.

Arithmetic operators are the most common. Other operators are used for
comparison of values, combination of logical states, and manipulation of individual
binary digits. The binary operators are rather low level for so are not covered here,

67
Operators and values are combined to form expressions. The values produced by
these expressions can be stored in variables, or used as a part of even larger
expressions.

5.2 Assignment Statement

The easiest example of an expression is in the assignment statement. An


expression is evaluated, and the result is saved in a variable. A simple example
might look like

y = (m* X) + C
This assignment will save the value of the expression in variable y.

Arithmetic operators

Here are the most common arithmetic operators

+ Addition
- Subtraction
* Multiplication
/ Division
% Modulo Reduction (Remainder from integer division)

*,/and % will be performed before + or - in any expression. Brackets can be used to


force a different order of evaluation to this. Where division is performed between
two integers, the result will be an integer, with remainder discarded. Modulo
reduction is only meaningful between integers. If a program is ever required to

68
divide a number by zero, this will cause an error, usually causing the program to
crash.

Here is some arithmetic expressions used within assignment statements.

velocity = distance / time;

force = mass acceleration;

count = count + 1;
C has some operators which allow abbreviation of certain types of arithmetic
assignment statements.

Shorthand Equivalent

i++; or ++i; i = i + 1;
i--; or --i; I = I – 1;

These operations are usually very efficient. They can be combined with another
expression.

X = a * b++; is equivalent to x = a * b;
x = b+ 1;

Versions where the operator occurs before the variable name change the value of
the variable before evaluating the expression, so

x = --i * (a + b) ; is equivalent to i = i – 1;
x = I * (a + b);

69
These can cause confusion if you try to do too many things on one command line.
You are recommended to restrict your use of ++ and - to ensure that your programs
stay readable.

Another shorthand notation is listed below

Shorthand Equivalent

i+ = 10; i = i + 10;
i -= 10; i = i - 10;
i *= 10; i = i * 10;
i /= 10; i = i / 10;

These are simple to read and use.

Logical Connectors

These are the usual And, Or and Not operators.

Symbol Meaning

&& And
II Or
! Not

They are frequently used to combine relational operators, for example

x < 20 && x >= 10


In C these logical connectives employ a technique known as lazy evaluation. They
evaluate their left hand operand, and then only evaluate the right hand one if this
is required. Clearly false && anything is always false, true 11 anything is always
true. In such cases the second test is not evaluated.

70
Not operates on a single logical value, its effect is to reverse its state. Here is an
example of its use.
if ( ! acceptable)
printf(“Not Acceptable !!\n”);

5.3 Special Characters

The following special patterns are used to represent a single character in C


programs. The leading backslash in the single quotes indicates that more
information is to follow.

C code Meaning

’\014’ Bit pattern for Form Feed


’\n’ New line
’\t’ Tab
’\\’ Backslash
’\” Single Quote
’\” ‘ Double Quote
’\b’ Backspace
’\r’ Carriage Return
’\f’ Form Feed
’\0’ NULL (String Terminator)

Table 5.1.1

5.4 COMMANDS USED

1. SWITCH-CASE STATEMANT:

71
The control statement that allows us to make a decision from the number of
choices is called a switch, or switch case - default. Since these three keywords go
together to make up the control statement

2. FOR LOOP:
For is the most popular looping instruction. It allows us to specify three things in a
single line.

a) Setting loop counter to initial value


b) Testing the loop counter to determine whether its value has reached the no.
of repetitions desired
c) Increasing the value of loop counter each time the program segment within
the loop has been executed.

3. WHILE:
A while loop is ideally suited for cases where we want to do something a fixed no.
of times.

4. BREAK:
We often come across situations where we want to jump out of a loop instantly,
without waiting to get back to conditional test. The keyword break allows us to do
this. When break is encountered inside any loop, control automatically passes to
the first statement after the loop,

5. INPORT:
Inport reads a word from a hardware port
Inportb reads a byte from a hardware port

6. OUTPORT:
Outport outputs a word to a hardware port

72
Outportb outputs a byte to a hardware port

5.5 Proteus Design Suite

Figure 5.1.1

Developer(s) Lab center Electronics Ltd.

Initial release 1988

Stable release 8.8

Operating system Windows

Type Electronic design automation

Licence Proprietary

Website www.labcenter.com

73
Table 5.1.1
The Proteus Design Suite is a proprietary software tool suite used primarily for
electronic design automation. The software is used mainly by electronic design
engineers and technicians to create schematics and electronic prints for
manufacturing printed circuit boards.
It was developed in Yorkshire, England by Lab center Electronics Ltd and is available
in English, French, Spanish and Chinese languages.
5.5.1 History
The first version of what is now the Proteus Design Suite was called PC-B and was
written by the company chairman, John Jameson, for DOS in 1988. Schematic
Capture support followed in 1990, with a port to the Windows environment shortly
thereafter. Mixed mode SPICE Simulation was first integrated into Proteus in 1996
and microcontroller simulation then arrived in Proteus in 1998. Shape based auto-
routing was added in 2002 and 2006 saw another major product update with 3D
Board Visualisation. More recently, a dedicated IDE for simulation was added in
2011 and MCAD import/export was included in 2015. Support for high speed
design was added in 2017.Feature led product releases are typically biannual,
while maintenance based service packs are released as required.
5.5.2 Product Modules
The Proteus Design Suite is a Windows application for schematic capture,
simulation, and PCB (Printed Circuit Board) layout design. It can be purchased in
many configurations, depending on the size of designs being produced and the
requirements for microcontroller simulation. All PCB Design products include an
auto router and basic mixed mode SPICE simulation capabilities.
5.5.3 Schematic Capture
Schematic capture in the Proteus Design Suite is used for both the simulation of
designs and as the design phase of a PCB layout project. It is therefore a core
component and is included with all product configurations.
5.5.4 Microcontroller Simulation
The micro-controller simulation in Proteus works by applying either a hex file or a
debug file to the microcontroller part on the schematic. It is then co-simulated
along with any analog and digital electronics connected to it. This enables its use in
a broad spectrum of project prototyping in areas such as motor control
temperature control and user interface design. It also finds use in the general
hobbyist community and, since no hardware is required, is convenient to use as a
training or teaching tool Support is available for co-simulation of:
• Microchip Technologies PIC10, PIC12, PIC16 ,PIC18, PIC24,dsPIC33
Microcontrollers.
• Atmel AVR (and Arduino), 8051 and ARM Cortex-M3 Microcontrollers

74
• NXP 8051, ARM7, ARM Cortex-M0 and ARM Cortex-M3 Microcontrollers.
• Texas Instruments MSP430, PICCOLO DSP and ARM Cortex-M3
Microcontrollers.
• Parallax Basic Stamp, Free scale HC11, 8086 Microcontrollers.
5.5.6 PCB Design
The PCB Layout module is automatically given connectivity information in the form
of a netlist from the schematic capture module. It applies this information,
together with the user specified design rules and various design automation tools,
to assist with error free board design. PCB's of up to 16 copper layers can be
produced with design size limited by product configuration.
5.5.7 3D Verification
The 3D Viewer module allows the board under development to be viewed in 3D
together with a semi-transparent height plane that represents the board enclosure.
STEP output can then be used to transfer to mechanical CAD software such as Solid
works or Autodesk for accurate mounting and positioning of the board.

5.8 Arduino IDE

75
Figure 5.8.1

Developer(s) Arduino Software

Stable release 1.8.8 / 7 December 2018; 2 months ago[1]

Written in Java, C, C++

76
Operating system Windows, macOS, Linux

Platform IA-32, x86-64, ARM

Type Integrated development environment

License LGPL or GPL license

Website www.arduino.cc/en/Main/Software

Table 5.8.1

The Arduino integrated development environment (IDE) is a cross-


platform application (for Windows, mac OS, Linux) that is written in the
programming language Java. It is used to write and upload programs to Arduino
board.
The source code for the IDE is released under the GNU General Public License,
version 2. The Arduino IDE supports the languages C and C++ using special rules of
code structuring. The Arduino IDE supplies a software library from the Wiring
project, which provides many common input and output procedures. User-written
code only requires two basic functions, for starting the sketch and the main
program loop, that are compiled and linked with a program stub main() into an
executable cyclic executive program with the GNU toolchain, also included with the
IDE distribution. The Arduino IDE employs the program avrdude to convert the
executable code into a text file in hexadecimal encoding that is loaded into the
Arduino board by a loader program in the board's firmware.

5.9 What is Arduino?


Arduino is an open-source electronics platform based on easy-to-use hardware and
software. Arduino boards are able to read inputs - light on a sensor, a finger on a
button, or a Twitter message - and turn it into an output - activating a motor,
turning on an LED, publishing something online. You can tell your board what to do
by sending a set of instructions to the microcontroller on the board. To do so you
use the Arduino programming language (based on Wiring), and the Arduino
Software (IDE), based on Processing.
Over the years Arduino has been the brain of thousands of projects, from everyday
objects to complex scientific instruments. A worldwide community of makers -
students, hobbyists, artists, programmers, and professionals - has gathered around
this open-source platform, their contributions have added up to an incredible

77
amount of accessible knowledge that can be of great help to novices and experts
alike.
Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast
prototyping, aimed at students without a background in electronics and
programming. As soon as it reached a wider community, the Arduino board started
changing to adapt to new needs and challenges, differentiating its offer from
simple 8-bit boards to products for IoT applications, wearable, 3D printing, and
embedded environments. All Arduino boards are completely open-source,
empowering users to build them independently and eventually adapt them to their
particular needs. The software, too, is open-source, and it is growing through the
contributions of users worldwide.
5.10 Why Arduino?
Thanks to its simple and accessible user experience, Arduino has been used in
thousands of different projects and applications. The Arduino software is easy-to-
use for beginners, yet flexible enough for advanced users. It runs on Mac,
Windows, and Linux. Teachers and students use it to build low cost scientific
instruments, to prove chemistry and physics principles, or to get started with
programming and robotics. Designers and architects build interactive prototypes,
musicians and artists use it for installations and to experiment with new musical
instruments. Makers, of course, use it to build many of the projects exhibited at
the Maker Faire, for example. Arduino is a key tool to learn new things. Anyone -
children, hobbyists, artists, programmers - can start tinkering just following the
step by step instructions of a kit, or sharing ideas online with other members of the
Arduino community.
There are many other microcontrollers and microcontroller platforms available for
physical computing. Parallax Basic Stamp, Net media's BX-24, Phid gets, MIT's
Handy board, and many others offer similar functionality. All of these tools take
the messy details of microcontroller programming and wrap it up in an easy-to-use
package. Arduino also simplifies the process of working with microcontrollers, but
it offers some advantage for teachers, students, and interested amateurs over
other systems:
 Inexpensive - Arduino boards are relatively inexpensive compared to other
microcontroller platforms. The least expensive version of the Arduino module
can be assembled by hand, and even the pre-assembled Arduino modules cost
less than $50
 Cross-platform - The Arduino Software (IDE) runs on Windows, Macintosh OSX,
and Linux operating systems. Most microcontroller systems are limited to
Windows.
 Simple, clear programming environment - The Arduino Software (IDE) is easy-
to-use for beginners, yet flexible enough for advanced users to take advantage
of as well. For teachers, it's conveniently based on the Processing programming
environment, so students learning to program in that environment will be
familiar with how the Arduino IDE works.

78
 Open source and extensible software - The Arduino software is published as
open source tools, available for extension by experienced programmers. The
language can be expanded through C++ libraries, and people wanting to
understand the technical details can make the leap from Arduino to the AVR C
programming language on which it's based. Similarly, you can add AVR-C code
directly into your Arduino programs if you want to.
 Open source and extensible hardware - The plans of the Arduino boards are
published under a Creative Commons license, so experienced circuit designers
can make their own version of the module, extending it and improving it. Even
relatively inexperienced users can build the breadboard version of the
module in order to understand how it works and save money.

5.11 How do I use Arduino?


See the getting started guide. If you are looking for inspiration you can find a great
variety of Tutorials on Arduino Project Hub.
The text of the Arduino getting started guide is licensed under a Creative Commons
Attribution-Share Alike 3.0 License. Code samples in the guide are released into the
public domain

Bluetooth Controlled Robot car using Arduino


In this project, I will show you how to design and develop a Bluetooth
Controlled Robot using Arduino, HC-05 Bluetooth Module and L298N
Motor Driver Module. On the other end of the Bluetooth Communication,
I will be using a Smart Phone and a simple Android App to control the
Robotic Car.

Introduction
Robots are always a fancy topic for students, hobbyists and DIYers. If
you are beginner, then building a robot (like a car or an arm) is probably
one of the important projects to do after learning about the basics.

If you remember the earlier tutorial, I have discussed about HC-05


Bluetooth Module and how to interface one with Arduino. Also, I have
provided a simple Bluetooth Controller App, which can be installed on
your Android Phone and start transmitting the data.

79
As a continuation to that project, I will be implementing Bluetooth
Controlled Robot using Arduino and a few other components and build
a simple robotic car that can be controlled using an Android Phone
(through an App) over Bluetooth Communication.

Prerequisites for Bluetooth Controller Robot

Apart from Arduino, which is the main controlling module of the project,
there are two other important modules that you have to be familiar with
in order to implement the Bluetooth Controlled Robot project.

They are the HC-05 Bluetooth Module and the L298N Motor Driver
Module

Hardware Requirement

The list of components mentioned here are specifically for controlling 4 different
loads

80
Components Required
 Arduino UNO
 L298N Motor Driver Module
 HC-05 Bluetooth Module
 Robot Chassis
 4 x 5V Geared Motors
 Connecting Wires
 Battery Holder
 Power Supply
 Android Phone
 Bluetooth Controller

Arduino Robot car Bluetooth controller ciucrit digram

Figure

Code

The Arduino code for Bluetooth Controlled Robot project is given below.

void setup()
{
pinMode(13,OUTPUT);
pinMode(12,OUTPUT);
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
Serial.begin(9600);
Serial.println("enter f to Forward and r to Reverse");

81
}
void loop()
{
while(Serial.available())
{
//wait until user enters the data
}
if(Serial.available())
{
if(Serial.available())
{
char input = Serial.read();
switch(input)
{
case'f':
Serial.println("Forward");
digitalWrite(13,HIGH);
digitalWrite(9,HIGH);
digitalWrite(12,LOW);
digitalWrite(10,LOW);
break;
case 'r':
Serial.println("Reverse");
digitalWrite(12,HIGH);
digitalWrite(10,HIGH);
digitalWrite(13,LOW);
digitalWrite(9,LOW);
break;
Serial.println("Forward");
digitalWrite(13,HIGH);
digitalWrite(9,HIGH);
digitalWrite(12,LOW);
digitalWrite(10,LOW);
break;
Serial.println("Reverse");
digitalWrite(12,HIGH);
digitalWrite(10,HIGH);
digitalWrite(13,LOW);
digitalWrite(9,LOW);
break;

default:
Serial.println("you entered wrong character");
}//end of switch
}//end of lf
}//end of loop

82
}

 Arduino uno R3

The Arduino UNO is an open-source microcontroller board based on


the Microchip ATmega328P microcontroller and developed by Arduino.cc. The board
is equipped with sets of digital and analog input/output (I/O) pins that may be
interfaced to various expansion boards (shields) and other circuits. The board has 14
Digital pins, 6 Analog pins, and programmable with the Arduino IDE (Integrated
Development Environment) via a type B USB cable. It can be powered by a USB cable
or by an external 9 volt battery, though it accepts voltages between 7 and 20 volts. It
is also similar to the Arduino Nano and Leonardo. The hardware reference design is
distributed under a Creative Commons Attribution Share-Alike 2.5 license and is
available on the Arduino website. Layout and production files for some versions of
the hardware are also available. "Uno" means one in Italian and was chosen to mark
the release of Arduino Software (IDE) 1.0. The Uno board and version 1.0 of Arduino
Software (IDE) were the reference versions of Arduino, now evolved to newer

83
releases. The Uno board is the first in a series of USB Arduino boards, and the
reference model for the Arduino platform. The ATmega328 on the Arduino Uno
comes pre-programmed with a bootloader that allows uploading new code to it
without the use of an external hardware programmer. t communicates using the
original STK500 protocol. The Uno also differs from all preceding boards in that it
does not use the FTDI USB-to-serial driver chip. Instead, it uses the Atmega16U2
(Atmega8U2 up to version R2) programmed as a USB-to-serial converter.

L293D Motor driver

The Motor Driver is a module for motors that allows you to control the working
speed and direction of two motors simultaneously .This Motor Driver is designed and
developed based on L293D IC.

L293D is a 16 Pin Motor Driver IC. This is designed to provide bidirectional drive
currents at voltages from 5 V to 36 V.

L293D Pin Diagram

L293D IC Pin Out

The L293D is a 16 pin IC, with eight pins, on each side, to controlling of two DC motor
simultaneously. There are 4 INPUT pins, 4 OUTPUT pins and 2 ENABLE pin for each
motor.

84
Pin 1: When Enable1/2 is HIGH, Left part of IC will work, i.e motor connected with
pin 3 and pin 6 will rotate.

Pin 2: Input 1, when this pin is HIGH the current will flow though output 1.

Pin 3: Output 1, this pin is connected with one terminal of motor.

Pin 4/5: GND pins

Pin 6: Output 2, this pin is connected with one terminal of motor.

Pin 7: Input 2, when this pin is HIGH the current will flow though output 2.

Pin 8: VSS, this pin is used to give power supply to connected motors from 5V to 36V
maximum depends on Motor connected.

Pin 9: When Enable 3/4 is HIGH, Right part of IC will work, motor connected with pin
11 and pin 14 will rotate.

Pin 10: Input 4, when this pin is HIGH the current will flow though output 4.

Pin 11: Output 4, this pin is connected with one terminal of motor.

Pin 12/13: GND pins

Pin 14: Output 3, this pin is connected with one terminal of motor.

Pin 15: Input 3, when this pin is HIGH the current will flow though output 3.

Pin 16: VCC, for supply power to IC 5V.

85
Figure

HC-05 Bluetooth Module

 It is used for many applications like wireless headset, game controllers,


wireless mouse, wireless keyboard and many more consumer applications.
 It has range up to <100m which depends upon transmitter and receiver,
atmosphere, geographic & urban conditions.
 It is IEEE 802.15.1 standardized protocol, through which one can build
wireless Personal Area Network (PAN). It uses frequency-hopping spread
spectrum (FHSS) radio technology to send data over air.
 It uses serial communication to communicate with devices. It communicates
with microcontroller using serial port (USART).

HC-05 Bluetooth Module


 HC-05 is a Bluetooth module which is designed for wireless communication.
This module can be used in a master or slave configuration.

86
HC-05 Bluetooth Module
Pin Description

Bluetooth serial modules allow all serial enabled devices to communicate with each
other using Bluetooth.

It has 6 pins,

1. Key/EN: It is used to bring Bluetooth module in AT commands mode. If Key/EN pin


is set to high, then this module will work in command mode. Otherwise by default it
is in data mode. The default baud rate of HC-05 in command mode is 38400bps and
9600 in data mode.

HC-05 module has two modes,

1. Data mode: Exchange of data between devices.

2. Command mode: It uses AT commands which are used to change


setting of HC-05. To send these commands to module serial (USART)
port is used.

2. VCC: Connect 5 V or 3.3 V to this Pin.

87
3. GND: Ground Pin of module.

4. TXD: Transmit Serial data (wirelessly received data by Bluetooth module


transmitted out serially on TXD pin)

5. RXD: Receive data serially (received data will be transmitted wirelessly by


Bluetooth module).

6. State: It tells whether module is connected or not

Robot Chassis

Two Wheel Drive Robot Chassis is the perfect mechanical platform for your robotics
projects. This kit includes all the hardware and mechanical components required to
build your robot, including motors, wheels, chassis, nut and bolts, etc. Just add your
electronics - Arduino/Raspberry Pi and Motor Driver and you can start programming
your robot. It offers a large space with predrilled holes for mounting sensors and
electronics as per your requirement. This robot chassis lets you get your mechanical
platform ready in minutes and quick start your robot building process. Allows you to
spend your time and effort on programming your robot rather than designing and
fabricating your own custom platform.

Wheeled Robots are most popular robot platforms and are easy to run, maintain and
use. Simple to build and program, this kit is the simplest robot platform. Highly
recommended for beginners and novice users. Building robots using this wheeled kit
is fun and a great learning experience too. This 2WD Robot Kit costs less, is simple to

88
build, maintain and program. Our 4WD Kit lets you go faster, carry more weight, and
carry bigger load compared to the 2WD Kit. You can build line following robots,
obstacle avoiding robots, maze solvers, and other robots using this kit.

We have carefully selected the high quality motor, wheel and platform combination
for the best performance. All 2 Motors come with matching wheels and mounting
hardware. The motors also include encoder discs to measure speed and the distance
traveled by the robot. Since this is a very popular robot kit, numerous assembly and
usage instructions are available on the internet. Assembly manual is included in the
kit too.

Assembling the Chassis

89
Solder two wires to each DC motor. Then fix two motors to the chassis using
the screws. If you need any clarification, please watch this and it will show you
how to assemble the Smart 2WD Robot car chassis.

90
 Connecting Wires

A jump wire (also known as jumper wire, or jumper) is an electrical wire, or group of
them in a cable, with a connector or pin at each end (or sometimes without them –
simply "tinned"), which is normally used to interconnect the components of
a breadboard or other prototype or test circuit, internally or with other equipment
or components, without soldering.
Individual jump wires are fitted by inserting their "end connectors" into the slots
provided in a breadboard, the header connector of a circuit board, or a piece of test
equipment.

 Power supply

Power supply is an electrical device that supplies to an electrica powerl load. The
primary function of a power supply is to convert electric current from a source to the
correct voltage, current, and frequency to power the load. As a result, power
supplies are sometimes referred to as electric power converters. Some power
supplies are separate standalone pieces of equipment, while others are built into the
load appliances that they power. Examples of the latter include power supplies found
in desktop computers and consumer electronics devices. Other functions that power
supplies may perform include limiting the current drawn by the load to safe levels,
shutting off the current in the event of an electrical fault, power conditioning to
prevent electronic noise or voltage surges on the input from reaching the
load, power-factor correction, and storing energy so it can continue to power the
load in the event of a temporary interruption in the source power (uninterruptible
power supply).
All power supplies have a power input connection, which receives energy in the form
of electric current from a source, and one or more power output connections that
deliver current to the load. The source power may come from the electric power
grid, such as an electrical outlet, energy storage devices such as batteries or fuel
cells, generators or alternators, solar power converters, or another power supply.
The input and output are usually hardwired circuit connections, though some power

91
supplies employ wireless energy transfer to power their loads without wired
connections. Some power supplies have other types of inputs and outputs as well,
for functions such as external monitoring and control.

The Android App

92
1. Download Smart car on your android mobile

2. Install the app. If your mobile prevent installing the app, Go to

3. Open the app

4. At the beginning, the app will show "Disconnected" and the HC-06 Bluetooth

module red LED will blink

5. Tap the Bluetooth symbol ᛒ on the app

6. Select something named with HC-06

7. Now the app will show connected and the LED in the HC-06 Bluetooth module

will light up continuously without blinking

Working

Assemble the robot, make the necessary connections and upload the code to
Arduino. If you understood the HC-05 Bluetooth Module tutorial, then understanding
the Bluetooth Controlled Robot project is very easy.

93
First, in the Android App, I have used 5 keys as Forward, Reverse, Left, Right and
Stop. The corresponding data associated with each key is as follows:

 Forward – 1
 Reverse – 2
 Left – 3
 Right – 4
 Stop – 5

When a key is pressed, the corresponding data is transmitted to the Bluetooth


Module from the Phone over Bluetooth Communication.

In the Arduino code, the Arduino UNO receives any of this data from the Bluetooth
Module (as per the key pressed) and performs a simple switch case operation, where
each case associated with appropriate instructions to the Motor Driver Input Pins.

For example, if ‘Forward’ key is pressed in the Android Phone, then ‘1’ is transmitted.
Arduino will then make IN1 and IN3 as HIGH and IN2 and IN4 as LOW to achieve a
forward motion.

Similarly, other keys correspond to appropriate setting of IN1 – IN4 pins.

Limitations

 As the range of the Bluetooth Communication is limited (a maximum of 10


meters for class 2 devices for example) the control range of Bluetooth
Controlled Robot is also limited.
 Make sure that sufficient power is provided to all the modules especially the
Bluetooth Module. If the power is not sufficient, even though the Bluetooth
Module powers on, it cannot transmit data or cannot be paired with other
Bluetooth devices.

Applications

 Low range Mobile Surveillance Devices


 Military Applications (no human intervention)
 Assistive devices (like wheelchairs)

94
95
Thank you

96

Das könnte Ihnen auch gefallen