0% found this document useful (0 votes)
425 views114 pages

MODULE 3 Embedded Systems Sensors and Interfacing Actuators Communcation Interface

The document discusses different topics related to embedded systems including definitions, classifications, applications, and components. It defines embedded systems and compares them to general computing systems. Embedded systems are classified based on generation, complexity, and performance, with examples provided for each classification. The document also outlines major application areas for embedded systems and lists common system elements.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
425 views114 pages

MODULE 3 Embedded Systems Sensors and Interfacing Actuators Communcation Interface

The document discusses different topics related to embedded systems including definitions, classifications, applications, and components. It defines embedded systems and compares them to general computing systems. Embedded systems are classified based on generation, complexity, and performance, with examples provided for each classification. The document also outlines major application areas for embedded systems and lists common system elements.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 114

MODULE - 3

Prof. Chandra Shekar P


Asst. Professor
Dept. Of ECE
ATME College of Engineering, Mysuru
Module -3
Embedded Systems – Definition, Embedded systems vs general computing
systems, Classification of Embedded Systems, Major application areas of
Embedded Systems, Elements of an Embedded System, Core of the
Embedded System, Microprocessor vs Microcontroller, RISC vs CISC,
Harvard vs Von-Neumann. Text
Sensors and Interfacing – Instrumentation and control systems, Transducers,
Sensors.
Actuators, LED, 7-Segment LED Display, Stepper Motor, Relay, Piezo
Buzzer, Push Button Switch, Keyboard.
Communication Interface, UART, Parallel Interface, USB, Wi-Fi, GPRS.
24-02-2022 Department of Electronics and Communication Engineering 2
What is Embedded Systems ?
An Electronic/Electro mechanical system which is
designed to perform a specific function and is a
combination of both hardware and firmware
(Software).

24-02-2022 Department of Electronics and Communication Engineering 3


Embedded Systems Vs General Computing Systems
General Computing System Embedded Systems
combination of generic hardware and General combination of special purpose hardware and
Purpose Operating System embedded OS for executing a specific set of
applications
Contain a General Purpose Operating System May or may not contain an operating system for
(GPOS) functioning
Applications are alterable (programmable) by user The firmware of the embedded system is pre-
programmed and it is non-alterable by end-user
Application specific requirements (like performance,
Performance is the key deciding factor on the
power requirements, memory usage etc) are the key
selection of the system. Always ‘Faster is Better’
deciding factors

24-02-2022 Department of Electronics and Communication Engineering 4


Embedded Systems Vs General Computing Systems
General Computing System Embedded Systems
Less/not at all tailored towards reduced Highly tailored to take advantage of the
operating power requirements, options for power saving modes supported by
different levels of power management. hardware and Operating System

Response requirements are not time For certain category of embedded systems
critical like mission critical systems, the response
time requirement is highly critical
Need not be deterministic in execution Execution behavior is deterministic for
behavior certain type of embedded systems like
‘Hard Real Time’ systems
24-02-2022 Department of Electronics and Communication Engineering 5
Classification
of Embedded
Systems
24-02-2022 Department of Electronics and Communication Engineering 6
Classification of Embedded Systems
Based on Generation
Second Fourth
First Generation Third Generation
Generation Generation

Based on Complexity and performance


Small Scale Embedded Medium Scale Large Scale Embedded
Systems Embedded Systems Systems

24-02-2022 Department of Electronics and Communication Engineering 7


Classification of Embedded Systems
based on Generation
First Generation
• 8 Bit Microprocessors(8085) and 4 bit Microcontrollers . Simple in hardware
circuits with firmware developed in assembly code.
Digital Telephone Keypads, Stepper Motor Control units.

Second Generation
• built around 16 bit microprocessors. 8 bit and 16 bit microcontrollers. More
complex and powerful
Data Acquisition systems, SCADA systems

24-02-2022 Department of Electronics and Communication Engineering 8


Classification of Embedded Systems
based on Generation
Third Generation
Application and domain specific processors/controllers like Digital Signal
Processors(DSP) and Application Specific Integrated Circuits(ASICs)
Instruction set more complex and powerful
Instruction Pipelining
Fourth Generation
System on Chip, Reconfigurable processors and multicore processors
High performance, tight integration and miniaturization
24-02-2022 Department of Electronics and Communication Engineering 9
Classification Based on
Complexity and Performance

Small Scale Embedded Systems

Medium Scale Embedded Systems

Large Scale Embedded Systems


24-02-2022 Department of Electronics and Communication Engineering 10
Classification of Embedded Systems based on
Complexity and Performance

Small Scale Embedded Systems


• Simple in application needs, performance requirements are not time critical
• Built on low cost 8 or 16 bit microprocessors/microcontrollers
• May or may not contain an operating system for its functioning
Eg: Electronic Toy

24-02-2022 Department of Electronics and Communication Engineering 11


Classification of Embedded Systems based on
Complexity and Performance

Medium Scale Embedded Systems


• Slightly complex in hardware and firmware requirements
• Built around low cost 16 bit/ 32 bit
microprocessors/microcontrollers
• Usually contain an embedded operating system
24-02-2022 Department of Electronics and Communication Engineering 12
Classification of Embedded Systems based on
Complexity and Performance

Large Scale Embedded Systems


• Highly complex hardware and firmware requirements.
• Mission critical applications demanding high performance
• May contain multiple processors/controllers and co units/ hardware
accelerators
• Complex embedded systems usually contain a high performance RTOS
24-02-2022 Department of Electronics and Communication Engineering 13
Home Automation and Automotive Industry:
Major Applications

Consumer Household Appliances:


Security Systems: Air Anti-lock breaking
Electronics: Television, DVD players,
conditioners, sprinklers, systems (ABS), Engine
Washing machine,
Camcorders, Intruder detection Control, Ignition
of Embedded

