0

Max31865 for Pt100 Temp Sensor
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Max31865 for Pt100 Temp Sensor

by Feynman137 on Sat Sep 14, 2019 8:48 pm

Hello
I recently bought and set-up a Max31865 board for my Pt100 and raspberry pi 3b+. The wiring and code is pretty much copy paste from the Adafruit set-up guide but I have noticed some strange behavior from the digital values I am reading from the Max31865 when I execute my code.

I have a variable resistor heater inside a 2 gal tank and a pt100 sensor is screwed into the side of the tank and the probe extends to the middle of the tank. I have noticed that when decrease the amps flowing through the resistor to slow the heating in the tank the temperature readings from the while true loop stop changing at all.

I have an IR temperature reading of the tanks surface and from its readings I can tell the tank is in fact continuing to heat up. So the pt100 sensors are no longer valid until I increase the amps to the variable resistor, and almost instantly the temperature reading spikes up! I have seen it be inaccurate by 15+ degrees C.

My question does the max31865 have some sort of deadband that is making it unable to detect small temperature changes?

Feynman137
 
Posts: 6
Joined: Sat Sep 14, 2019 8:31 pm

Re: Max31865 for Pt100 Temp Sensor

by adafruit_support_bill on Sun Sep 15, 2019 8:35 am

What are you using to control the current to the resistive heater? If you are using PWM, it is possible that the switching noise is interfering with communication to the sensor.

adafruit_support_bill
 
Posts: 74659
Joined: Sat Feb 07, 2009 10:11 am

Re: Max31865 for Pt100 Temp Sensor

by Feynman137 on Sun Sep 15, 2019 10:06 am

I am using a PMW but it seems unlikely to me because:

1. PMW is controlled locally by a knob and not by RPi.
2. The only connection the heater’s circuit has to the Pi is through a relay. Which has octocoupler isolation and an external 5V power supply. But is controlled by the PIs GPIO.

Feynman137
 
Posts: 6
Joined: Sat Sep 14, 2019 8:31 pm

Re: Max31865 for Pt100 Temp Sensor

by adafruit_support_bill on Sun Sep 15, 2019 11:08 am

Rule number 1 of EMI: Everything is an antenna. Noise can couple inductively too.

PWM - particularly at high current levels - creates a changing magnetic field around the conductors supplying power to your heater - thus effectively turning them into a broadcast antenna. And even though the Pi and associated circuitry may be conductively isolated, there may be wires or other components all too happy to act as a receiving antenna for that noise.

We see this often in temperature control applications using electrical heating elements. Twisted-pair and/or shielded wiring can help.

adafruit_support_bill
 
Posts: 74659
Joined: Sat Feb 07, 2009 10:11 am

Re: Max31865 for Pt100 Temp Sensor

by Feynman137 on Sun Sep 15, 2019 5:36 pm

I did some wire twisting on the power cords into and out of the pmw but no effect.

I have a pressure transmitter in the tank that’s wired to the rpi and it is not affected by this issue which is strange.

Do I need to shield the actual pmw unit or just the wiring?

Feynman137
 
Posts: 6
Joined: Sat Sep 14, 2019 8:31 pm

Re: Max31865 for Pt100 Temp Sensor

by adafruit_support_bill on Sun Sep 15, 2019 6:31 pm

Twisted pair wiring and/or shielding is useful on both the source of the interference and any circuitry that is affected by it. With resistive heating elements, you can twist and/or shield the feed wires, but the element itself can still be a potent source of EMI.

Most thermocouple and RTD type probes are constructed with twisted leads. Some are available with shielding as well. Wiring between the breakout board and the Pi is another area of possible EMI pickup.

How does your code handle read errors on the sensor? It would be helpful to know if and when communication errors are actually occuring between the Pi and the breakout.

adafruit_support_bill
 
Posts: 74659
Joined: Sat Feb 07, 2009 10:11 am

