You have something mixed up here. AD621 is made by Analog Devices, and it has a minimum gain of 10.
Yep I totally messed that up. I meant to say Burr Brown INA121PA thanks for catching that Ron.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
You have something mixed up here. AD621 is made by Analog Devices, and it has a minimum gain of 10.
If you have a good inamp, programmable for a gain of 1, you can connect its output to its (-) input and the gain becomes 1/2. The precision resistors, high linearity, and low drift are built in.
View attachment 70566
Hi. Glad to see it works more or less in the real world. A few questions:
1. Are there pulses or noise spikes present at the input of the inamp? If they are present, the inamp may not respond fast enough to them, resulting in oscillations at the output. A capacitor at the output of the inamp can exacerbate the oscillations by slowing the response of the inamp even further. In this case, suggest putting a .01uF capacitor from inamp input to ground with 2K resistor between op amp output and inamp input. Additional filtering can be placed before the input of the op amp.
2. Are power supply bypassing capacitors used directly at the inamp and microcontroller? If not, suggest adding them, regardless of the specific cause of the oscillation.
3. What is the p-p amplitude of this oscillation? Is the amplitude constant when present, or is it periodically varying in amplitude?
4. How many .01uF capacitors are you using at the output of the inamp?
Edit: In simulation, a .01uF cap at the output of the inamp causes 250 mV of oscillation at the output with a clean 6V input. A cap .005uF or larger results in oscillation. Not a good idea to put a capacitor that large there. It is apparently causing a phase shift large enough to create an oscillator. If a cap at the input to your ADC is necessary then I suggest a buffer op amp, selected for very low input offset voltage and high load capacitance capability. Alternatively, you can try putting a 120nF cap in series with a 27 ohm resistor connected from the inamp output to ground (i.e., the series combination connected in parallel with the .01uF load capacitor) to compensate somewhat for the .01uF load capacitor. That works in simulation and will not decrease DC accuracy.
The oscillation is .6Vpp and has a period of 3 uS with a rough sine shape. As the inamp output approaches about 2.5V (5V input) there's another oscillation that happens even without the .01uF capacitor - .2Vpp and a period of 1mS.
The oscillation at 2.5V input without the .01uF cap is difficult for me to explain assuming all the usual steps of proper bypassing are in place, short leads, and good routing. Hmmmm.
I'm puzzled for the need of the .01uF capacitor at the output of the inamp if the microcontroller you are using is the Freescale model in the link you gave previously. In the datasheet for that micro, page 37, it specifically states (for reason unknown to me) that the R/C time constant of the output resistance of the source (80 ohms at 300KHz for the inamp) and the output capacitance of the source (added .01uF cap) should be less than 1nS, which it is NOT. Based on that, if the .01uF cap is for filtering the 5mV of noise you mentioned at the input of the inamp, you should do the filtering between the op amp buffer and the input of the inamp (as a described in my last post) instead of the output of the inamp, and/or before the input to the op amp buffer, and forgo the .01uF at the output of the inamp. Then, it's not clear if the note in the datasheet means Rs/Cs as a division operation, or the "time constant" which is Rs*Cs.
Something curious is that the datasheet for the micro gives an input resistance of 2Kohm typical, but in figure 10 that resistance is shown in series with the input of an "ADC SAR Engiine", the input current of which is not specified.
I'm interested in how your experiments work out, in any case.
Hi ccurtis,
I've spent most of the night experimenting with the circuit. I think some of the problems might be from my prototyping set up (lots of pretty long wires on a breadboard). I added an RC low-pass filter on the input of the inamp with a 10K resistor and .1uF capacitor. My input signal is mainly DC with at most 20Hz oscillations. That cleaned up a lot of the noise at the input. I also added a 1K resistor in series with the output of the inamp . Both of those things seemed to stop the two different high frequency oscillations that were happening under different conditions, and it all seems to play nice with the .01uF capacitor at the microcontroller input to keep it happy.
I'm concerned that the 1K resistor before the microcontroller input would throw off the measurements though if the input impedance was 2K as you mentioned, but it seems like the microcontroller's input impedance goes quite high when the microcontroller is powered up. My meter measures it as totally open (greater than 10M?) but only about 200K when not powered up. Maybe because the microcontroller is on it's own power source with it's own ground, and the inamp and everything else (reference voltage, etc) is only connected through the voltage reference low/ground input? no clue.. but everything still scales fine!
Fine business. It seems the input resistance into the ADC pin is much higher than the datasheet seems to imply, and that the internal 2K ohm resistor is only important in conjunction with the internal capacitance if higher frequency AC is being measured by the ADC. It still seems odd to me why you need/want the .01uF cap at the input of the microcontroller, unless you are looking for rock stable digital conversion to the lowest significant bit. It causes instability in the inamp without compensation/isolation (resistor). Yep, one can't be too careful with layout/bypass considerations. Thanks for the feedback.