Dual Slope ADC for 8051

by Martin Clausen (mc AT rotgradpsi DOT de)

A low cost circuit for the measurement of voltages with up to 14 bit precision.

Table of contents:

Features

Principle of Operation

Applications

The dual slope method to digitalize voltages is used, when a low conversion rate together with a high resolution is needed. Note the low part count. The disturbance suppression can be improved, if the conversion time is two times an integer value of the period of the disturbance. Well known chips with this technique are ICL7106 / ICL7107 and MAX134, which are often used in multimeters. But special chips are not necessary to build the circuit. If a microcontroller is used in the circuit any way, it can control the conversion and acquire the data. The microcontroller will not be blocked during the conversion, if a 16 bit timer and an interrupt are free.

The Conversion Cycle

In the beginning of each conversion the measurement capacitor will be precharged (Z with Z1 and Y with Y1 connected). Through this precharging the bipolar input range is shifted to the positive values and the offset of the comperator is canceled.
Then the capacitor is discharged with the input voltage over the 100K resistor (Z with Z0 and Y with Y0 connected). Form the mathematic point of view it is an integration over the input current. The 100k resistor works as a voltage to current converter.
In the second step of the measurement the capacitor is charged with a known current, generated with the voltage reference and the 100K resistor (Z with Z1 and Y with Y0 connected). The microcontroller measures now the time until the capacitor is charged again.

Understanding the Properties of the Circuit

In principle a comparison between two voltages is done. The ratio of the voltages is also seen in the times for charging and discharging the capacitor. Time can be measured very precise with the quartz time base of the microcontroller.
Because in both parts of the measurement cycle the same components are used, only the short time drift of the components have to be taken into account. Of cause this is not true for the drift of the voltage reference, unless the input signal also depends in the same way on the reference voltage.

Improvement of the Precision

The error is mainly caused by the voltage reference and the amplification error of the operational amplifier. This error can be cancelled through a correction with the microcontroller. It is not possible to compensate for self discharge of the capacitor, drift of offset- and reference voltage and uncertainty in the switching of the comperator.
Through the integration periodic distortions average out. Good multimeters have therefore an option to select the power line frequency.
The integration time, resistor and capacitor have to be chosen in a way, that the conversion time gets not to long and the self discharging of the capacitor get not to large. Further one has to obey the voltage range of the operational amplifier.
The 47 Ohm resistor in the integrator circuit damps oscillations of the operational amplifier. The output transistor decouples comperator and microcontroller and adjusts the signal level.

Further Reading

Parts

Hints

Download of Program and Schematic

Variants for Unipolar Input Voltages

The circuit can also be used for unipolar input voltages (0V to 2,46V or -2,46V) (schematics not tested yet): Alternatively can the circuit also be modified for unipolar voltages (0V to 1,23V) and single-supply.

The part description in schematics is read as follows:
part type + value in exponential form + package description + subpart number in package
for example: C1040805,1 means Capacitor, 100nF, package SMD 0805, first subpart in package

Similar Projects

DescriptionAuthor
Analog-to-Digital Conversion Utilising the AT89CX051 MicrocontrollersAtmel
AVR401: 8-bit Precision A/D ConverterAtmel
A Comparator Based Slope ADC AN863Microchip

Disclaimer: No warranty at all!
Copyright by Martin Clausen, Germany.
Contact the author: mc AT rotgradpsi DOT de
Impressum