Fridge, Microwave Oven


Cameras etc. alarms, Closed Circuit Systems, Automatic
etc.
Television Cameras Navigation Systems etc.
Systems

Telecom: Cellular Computer


Computer Health Care:
Telephones, Networking Systems:
Peripherals: Printers, Different Kinds of
Telephone switches, Network Routers,
Scanners, Fax Scanners, EEG, ECG
Handset Multimedia Switches, Hubs,
machines etc. Machines etc.
Applications etc. Firewalls etc.

Measurement & Banking & Retail:


Card Readers:
Instrumentation: Digital Automatic Teller
Barcode, Smart Card
multi meters, Digital Machines (ATM) and
CROs, Logic Analyzers Readers, Hand held
Currency counters,
PLC systems etc. Devices etc.
Point of Sales (POS)

24-02-2022 Department of Electronics and Communication Engineering 14


FPGA/ASIC/DSP/SoC
Microprocessor/controller Embedded

Elements of an
Firmware

Memory
Embedded
Communication Interface
Systems
System
I/p Ports Core O/p Ports
(Sensors)
(Actuators)

Other supporting
Integrated Circuits &
subsystems

Embedded System

Real World
24-02-2022 Department of Electronics and Communication Engineering 15
General Purpose and Domain Specific Processors
• Microprocessors
Core of the
Embedded

• Microcontrollers
System

• Digital Signal Processors

Programmable Logic Devices (PLDs)

Application Specific Integrated Circuits (ASICs)

Commercial off the shelf Components (COTS)


24-02-2022 Department of Electronics and Communication Engineering 16
Microprocessor
Vs
Microcontroller

24-02-2022 Department of Electronics and Communication Engineering 17


Microprocessor
❖ CPU for Computers
❖ No RAM, ROM, I/O on CPU chip itself
❖ Example:Intel’s x86, Motorola’s 680x0
Many chips on mother board
Data Bus
CPU
General-
Serial
Purpose RAM ROM I/O Timer COM
Micro- Port
Port
processor
Address Bus

24-02-2022 Department of Electronics and Communication Engineering 18


Microcontroller

❖ A smaller computer
CPU RAM ROM ❖ On-chip RAM, ROM, I/O ports...
A single chip ❖ Example : Motorola’s 6811,
I/O
Serial Intel’s 8051, Zilog’s Z8 and PIC
Timer COM
Port
Port
16X

24-02-2022 Department of Electronics and Communication Engineering 19


Microprocessor
V/S
Microcontroller
Microprocessor Microcontroller
• Silicon chip representing a CPU, performs • Highly integrated chip contains CPU, scratch
arithmetic and logical operations pad RAM, on chip ROM/flash memory, I/O
• Dependent Unit ports
• General purpose in design and operation • Self contained unit
• Doesn’t contain I/O port • Application oriented and domain specific

• Limited power saving options compared to • Contains multiple built in I/O ports
microcontrollers • Includes lot of power saving features

24-02-2022 Department of Electronics and Communication Engineering 20


Microcontroller
Architecture

Harvard Von Neumann

24-02-2022 Department of Electronics and Communication Engineering 21


Harvard Architecture

24-02-2022 Department of Electronics and Communication Engineering 22


Von Neumann Architecture

24-02-2022 Department of Electronics and Communication Engineering 23


Harvard Architectures Von Neumann
Architectures
❖Separate buses for instruction ❖Single shared bus for
and data fetching instruction and data fetching
❖Easier to pipeline, so high ❖Low performance Compared to Harvard
performance Harvard Architecture vs
❖Comparatively high cost ❖Cheaper
❖No memory alignment ❖Allows self modifying codes Von Neumann
problems ❖Since data memory and Architectures
❖Since data memory and program memory are stored
program memory are stored physically in same chip,
physically in different locations, chances for accidental
no chances for accidental corruption of program memory
corruption of program memory
24-02-2022 Department of Electronics and Communication Engineering 24
RISC PROCESSOR CISC PROCESOR
❖Lesser no. of instructions ❖Greater no. of Instructions
❖Instruction Pipelining and ❖Generally no instruction
RISC increased execution speed pipelining feature
❖Orthogonal Instruction Set ❖Non Orthogonal Instruction
vs ❖Operations are performed on Set
CISC registers only, the only memory
operations are load and store
❖Operations are performed on
registers or memory depending
Processors ❖Large number of registers are on the instruction
available ❖Limited no. of general purpose
registers

24-02-2022 Department of Electronics and Communication Engineering 25


RISC PROCESSOR CISC PROCESOR
❖Programmer needs to write more ❖Instructions are like macros in C
code to execute a task since the language
instructions are simpler ones
RISC ❖Variable length Instructions
❖Single, Fixed length Instructions
vs ❖More silicon usage since more
CISC ❖Less Silicon usage and pin count additional decoder logic is
required to implement the
Processors ❖Harvard Architecture complex instruction decoding

❖Can be Harvard or Von-Neumann


Architecture

24-02-2022 Department of Electronics and Communication Engineering 26


Sensors and Interfacing
❖ Sensors provide us with the means of generating signals that can be used
as an input to electronic circuit.
❖ The things that we might want to send includes physical parameters such as
temperature, light level and pressure.
❖ Being able to generate an electrical signal that accurately represents these
quantities allows us not only to measure and record these values but also to
control them.
❖ Sensors are in fact a subset of a larger family of devices known as a
transducer
❖ Instrumentation and control systems in which sensors transducers and a
signal conditioning circuit are used
24-02-2022 Department of Electronics and Communication Engineering 27
Instrumentation and Control Systems
❖Instrumentation: Technology of measurement
➢ An instrument is a device that measures or manipulates process physical variables such as flow,
temperature, level, or pressure etc.

