6
\$\begingroup\$

I've had a number of issues getting good stable analog readings from an RTD temperature sensor. The temperature readings have a tendency to bounce as much as +/- 5 Deg C. The circuit is very basic, a voltage divider is formed between a fixed resistor and an RTD connected to ground. The voltage at the RTD is then fed into a programmable gain amplifier set at 16 V/V. The analog signal output from the programmable gain amplifier is then fed into a 10-bit ADC on a PIC microprocessor. I've implemented a low pass filter in software to attempt to fix the problem, but the temperature readings are still very unstable. Does anyone have any suggestions about where I could look to find the source of the problem and correct it?

\$\endgroup\$
  • \$\begingroup\$ Just to give everyone an update. It looks like the problem was with the voltage regulator. The filter capacitors at the outputs were not large enough. We used 1uF datasheet recommended 10uF. Looking at the voltage rail with the oscilloscope showed ~200 mV of ripple going into the voltage divider. I though I had checked that before, but apparently not. Checking a power supply with just a multi-meter is really not enough I guess. \$\endgroup\$ – mjh2007 Mar 10 '10 at 14:08
4
\$\begingroup\$

The first thing I'd look at is ripple in your voltage rail. Noisy voltages are killer with a voltage divider. A higher-quality measurement system might use a regulated constant current source to drive the RTD instead of a voltage divider. An LM317 can be used to do this - hook a resistor between the OUTPUT and ADJ terminal, and hook the RTD between ADJ and GND. The value of the resistor between output and adjust will set the current going through the RTD - use a precise resistor to be certain of the amount of current.

Otherwise, attempt to do the filtering in hardware if possible. You first have to figure out where the noise is coming from to make it effective. Determine what frequencies of noise you're seeing and then probe at the input to the gain stage, the output, and the input to the ADC. If there's noise everywhere, then it's in the source, otherwise it's being injected somewhere else. Make sure all of your IC's have bypass capacitors to start with. Then make sure that you don't have any long ground loops - make everything as direct (high current) of a connection to ground as possible. Don't daisy chain grounds - everything should get its own connection to ground that doesn't run through other chips.

If you're seeing noise at the source, chances are it's your voltage source for the divider. To combat this, you could put a capacitor in parallel with the RTD to make a simple filtering circuit. Just figure out what frequencies of noise you're seeing and match the capacitor to the resistance of the RTD and figure it out.

\$\endgroup\$
  • \$\begingroup\$ It's a little late to make another hardware change to the board so we can't switch to a better current source, however you were right to point me in the direction of the power supply. I had checked it with a multi-meter and it looked ok, but when I looked at it with the oscilloscope the problem became clear. Thanks! \$\endgroup\$ – mjh2007 Mar 10 '10 at 14:10
4
\$\begingroup\$

There are a few places to look.

First of all you should have some analogue filtering before you sample. Temperature measurements are usually slow changing so it should be possible to filter fairly aggressively. Even a simple RC can be very effective.

Consider how much cable you have between the circuit and the RTD. Where is that cable running in relation to other (potentially noisy) cables? Separation between wiring looms and reducing the length of the cable can both help in this case. As can better quality shielded and/or twisted pair wiring.

If you have access to an oscilloscope you should try and measure the voltage signal that you see going into the adc. Assuming that there is noise present, the nature of the noise will give some hint as to where it's coming from.

Consider how the sensor and you uC circuit are grounded with regard to what ever it is you're measuring. If the RTD is connected to an earthed object it is possible that the noise is being coupled as a result of an earth loop.

If you can post more details of the circuit you have, how you're filtering the samples and the application, it should be possible to provide some more specific feedback.

