ANALOG TO DIGITAL CONVERTER INTRODUCTION Connecting digital circuitry to sensor devices is simple if the sensor devices are inherently digital themselves. Switches, relays, and encoders are easily interfaced with gate circuits due to the on/off nature of their signals. However, when analog devices are involved, However, when analog devices are involved, interfacing becomes much more complex. What is needed is a way to electronically translate analog signals into digital (binary) quantities, and vice versa. An analog-to-digital converter, or ADC, performs the former task while a digital-to-analog converter, or DAC, performs the latter. 2 DIGITAL TOANALOG CONVERTER (DAC) INTRODUCTION A DAC inputs a binary number and outputs an analog voltage or current signal. DAC in a block diagram: AnADC inputs an analog electrical signal such as voltage or current and outputs a binary number. ADC in a block diagram: diagram: 3 DIGITAL TOANALOG CONVERTER (DAC) ADC in a block diagram: INTRODUCTION Together, they are often used in digital systems to provide complete interface with analog sensors and output devices for control systems . 4 DIGITAL TOANALOG CONVERTER (DAC) APPLICATIONS Digital audio: CD/ MP3 players, HD radio, digital telephones Digital videos: DVDplayers, DTV, computer displays Industrial control systems:- motor control, valves, Industrial control systems:- motor control, valves, transducer excitation, cruise control Waveformfunction generators, test equipment, digital oscilloscope Calibration/ tuning in embedded systems, built-in self test 5 DIGITAL TOANALOG CONVERTER (DAC) DAC CONVERSION METHOD Resistive divider (binary-weighted-input DAC) a variation on the inverting summing op-amp circuit. The output voltage is the inverted (opposite polarity) sumof all input voltages 6 DIGITAL TOANALOG CONVERTER (DAC) DAC CONVERSION METHOD R-2R ladder (binary ladder DAC) An alternative to the resistive divider (binary- weighted-input DAC) is the so-called R-2R DAC, which uses fewer unique resistor values. 7 DIGITAL TOANALOG CONVERTER (DAC) RESISTIVE DIVIDER Circuit diagram 8 DIGITAL TOANALOG CONVERTER (DAC) RESISTIVE DIVIDER OPERATION Starting fromV 1 and going throughV 3 , this would give each input voltage exactly half the effect on the output as the voltage before it. input voltageV 1 has a 1:1 effect on the output voltage (gain of 1) (gain of 1) input voltageV 2 has half of V1 effect on the output (a gain of 1/2) input voltageV 3 half of V2 (a gain of 1/4). These ratios were not arbitrarily chosen: they are the same ratios corresponding to place weights in the binary numbering system. 9 DIGITAL TOANALOG CONVERTER (DAC) RESISTIVE DIVIDER The values of input resistors are chosen to be inversely proportional to the binary weights of the corresponding input bits. The lowest value resistor corresponds to the highest binary weighted input (MSB). Other resistors are multiples of R (2R, 4R, 8R etc) 10 DIGITAL TOANALOG CONVERTER (DAC) RESISTIVE DIVIDER Example of a 3 bit binary input : For R=1k, input voltage high = +5V and low = 0V. The output voltages for all eight combinations of binary bits input to this circuit are: Binary Input Output Voltage (V) 000 0.00 11 DIGITAL TOANALOG CONVERTER (DAC) 000 0.00 001 -1.25 010 -2.50 011 -3.75 100 -5.00 101 -6.25 110 -7.50 111 -8.75 RESISTIVE DIVIDER For R=1k, input voltage high = +5V and low = 0V. Binary input = 000 ; ) 4 2 ( 3 2 1 R V R V R V R V f o
LSB input MSB input MSB LSB 0 0 0 Binary input = 001 ; 12 DIGITAL TOANALOG CONVERTER (DAC) V k k k k V o 0 ) ) 1 ( 4 0 ) 1 ( 2 0 1 0 ( 1 MSB LSB V k k k k V o 25 . 1 ) ) 1 ( 4 5 ) 1 ( 2 0 1 0 ( 1 RESISTIVE DIVIDER Binary input = 100 ; Binary input = 101 ; MSB LSB V k k k k V o 5 ) ) 1 ( 4 0 ) 1 ( 2 0 1 5 ( 1 MSB LSB Binary input = 111 ; 13 DIGITAL TOANALOG CONVERTER (DAC) V k k k k V o 25 . 6 ) ) 1 ( 4 5 ) 1 ( 2 0 1 5 ( 1 V k k k k V o 75 . 8 ) ) 1 ( 4 5 ) 1 ( 2 5 1 5 ( 1 MSB LSB RESISTIVE DIVIDER OUTPUTWAVEFORM binary input Vo 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 -2.5 -1.25 14 DIGITAL TOANALOG CONVERTER (DAC) -5.0 -7.5 -8.75 -6.25 -3.75 PRO & CONS OF RESISTIVE DIVIDER DAC PRO: Easily understood CONS : Limited to 8 bits input Limited to 8 bits input Large number of resistors used in the circuit; several different precise input resistor values, one unique value per binary input bit. Susceptible to noise Expensive Greater error 15 DIGITAL TOANALOG CONVERTER (DAC) R-2R LADDER 3 bit By constructing a different kind of resistor network on the input of the summing circuit, the same kind of binary weighting is achieved with only two kinds of resistor values, and with only a modest increase in resistor count. 16 DIGITAL TOANALOG CONVERTER (DAC) R-2R LADDER The less significant the bit, the more resistors the signal must pass through before reaching the op- amp. The current is divided by a factor of 2 at each node. 17 DIGITAL TOANALOG CONVERTER (DAC) 2R D2 R D0 0 +V R 2R 2R Rf 2R MSB 2R D1 LSB R-2R LADDER a b c Vout 0 - + 1 2 3 If you look down the R-2R ladder, you see an equivalent resistance of 2R. (To arrive at this, start at the LSB and work toward node a) We have 2Rs in parallel, which is equivalent to R. This results in two Rs in series, which is equivalent to 2R, and so forth all the way back to node a. 18 DIGITAL TOANALOG CONVERTER (DAC) R-2R LADDER Consider the switch at bit D1 connected to the amp, and all others switched to ground. At node b, looking down the ladder or looking toward the switches, you see a 2R to ground. The equivalent resistance of two paralleled 2Rs is 19 DIGITAL TOANALOG CONVERTER (DAC) The equivalent resistance of two paralleled 2Rs is just R. Thus we have a voltage divider, henceV B =+V/ 2. Similar analysis will showthat +V is halved progressing fromnode a to node d. R-2R LADDER D2 R Req = R 2R +V D1 a b Va = +V we have a voltage divider, hence V B =+V(R/2R) V B =+V/2 20 DIGITAL TOANALOG CONVERTER (DAC) Similarly, V C =V B (R/2R) Vc = +V / 4 D1 R Req = R 2R D0 b c Vb = +V/2 2R D2 R D0 0 +V R 2R 2R Rf 2R MSB 2R D1 2 LSB R-2R LADDER a b c I c = I f ) 2 1 )( 4 ( 2 R V R V I c c
Vout 0 - + 1 2 3 For a 3 bit binary input, what is the output voltage when input is 001? Vo = -I f x R f = 21 DIGITAL TOANALOG CONVERTER (DAC) V V 25 . 1 4
+v = 5V 2R D2 R D0 0 +V R 2R 2R Rf 2R MSB 2R D1 2 LSB R-2R LADDER a b c I c = I f ) 2 1 )( 4 ( 2 R V R V I c c
) 2 ( 2 R V R V I a a
) 2 1 )( 2 ( 2 R V R V I b b
Vout 0 - + 1 2 3 For a 3 bit binary input, what is the output voltage when input is 111? Vo = -I f x R f = 22 DIGITAL TOANALOG CONVERTER (DAC) 75 . 8 2 )} 2 1 4 ( ) 2 1 2 ( 2 { R x R V R V R V +v = 5V R-2R LADDER Example of a 3 bit binary input : For input voltage high = +5V and low= 0V. The output voltages for all eight combinations of binary bits input to this circuit are: Binary Input Output Voltage (V) 000 0.00 23 DIGITAL TOANALOG CONVERTER (DAC) 000 0.00 001 -1.25 010 -2.50 011 -3.75 100 -5.00 101 -6.25 110 -7.50 111 -8.75 R-2R LADDER OUTPUTWAVEFORM binary input Vo 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 -2.5 -1.25 24 DIGITAL TOANALOG CONVERTER (DAC) -5.0 -7.5 -8.75 -6.25 -3.75 PRO & CONS OF R-2R LADDER DAC Pro: Easier to implement Easier to manufacture, use 2 resistors value only. Faster response time Cons : More confusing analysis 25 DIGITAL TOANALOG CONVERTER (DAC) DAC & ADC RESOLUTION (step size) is defined as the smallest change that can occur in the analog output as a result of a change in the digital input. For an n-bit digital input , the total no. of steps is (2 n - 1) Full scale output = the max output voltage obtained Full scale output = the max output voltage obtained froma corresponding max input bits. Step size = full scale output/no of total steps Percentage resolution : = (1/total no. of steps)*100 = 1/(2 n - 1) *100 26 DIGITAL TOANALOG CONVERTER (DAC) DIGITAL TO ANALOG CONVERTER (DAC) Example : Assuming the zero state output of the DAC is 0V, a 12-bit DAC has a step size of 8 mv. 1. Determine the full scale output voltage and percentage resolution. 2. Also find the output voltage for the input of 010101101101? Answer : Answer : 1. The total no of steps is 2 n -1 = 2 12 -1 = 4095; Each step changes the output by 8mv; full scale output = 4095 x 8mV = 32.76V. The resolution is (1/total no of step)*100%= 2.44% 2. An input of 010101101101 b is equivalent to 1389 d . Vo = 8mV x 1389 = 11.11V 27 DIGITAL TOANALOG CONVERTER (DAC)