Chapter 8

Download as pdf or txt
Download as pdf or txt
You are on page 1of 40

CHAPTER 8

Interfacing with Analog Devices

1
Lecture Outlines

 D/A Conversion, Operational Amplifiers, Basic D/A


Converters, Ladder-Type D/A converter
 Voltage comparators
 Elementary Digital Voltmeter

2
Overview: Interfacing With the Analog World
 Most physical variables are analog, and can take on any value
within a continuous range of values.
 For instance, time, speed, weight, pressure, light, intensity, and
position measurements are all analog in nature.
 A transducer converts the physical variable to an electrical
variable.
 Thermistors, photo-cells, photodiodes, flow meters, pressure
transducers, tachometers, etc.

3 A digital system with analog input and analog output


Overview: Interfacing With the Analog World
 The transducer’s electrical analog output is the analog input to
the analog-to-digital converter.
 The ADC converts analog input to a digital output
 Output consists of a number of bits that represent the value of
the analog input.
 The binary output from the ADC is proportional to the
analog input voltage.

4 A digital system with analog input and analog output


Overview: Interfacing With the Analog World
 The digital representation of the process variable is transmitted
from the ADC to the digital computer
 The digital value is stored & processes according to a program
of instructions that it is executing.
 The program might perform calculations or other operations to
produce output that will eventually be used to control a physical
device.

5 A digital system with analog input and analog output


Overview: Interfacing With the Analog World
 Digital output from the computer is connected to a digital-to-
analog converter (DAC).
 Converted to a proportional analog voltage/current
 The analog signal is often connected to some device or circuit
that serves as an actuator to control the physical variable.
 An electrically controlled valve or thermostat, etc.

6 A digital system with analog input and analog output


Overview: Interfacing With the Analog World

 The entire system in figure below is called a hybrid system because


it contains both digital and analog devices.

A digital system with analog input and analog output

7
D/A Conversion (DAC)
 Suppose we want to convert the binary from the processing unit to
a 0-V to 3-V output.
 First set up a truth table of all the possible situations.
 Table 1 shows four inputs (D, C, B, A) into the D/A converter.

8
D/A Conversion (DAC)
 Figure illustrates a block diagram of a D/A converter.
 The digital inputs (D, C, B, A) are at the left.
 The decoder consists of two sections: the resistor network and the
summing amplifier.
 The output is shown as a voltage reading on the voltmeter at the
right.

9
D/A Conversion (DAC)

 A resistor network in figure must take into account that a 1 at input


B is worth twice as much as a 1 at input A.
 Also, a 1 at input C is worth four times as much as 1 at input A.
 Several arrangements of resistors are used to do this job. These
circuits are called resistive ladder networks.

10
D/A Conversion (DAC)

 The summing amplifier takes the output voltage from the resistor
network and amplifies it the proper amount to get the voltages
shown in the right most column of Table 1.
 The summing amplifier typically uses an IC unit called operational
amplifier.
 An operational amplifier is often called op amp (scaling amplifier).

11
Operational Amplifiers

 The special amplifiers called op amps are characterized by high


input impedance, low output impedance, and a variable voltage
gain that can be set with external resistors.
 The op amp shown has two inputs.
 The top input is labelled an inverting input. The inverting input is
shown by the minus (–) on the symbol.
 The other input is labelled a noninverting input. The noninverting
input is shown by the plus sign (+). The output of the amplifier is
shown on the right of the symbol

12
Operational Amplifiers

 The op amp is almost never used alone.


 Typically, the two resistors shown below are added to the op amp
to set the voltage gain of the amplifier.
 Resistor Rin is called the input resistor. Resistor Rf is called the
feedback resistor. The voltage gain of this amplifier is found by
using the following formula:

13
The Practical Operational Amplifiers

 Characteristics of a practical op-amps:


i. Very high voltage gain
ii. Very high bandwidth
iii. Very high input impedance
iv. Very low output impedance

14
The Ideal Operational Amplifiers

 The ideal op-amp has:


i. Infinite (very high) voltage gain.
ii. Infinite (very high) bandwidth.
iii. Infinite (very high) input impedance.
iv. Zero (very low) output impedance.

15
A Basic D/A Converter (Binary Weighted DAC)

 The D/A converter is made in two sections; resistor network and summing