Fig. shows the arrangement of an instrumentation system.

The physical quantity to be measured (e.g. temperature) acts upon a sensor that produces an electrical output
signal.
24-02-2022 Department of Electronics and Communication Engineering 28
Instrumentation and Control Systems cont.,
This signal is an electrical analogue of the physical input but
▪ there may not be a linear relationship between the physical quantity and its
electrical equivalent.
▪ Also, the output produced by the sensor may be small or may suffer from the
presence of noise (i.e. unwanted signals)
further signal conditioning will be required before
▪ the signal will be at an acceptable level and in an acceptable form
▪ for signal processing, display and recording.
the signal processing may use digital rather than analogue signals
▪an additional stage of analogue-to-analogue conversion may be required.

24-02-2022 Department of Electronics and Communication Engineering 29


Control System A control system is a system, which provides the desired response
by controlling the output.

24-02-2022 Department of Electronics and Communication Engineering 30


This uses negative feedback in order to regulate and stabilize the output.
It thus becomes possible to set the input or demand (i.e. what we desire the output to be)
& leave the system to regulate itself by comparing it with a signal derived from the output (via a sensor and
appropriate signal conditioning).
A comparator is used to sense the difference in these two signals and where any discrepancy is detected the input
to the power amplifier is adjusted accordingly.
This signal is referred to as an error signal (it should be zero when the output exactly matches the demand).
The input (demand) is often derived from a simple potentiometer connected across a stable d.c. voltage source
while the
controlled device can take many forms (e.g. a d.c. motor, linear actuator, heater, etc.).
24-02-2022 Department of Electronics and Communication Engineering 31
Transducers
➢Transducers are devices that convert energy in the form of sound, light, heat, etc., into an
equivalent electrical signal, or vice versa.
➢Examples:
➢ A loudspeaker is a transducer that converts low frequency electric current into audible sounds.
➢ A microphone, is a transducer that performs the reverse function, i.e. that of converting sound pressure
variations into voltage or current.
➢ Loudspeakers and microphones can thus be considered as complementary transducers.

➢Transducers may be used both as inputs to electronic circuits & outputs from them.
➢ a loudspeaker is an output transducer designed for use in conjunction with an audio system.
➢ A microphone is an input transducer designed for use with a recording or sound reinforcing system.
24-02-2022 Department of Electronics and Communication Engineering 32
24-02-2022 Department of Electronics and Communication Engineering 33
Some Examples of Input Transducers
Physical quantity: Sound (pressure change)
Input transducer: Dynamic microphone
Diaphragm attached to a coil is suspended in
a magnetic field.
Movement of the diaphragm causes current
to be induced in the coil.

24-02-2022 Department of Electronics and Communication Engineering 34


24-02-2022 Department of Electronics and Communication Engineering 35
Physical quantity: Temperature Input transducer: Thermocouple
Small emf generated at the junction between two dissimilar metals (e.g. copper & constantan)
Requires reference junction and compensated cables for accurate measurement.

24-02-2022 Department of Electronics and Communication Engineering 36


Physical Input transducer Notes
quantity
Angular Rotary potentiometer Fine wire resistive element is wound around
position a circular former.
Slider attached to the control shaft makes
contact with the resistive element.
A stable d.c. voltage source is connected
across the ends of the potentiometer.
Voltage appearing at the slider will then be
10 ohms potentiometer proportional to angular position.

24-02-2022 Department of Electronics and Communication Engineering 37


24-02-2022 Department of Electronics and Communication Engineering 38
24-02-2022 Department of Electronics and Communication Engineering 39
Some examples of output transducers
Physical Output Notes
quantity transducer
Sound Loudspeaker Diaphragm attached to a coil is suspended in a magnetic field.
(pressure Current in the coil causes movement of the diaphragm which
change) alternately compresses and rarefies the air mass in front of it.

24-02-2022 Department of Electronics and Communication Engineering 40


Physical Output Notes
quantity transducer
Temperature Heating element Metallic conductor is wound onto a ceramic or mica
(resistor) former.
Current flowing in the conductor produces heat.

Angular Rotary Multi-phase motor provides precise rotation in discrete


position potentiometer steps of 15° (24 steps per revolution), 7.5° (48 steps per
revolution) and 1.8° (200 steps per revolution).

24-02-2022 Department of Electronics and Communication Engineering 41


Sensors
❖A sensor is a special kind of transducer that is used to generate an input signal to a
measurement, instrumentation or control system.

❖The signal produced by a sensor is an electrical analogy of a physical quantity, such as


distance, velocity, acceleration, temperature, pressure, light level, etc.

❖The signals returned from a sensor, together with control inputs from the user or
controller (as appropriate) will subsequently be used to determine the output from the
system.

❖The choice of sensor is governed by a number of factors including accuracy, resolution,


cost and physical size.
24-02-2022 Department of Electronics and Communication Engineering 42
❖ Sensors can be categorized as either active or passive.
❖ An active sensor generates a current or voltage output.
❖ A passive transducer requires a source of current or voltage and it modifies this in some way
(e.g. by virtue of a change in the sensor’s resistance). The result may still be a voltage or current
but it is not generated by the sensor on its own.
❖ Sensors can also be classed as either digital or analogue.
❖ The output of a digital sensor can exist in only two discrete states, either ‘on’ or ‘off’, ‘low’
or ‘high’, ‘logic 1’ or ‘logic 0’, etc.
❖ The output of an analogue sensor can take any one of an infinite number of voltage or
current levels. It is thus said to be continuously variable.

24-02-2022 Department of Electronics and Communication Engineering 43


Rotary track potentiometer
with linear law produces
analogue voltage proportional
to angular position.

24-02-2022 Department of Electronics and Communication Engineering 44


