You are on page 1of 46

Digital

Instrumentation,
ADC / DAC
MCT 3332 : Instrumentation and
Measurements

Outlines

Digital Signal Conditioning


Review of Digital Fundamental
Digital to Analog Converter (DAC) &
Analog to Digital Converter (ADC)

Digital Signal
Conditioning
In our days almost all instrumentation systems rely on digital
techniques for signal processing, transmission and data storage.
Analog outputs from sensors and analog front-ends (analog
signal conditioning) have to be converted into digital signals.
This process has two steps:
Analog signal sampling (Continuous time to discrete time)
Analog to digital conversion (Continuous Voltage to discrete
amplitude values)

Digital Signal
Conditioning

Digital Signal Conditioning


Functional Diagram for Data Acquisition and Control

Digital Signal Conditioning


Signal Processing for Digital and Analog Signals

Review of Digital Fundamental


Number systems and conversion, Boolean
algebra.
Logic gate networks, multiplexers, decoder,
read only memory and programmable logic
arrays. Combinational logic circuits, sequential
logic components, flip-flops, registers, counters
and sequential circuits.
Analysis and design of synchronous and
asynchronous networks. Programmable logic
device and field programmable gate array.

Review of Digital Fundamental


Number Systems
Decimal Number Systems
dn d3d2d1d0 = dn 10n++ d2 102+ d1 101+ d0 100

Base: 0,1,2,3,4,5,6,7,8,9

Binary Number Systems


(dn d3d2d1d0)2 = dn 2n++ d2 22+ d1 21+ d0 20

Base: 0 (OFF), 1 (ON)


Example: 11012
Bits are the digits of a binary number
MSB (Most Significant Bit)
LSB (Least Significant Bit)

Hexadecimal
Base: 0, 1, 2, 3, 4, 5, 6, 7,
8, 9, A, B, C, D, E, and F
To convert a binary number
to hexadecimal, divide the
number into groups of four
digits.
0111 10112 = 7B16

Review of Digital Fundamental


ASCII (American Standard Code for Information
Interchange)
7-bit code to denote all of the alphanumeric
characters.
Some example codes are:
A: 100 0001 = 4116=6510
B: 100 0010 = 4216=6610
0: 011 0000 = 3016=4810
1: 011 0001 = 3116=4910
BCD (Binary Coded Decimal)
4 bits are used to represent a single decimal
number.
Ex:
12310=0001 0010 0011bcd
(Binary: 12310=0111 10112)

Review of Digital Fundamental


The gates are manufactured as integrated circuit (IC) where
transistors, resistors and diodes exist on a single piece of
silicon.

Two families of digital integrated circuits:


TTL (Transistor-transistor logic)
CMOS (Complementary metal-oxide
semiconductors)

10

Review of Digital Fundamental


TTL (Transistor-Transistor Logic) uses the BJT
technology
Logic zero (0) or low (L): less than 0.8V
Logic one (1) or high (H): greater than 2.0V
The input voltage range 0.8V to 2.0V is a dead zone
where the input state is undefined.
The digital output of a TTL device ranges between 0
and 0.5V for low and between 2.7V and 5V for high.

CMOS (Complementary Metal Oxide


Semiconductor) uses the FET technology:
The logic levels depend on the supply voltage.
Very little power consumption, but susceptibility to
damage from static electricity.

11

Review of Digital Fundamental

12

Digital Signals

An analog-to-digital converter,
or ADC, performs the former
task while a digital-to-analog
converter, or DAC, performs
the latter.

An ADC inputs an analog


electrical signal such as
voltage or current and outputs
a binary number.
13

Digital Signals

A DAC, on the other hand,


inputs a binary number and
outputs an analog voltage
or current signal.

14

Digital Signals

They are often used in digital systems to provide complete


interface with analog sensors and output devices for
control systems such as those used in automotive engine
controls

15

ADC
A/D Conversion Process

Measurement
system

16

A/D Card

ADC
Sample-and-Hold (S/H)

S/H circuit is connected to the ADC


input to ensure input signal is always
steady and at acceptable level
before going thru conversion.

When the electronic switch is closed,


the capacitor voltage (VC) will
"tracks or follows the input voltage,
Vc(t) = Vin(t)

At ts, when a conversion of Vin is


desired, the electronic switch opens,
the capacitor will be isolated from
the input.
-> the capacitor will hold (stay
charged) to the voltage when the
switch opened, Vc, = Vin(ts)

Sample-and-hold circuit

A S/H using a FET as an electronic switch

17

ADC
A/D Conversion Process

The conversion occurs repetitively every T time which is


called as sampling period or sampling time.

Sampling rate or
sampling frequency

1
fs
T
How fast or often the signal should be sampled to
obtained an accurate representation ?.

18

ADC
Sampling Rate

19

ADC
Shannon-Nyquists Sampling Theorem
An analog signal should be
sampled at a rate more than two
times the maximum frequency
components in the analog signal.

Therefore, to faithfully represent


the analog signal, the digital
samples must be taken at a
frequency, fs :

f s 2 f max

Nyquist Theorem: If a function x(t) contains no frequencies higher


