Experiment-10 (1)
Experiment-10 (1)
Experiment 10
Experiments
1.1 Design a 4-bit weighted resistor DAC. Let Rf = 1 kΩ. For good results, the tolerance of
resistors should be better than 0.5%. Choose the appropriate resistor values. Assemble the
total circuit.
Choose R= Rf.
1.2 Let Vr = 3.2 V. Measure the analog output voltage for each of the possible switch (input)
combinations (decimal 0 through 15). Calculate the maximum linearity error and the
accuracy.
b1 b2 b3 b4 V0(theoretical) Vo Error voltage
(measured)
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1
2.1 Design a 4-bit weighted resistor DAC. Let Rf = 5 kΩ (10k|| 10k). For good results, the
tolerance of resistors should be better than 0.5%. Choose the appropriate resistor values.
Assemble the total circuit.
Choose R= Rf.
2.2 Let Vr = 3.2 V. Measure the analog output voltage for each of the possible switch (input)
combinations (decimal 0 through 15). Calculate the maximum linearity error and the
accuracy.
b1 b2 b3 b4 V0(theoretical) Vo Error voltage
(measured)
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1
• Compatible with 8080 p derivatives- no interfacing logic needed, access tome 135 ns.
• Easy interface to all microprocessors, or operates standalone.
• Differential analog voltage inputs.
• Logic inputs and outputs meet both MOS and TTL voltage level specifications.
• Work with 2.5 V voltage reference.
• On-chip clock generator.
• 0v to 5V analog input voltage range with single supply 5V supply.
• No zero adjustment required.
• 0.3 inch standard width 20-pin DIP package.
• Resolution 8 bits.
• Total error LSB.
• Conversion time 100 s.
Assemble the circuit as shown in the Fig. 3. Vary the input voltage in steps of LSB and see the
output levels and record the values in the table given below.
Fig. 3 8-Bit Digital to Analog Converter using ADC0804 IC
Since the IC comes with an internal clock we do not need many components to make it work.
However to make the internal clock to work we have to use a RC circuit. The IC should be powered
by +5V and the both ground pins should be tied to circuit ground. To design the RC circuit simply
use a resistor of value 10k and capacitor of 100pf (approx) and connect them to CLK R and CLK
IN pins as shown in the circuit below. The chip select (CS) and Read (R) pin should also be
grounded. The Vref pin is left free because by default without any connection it will be connected
to +5V.
The digital output will be obtained from the pins DB0 to DB7 and the analog voltage should be
connected to V in(+) pin as shown in the circuit. Also note that another end of the voltage source
(sensor/module) should also be grounded to the circuit for the ADC conversion to work. Now, for
the ADC Conversion to start we have o make the Write(WR) pin to go high momentary this can
be done connecting the pin to I/O of MPU and toggling it high before every ADC read. Only if
this is done the ADC value on the output side will be update.
In the above circuit a potentiometer is used to feed in a variable voltage of 0V to 5V to the Vin pin
and the present Voltage is read using a voltmeter. Suppose if the voltage value is 1.55V and the
resulting binary value is 01001111. Let us see how this binary value can be converted to Analog
value, since we will need it while programming/designing.
Binary Value = 01001111
Converting to Decimal = (0*128)+(1*64)+(0*32)+(0*16)+(1*8)+(1*4)+(1*2)+(1*1)
= 79
Analog Voltage = Decimal Value * Step size
= 79 * 19.53mV
= 1.54V
The obtained value is 1.54V and the measured voltage is 1.55V which are very much close. So
this is how you use an ADC0804 IC.
Analog Digital Output Equivalent
Input DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 Analog
voltage Voltage
Vin