Optical Shaft Encoder
Encoded disk interposed between optical
transmitter and receiver (infrared LED and
photodiode or photo-transistor).
The optical encoder's disc is made of
glass or plastic with transparent and
opaque areas. A light source and photo
detector array reads the optical pattern
that results from the disc's position at
any one time.[8] The Gray code is often
used. This code can be read by a
controlling device, such as
a microprocessor or microcontroller to
determine the angle of the shaft.
24-02-2022 Department of Electronics and Communication Engineering 45
24-02-2022 Department of Electronics and Communication Engineering 46
Physical quantity: Angular velocity

Input transducer: Tachogenerator


Small d.c. generator with linear output characteristic.
Analogue output voltage proportional to shaft speed.

Input transducer: Toothed rotor tachometer


Magnetic pick-up responds to the
movement of a toothed ferrous disk.
The pulse repetition frequency of the
output is proportional to the angular velocity.
24-02-2022 Department of Electronics and Communication Engineering 47
Physical quantity: Flow
Input transducer: Rotating vane
flow sensor (see Fig. 15.9)
Turbine rotor driven by fluid.
Turbine interrupts infra-red beam.
Pulse repetition frequency of output is
proportional to flow rate.

24-02-2022 Department of Electronics and Communication Engineering 48


Physical quantity: Linear position

Input transducer: Resistive linear position sensor

Linear track potentiometer with linear law produces analogue voltage proportional
to linear position. Limited linear range.
Input transducer: Linear Variable Differential Transformer (LVDT)

Miniature transformer with split secondary windings and moving core attached to a
plunger. Requires a.c. excitation and phase-sensitive detector.
Input transducer: Magnetic linear position sensor

Magnetic pick-up responds to movement of a toothed ferrous track.


Pulses are counted as the sensor moves along the track.

24-02-2022 Department of Electronics and Communication Engineering 49


24-02-2022 Department of Electronics and Communication Engineering 50
Physical quantity: Light Level

24-02-2022 Department of Electronics and Communication Engineering 51


Physical quantity: Liquid Level

24-02-2022 Department of Electronics and Communication Engineering 52


Physical quantity: Pressure

24-02-2022 Department of Electronics and Communication Engineering 53


Physical quantity: Proximity

24-02-2022 Department of Electronics and Communication Engineering 54


Physical quantity: Strain

Physical quantity: Weight

24-02-2022 Department of Electronics and Communication Engineering 55


Physical quantity: Temperature

24-02-2022 Department of Electronics and Communication Engineering 56


Physical quantity: Vibration

24-02-2022 Department of Electronics and Communication Engineering 57


Actuator
A form of transducer device (mechanical or electrical) which converts
signals to corresponding physical action (motion).
Actuator acts as an output device
Eg. Micro motor actuator which adjusts the position of the cushioning element
in the Smart Running shoes from adidas
Wearable Devices – certain smart watches use Ambient Light sensors to detect
surrounding light intensity and adjust the screen brightness for better readability
using electrical / electronic actuators.
Actuators

LED –Light 7-Segment


Stepper Piezo
Push
Emitting LED Rely Button Keyboard
Diode Motor Buzzer
Display Switch

24-02-2022 Department of Electronics and Communication Engineering 59


Interfacing a LED
➢Light Emitting Diode (LED) emits
light when forward biased.
➢When the port pin P1.2 goes high
in Fig., the LED is forward biased
and emits light.
➢When the pin P1.2 goes low, LED
is off.

24-02-2022 Department of Electronics and Communication Engineering 60


7-Segment LED Display
The 7 – segment LED display is an output device for displaying alpha
numeric characters
✓It contains 8 light-emitting diode (LED) segments arranged in a special l
form.
✓Out of the 8 LED segments, 7 are used for displaying alpha numeric
characters and 1 is used for representing decimal point.
✓The LED segments are named A to G and the decimal point LED segment
is named as DP
✓The LED Segments A to G and DP should be lit accordingly to display
numbers and characters
✓The 7 – segment LED displays are available in two different
configurations, namely; Common anode and Common cathode
24-02-2022 Department of Electronics and Communication Engineering 61
7-segment display arrangement
• An array of LEDs arranged in a two-
dimensional plane to display
numbers (0–9 and A–F) is the 7-
segment display.
• The array of LEDs with all the
anodes connected together, is called
common-anode display.
• Similarly, with all the cathodes
connected together, it is called a
common-cathode display.

24-02-2022 Department of Electronics and Communication Engineering 62


In the Common anode configuration,
the anodes of the 8 segments are connected
commonly
To display ‘0’, the inputs a, b, c, d, e, f should be made
“low” to forward bias the corresponding LEDs, as the
anodes are already connected to Vcc.
In the Common cathode configuration,
the 8 LED segments share a common
cathode line (connected to ground).
To display the number 0 (zero),
LEDs A, B, C, D, E, F should be switched
“on” and LEDs G and DP should be made
“off” in the 7-segment display.
24-02-2022 Department of Electronics and Communication Engineering 63
7-Segment LED Display
✓Based on the configuration of
the 7 – segment LED unit,
✓the LED segment anode or
cathode is connected to the
✓Port of the processor/
controller in the order
✓ ‘A’ segment to the Least
significant port Pin and
✓DP segment to the most
significant Port Pin.
✓OR vice versa
24-02-2022 Department of Electronics and Communication Engineering 64
• Display numbers 0–9 on a common-
anode 7-segment display

24-02-2022 Department of Electronics and Communication Engineering 65


✓ The current flow through each of the LED segments should be
limited to the maximum value supported by the LED display unit
✓The typical value for the current falls within the range of 20mA
✓The current through each segment can be limited by connecting a
current limiting resistor to the anode or cathode of each segment

24-02-2022 Department of Electronics and Communication Engineering 66


