At 02:11 PM 3/8/00 -0500, Jim wrote: >I'm working with a 5V circuit. The 2 inputs range from 1V to 4V, with >the difference between the 2 ranging from 0 - 500 mV. S1 > S2. Here is >a simplified version of the circuit: (NOTE: There is also a variable 1K >resistor on S1 that is used as a zero adjust) > > 10K |\ LMC6482 > S1 >----vvvvvv-----|+\ 1K > 10K | >-+---vvvvvv-----> output > S2 >----vvvvvv--+--|-/ | > | |/ | > | 100K | > L-vvvv--| > >The output is not what I expect because it seems to be influenced more >by S2 than it is by S1. If both S1 and S2 are increasing (over a 1 >minute period), then the output also increases. If S1 increases and S2 >decreases, the output decreases. If S1 decreases and S2 increases, the >output increases. 1. As others have mentioned, you need a 100k resistor to ground to maintain balance between the two inputs. Otherwise you will lose common mode rejection and you'll develop a bias current problem on the + terminal. 2. I assume the "LMC" op-amp is a CMOS rail-rail op-amp, so you shouldn't have to worry about offset voltages or bias current effects, since they will be very small compared to your inputs. 3. Make sure your signals don't get above 0.5 V, or you will saturate the op-amp, giving a fixed ~ 5 V instead of the correct value. 4. Make sure the difference between the two inputs doesn't exceed the maximum difference allowed between inputs by the op-amp. 5. If your op-amp is not 'rail-rail', you will get saturation/clipping below 5 V. 6. I think most of your problems will go away when you add the 100 k resistor to the + terminal. 7. Another thing you can try is to replace the 100k resistors with 10k and see what your output looks like with unity gain. 8. Do you have an oscilloscope? This will allow real-time debugging of the electronics separately from the PIC. 9. Are the inputs via twisted pair? What is the opportunity to pick up hum from AC power lines, fluorescent lights, etc? If this can be a problem, the resistors used for inputs should be matched to 1% or 0.1%, or you need a circuit mod for common mode rejection adjustment. 10. What is the output impedance of your input sources? Is 10k the correct value to use for the input resistors? 11. This circuit should work (with the 100k addition), without the need for more op-amps to make an instrumentation amplifier. A good CMOS op-amp (I use LMC660) is accurate enough to make a high-quality difference amplifier. 12. You can connect the two inputs together and look at the output. You should get zero volts to 1% or better if your design is correct. ================================================================ Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: ral@lcfltd.com Least Cost Formulations, Ltd. URL: http://lcfltd.com/ 824 Timberlake Drive Tel: 757-467-0954 Virginia Beach, VA 23464-3239 Fax: 757-467-2947 "Vere scire est per causae scire" ================================================================