Sie sind auf Seite 1von 28

# Interfacing with the Analog World

Input

Sensing element

## Output is digital Actuators Input is analogue

sensors

DAC

Microcontrollers microprocessors with input and Output signal processing with ADC and DAC in a chip

Five Elements involved when a computer is monitoring and controlling a physical variable that is assumed to be analog

A D C transducer

## Digital system computer

D A C actuators

1.Transducer device that converts the physical variable to an electrical variable 2. ADC (Analog to digital converter) converts the analog input from the transducer to digital output. 80 to 1500 mV is converted to 01010000 to 10010110 3. Computer- stores the digital value and processes it according to a program of instruction that is executing. 4. DAC Digital to analog converter- it converts the output from the computer to a proportional analog voltage or current. 5. Actuator- it control the physical variable.

Analog signal is one that is continuously variable, changing smoothly over a range of values. Digital Signal increases in jumps, being a sequence of pulses, often just on-off signals.

a) Taking samples of the analogue signal b) A clock supplies regular time signal pulses to ADC and every time it receives a pulse it samples the analogue dignal c) Result is series of narrow pulses with heights that vary in accord with the variation of the analogue signal d) Pulses in changed into the signal form by each sampled value being held until the next pulse occurs

Digital signal

## Sample and hold

Consider a digital output of 3 bits Binary digits 0 and 1 are called bits Word is a group of bits, hence 3 bits is the word length For a binary word

n 1

,....,2 ,2 ,2 ,2

## LSB, least significant bit

Basic Rules
With binary number 0+0 = 0; 0+1 = 1; 1+1 = 0 000+ 1 = 001 001+1 = 010 010+1 = 011 With 3 bits , the possible words are 000 001 010 011 100 101 110 111

The number of possible words with a word length of n bits in 2n In n = 3, 23 = 8 0 0 0 0 0 1 1 1 1 0 0 0 1 1 0 0 1 1 0 0 1 0 1 0 1 0 1 0 1/8 2/8 3/8 4/8 5/8 6/8 7/8 8/8

Sketch Resolution the minimum change in input that can be detected is VFS/2n Example : An ADC with 10 bits and maximum voltage of 10 volts, the resolution is

## Digital to analog Conversion

D I G I T A L I N P U T Vref = 15 V D C B
A

DAC

## Vout Analog output

4 bit DA converter Analog output = K x digital input K depends on the ref voltage

D 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

C 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

B 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

A 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Volts 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Input Weights
D 0 0 0 1 C 0 0 1 0 B 0 1 0 0 A 1 0 0 0 Vout(V) 1(LSB) 2 4 8(MSB)

Example: A five-bit D/A converter produces Vout=0.2V for a digital input of 00001. Find the value of Vout for an input of 11111.

Example1:A five bit DAC has a current output. For a digital input of 10100, an output current of 10 mA is produced. What will Iout be for a digital input of 11101? Example 2: What is the largest value of output voltage from an eight-bit DAC that produces 1.0V for a digital input of 00110010?

Resolution
Resolution of a D/A converter is defined as the smallest change that can occur in the analog output as a result of a change in the digital input. It is equivalent to the LSB and also called the step size.
k= full scale output 2n 1

%resolution =

## step size full scale

x100%

Example3: A five-bit D/A converter produces Vout =0.2v for a digital input of 00001. Find the resolution and the Vout for a digital input of 10001.

Example 4: A 10 bit DAC has a step size of 10mV. Determine the full scale output voltage and the percentage resolution.

## What does resolution really mean?

It determine how many possible voltage values the computer can send to the value. Example: 6 bits 0-10V, there are 2N-1= 26-1= 63 steps of 0.159V In a 8 bits 0-10V, there are 28-1= 255 steps of 0.039V Hence, the greater the number of bits, the finer the resolution is. Resolution limits how close the DAC output can come to a given analog value.The cost of DAC increases with the number of bits, and so the designer will use only as many bits as necessary.

Example 5: a)How many bits should be used if the computer be able to produce a motor speed that is within 2 rpm of the desired speed?

## I out COMPUTER DAC 0-2mA I amp

Motor

0-1000 rpm

b) Using nine bits, how close to 326 rpm can the motor speed be adjusted?

## BCD input Code

B C D M S D B C D L S D D1 C1 B1 A1 D0 C0 B0 A0 Step size = weight of A0

## Vout 100 possible values Since input range from 00 to 99

Example 6: If the weight of A0 is 0.1V in the figure find the following values: (a) Step size (b) Full-scale output and percent resolution (c) Vout for D1C1B1A1=0101 and D0C0B0A0 =1000 Example 7: A certain 12-bit BCD digital-toanalog converter has a full-scale output of 9.99V.Determine (a) Percent resolution (b) Converters step size

D/A-converter circuitry
The figure shows a basic circuit for 4-bit DAC.The inputs A,B,C,D are binary inputs that are assumed to have values of either 0 or 5V.The op-amp is a summing amplifier. The amplifier output is expressed as
1 1 1 Vo = V D+ VC + VB + VA 2 4 8

## DAC using op-amp summing amplifier with binary-weighted

MSB D C B LSB A 1 K 2K 4K 8K -Vs R1=1K +Vs Vout

D 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

C 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

B 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

A 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Volts 0 -0.625(LSB) -1.250 -1.875 -2.500 -3.125 -3.750 -4.375 -5.000 -5.625 -6.250 -6.875 -7.500 -8.125 -8.750 -9.375

R/2R
Consists mainly of resistive ladder having series resistors R and parallel resistors of 2R and a bank of n-switches The ladder acts as a current splitting device, thereby making the ratio of resistors more critical than their absolute values. The output voltage is thus proportional (by superposition) to the sum of all binary weighted currents that have been switched on.

LSB

MSB

V0 =

Vref

## 8 where D value of the binary output

Example
Assume that Vref = 5V for the DAC shown. What are the resolution and full-scale output of this converter?