Stepper Motor
A Stepper motor is an electro-mechanical device which generates discrete displacement
(motion) in response to dc electrical signals.
The dc motor produces continuous rotation on applying dc voltage whereas a stepper
motor produces discrete rotation in response to the dc voltage applied to it.
Stepper motors are widely used in industrial embedded applications, consumer electronic
products and robotics control system, for position control applications (paper feed
mechanism) such as dot matrix printers, disk drives, etc.
Based on coil winding arrangements, a two phase stepper motor is classified into two
types: 1. Unipolar 2. Bipolar

24-02-2022 Department of Electronics and Communication Engineering 67


Stepper Motor Interfacing to 8051

24-02-2022 Department of Electronics and Communication Engineering 68


❖A unipolar stepper motor contains two windings per phase.
Unipolar ❖The direction of rotation (clockwise or anticlockwise) of a stepper
motor is controlled by changing the direction of current flow.
2-Phase Unipolar
❖Current in one direction flows through one coil and in the opposite
stepper motor direction flows through the other coil.
❖It is easy to shift the direction of rotation by just switching the
terminals to which the coil are connected.
❖The coils are represented as A, B, C and D.
❖Coils A and C carry current in opposite directions for phase 1 (only
one of them will be carrying current at a time).
❖Similarly, B and D carry current in opposite directions for phase 2
(only one of them will be carrying current at a time).C
24-02-2022 Department of Electronics and Communication Engineering 69
Bipolar
❖A bipolar stepper motor contains single winding per phase.
❖For reversing the motor rotation, the current flow through the windings is
reversed dynamically.
❖It requires complex circuitry for current flow reversal.
❖Fig. shows the stator winding details for a two phase bipolar stepper motor
❖The stepping of stepper motor can be implemented in different ways by
changing the sequence of activation of the stator winding.
❖The different stepping modes supported by the stepper motor are
explained.
24-02-2022 Department of Electronics and Communication Engineering 70
24-02-2022 Department of Electronics and Communication Engineering 71
Full Step
❖In the full step mode both the phases are energised simultaneously.
❖The coils A,B,C and D are energised as shown in the Table.
❖It should be noted that out of the two windings, only one winding of a phase
is energised at a time.
Step Coil A Coil B Coil C Coil D
1 H H L L
2 L H H L
3 L L H H
4 H L L H
24-02-2022 Department of Electronics and Communication Engineering 72
Step Coil A Coil B Coil C Coil D
1 H H L L
2 L H H L
3 L L H H
4 H L L H
24-02-2022 Department of Electronics and Communication Engineering 73
Wave Step
❖ In the wave step mode only one phase is energised at a time and each coils
of the phase is energised alternatively.
❖ The coils A, B, C and D are energised in the following order:
Step Coil A Coil B Coil C Coil D
1 H L L L
2 L H L L
3 L L H L
4 L L L H
24-02-2022 Department of Electronics and Communication Engineering 74
Half Step Step Coil A Coil B Coil C Coil D
1 H L L L
❖ It uses the combination of 2 H H L L
wave and full step. 3 L H L L
❖ It has the highest torque 4 L H H L
and stability. 5 L L H L
Coil energising sequence 6 L L H H
for half step 7 L L L H
8 H L L H
24-02-2022 Department of Electronics and Communication Engineering 75
❖ The rotation of the stepper motor can be reversed by reversing
the order in which the coil is energised.
❖ Two-phase unipolar stepper motors are the popular choice for
embedded applications.
❖ The current requirement for stepper motor is little high and
hence the port pins of a microcontroller/processor may not be
able to drive them directly.
❖ Also, the supply voltage required to operate stepper motor
varies normally in the range 5V to 24 V.
24-02-2022 Department of Electronics and Communication Engineering 76
❖ Depending on the current and voltage requirements, special
driving circuits are required to interface the stepper motor with
microcontroller/processors.
❖ Commercial off-the-shelf stepper motor driver ICs are available in
the market and they can be directly interfaced to the
microcontroller port.
❖ ULN2803 is an octal peripheral driver array available from Texas
Instruments and ST microelectronics for driving a 5V stepper
motor.
❖ Simple driving circuit can also be built using transistors
24-02-2022 Department of Electronics and Communication Engineering 77
Interfacing of a Stepper Motor through a Driver Circuit
24-02-2022 Department of Electronics and Communication Engineering 78
• The following circuit diagram illustrates the interfacing of a stepper motor through a
driver circuit connected to the port pins of a microcontroller/processor

24-02-2022 Department of Electronics and Communication Engineering 79


for interfacing the stepper motor to 8051, we need to connect the four winding leads to
four-port pins, say, P1.0 to P1.3.
Since the port pins do not have the sufficient current, to drive the stepper motor
windings (needs > 10 mA) a driver such as ULN 2003 is used.
ULN 2003 consists of 4 sets of power
transistors (to supply more current) and
associated diodes (to provide a
freewheeling path to each winding when it
is made off).
Here, separate power supplies are used.
One for 8051 and another for ULN 2003 and
stepper motor.
24-02-2022 Department of Electronics and Communication Engineering 80
Relay
❖An electromechanical device
❖In an embedded application, the
‘Relay Unit’ acts as dynamic path

Relay Coil
Relay Coil

Relay Coil
selectors for signals and power
❖The ‘Relay’ unit contains a relay Single Pole Single Single Pole Single Single Pole Double
Throw Normally Throw Normally Throw
coil made up of insulated wire on a Open Closed

metal core and a metal armature with


one or more contacts. Relay Configurations
24-02-2022 Department of Electronics and Communication Engineering 81
❖ ‘Relay’ has a relay coil on a metal core and a metal armature with
one or more contacts.
❖ ‘Relay’ works on electromagnetic principle.
❖ When a voltage is applied to the relay coil,
❖ current flows through the coil,
❖ which in turn generates a magnetic field.
❖ The magnetic field attracts the armature core and moves the contact
point.
❖ The movement of the contact point changes the power/signal flow
path.
24-02-2022 Department of Electronics and Communication Engineering 82
❖ Single Pole Single Throw configuration has only
one path for information flow.
Relay Coil