Re: Max31865 for Pt100 Temp Sensor

by Feynman137 on Sun Sep 15, 2019 9:29 pm

There is no real handling of the errors. They just manifest by continuing to print the same float value every while true cycle. The code is copy paste from the Adafruit doc on Max31865.

I am printing a new temp reading every 10s and as soon as I reduce the voltage to the heating element using the PMW the sensor flatlines. You mentioned that the actual heating element is a major source of EMI. The probe tip and the element are close.

Are you thinking that the element’s EMI is too strong to make this possible even with good shielding? The voltage source ranges from 120-0V and the element is 1500W at full voltage. So it is pretty high amps. Also is the high or low voltage side of the PMW the source of most of the EMI?

Feynman137
 
Posts: 6
Joined: Sat Sep 14, 2019 8:31 pm

Re: Max31865 for Pt100 Temp Sensor

by Feynman137 on Sun Sep 15, 2019 10:01 pm

PWM*

Feynman137
 
Posts: 6
Joined: Sat Sep 14, 2019 8:31 pm

Re: Max31865 for Pt100 Temp Sensor

by adafruit_support_mike on Mon Sep 16, 2019 11:38 pm

Feynman137 wrote:The voltage source ranges from 120-0V and the element is 1500W at full voltage.

If you have a 120V 1500W signal, it's definitely strong enough to cause interference with sensors and nearby wiring.

Try shutting off the heater just before you take a reading, and turning it on again after you take a reading. The effect on the heating inside the tank will be negligible.

Feynman137 wrote:Also is the high or low voltage side of the PMW the source of most of the EMI?

It's the transition from one to the other. DC voltages don't generate EMF because the current stays constant. Suddenly increasing or decreasing the current makes the magnetic field expand or contract, and that's what generates noise.


As a side note, all heating and cooling systems have thermal time constants that have to be considered. It takes time for heat to propagate through any material, so there will always be a lag between the heater turning on or off and a corresponding change in the thermometer's reading. Any container of liquid or gas will also have convection that can make readings unpredictable. If you want to break those up, you need fairly aggressive mixing.

A system with laggy measurements is hard to control, so it's usually best to put at least one thermal sensor in direct contact with the heating or cooling element. Any others will measure the flow of heat through the system.

adafruit_support_mike
 
Posts: 59184
Joined: Thu Feb 11, 2010 2:51 pm

Re: Max31865 for Pt100 Temp Sensor

by Feynman137 on Wed Sep 18, 2019 12:33 am

Readings in the 3 following distinct scenarios were all good quality:

1. The heat element switched off.
2. Element on but pwm inactive.
3. Sensor slightly removed from tank but pwm and element active.

This seems to indicate the source of the interference is the element itself and not the wiring to and from. But I think logic to switch the element off before taking a reading, as suggested by Mike, will solve my problems! So long as the interference, which is causing the sensor readings to flatline, received by the Adafruit max31865 doesn’t damage the circuitry in any way.
I do not think lag was the issue as the sensor is about 3 inches away from the element (small tank) and I could wait 5 minutes with the heater on and still not register a new reading but was registering large temp increases in the tank via IR gun.
As a side note, I found that the PWM interference caused sensor errors between 40-95V. But good quality readings were possible from 0-40V and 95-120V!

Feynman137
 
Posts: 6
Joined: Sat Sep 14, 2019 8:31 pm

Re: Max31865 for Pt100 Temp Sensor

by adafruit_support_mike on Thu Sep 19, 2019 2:35 am

Feynman137 wrote:As a side note, I found that the PWM interference caused sensor errors between 40-95V. But good quality readings were possible from 0-40V and 95-120V!

Hmm.. that would be something to hook up to an oscilloscope so you could see the exact problems.

If shutting off the heater before taking a reading solves the problem, and doesn't cause any other problems for your system, it sounds like a problem that's easier to sidestep than to debug though.

adafruit_support_mike
 
Posts: 59184
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.