Here's an interim report on the Sigma-Delta Analog to Digital converter that I've been playing with. This provides a VERY low cost analog to digital converter subject to certain limitations. I'm getting around 10 bits effective accuracy full scale (9 bits across the limited range I'm using for reasons summarised below). - better than on-chip 8 bit A2D converters. For results accuracies better than a few percent a true comparator or a gate with a stable and symmetric switching point is needed. I am using a Z8 with an internal comparator but a PIC, AVR or other processor with comparator would work equally well. There's more detail than shown below but this gives enough ideas to show how it's done. Russell McMahon ________________________________________ Circuit - Designate one processor output pin as "feedback pin" = Pfb Cin = Comparator input state. Resistor [10K] from unknown voltage to comparator input. Resistor [10k] from Feedback pin to comparator pin. Capacitor Cint from comparator pin to ground. /-----Cin | - - | Gnd Code: Assign register Low_Counter Low_Counter = 0 Set Pfb low until Cin = low Pfb high till Cin = hi For N counts Set Pfb to complement of Cin If Cin = lo then increment Low_Counter Next N Vin unknown is proportional to Low_Counter NB: The time around the For/Next loop MUST be constant under all conditions (or else). Outline: I find the time constant of Rf//Ri plus Cint can have a major affect on accuracy - contrary to comments made by some others. I am currently using a 1uF (!) MKT capacitor but hope to reduce this for size and cost reasons. Increased resistor sizes (which affect the time constant in the same way as increased Cint) also have other affects so care is needed. I'm getting about +/- 0.2% A2D resolution across a 2 volt range using a LM324 amplifier to amplify and shift a 0 - 0.2 volt signal to 1 - 3 volt approx. Using Z8 internal comparator. Using 2048 processor loops at 12uS per loop = 25 ms conversion time. There are all sorts of potential inaccuracies which are probably not easily addressed without significant extra expense. Reference is currently divided decoupled Vcc. Will probably zener regulate this to give enough stability for this application. Higher accuracies SHOULD be possible with more conversion loops (and longer conversion time). I'm considering using a continuous conversion process where I hold records of say the last 8 conversions of 100 bits say (to 8 bits) and subtract these from a rolling 16 bit accumulator every time another 100 sample conversion is completed. This would allow, in this example, the equivalent of a tracking 8000 sample conversion with a new result available every 100 samples (every 1.2ms in this case). Whether the consequent affect on response is acceptable depends on your application. A single 5v supply is used in this application - a higher voltage if available will give the 324 a higher common mode range and accordingly a higher converter range. The LM324 is not a nice op-amp - where cost is not an utterly driving factor (as it is here) then the use of a more normal op-amp is indicated. The LM324 does bad things when its output gets within about 0.6 volts of ground so I have "translated" the input voltage (0-0.2 volts in my case) up to about 1 volt and amplified it by a factor of about 10. Adding an external pulldown to the LM324's output assist its performance when approaching its lower limit. Spare amplifiers (if any) should be placed in a defined state - I'm connecting the inverting inputs to outputs and the non-inverting inputs to the reference voltage. This keeps the outputs defined and the inputs within the common mode range. The LM324 costs $US0.16 in volume and I haven't found any other opamp which comes close in price. Any suggestions of a COMPARABLY PRICED but usefully superior amp would be welcomed. Changing the Z8 input over from a comparator to a std input pin produces a result about 10 times worse! - about +/- 2% accuracy! This demonstrates the advantages of the comparator. For processors without a comparator a low cost result could be achieved with an LM339 comparator and LM324 op-amp. If the input voltage is 0 - 5 volts and low impedance relative to 10K then an input amplifier MAY be able to be avoided. Note that a non-zero impedance source will affect accuracy. The LM339 is also a less than ideal comparator but is slightly cheaper than a 324! In volume a 324 and 339 cost about $US0.30 plus passive R's and C's - the passives will form an appreciable part of the cost. This would provide up to 4 channels of 10bit (plus, probably) A2D.