than B Hz, it is completely determined by giving its ordinates at a
series of points spaced 1/(2B) seconds apart.

20

ADC
Aliasing

If a signal is sampled at less than two times its maximum frequency


components, then a completely different waveform of a lower frequency
is constructed
from the data acquired. This effect is called aliasing.

21

ADC
Quantization Theory
The analog to digital (A/D) conversion is a two-step process, which
changes a sampled analog voltage into digital form:
Quantizing: the transformation of a continuous analog input into a
set of data represented by discrete output states.
Coding: the assignment of a digital code word or number to each
output state.

22

ADC
The number of possible states, N is equal to the number of
bit combinations:

N 2

n: the number of bits


of the ADC card.
23

ADC
Resolution (or analog quantization size) defines the number of
divisions into which a full-scale input range can be divided to
approximate an analog input voltage.

Vmax Vmin
Q
N

24

ADC
Hardware for ADC

25

ADC
Hardware for ADC

26

ADC
Comparator

27

ADC
Comparator in Digital System
Va or Vb, is the variable input, and the other a
fixed value is the reference voltage.

28

ADC
Comparator
In basic form, a comparator can be made from an op-amp without feedback:

for an ideal op-amp:

where the real open loop gain of the op-amp AOL is of order 510 or more. Thus,
some small voltage difference, V2-V1 , produces a large VOUT .
this property can be exploited in a logical operation including the effects of
amplifier saturation:
29

ADC
An ideal comparator behaves in the following manner:

30

ADC
1. Flash/Parallel Converter

a simple way to get better (more bits of) resolution is to use more
comparators.

for a 2-bit flash converter we can use 2n -1 comparators, supplying them


with reference voltages that are equally spaced over the desired
conversion range.

the other comparator inputs are connected to the input signal.

31

ADC

all the digital outputs with reference input voltages below the
input signal will be true and all of the digital outputs with
reference signals above the input signal level will be false.

the output logic circuit converts these 2n-1 binary values into an
n-bit number.

32

ADC

the pattern of comparator


outputs is analyzed by
combinational logic
circuits (i.e. gates) to
determine the output.

this technique is called


flash (or parallel)
encoding.

33

ADC

34

35

DAC
Digital to analog converter
Analog signal

Binary number

DAC

A DAC allows a computer or other


digital devices to interface with
external analog circuits and
devices.

36

DAC

Data in binary digital form can be converted to an


analog form by using a summing amplifier.
Summing Amplifier

Vout

RF
RF

V1
V2
R2
R1
37

DAC
VR b
0 LSB

128R

Weightedresistor DAC

b1

64R

b2

32R

b3

16R

b4

8R

b5

4R

b6

2R

b7 MSB

RF
Vout

8-bit DAC

38

DAC
The output voltage of the summing amplifier Vout is,

Vout

RF
VR

R1

Vout

RFVR

b7
b6
b0
1
0 1 7
R1 2 R 2 R
2 R
b0
b7 b6
0 1 7
2
2 2
39

where b0, b1,, b7 are the bit states.

DAC
For n-bit DAC

Vout

RFVR

b0
bn 1 bn 2
0 1 n 1
2
2
2

The full-scale range voltage,

Vout

2 RF VR

40

41

ADC

For bipolar ADC : binary number, N INT [(

Vin 1 n
)2 ]
VR 2

Example:
A bipolar 8-bit successive approximation ADC is used to convert the signal
from the sensor. The voltage input range is -5 5 Volt (or 5V ref). Determine
the binary number as the result of the conversion, when the voltage input to
the ADC card is -0.85 volt.

0.85 1 8
)2 ]
5
2
N INT [84.48] 8410 01010100 2
N INT [(

42

DAC
Digital-to-Analog Converters (DACs)

VOUT VR b1 2 1 b2 2 2 ........bn 2 n

where VOUT = analog voltage output


VR = reference voltage
b1,b2.bn = n-bit binary word

the minimum VOUT is zero, and the maximum is determined by the


size of the binary word
43

DAC

This equation can also be used


N
VOUT n VR
2
N = base 10 whole-number equivalent of DAC input

Bipolar DAC

VOUT

N
1
V

VR
n R
2
2

if N=0 ; Vout(min) = -VR/2


If the maximum value for N is 2n-1 ; VOUT(max) is

2
Vout (max)

1
1
1
VR
V

R
R
R
2n
2
2
2n

44

DAC
Conversion Resolution

it is a function of the reference voltage and the number of bits in the


word.

more bits, the smaller the change in analog output for a 1-bit change
in binary word, gives a better resolution.

the smallest possible change is simply given by

Vout VR 2 n
VOUT = smallest output change
VR
= reference voltage
n
= number of bits

45

DAC
Problem
A control valve has a linear variation of opening as the input voltage
varies from 0 to 10V. A microcomputer outputs an 8-bit word to control
the valve opening using an 8 bit DAC to generate the valve voltage.

a. Find the reference voltage required to obtain a full open valve


(Vout = 10V)
b. Find the percentage of valve opening for a 1-bit change in the
input word

46