You are on page 1of 20

Data Converters

Muhammad Zaigham Abbas Shah

Many sensors and actuators are analog!


Strain Gauge

Solenoid
Valve

Thermocouple

Thermistors

In order to use these with digital devices, we need


a way to make digital data in to analog and the
other way round

Digital to Analog Converters(DACs)

A device used to convert a Digital Number(binary 0s


and 1s) an Analog Voltage or Current.

It scales the analog output to zero when all inputs are


zero and vice versa, mathematically
Vout Vref (b1 2 1 b2 2 2 .... bn 2 n )

where Vout is the Analog output voltage, Vref is the


reference voltage which sets the maximum output
voltage for the DAC

The output equationVref


can also be written as
Vout

2n

* Input ( Decimal )

Vref
term 2n

The
is also called the Resolution which is the
analog voltage per bit increment, mathematically
Re s

Vref
2n

The smaller the reference voltage and greater the


number of bits of the DAC, better is the resolution

Bipolar DACs

Output voltage can be negative as well as positive

Uses offset binary for the output


Vout

N
1
V

Vref
ref
2n
2

DAC structures

High Speed
Binary Weighted DAC
Segmented DAC (wont be discussed)
High Resolution
R-2R DAC
PWM DAC (wont be discussed)
Integrating DAC (wont be discussed)
Weighted Capacitor DAC (wont be discussed)
Delta Sigma DAC (wont be discussed)

DAC
1.

Binary Weighted (R/2nR) DAC

A variation of the opamp


summer amplifier

The resistors are weighted


and represent bits of the
input digital number

Bin_wtd_DAC.pdsprj

R/2R DAC

The Binary Weighted DAC required resistors with many


unique values(one per bit) thus manufacturing is a
problem

The R/2R DAC eliminates this spread in resistor values


by using a R/2R ladder network

Manufacturing becomes a
lot easier

R-2R_DAC.pdsprj

A DAC IC

A DAC IC consists of the following pins:

Digital I/p Lines: To give the digital


no to the DAC

Vref: To provide the Reference voltage

Vout: Analog output voltage pin

V+,Gnd,V-: Power pins

Offset: To make offset zero

Data Latch: To latch the digital input


so as to have a steady output

Conversion Time: The time the DAC takes to


Convert a signal form Digital to Analog

Comparator

Used to perform comparison of two analog voltages

Utilizes the very high open loop voltage


gain of the opamp. Due to the high
gain of the opamp, a slight
difference between the input
terminals results in the output
saturating to either the positive
supply(vcc) or the negative supply(vee)

One of the inputs is given the input


voltage and the other is given a
reference voltage

comparators.pdsprj

Where does the simple comparator fail?


The problem with the simple analog comparator is that
in a noisy environment, when the input signal crosses
the threshold level, the output might have multiple
transitions

What to do?

Use positive feedback to add hysteresis i-e have


multiple
threshold values, a lower threshold and an upper
threshold
Images: Art of Electronics, Horrowitz

Schmitts Trigger/ Hysteresis Comparator


Uses positive feedback to define two
threshold values

Introduces noise immunity to


comparators

When the input voltage comes to a


value with in the hysteresis window,
the output maintains its previous state
unless it goes below the lower
threshold value(making the output go to the ve
supply rail) or goes above the upper threshold
level(making the output go to the +ve supply rail)

When the output is at ground(i-e the input voltage is


greater than the reference voltage[Vref]) , Vref is given by
the equation
R 2 || R3
Vref Vcc *
R1 R 2 || R3

If the output is at Vcc(i-e the input voltage is less than


Vref), Vref is given by the equation
Vref Vcc *

R 2 || R3
R1 || R 2
Hint: Use
Vout *
R1 R 2 || R3
( R1 || R 2) R3 Superposition

theorem to
get this equation

Thus, the additional voltage, increases Vref required to


bring change thus ensuring that there are no transitions
due to noise

Reading: Application Note: Hysteresis in Comparators

Digital Signal Conditioning

Convert the signal in to a form compatible with the


system

Analog to Digital Converters (ADCs)

Most sensors have an analog output

Convert an Analog voltage in to a Digital number


(sampling+quantisation+coding)

It finds a binary number which is the closest


approximation to the fraction formed by the input
V
2
voltage andb1the
2 1 breference
.... bn 2 n in
22
Vref

ADC Structures
Some typical structures

High Resolution
Parallel-Feedback(Successive Approximation) ADC
Ramp ADC
High Speed
Flash ADC (wont be discussed)
Pipeline ADC (wont be discussed)
Sub-range ADC (wont be discussed)
Folding ADC (wont be discussed)
Delta Sigma ADC (wont be discussed)

i.

Parallel-Feedback (Successive
Approximation) ADC:

Consists of a comparator, a DAC and a Logic


counting network (Successive Approximation
Register)

The comparator compares the input voltage


and drives the Logic counter network, the
output of which is connected to DAC.

The output of the DAC is


connected to the comparator
and serves as a reference

The comparator indicates


when the two signals are
same or with in a resolution
of the input voltage thus
stopping the Logic
counting network

Images: Process Control Instrumentation Technology, Curtis

Ramp(Integrating) ADC

Eliminates the DAC in ADCs

Consists of a an Opamp integrator which produces a


sawtooth waveform. This is compared against an analog
input by a comparator. The time it takes for the sawtooth
wave to exceed the input voltage is measured by means of
a counter timed from a crystal oscillator. The output of the
counter is the digital representation of the input voltage

The single slope ramp ADC suffers from calibration drift , a


better version is the Dual slope ramp ADC discussed next

In the Dual slope Ramp


ADC, the integrator is
first switched to a
negative input voltage
(producing an
increasing ramp) for
time T1, giving
the
1

RC
or,

V1

Vx dt

1
output
V1
T1Vx
since Vx is constant, RC

After T1, the input switches to the Vref which is positive


1
hence producing a negative
ramp.
The voltage at the
V2 V1
V
R dt

RC
output decreases as follows

or
V2

1
1
T1Vx
t xVR
RC
RC

A counter is started at the end of T1 and


it counts till the comparator indicates V2 to be zero. At
this time, Vx is given by
Vx

tx
VR
T1

Thus the time for which the counter is counts(tx) is


proportional to the input voltage (Vx).

As observed the output expression is free from R and C

Tasks

It is required to operate a solenoid valve using a


microcontroller based system. The solenoid valve has two
opening positions A and B, the valve opens at position A at
a voltage of 0.4125V (scaled) and at position B at a voltage
of 2.0625V (scaled). Design a binary weighted DAC that
can be used to perform this task and also simulate on
Proteus. (Hint: Choose a resolution of 3-bits)

Read up on the following terminologies for Data


Converters:
Resolution
Quantization error
Sampling
Spurious Free Dynamic Range

You might also like