Relay Coil ❖ The path is either open or closed in normal


Single Pole Single
Throw Normally
Single Pole Single
Throw Normally
condition.
Open Closed
❖ For Normally Open SPST relay, circuit is normally
open and it becomes closed when relay is
energized.
Relay Coil

❖ Vice versa for NC SPST relay


❖ Single Pole Double throw relay, there are two paths
Single Pole Double for information flow & they are selected by
Throw
energizing and de-energizing the relay
24-02-2022 Department of Electronics and Communication Engineering 83
Relay Driver Circuit
✓The Relay is normally controlled using a relay
Vcc

Freewheeling Diode
driver circuit connected to the port pin of the
processor/controller
✓A transistor can be used as the relay driver. The

Relay Coil
Load
transistor can be selected depending on the Port Pin
relay driving current requirements
✓A free-wheeling diode – to protect the relay & Relay Unit

transistor – used to free-wheel the voltage


produced in the opposite direction when the
relay coil is de-energized. Transistor based Relay driving Circuit
Industrial relays are bulky, requires high voltage to operate
‘Reed’ relays – special relays – for embedded application requiring switching of low voltage DC
signals.
24-02-2022 Department of Electronics and Communication Engineering 84
Piezo Buzzer
⁕Piezo buzzer is a piezoelectric device for generating audio
indications in embedded application.
⁕A piezoelectric buzzer contains a piezoelectric diaphragm
which produces audible sound in response to the voltage
applied to it.
⁕Piezoelectric buzzers are available in two types:
1. Self driving
2. External driving
24-02-2022 Department of Electronics and Communication Engineering 85
 The 'Self-driving’ circuit contains all the necessary components to
generate sound at a predefined tone.
 It will generate a tone on applying the voltage.
 ‘External driving’ piezo buzzers supports the generation of different
tones.
 The tone can be varied by applying a variable pulse train to the
piezoelectric buzzer.
 A piezo buzzer can be directly interfaced to the port pin of the processor /
control.
 Depending on the driving current requirements, the piezo buzzer can also be
interfaced using a transistor based driver circuit as in the case of a "Relay”.
24-02-2022 Department of Electronics and Communication Engineering 86
✓Push Button switch is an input device Push Button Switch
✓Push button switch comes in two configurations, namely ‘Push to Make’ and ‘Push to Break’
✓The switch is normally in the open state and it makes a circuit contact when it is pushed or
pressed in the ‘Push to Make’ configuration
✓In the ‘Push to Break’ configuration, the switch is normally in the closed state and it breaks the
circuit contact when it is pushed or pressed
✓The push button stays in the ‘closed’ (For Push to Make type) or ‘open’ (For Push to Break
type) state as long as it is kept in the pushed state and it breaks/makes the circuit connection
when it is released
✓Push button is used for generating a momentary pulse.
✓In embedded application push button is generally used as reset and start switch and pulse
generator.
✓The Push button is normally connected to the port pin of the host processor
24-02-2022 Department of Electronics and Communication Engineering 87
24-02-2022 Department of Electronics and Communication Engineering 88
❖Keyboard is an input device for user interfacing.
Keyboard
❖If the number of keys required is very limited, push button
switches can be used and they can be directly interfaced to
the port pins for reading.
❖Matrix keyboard is an optimum solution for handling large
key requirements. It greatly reduces the number of interface
connections.
❖Ex: For interfacing 16 keys, in the direct interfacing
technique 16 port pins are required, whereas in the matrix
keyboard only 8 lines are required. The 16 Keys are
arranged in a 4 column, 4 Rows matrix.
❖Fig illustrates the connection of keys in a matrix keyboard.
24-02-2022 Department of Electronics and Communication Engineering 89
24-02-2022 Department of Electronics and Communication Engineering 90
Interfacing Keyboard /
Matrix Keypad to 8051

24-02-2022 Department of Electronics and Communication Engineering 91


❖ In a matrix keyboard, the keys are arranged in matrix fashion (i.e.,
they are connected in a row and column style).
❖ For detecting a key press, the keyboard uses the scanning
technique, where each row of the matrix is pulled low and the
columns are read.
❖ After reading the status of each columns corresponding to a row,
the row is pulled high &
❖ the next row is pulled low and the status of the columns are read.
❖ This process is repeated until the scanning for all rows are
completed.
24-02-2022 Department of Electronics and Communication Engineering 92
❑ When a row is pulled low
and
❑ if a key connected to the
row is pressed,
❑ reading the column to
which the key is
connected will give logic
0.

24-02-2022 Department of Electronics and Communication Engineering 93


➢ Since keys are mechanical devices, there is a possibility for de-
bounce issues, which may give multiple key press effect for a
single key press.
➢ To prevent this, a proper key de-bouncing technique should be
applied.
➢ Hardware key de-bouncer circuits and software key de-bounce
techniques are the key de-bouncing techniques available.
➢ The software key de-bouncing technique doesn't require any
additional hardware and is easy to implement.
24-02-2022 Department of Electronics and Communication Engineering 94
➢ In the software de-bouncing technique, on detecting a key
press, the key is read again after a de-bounce delay.
➢ If the key press is a genuine one, the state of the key will
remain as 'pressed’ on the second read also.
➢ Pull-up resistors are connected to the column lines to
limit the current that flows to the Row line on a key press.

24-02-2022 Department of Electronics and Communication Engineering 95


