1/13/2020
1
Konversi Data analog ke digital
Dr Ir Dina Maizana MT
Mari kita berdoa menurut agama dan kepercayaan masing-masing sebelum kelas dimulai.
Doa dimulai…
1/13/2020
2
Jadwal Kandungan Jam
Minggu-1 Pendahuluan, penyampaian kontrak kuliah, Konsep-konsep pengukuran, Kesalahan-kesalahan pembacaan alat ukur
Selasa (9.40-12.10 wib) R. III.3 Selasa (19.00-20.30 wib) R. A.II.6
Minggu-2 Satuan pengukuran dan besaran standar listrik, Nilai dan fungsi satuan
Minggu-3 Besaran listrik, Alat ukur dengan termokopel, besi putar, elektrodinamis, elektrostatis dan induksi.
Minggu-4 Instrument penunjuk arus searah, Volt Ammeter DC, Prinsip kerja, Cara kerja, Penggunaan alat ukur DC
Minggu-5 Instrument arus bolak-balik, Voltmeter elektrostatis, Prinsip Kerja,Cara kerja, Penggunaan alat ukur untuk AC
Minggu-6 Pengukuran daya, Wattmeter, Pengukuran daya tanpa Wattmeter, Type alat pengukur daya
Minggu-7 Penggunaan jembatan Wheatstone, Prinsip dari jembatan wheatstone, Contoh dari jembatan wheatstone
Minggu-8 UTS
Minggu-9 Pengukuran dengan alat ukur oscilloscope
Minggu-10 Generator sinyal
Minggu-11 Alat-alat ukur digital
Minggu-12 Trafo Instrumentasi, Trafo arus untuk alat ukur, Trafo tegangan alat ukur, Kwh meter.
Minggu-13 Transduser
Minggu-14 Konversi Data analog ke digital
Minggu-15 Sistem data akusisi
Minggu-16 UAS
Rencangan Pembelajaran Semester (RPS) Sem. A ta 2019/20
CPMK
Mahasiswa mampu menjelaskan Konversi Data analog ke digital
1/13/2020
3
1/13/2020
PRINCIPLES OF DATA CONVERSION OUTLINE
Signal vs data
Digital to Analog Data Convertor (DAC)
-Binary Weighted Resistor
-R-2R Ladder
Analog to Digital Data Convertor(ADC)
-Digital-Ramp ADC
-Successive Approximation ADC
-Flash ADC
Voltage to Frenquency Converter
Frequency to Voltage Converter
Digital instruments
Is more advantages in term of speed, increased accuracy, resolution, reduction in error and the ability to provide automatic measurement in system application
Analog to Digital
Converter
Signal Processing
Display
(Building block of a digital instrument)
1/13/2020
4
Comparison of digital and analog instruments
Digital instruments are basically the arrangement of logic circuit while the analog is base on fundamental circuit
The comparison of digital and analog instruments are shown in table below
Digital Instruments Analog Instruments
-the outputs are in digital data
-easy to read and to analyze
-more accurate
-the range is more wider
-it has better resolution
-build with triggering circuits
that used for sample speed (3
to 10 samples per second)
-able to read beyond full scale
-the outputs are in analog data
-need to read the analog scale
properly and must has skill to
process the data
-not too accurate
-the range is not wider
-low resolution
-low sample speed with 1 sample
per 1sec or 2sec
Analog and Digital Signals
• Signals can be analog or digital. • Analog signals can have an infinite number of values in a
range. • Digital signals can have only a limited number of values.
1/13/2020
5
Analog and Digital Data
Data can be analog or digital. Analog data are continuous and take continuous values. Digital data are discrete and take discrete values.
Comparison of analog and digital signals
1/13/2020
6
• A number may be represented in digital form by simply setting a pattern of voltages on a line high or low. An 8 bit binary pattern is shown below.
Revision of Binary Number
BIT NUMBER 7(28) 6(27) 5(26) 4(25) 3(24) 2(22) 1(21) 0(20)
BIT VALUE 128 64 32 16 8 4 2 1
• Bit zero is called the least significant bit (LSB) and the bit with highest value is called the most significant bit (MSB).
Digital to Analog Data Conversion
1. DAC
What is a DAC? A digital to analog converter (DAC) converts a digital
signal to an analog voltage or current output.
DAC 100101…
input
output
1/13/2020
7
Digital to Analog Data Conversion
In an electronic circuit, a combination of high voltage (e.g. +5V) and low voltage (0V) is usually used to represent a binary number. For example, a binary number 1010 is represented by
Weighting
23
22
21
20
Binary Digit
1
0
1
0
State
+5V
0V
+5V
0V
Digital to Analog Data Conversion
DACs are used in many other applications, such as voice synthesizers, automatic test system, and process control actuator. In addition, they allow computers to communicate with the real (analog) world.
Reg
iste
r
Voltage
Switch
Resistive
Summing
NetworkAmplifier
Input Binary
Number
Analog Voltage
Output
1/13/2020
8
Digital to Analog Data Conversion Register: Use to store the digital input (let it remain a constant value) during the conversion period. Voltage switch: Similar to an ON/OFF switch. It is ‘closed’ when the input is ‘1’. It is ‘opened’ when the input is ‘0’. Resistive Summing Network: Summation of the voltages according to different weighting. Amplifier: Amplification of the analog according to a pre-determined output voltage range. For example, an operation amplifier
Types of DACs
Many types of DACs available.
Usually switches, resistors, and op-amps used to implement conversion
Two Types:
Binary Weighted Resistor
R-2R Ladder
1/13/2020
9
Binary Weighted Resistor
Utilizes a summing op-amp circuit
Weighted resistors are used to distinguish each bit from the most significant to the least significant
Transistors are used to switch between Vref and ground (bit high or low)
Binary Weighted Resistor
-
+
R
2R
4R
2nR
Rf
Vout
I
Vref MSB
LSB
Assume Ideal Op-amp
No current into op-amp
Virtual ground at inverting input
Vout= -IRf
1/13/2020
10
Binary Weighted Resistor
R
V
R
V
R
V
R
VRIRV
1-n
n321ffout
242
MSB
LSB
I
-
+
R
2R
4R
2n-1R
Rf
Vout
Vref
V1
V2
V3
Vn
MSB
LSB
Voltages V1 through Vn are either Vref if corresponding bit is high or ground if corresponding bit is low V1 is most significant bit (MSB) Vn is least significant bit (LSB)
Binary Weighted Resistor
If Rf=R/2
n
n321fout
2842
VVVVIRV
For example, a 4-Bit converter yields
16
1
8
1
4
1
2
10123refout bbbbVV
Where b3 corresponds to Bit-3, b2 to Bit-2, etc.
1/13/2020
11
Example 1
Calculate the value of Vo, of a 4-bit weighted –resistor DAC, where Vref = 5V, R = 1kΩ, Rf = 470 Ω, and digital input of 1010 is applied.
Solution:
V
Rb
Rb
Rb
RbVR
Rb
Rb
Rb
RbVRV
reff
reffo
973.210008
)]01()12()04()18[(5470
)]8
1
8
2
8
4
8
8([
)]8
1
4
1
2
11([
0123
0123
Binary Weighted Resistor
Advantages
Simple Construction/Analysis
Fast Conversion
Disadvantages
Requires large range of resistors (2000:1 for 12-bit DAC) with necessary high precision for low resistors
Requires low switch resistances in transistors
Can be expensive. Therefore, usually limited to 8-bit resolution.
1/13/2020
12
R-2R Ladder
Bit: 0 0 0 0
Each bit corresponds to a switch: If the bit is high, the corresponding switch is connected to the inverting input of the op-amp. If the bit is low, the corresponding switch is connected to ground.
4-Bit Converter
Vout
Vref
Vref V2 V1 V3
R-2R Ladder
Ideal Op-amp
2R 2R
V3
RRR
RRR
22
22eq
1/13/2020
13
Vref V2 V1 V3
R-2R Ladder
V2 V3
R R
2232
1VV
RR
RV
Likewise,
122
1VV
ref12
1VV
I
IRV out
Vref V2 V1 V3
R-2R Ladder
Results:
ref1ref2ref32
1,
4
1,
8
1VVVVVV
R
Vb
R
Vb
R
Vb
R
VbRV
16842
ref0
ref1
ref2
ref3out
Where b3 corresponds to bit 3, b2 to bit 2, etc. If bit n is set, bn=1 If bit n is clear, bn=0
1/13/2020
14
R-2R Ladder
16
1
8
1
4
1
2
10123refout bbbbVV
For a 4-Bit R-2R Ladder (R=Rf)
For general n-Bit R-2R Ladder or Binary Weighted Resister DAC
i
n
i
inbVV2
1
1
refout
R-2R Ladder
Advantages
Only two resistor values (R and 2R)
Does not require high precision resistors
Disadvantage
Lower conversion speed than binary weighted DAC
1/13/2020
15
Example 2 (a)
For the circuit shown above with Vref = 5V and R = Rf = 2kΩ, calculate the output voltage V0 for an input code word 1110.
16
1248 0123 bbbbVV refo
Example 2 (a)
Vref = 5V
R=Rf = 2kΩ
input code word 1110
Vo = -5 [(8x1)+(4x1)+(2x1)+(1x0) /16]
= - 5 * (8 + 4 + 2) / 16
= - 4.375 volts
16
1248 0123 bbbbVV refo
1/13/2020
16
Example 2 (b)
Find the output voltage for the R-2R DAC shown below. The digital input is 110.
Example 2 (b)
AmAmAI
I
mAk
V
R
VI
mAk
V
R
VI
ref
refin
33.830833.02
1667.0
2
1667.030
5
2
333.015
5
21
2
1/13/2020
17
Example 2 (b)
VkmARIV
mAmAmAIII
AmAmAI
I
fTo
T
75045.31525003.0
25003.00833.01667.0
66.4104166.02
0833.0
2
12
10
Pros & Cons
Binary Weighted R-2R
Pros Easily understood
Only 2 resistor values
Easier implementation
Easier to manufacture
Faster response time
Cons
Limited to ~ 8 bits
Large number of resistors
Susceptible to noise
Expensive
Greater Error
More confusing analysis
1/13/2020
18
Digital to Analog Data Conversion
3. Selection of DAC
For the selection of a DAC, there are several parameters that can determine the suitability of a particular device.
Resolution It is the smallest possible change in the analog output as a result of the change in digital input. Resolution should be as high as possible.
Example 3:
A 4 bit D/A converter have an output range of 0 to 1.5 V. Define its resolution. Solution: Given, n = 4 = number of bits Full scale output, VOFS = 1.5V
Thus the output voltage can have 16 different values including zero. Resolution: Thus, an input change of 1 LSB changes the output by 100 mV.
LSBmVV
Rn
OFS/100
15
5.1
116
5.1
12
1622 4 n
1/13/2020
19
Digital to Analog Data Conversion
Output Voltage Range This is the difference between the maximum and minimum output voltages expressed in volts.
Example 4: Calculate the output voltage range of a 4-bit DAC if the output voltage is +4.5V for an input of 0000 and +7.5V for an input of 1111. Solution: Output voltage range = 7.5 – 4.5 = 3.0V
Digital to Analog Data Conversion
Accuracy It indicates how close the analog output is to its theoretical value. It is the deviation of actual output from the theoretical value. Linearity The relation between the digital input and analog output should be linear.
1/13/2020
20
Digital to Analog Data Conversion
Settling time The time taken for the applied digital input to be converted to an analog output. Typical period can be as low as 100ns, making DA conversion a very fast process compared with those of AD conversion.
Input coding The digital input can be in binary format or it can be in binary coded decimal format depending on the application. Binary format is more commonly used.
Digital to Analog Data Conversion
Binary-coded decimal, or BCD, is a method of using binary digits to represent the decimal digits 0 through 9. A decimal digit is represented by four binary digits, as shown below:
BCD Decimal 0000 0
0001 1 0010 2
0011 3
0100 4
0101 5
0110 6
0111 7 1000 8
1001 9
1/13/2020
21
Digital to Analog Data Conversion
It should be noted in the table above that the BCD coding is the binary equivalent of the decimal digit. However, BCD and binary are not the same. For example,
4910 in binary is 1100012, but
4910 in BCD is 01001001BCD. Each decimal digit is converted to its binary equivalent.
Analog to Digital Data Conversion
2. ADC
Many types of ADC
Digital-Ramp ADC
Successive Approximation ADC
Flash ADC
1/13/2020
22
Digital-Ramp ADC
Conversion from analog to digital form inherently involves comparator action where the value of the analog voltage at some point in time is compared with some standard point.
A common way to do that is to apply the analog voltage to one terminal of a comparator and trigger a binary counter which drives a DAC.
Digital-Ramp ADC
1/13/2020
23
Digital-Ramp ADC
The output of the DAC is applied to the other terminal of the comparator.
Since the output of the DAC is increasing with the counter, it will trigger the comparator at some point when its voltage exceeds the analog input.
The transition of the comparator stops the binary counter, which at that point holds the digital value corresponding to the analog voltage.
Successive approximation ADC
Illustration of 4-bit SAC with 1 volt step size
1/13/2020
24
Successive approximation ADC
Much faster than the digital ramp ADC because it uses digital logic to converge on the value closest to the input voltage.
A comparator and a DAC are used in the process.
Flash ADC
It is the fastest type of ADC available, but requires a comparator for each value of output.
(63 for 6-bit, 255 for 8-bit, etc.)
Such ADCs are available in IC form up to 8-bit and 10-bit flash ADCs (1023 comparators) are planned.
The encoder logic executes a truth table to convert the ladder of inputs to the binary number output.
Illustrated is a 3-bit flash ADC with resolution 1 volt
1/13/2020
25
Flash ADC
The resistor net and comparators provide an input to the combinational logic circuit, so the conversion time is just the propagation delay through the network - it is not limited by the clock rate or some convergence sequence.
Analog to Digital Data Conversion
T y p e o f A D C S p eed P r ice N o ise
Im m u n ity
C o n v ersio n
T im e
V o lta g e to
freq u en cy
C o n stan t
D u a l s lo p e V ary
S ta irca se
ra m p
V ary
fT
n2max
S u ccess iv e
a p p ro x im a tio n
C o n stan t
f
nT
P a ra lle l (o r
fla sh )
N o t feas ib le
fo r h igh
reso lu tio n
C o n stan t
1/13/2020
26
Analog to Digital Data Conversion
4. Selection of ADC
The parameters used in selecting an ADC are very similar to those considered for a DAC selection.
• Error/Accuracy: Quantizing error represents the difference between an actual analog value and its digital representation. Ideally, the quantizing error should not be greater than ± ½ LSB.
• Resolution: DV to cause 1 bit change in output • Output Voltage Range Input Voltage Range • Output Settling Time Conversion Time • Output Coding (usually binary)
Analog to Digital Data Conversion
To measure an AC voltage at a particular instant in time, it is necessary to sample the waveform with a ‘sample and hold’ (S/H) circuit.
Hold
Sample
Input Output to
ADC
1/13/2020
27
Analog to Digital Data Conversion
5. Worked Examples
If the clock rate is 2MHz, calculate the maximum conversion time of
(a) a 8-bit staircase ramp ADC.
(b) a successive approximation ADC.
Solution:
(a) For a 8-bit staircase ramp ADC, the maximum number of count is
nc = 28 = 256
Therefore, the maximum conversion time is
ssf
nT c
c 12810128102
256 6
6
Analog to Digital Data Conversion
(b) For a 8-bit successive approximation ADC, the conversion time is constant and equal to
ssf
nTc 4104
102
8 6
6
It can be noted that the conversion speed of successive approximation ADC is much faster than the staircase ramp type.
1/13/2020
28
Frequency to Voltage Converter & Voltage to Frequency Converter
Where an instrumentation system is based mainly on capturing voltage signals (analogue multiplexer and A/D) it may be inconvenient to provide separate inputs for pulse or frequency signals. They can be converted to a voltage by a Frequency to Voltage converter circuit, F/V.
(Conversely some systems are designed to capture pluses or frequencies for them voltages can be converted to frequencies, V/F. The integrated circuits used are often the same.)
Frequency to Voltage converter
The LM331 is a V/F used here as F/V. A pulse train or square wave of at least 3v amplitude. 10kHz produces an output of 10v the linearity is good. However, the circuit has a slow response to input changes
1/13/2020
29
Frequency to Voltage converter
The operating principle here can be applied to any monostable circuit. The zero crossings of the pulse of frequency signal are used to trigger the monostable, whose fixed width pulses are integrated by the RC filter to produce a dc voltage. The higher the frequency the higher the voltage. A simple circuit like this will need calibration.
Voltage to Frequency Converter
In some circumstances sending a analogue signal into a measurement system is not the best solution to a problem, there may be excessive noise or a long distance between sensor and system or simply all the other signals may be digital. One solution is to convert the analogue voltage to a frequency.
It is possible to use Op Amps or other common ICs (e.g. 555 Timer) but a better performance comes from specialist ICs.
1/13/2020
30
Voltage to Frequency Converter
The LM331again, this time
as F/V, it offers a highly linear conversion, 0.01% max and wide frequency range, 1to 100kHz in a single simple to use package.
The output is a digital pulse train that is easily interfaced to digital measurement systems.
Voltage to Frequency Converter
Typical applications are as shown.
The output of a single sensor (photo-transistor, temperature sensor) is converted to a frequency for transmission to a measurement system.
1/13/2020
31
Voltage to Frequency Converter
The internal circuitry is complex and difficult to emulate using simpler devices.
Other V/F:F/V integrated circuit are AD650 and LM2907
Thank you for coming
• .