\$\endgroup\$
  • \$\begingroup\$ Good suggestions Clint. Sending small analogue signals over any sort of distance is never easy. Could you provide amplification or conversion to a balanced or even current loop interface at the sensor end to reduce the sensitivity of the interface to noise pickup. \$\endgroup\$ – uɐɪ Mar 9 '10 at 11:18
  • \$\begingroup\$ You're right about amplifying near the sensor before transmission, but I'd guess that would be over kill in this situation. We're only trying to measure 10's of mV, not uV. Without more info on the circuit mjh2007 is using, all of this is becoming wild speculation. \$\endgroup\$ – Clint Lawrence Mar 9 '10 at 20:46
4
\$\begingroup\$

One common culprit is charge coupling between channels of the ADC (disregard if you are only using 1 channel).

Most microcontrollers with multichannel ADCs have a multiplexer and a sampling capacitor. The sampling capacitor might be in the 1-10pf range. When you switch from one channel to the next, that sampling capacitor initially retains charge from the previous channel's voltage. The sampling capacitor then has to charge up/down to the voltage on the next channel, and has a time constant that depends on the external impedance on the ADC channel input.

It is good practice to use an RC circuit right on the ADC channel inputs. (edit: if you have a voltage divider, you don't need the R; the Thevenin equivalent resistance acts as a resistor, so a 10K and a 1K divider will yield an equivalent resistance of 909 ohms.) I tend to use something in the neighborhood of 499 ohms, 100-300pf. What happens is the external capacitor in the RC network acts as a storage reservoir, so when the ADC multiplexer switches, the external capacitor very quickly charges the sampling capacitor. There's a tradeoff between using a small capacitance (fast time constant, but initial transient when ADC mux switches is very large) vs. a large capacitance (very little initial transient on external capacitor when ADC mux switches, but a long time constant) and you can solve this yourself to optimize.

You generally need to do this even if you are using an op-amp to buffer the voltage leading into the ADC. This is because op-amps aren't great at dealing with high-frequency nonlinear loads like a multiplexer + sampling capacitor.

If you are not buffering the voltage leading into the ADC with an op-amp, note that high source resistance can be a problem. This charge coupling causes a current that flows between one channel and the next, with current equal to f * C * deltaV, where f = sampling frequency, C = internal sampling capacitance, and deltaV = voltage between successive channels sampled by the ADC. Example: deltaV <= +/-3V, C = 5pf, f = 1000Hz yields a charge-coupling current of up to +/- 15nA. If your source impedance is 10K, you'll get an offset voltage of up to +/-150uV depending on the voltage difference between channels. (This really only becomes a problem with high sampling rates or high source impedances)

\$\endgroup\$
  • \$\begingroup\$ While everything you write is correct, I can't see how it addresses the question. The circuit works fine in one environment, but not another. If your suggestion was the culprit I would expect to see the problem on the bench as well. \$\endgroup\$ – Clint Lawrence Mar 9 '10 at 20:40
  • \$\begingroup\$ ah, I missed that detail from the original post. \$\endgroup\$ – Jason S Mar 11 '10 at 21:18
  • \$\begingroup\$ Good suggestion. The PGA that I’m using has a built in analog multiplexer so the 8 analog channels are fed to a multiplexer then the PGA then to a single microprocessor analog port. I though it could be one channel interfering with the other channels, but the frequency I'm switching channels and sampling at is very low (20Hz). \$\endgroup\$ – mjh2007 Mar 11 '10 at 22:24
0
\$\begingroup\$

You might also be running into EMI susceptibility. Active components (such as your PGA) are prone to a phenomenon called RF rectification where an AC disturbance at high frequencies at the input amplifier causes a DC disturbance at the output of an amplifier. This is very common in high-gain circuits (you'll see it a lot in thermocouple amplifiers) in an electrically noisy environment.

If this is the problem, shunt out high-frequency noise by putting one or more good high-frequency bypass capacitors (1000pf-10000pf ceramic probably best) across the closest points that are inputs of your circuit. (for instance, if you have a 4-resistor one-op-amp differential amplifier:

alt text

then put 2 capacitors at the input of the resistors -- from V1 to GND and V2 to GND, you may need a 3rd one from V1 to V2 if there is a lot of differential noise -- and NOT across the op-amp inputs)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.