Communication Interface
₰ Communication interface is essential for communicating with various
subsystems of the embedded system and with the external world
₰ For an embedded product, the communication interface can be viewed in
two different perspectives; namely;
1.Device/board level communication interface
(Onboard Communication Interface)
2.Product level communication interface
(External Communication Interface)
24-02-2022 Department of Electronics and Communication Engineering 96
₰ Embedded product is a combination of different types of components
(chips/devices) arranged on a Printed Circuit Board (PCB).

₰ The communication channel which interconnects the various


components within an embedded product is referred as Device/board
level communication interface (Onboard Communication Interface)

₰ Serial interfaces like I2C, SPI, UART, 1-Wire etc and Parallel bus
interface are examples of ‘Onboard Communication Interface’

24-02-2022 Department of Electronics and Communication Engineering 97


Communication Interface
₰ The ‘Product level communication interface’ (External Communication Interface) is
responsible for data transfer between the embedded system and other devices or
modules
₰ The external communication interface can be either wired media or wireless media
and it can be a serial or parallel interface. Infrared (IR), Bluetooth (BT), Wireless LAN
(Wi-Fi), Radio Frequency waves (RF), GPRS etc are examples for wireless
communication interface
₰ RS-232C/RS-422/RS 485, USB, Ethernet (TCP-IP), IEEE 1394 port, Parallel port, CF-II
Slot, SDIO, PCMCIA etc are examples for wired interfaces
₰ Mobile Communication Equipment – an example of an embedded system with
external communication interface
24-02-2022 Department of Electronics and Communication Engineering 98
On-board Communication Interface –
Universal Asynchronous Receiver Transmitter (UART)
₰ UART based data transmission is an asynchronous form of serial data transmission
₰ The serial communication settings (Baudrate, No. of bits per byte, parity, No. of start
bits and stop bit and flow control) for both transmitter and receiver should be set as
identical
₰ The start and stop of communication is indicated through inserting special bits in the
data stream
₰ While sending a byte of data, a start bit is added first and a stop bit is added at the end
of the bit stream. The least significant bit of the data byte follows the start bit.
₰ The ‘Start’ bit informs the receiver that a data byte is about to arrive. The receiver
device starts polling its ‘receive line’ as per the baudrate settings
24-02-2022 Department of Electronics and Communication Engineering 99
On-board Communication Interface – Universal Asynchronous Receiver Transmitter (UART)
₰ If parity is enabled for
communication, the UART of the
transmitting device adds a parity bit .
₰ The UART of the receiving device UART
TXD TXD
UART
calculates the parity of the bits RXD RXD
received and compares it with the
received parity bit for error checking.
₰ The UART of the receiving device
discards the ‘Start’, ‘Stop’ and ‘Parity’ TXD: Transmitter Line
RXD: Receiver Line
bit from the received bit stream and
converts the received serial bit data
to a word.
24-02-2022 Department of Electronics and Communication Engineering 100
On-board Communication Interface – Parallel Interface

D0 to Data Bus
Dx-1 Peripheral Device
RD\ RD\ (Eg: ADC)
WR\ WR\
Host Control Signals CS\
(Microprocessor/
Controller) Chip Select

A0 to Address Bus Address De-coder


Ay-1 Circuit

x: Data bus width


y: Address Bus width
24-02-2022 Department of Electronics and Communication Engineering 101
On-board Communication Interface – Parallel Interface
₰ Parallel interface is normally used for communicating with peripheral devices which are
memory mapped to the host of the system.
₰ The host processor/controller of the embedded system contains a parallel bus and the
device which supports parallel bus can directly connect to this bus system
₰ The communication through the parallel bus is controlled by the control signal interface
between the device and the host.
₰ The ‘Control Signals’ for communication includes ‘Read/Write’ signal and device select
signal.
₰ The device normally contains a device select line and the device becomes active only when
this line is asserted by the host processor.
₰ The direction of data transfer (Host to Device or Device to Host) can be controlled through
the control signal lines for ‘Read’ and ‘Write’. Only the host processor has control over the
‘Read’ and ‘Write’ control signals
24-02-2022 Department of Electronics and Communication Engineering 102
External Communication Interface – Universal Serial Bus (USB)
₰ Universal Serial Bus (USB) is a wired high speed serial bus for data
communication Peripheral
₰ The USB communication system follows a star topology with a USB host at Device 2
the center and one or more USB peripheral devices/USB hosts connected to
it
₰ A USB host can support connections up to 127, including slave peripheral Peripheral
devices and other USB hosts Peripheral USB Host
Device 1 (Hub) Device 3
₰ USB transmits data in packet format. Each data packet has a standard
format. The USB communication is a host initiated one
₰ The USB Host contains a host controller which is responsible for controlling
the data communication, including establishing connectivity with USB slave USB Host
devices, packetizing and formatting the data packet. (Hub)
₰ There are different standards for implementing the USB Host Control
interface; namely Open Host Control Interface (OHCI) and Universal Host
Control Interface (UHCI) Peripheral Peripheral
Device 4 Device 5
24-02-2022 Department of Electronics and Communication Engineering 103
External Communication Interface – Universal Serial Bus (USB)
₰ The Physical connection between a USB peripheral device and master device is
established with a USB cable
₰ The USB cable supports communication distance of up to 5 meters
₰ The USB standard uses two different types of connectors namely ‘Type A’ and ‘Type B’
at the ends of the USB cable for connecting the USB peripheral device and host device
₰ ‘Type A’ connector is used for upstream connection (connection with host) and ‘Type B’
connector is used for downstream connection (connection with slave device)
Pin No: Pin Name Description
1 VBUS Carries power (5V)
2 D- Differential data carrier line
3 D+ Differential data carrier line
4 GND Ground signal line

24-02-2022 Department of Electronics and Communication Engineering 104