amplifier.
 The resistor network is made up of resistors R1, R2, R3 and R4.
 The summing amplifier consists of an op amp and a feedback resistor.
 The input (Vin) is 3 V applied to switches D, C, B, and A. The output
voltage (Vo) is measured on a voltmeter.
 Notice that the op amp requires a dual power supply: a +10 V and –10 V.

16
A Basic D/A Converter
 With all switches at GND (0 V), the input voltage at point A is 0 V and the output
voltage is 0 V. This corresponds to row 1 in Table 1.
 Suppose we move switch A to the logical 1 position, the input voltage 3 V is applied
to the op amp.
 We next calculate the gain of the amplifier.
 The gain is dependent upon the feedback resistor (Rf), (which is 10 kΩ), and the
input resistor (Rin), which is R1 (150 kΩ). Using the gain formula:

17
A Basic D/A Converter
 To calculate the output voltage, we multiply the gain by the input
voltage:

 The output voltage is 0.2 V when the input is binary 0001. This
satisfies the requirements of row 2, Table 1.

18
A Basic D/A Converter
 Let us now apply binary 0010 to the D/A converter . Only switch B is
moved to the logical 1 position, applying 3 V to the op amp. The gain is:

 Multiplying the gain by the input voltage gives us 0.4 V. The 0.4 V is the
output voltage. This satisfies row 3, in Table 1.

19
A Basic D/A Converter
 Notice that for each binary count in Table 1, the output voltage of the
D/A converter increases by 0.2 V.
 This increase occurs because of the increased voltage of the op amp as
we switch in different resistors (R1, R2, R3, R4).
 When all switches are activated (at logical 1), the op amp puts out the full
3 V because the gain of the amplifier has increased to 1.

20
Ladder-Type D/A Converter
 This resistor network is sometimes called the 2-2R ladder network.
 The advantage of this arrangement is that only two values of resistors are
used.
 Resistors R1, R2, R3, R4, and R5 are 20 kΩ each.
 Resistors R6, R7, R8, and Rf are each 20 kΩ.
 Notice that all the horizontal resistors on the “ladder” are exactly twice the
value of the vertical resistors, hence it apply to the title “R-2R ladder
network”.

21
Ladder-Type D/A Converter
 The summing amplifier used is the same one used in the last
section. Again notice that the use of the dual power supply on the
op amp.
 The operation of this D/A converter is similar to the basic one in the
last section.
 Table 2 shows the detail operation of this D/A converter.
 Notice that we are using an input voltage of 3.75 V on this
converter.
 Each binary count increases the analog output by 0.25 V.
 Remember that each 0 on the input side of the table means 0 V
applied to that input. Each 1 on the input side of the table means
3.75 V applied to that input.
 The input voltage of 3.75 V is used because this is very close to the
output of TTL counters and other ICs you may have used.

22
Ladder-Type D/A Converter

23
An A/D Converter
 An analog-to-digital converter (ADC)is a special type of encoder.
 The input is a single variable voltage. The voltage in this case varies
from 0 to 3 V.
 The output of the A/D converter is in binary.
 The A/D converter translates the analog voltage at the input into a
4-bit binary word.

24
An A/D Converter
 The truth table in Table 3 shows how the A/D converter should work.
 Notice that each increase of 0.2 V increases the binary count by 1. Finally, row 16
shows that when the maximum 3 V is applied to the input, the output reads binary
1111. Notice that the truth Table 3 is just the reverse of the D/A converter.

25
An A/D Converter
 The truth table for the A/D converter looks quite simple.
 The electronic circuits that perform this task detailed in the truth table are
somewhat more complicated.
 One type of A/D converter is diagrammed below.
 The A/D converter contains a voltage comparator, an AND gate, a binary counter,
and a D/A converter.

26
An A/D Converter
 The analog voltage is applied at the left.
 The comparator checks the voltage coming from the D/A converter.
 If the analog input voltage at A is greater than the voltage at the input B, the clock
is allowed to increase the count of the 4-bit counter.
 The count on the counter increases until the feedback voltage from the D/A
converter becomes greater than the analog input voltage. At this point the
comparator stops the counter from advancing to a higher count.
 Suppose the input analog voltage is 2 V. According to Table 3, the binary counter
increases to 1010 before it is stopped. The counter is reset to binary 0000, and the
counter starts counting again.

