MTE 411
Mechatronic Systems
Lecture 7: Digital Signals
Dr. Ahmed Bujelawi
Mechatronic Engineering Program
Libyan International University
ahmed.tahir@limu.edu.ly
Objectives
The objectives of this chapter are that, after studying it, the
reader should be able to:
• Explain the principles and main methods of analogue-to-digital
and digital-to-analogue converters.
• Explain the principles and uses of multiplexers.
• Explain the principles of digital signal processing.
1
Introduction
• The analogue output from the sensor has to be
converted into a digital form before it can be used as
an input to the microprocessor.
• Likewise, most actuators operate with analogue
inputs and so the digital output from a
microprocessor has to be converted into an
analogue form before it can be used as an input by
the actuator.
2
Binary numbers
• The binary system is based on just the two symbols
or states 0 and 1, these possibly being 0 V and 5 V
signals.
• For example, the decimal number 15 is 20 +21 +22
+23 =1111 in the binary system.
• The bit 0 is termed the least significant bit (LSB)
and the highest bit the most significant bit (MSB).
• A word: is the combination of bits
• Byte: is used for a group of 8 bits.
3
Analogue and digital signals
Analogue-to-digital conversion
analogue input clock signal
sampled signal sampled and held signal 4
Input/output for an ADC
5
Quantization
• Quantization interval: the difference in analogue voltage
between two adjacent quantization levels.
• Quantization error: it is caused by the fact that the digital
output is not always proportional to the analogue input due to
step-like nature of the relationship.
• When the input is centered over the interval, the quantization
error is zero, the maximum error being equal to one-half of
!
the interval or ± " bit.
• Resolution: it is the smallest change in input which will
result in a change in the digital output.
• For a word length of n bits with the full-scale analogue input
VFS , the resolution, is VFS /2n (1 LSB).
6
Examples
• An ADC with a word length of 10 bits and the
analogue signal input range is 10 V, then the
resolution is 10/1010 = 10/1024 = 9.8 mV.
• Consider a thermocouple:
Ø Giving an output of 0.5 mV/°C. If temperatures from 0 to
200°C are to be measured with a resolution of 0.5°C.
Ø The full-scale output from the sensor is 200 × 0.5 = 100 mV.
Ø For a resolution of 0.5°C we must be able to detect a signal
from the sensor of 0.5 * 0.5 = 0.25 mV.
!"" $%&(("")
Ø Thus we require: 0.25 = ! , and therefore, n = = 8.6
# $%&(#)
Ø Thus, a 9-bit word length is required.
Digital-to-analogue conversion
• The input to a digital-to-
analogue converter (DAC)
is a binary word.
• The figure illustrates this
for an input to a DAC with
a resolution of 1 V for
unsigned binary words.
• Each additional bit
increases the output
voltage by 1 V.
Weighted-resistor DAC
• The problem with this method is that it is difficult to obtain
accurate resistors over the wide range needed.
• As a result this form of DAC tends be limited to 4-bit
conversions.
R –2R ladder network
• This overcomes the problem of obtaining accurate
resistances over a wide range of values, only two values
being required.
ZN558D DAC
Successive approximations ADC
• The comparison could be accomplished by starting the count at 1,
the LSB, and then proceeding bit by bit upwards.
• A faster method is by successive approximations. For example,
we might start the comparison with 1000. If this is too large we
try 0100. If this is too small we then try 0110. If this is too large
we try 0101.
ZN439 ADC
Ramp ADC
• It involves an analogue voltage which is increased at a constant
rate.
• When the ramp voltage starts, a gate is opened which starts a
binary counter counting the regular pulses from a clock and then
it is closed the two voltages are equal.
Flash ADC
Specifications of ADCs
1. Conversion time:
• It is the time required to complete a conversion of the input signal.
• The maximum frequency is 1/(2 × conversion time).
2. Resolution:
• The number of bits used in the digital output to communicate the
binary value resulting from the conversion.
• For an ADC with 10 bits of resolution and a 5 V reference voltage,
the voltage change required to give a change of 1 bit would be
5/1024 = 0.00488 V.
3. Linearity error:
• This being the deviation from a straight line drawn through zero
and full-scale.
!
• It is a maximum of ± LSB.
#
Sample and hold amplifiers
• When the switch closes, the input voltage is applied across the
capacitor and the output voltage becomes the same as the input
voltage.
• When the switch opens, the capacitor retains its charge and the
output voltage remains equal to the input voltage at the instant
the switch was opened.
• The time required for the capacitor to charge to a new sample of
the input analogue voltage is called the acquisition time and
depends on the value of the capacitance and the circuit resistance
when the switch is on.
Multiplexers
• A multiplexer is a circuit that is able to have inputs of data
from a number of sources and then, by selecting an input
channel, give an output from just one of them.
Two-channel Digital multiplexer
Serial communication
Asynchronous serial transmission
Parallel communication
• With serial bit communication, each bit is
transmitted one at a time, but with parallel bit
communication each of the bits is transmitted
simultaneously along parallel lines.