External Communication Interface – Universal Serial Bus (USB)
₰ Each USB device contains a Product ID (PID) and a Vendor ID (VID)
₰ The PID and VID are embedded into the USB chip by the USB device
manufacturer
₰ The VID for a device is supplied by the USB standards forum.
₰ PID and VID are essential for loading the drivers corresponding to a USB
device for communication.
₰ USB supports four different types of data transfers, namely; Control, Bulk,
Isochronous and Interrupt.
₰ Control transfer is used by USB system software to query, configure and
issue commands to the USB device
24-02-2022 Department of Electronics and Communication Engineering 105
⁂Bulk transfer is used for sending a block of data to a device. Bulk transfer
supports error checking and correction. Transferring data to a printer is an
example for bulk transfer.
⁂Isochronous data transfer is used for real time data communication. In
Isochronous transfer, data is transmitted as streams in real time. Isochronous
transfer doesn’t support error checking and re-transmission of data in case of
any transmission loss
⁂Interrupt transfer is used for transferring small amount of data. Interrupt
transfer mechanism makes use of polling technique to see whether the USB
device has any data to send
⁂The frequency of polling is determined by the USB device and it varies from 1 to
255 milliseconds. Devices like Mouse and Keyboard, which transmits fewer
amounts of data, uses Interrupt transfer.
24-02-2022 Department of Electronics and Communication Engineering 106
External Communication Interface – Wi-Fi
₰ Popular wireless communication technique for networked communication of devices. Wi-Fi
follows the IEEE 802.11 standard.
₰ Wi-Fi is intended for network communication and it supports Internet Protocol (IP) based
communication – each device identified an IP address – unique to each device on the
network. (Required – device identities in a multipoint communication to address specific
devices)
₰ Wi-Fi based communications require an intermediate agent called Wi-Fi router/ Wireless
Access point to manage the communications.
₰ The Wi-Fi router is responsible for
₰ restricting the access to a network,
₰ assigning IP address to devices on the network,
₰ routing data packets to the intended devices on the network.
24-02-2022 Department of Electronics and Communication Engineering 107
External Communication Interface – Wi-Fi
Wi-Fi Router

Device 1
Device 2 Device 3

24-02-2022 Department of Electronics and Communication Engineering 108


₰ Wi-Fi enabled devices contain a wireless adaptor for transmitting and
receiving data in the form of radio signals through an antenna.
₰ Wi-Fi operates at 2.4GHZ or 5GHZ of radio spectrum and they co-exist with
other ISM band devices like Bluetooth.
₰ A Wi-Fi network is identified with a Service Set Identifier (SSID). A Wi-Fi
device can connect to a network by selecting the SSID of the network
₰ Wi-Fi networks implements different security mechanisms for
authentication and data transfer.
₰ Wireless Equivalency Protocol (WEP), Wireless Protected Access (WPA) etc
are some of the security mechanisms supported by Wi-Fi networks in data
communication

24-02-2022 Department of Electronics and Communication Engineering 109


❖ For communicating with devices over a Wi-Fi network,
➢ the device when its Wi-Fi radio is turned ON,
➢ searches the available Wi Fi network in its vicinity and
➢ lists out the Service Set Identifier (SSID) of the available networks.
❖ If the network is security enabled,
➢ a password may be required to connect to a particular SSID.
❖ for securing the data communication, Wi-Fi employs different security mechanisms like
➢ Wired Equivalency Privacy (WEP)
➢ Wireless Protected Access (WPA), etc.
❖ Wi-Fi supports data rates ranging from 1 Mbps to 1300Mbps (Growing towards higher
rates as technology progresses), depending on the standards (802.11a/b/g/n/ac) and
access / modulation method.
❖ Depending on the type of antenna and usage location (indoor / outdoor), Wi-Fi offers a
range of 100 to 1000 feet
24-02-2022 Department of Electronics and Communication Engineering 110
₰ Wi-Fi enabled devices contain a wireless adaptor for transmitting and
receiving data in the form of radio signals through an antenna.
₰ Wi-Fi operates at 2.4GHZ or 5GHZ of radio spectrum and they co-exist with
other ISM band devices like Bluetooth.
₰ A Wi-Fi network is identified with a Service Set Identifier (SSID). A Wi-Fi
device can connect to a network by selecting the SSID of the network
₰ Wi-Fi networks implements different security mechanisms for
authentication and data transfer.
₰ Wireless Equivalency Protocol (WEP), Wireless Protected Access (WPA) etc
are some of the security mechanisms supported by Wi-Fi networks in data
communication
24-02-2022 Department of Electronics and Communication Engineering 111
GPRS – General Packet Radio Services
₰ GPRS, 3G, 4G, LTE are cellular communication technique for transferring data
over a mobile communication network like GSM and CDMA.
₰ Data is sent as packets in GPRS communication.
₰ At transmitting side- data gets splits to a several packets and at receiving side –
data gets reconstructed by combining a packets.
₰ The transfer rate by theoretical of GPRS is 171.2 kbps.
₰ In GPRS communication the radio channel is concurrently shared between
several users instead of dedicating a radio channel to cell phone user.
₰ GPRS supports IP,PPP, and X25 protocol for communication.
24-02-2022 Department of Electronics and Communication Engineering 112
GPRS – General Packet Radio Services
₰ GPRS is mainly used by mobile enabled embedded devices for data
communication. The device should support the necessary GPRS hardware
like GPRS modem and GPRS radio. Also, the carrier network should
support GPRS communication.
₰ GPRS is an old technology and it is being replaced by new generation data
communication techniques like 3G, High Speed Downlink Packet Access
(HSDPA), 4G, LTE, etc which offers higher bandwidths for communication
₰ 3G – data rates – 144Kbps to 2Mbps or higher
₰ 4G – 2 to 100+ Mbps depending on network & underlying technology.
24-02-2022 Department of Electronics and Communication Engineering 113

You might also like