Professional Documents
Culture Documents
Project /training Report On Embedded System: Parminder Kaur ROLL NO 1625755 Ssiet, Jalandhar
Project /training Report On Embedded System: Parminder Kaur ROLL NO 1625755 Ssiet, Jalandhar
PROJECT
/TRAINING REPORT
ON EMBEDDED
SYSTEM
PARMINDER KAUR1
ROLL NO 1625755
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
At
INFOWIZ
Chandigarh
Place: Chandigarh
Date: ,2019
3
CHAPTER-1
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 softwares & engineering subjects. “INFOWIZ”
is in a strong position to work with reputed Universities and
Corporates`
Company Strategy
Vision:
4
• 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
INFOWIZwon 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.
• Best Industrial Training Award 2015 from Dr .Udit Raj (MP) & Mrs.
Vimla Mehra (IPS Delhi)
Product Portfolio
• Web Development (PHP & .NET)
5
• JAVA (Core & Advance)
• CCDP certification
• Robotics
• MATLAB
• C/C++/Data structure
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
6
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
Sn URL's Countr
Projects
o. y
1 Viva Sales www.INFOWIZ .in/vivasales UK
Germa
2 Mds Creative
www.mdscreative.com ny
3 Liddle TV www.filmon.com UK
Ongoing Austral
4 Paradigms(Android)
ia
5 Printcost www.popgraphics.net UK
www.bootstrap.achieversperfect.c
6 PSTDO Bootstrap
om USA
Austral
7
Essencesoftwares www.essencesoftwares.com ia
Dashboard Ongoing
8
(WordPress) USA
9 Realstate www.realstate.INFOWIZ .in Russia
Dealpartners(WordP www.dealpartners.co.uk.gridhost
10
ress) ed.co.uk UK
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.
8
EMBEDDED SYSTEMS
TABLE OF CONTENTS
Micro-controller 8051
Introduction to Kiel.
Proteus
Arduino IDE
Commands used.
Introduction to ISP.
6) Some Basic programs using assembly 127-130
9
10
ELECTRONIC DEVICES
ELECTRICAL RESISTANCE:
R=V / I
where
11
R is the resistance of the object, usually measured in ohms, equivalent
to J.s/C2
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 Digilab
resistors are rated to dissipate 250mW of power, or 1/4 Watt. Resistors that
12
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 colors 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 multiplied by 10 raised to the power indicated by the
colour of the multiplier band. The following table associates band colors to
digits and multiplier factors. Simply multiply the two-digit value by the
multiplier, and you’ve got the resistor value.
13
White 9 109 N/A Resistor schematic
Gold N/A .1 5% symbol
Silver N/A .01 10%
No color N/A N/A 20%
Resistors are manufactured with many body colors, with tan or light brown
being the most typical. The only significant resistor body colors are white and
blue; these colors 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 Digilab
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.
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.
14
RESISTANCE IN SERIES AND PARALLEL CIRCUITS
Series circuits
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
15
re-combining when the branches meet again. The voltage across each resistor
in parallel is the same.
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:
The individual currents can also be found using I = V / R. The voltage across
each resistor is 10 V, so:
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.
16
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.
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.
CAPACITORS
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.
17
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 Digilab board.
18
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 Digilab 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 Digilab board.
The majority of the capacitors (24 out of 27) are used to decouple Digilab's
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 Digilab 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 Digilab board uses 0.047uF bypass capacitors. The board
19
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.
ENERGY STORAGE
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.
20
CAPACITORS IN SERIES
1 1 1 1
......
Ceq C1 C2 Cn
CAPACITORS IN PARALLEL
Ceq = C1 + C2 + ….. + Cn
CAPACITOR TYPES
21
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.
22
equivalent series resistance are available. Tend to lose capacity in low
temperatures. Can achieve high capacities.
USES OF CAPACITORS
Timing - for example with a 555 timer IC controlling the charging and
discharging.
23
Storing energy - for example in a camera flash circuit
CURRENT
VOLTAGE
RESISTANCE
OHM'S LAW
Ohm's law predicts the current in an (ideal) resistor (or other ohmic device) to
be applied voltage divided by resistance:
I=V/R
24
Where
MEASURING INSTRUMENTS
VOLTMETER
25
AMMETER
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).
26
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
OHMMETER
27
R= V/1
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
28
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.
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 Digilab 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.
29
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.
Diodes locations on the circuit board are typically denoted with a "D-"
reference designator
30
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.
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.
LEDs produce more light per Watt than do incandescent bulbs; this is
useful in battery powered devices.
LEDs can emit light of an intended color without the use of color filters
that traditional lighting methods require. This is more efficient and can
lower initial costs.
31
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,
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.
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.
32
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
33
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 color of the plastic lens is often the same as the
actual color 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
blinkies.
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 colors.
Some of these applications are further elaborated upon in the following text.
34
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.
Red, yellow, green, and blue LEDs can be used for model railroading
applications.
Remote controls, such as for TVs and VCRs, often use infrared LEDs.
35
Glow lights, as a more expensive but longer lasting and reusable
alternative to Glow sticks.
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.
LED phototherapy for acne using blue or red LEDs has been proven to
significantly reduce acne over a 3 month period.
36
low-voltage regulators. Zener diodes are not available below voltages
of about 3 V.
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
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
37
copper ring can be crimped to the end of the solenoid. This "shading ring"
creates a small out-of-phase current, which increases the minimum pull on
the armature during the AC cycle. [1]
APPLICATIONS
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 co~trol office lighting as the low voltage wires are easily
installed in partitions, which may be often moved as needs change.
38
They may also be controlled by room occupancy detectors in an effort
to conserve energy,
ALTERNATING CURRENT
DIRECT CURRENT
39
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.
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,
40
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, 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.
41
42
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
ADVANTAGES
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.
43
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.
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
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
44
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 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
0 0 0
45
0 1 0
1 0 0
1 1 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
0 0 0
0 1 1
1 0 1
1 1 1
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.
46
Input Input
1 0
0 1
Symbol
NAND GATE
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 outputis
"false" if both inputs are "true." Otherwise, the output is "true."
Symbol
0 0 1
0 1 1
1 0 1
1 1 0
47
NOR GATE
NOR gate
0 0 1
0 1 0
1 0 0
1 1 0
XNOR GATE
48
Input 1 Input 2 Output
0 0 1
0 1 0
1 0 0
1 1 1
49
50
INTRODUCTION TO EMBEDDED SYSTEM
51
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.
52
53
KIEL
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.
54
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.
55
Keil Software
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
56
The pVision Debugger provides a number of ways to display variables and
program objects.
Executing
pVision offers several ways you can control and manipulate program
execution.
57
Reset - It is possible to debug reset conditions using the pVision
Simulator.
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.
58
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.
Simulation
Simulation capabilities make it possible to test your target system without
target hardware.
Target Debugging
Target debug drivers allow you to test programs running on target hardware.
59
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.
60
ABOUT C
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.
STEPS IN LEARNING C
Alphabets, Constants,
digits, special variables, Instructions Program
symbols keywords
USAGE
62
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.
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>
63
int main(void)
{
printf(“hello, world\n”);
return 0;
}
This program which will print out the message This is a C program
#include <stdio.h>
main()
{
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
64
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.
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,
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.
_______________________________________________________________
Assignment Statement
65
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
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulo Reduction (Remainder from integer division)
66
velocity = distance / time;
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);
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.
67
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;
Logical Connectors
Symbol Meaning
&& And
II Or
! Not
68
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.
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”);
Special Characters
C code Meaning
COMMANDS USED
69
1. SWITCH-CASE STATEMANT:
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.
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:
70
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
Outportb outputs a byte to a hardware port
71
Developer(s) Labcenter Electronics Ltd.
Licence Proprietary
Website www.labcenter.com
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
72
2011 and MCAD import/export was included in 2015. Support for high
speed design was added in 2017. [1]Feature led product releases are
typically biannual, while maintenance based service packs are released
as required.
Product Modules
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.
Microcontroller Simulation
73
• Microchip Technologies PIC10, PIC12, PIC16,PIC18,PIC24,dsPIC33
Microcontrollers.
PCB Design
3D Verification
74
Arduino IDE
Website www.arduino.cc/en/Main/Software
75
The Arduino integrated development environment (IDE) is
a cross-platform application (for Windows, macOS, Linux) that
is written in the programming language Java. It is used to write
and upload programs to Arduino board.[2]
The source code for the IDE is released under the GNU General
Public License, version 2.[3] The Arduino IDE supports the
languages C and C++ using special rules of code
structuring.[4] The Arduino IDE supplies a software library from
the Wiringproject, 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.[5] 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.
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.
76
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 amount of accessible
knowledge that can be of great help to novices and experts
alike.
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
77
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.
79
Introduction
Nowadays, we have remote controls for our television sets and
other electronic systems, which have made our lives real easy.
Have you ever wondered about home automation which would
give the facility of controlling tube lights, fans and other
electrical appliances at home using a remote control? Off-
course, Yes! But, are the available options cost-effective? If the
answer is No, we have found a solution to it. We have come up
with a new system called Arduino based home automation
using Bluetooth. This system is super-cost effective and can
give the user, the ability to control any electronic device
without even spending for a remote control. This project helps
the user to control all the electronic devices using his/her
smartphone.
Project Aim
The aim of the project is to design and construct a home
automation system that will remotely switch on or off any
household appliances connected to it, using a microcontroller,
voice dial on phone, or Bluetooth based android application.
80
Project Objective
The objective of this project is to implement a low cost, reliable
and scalable home automation system that can be used to
remotely switch on or off any household appliance, using a
microcontroller to achieve hardware simplicity, low cost short
messaging service for feedback and voice dial from any phone
to toggle the switch state.
When the user presses on the ‘On’ button displayed on the app
for the device 1, the Buzzer is switched on. This Buzzer can be
switched off, by pressing the same button again.
Similarly, when the user presses on the ‘On’ button displayed
on the app for the device 2, the fan is switched on. The fan can
be switched off, by pressing the same button again.
81
This project of home automation using Bluetooth and Arduino
can be used for controlling any AC or DC devices. In the
demonstration, we have used DC Fan and DC Bulb. To drive this
DC Fan and Light, a 9V battery is connected.
Hardware Requirement
The list of components mentioned here are specifically for
controlling 4 different loads.
Arduino Uno with Atmega 328P microcontroller
HC – 05 Bluetooth Module
10 KΩ Resistor
1 KΩ Resistor X 4
BC547 NPN Transistor X 4
1N4007 Diode X 4
5 V Relay X 4
Prototyping board (Bread board)
Connecting wires
9 V Power supply
Smartphone or tablet (Bluetooth enabled)
Software Requirement
Arduino IDE
Proteus 7
Android application
83
Circuit Diagram
84
HC-05 Bluetooth Module Interfacing with Arduino UNO HC-05
is a Bluetooth device used for wireless communication with
Bluetooth enabled devices (like smartphone). It communicates
with microcontrollers using serial communication (USART).
Default settings of HC-05 Bluetooth module can be changed
using certain AT commands. As HC-05 Bluetooth module has
3.3 V level for RX/TX and microcontroller can detect 3.3 V level,
so, there is no need to shift TX voltage level of HC-05 module.
But we need to shift the transmit voltage level from
microcontroller to RX of HC-05 module.
Applications
88
Using this project, we can turn on or off appliances remotely
i.e. using a phone or tablet.
The project can be further expanded to a smart home
automation system by including some sensors like light sensors,
temperature sensors, safety sensors etc. and automatically
adjust different parameters like room lighting, air conditioning
(room temperature), door locks etc. and transmit the
information to our phone.
Additionally, we can connect to internet and control the home
from remote location over internet and also monitor the safety.
Future Development of the project
Arduino based device control using Bluetooth on Smartphone
project can be enhanced to control the speed of the fan or
volume of the buzzer etc.
Home automation and Device controlling can be done using
Internet of Things – IOT technology.
We can replace Bluetooth by GSM modem so that we can
achieve device controlling by sending SMS using GSM modem.
Conclusion
The home automation system has been experimentally proven
to work satisfactorily by connecting sample appliances to it and
the appliances were successfully controlled from a wireless
mobile device. We learned many skills such as soldering, wiring
the circuit and other tools that we use for this project and was
able to work together as a team during this project. The
Bluetooth client was successfully tested on a multitude of
different mobile phones from different manufacturers, thus
proving its portability and wide compatibility. Thus a low-cost
home automation system was successfully designed,
implemented and tested.
89
Reference
The web sites that provide the information’s:
90