27
An A/D Converter: How it works?

 Assume that, there is a logical 1 at point X at the output of the


comparator. Also assume that the counter is at binary 0000.
Assume too that 0.55 V is applied to the analog input.
 The 1 at the point X enables the AND gate, and the first pulse from
the clock appears at the CLK input of the counter. The counter
advances its count to 0001. The 0001 is displayed on the lights at
the binary output. The 0001 is also applied to the D/A converter.
 According to Table 3, a binary 0001 produces 0.2 V at the output
of the D/A converter. The 0.2 V is fed back to the B input of the
comparator. The comparator checks its inputs. The A inputs is
higher (0.55 V as opposed to 0.2 V), and so the comparator puts
out a logical 1. The 1 enables the AND gate, which lets the next
clock pulse through to the counter. The counter is now 0010. The
0010 is applied to the D/A converter.

28
An A/D Converter: How it works?

 According to Table 3, a 0010 input produces a 0.4 V output. The


0.4 V is fed back to the B input of the comparator. The comparator
again checks the B input against the A input; the A input is still
larger (0.55 V as compared 0.4 V). The comparator outputs a
logical 1. The AND gate is enabled, letting the next clock pulse
reach the counter. The counter increases its count to binary 0011.
The 0011 is applied back to the D/A converter.
 According to Table 3, a 0011 input produces a 0.6 V output. The
0.6 V is fed back to the B input of the comparator. The comparator
checks input A against input B; for the first time the B input is larger
than the A input. The comparator puts out a logical 0. The logical 0
disabled the AND gate. No more clock pulses can reach the
counter. The counter stops at binary 0011. A look at row 4, Table 3,
it shows that 0.6 V gives the readout of binary 0011. Our A/D
converter has worked according to the truth table.

29
An A/D Converter: How it works?

 For instance:
 If the input analog voltage were 1.2 V, the binary output would
be 0110. The counter would have to count from binary 0000 to
0110 before being stopped by the comparator.
 If the input analog voltage were 2.8 V, the binary output would
be 1110. The counter would have to count from binary 0000 up
to 1110 before being stopped by the comparator.

 Notice that, it does take some time for the conversion of the
analog voltage to a binary readout. However, in most cases the
clock runs fast enough so that this time lag is no problem.

30
Voltage Comparator

 We found that a comparator compares two voltages and tells us


which is the larger of the two.
 If the voltage at input A is larger than at input B, the comparator
gives a logical 1 output.
 If the voltage input at B is larger than at input A, the output is a
logical 0. This is written A > B = 1 and B > A = 0.

31
Voltage Comparator

 We found that a comparator compares two voltages and tells us


which is the larger of the two.
 If the voltage at input A is larger than at input B, the comparator
gives a logical 1 output.
 If the voltage input at B is larger than at input A, the output is a
logical 0. This is written A > B = 1 and B > A = 0.

32
An Elementary Digital Voltmeter
 One use for an A/D converter is in a digital voltmeter. We already used all
the subsystems needed to make an elementary digital voltmeter system.
 The A/D converter converts the analog voltage to binary form. The binary
is sent to the decoder, where it is converted to a seven-segment code.
 The seven-segment readout indicates the voltage in decimal numbers.
With 7 V applied to the input of the A/D converter, the unit puts out binary
0111, as shown.
 The decoder activates lines a to c of the seven-segment display
(segments a to c light on the display). The display reads as a decimal 7.
 Note that the A/D converter is also encoder; it encodes from an analog
input to a binary output.

33
An Elementary Digital Voltmeter

 A wiring diagram of an elementary digital voltmeter is shown.


 Notice the voltage comparator, the AND gate, the counter, the
decoder, the seven-segment display and the D/A converter.
Several power supplies are needed to set up this circuit.
 A dual ±10 V supply (or two individual 10 V supplies) is used for the
741 op amps. A 5 V supply is used for the 7408, 7493, and 7447 TTL
ICs and the seven-segment LED display. A 0- to 10-V variable dc
power supply is also needed for the analog input voltage.

34
An Elementary Digital Voltmeter

35
Specifications of D/A Conversion

36
Specifications of D/A Conversion

37
Specifications of D/A Conversion

38
Specifications of D/A Conversion

39
Specifications of D/A Conversion

You might also like