MAX31855 problems, unstable readings [SOLVED]

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
xonxoff99
 
Posts: 3
Joined: Fri Sep 04, 2020 3:56 am

MAX31855 problems, unstable readings [SOLVED]

Post by xonxoff99 »

I wanted to post this solution under the original thread (see viewtopic.php?f=31&t=51584 ), but that thread has since been locked. Hence making it a new post.

Problem: when using MAX31855 for temperature measurement in furnaces or kilns with a heating coil exposed to air, once the temperature reaches around 900-1000C, MAX31855 starts reporting fault codes 2, 4 , 6 (thermocouple shorted to ground, VCC or both), while the actual temperature readings continue to be accurate. Some Arduino libraries for MAX31855 do not report the temperature value when one or more fault conditions are present, and the temperature is then reported as NaN.

Why this is happening: As the air heats up to about 1000C and above, it becomes slightly electrically conductive. A leakage path is then introduced from the exposed heating coil through the thermocouple to the common ground. MAX31855 detects this leakage current as a fault. MAX31855 needs just 50 microamps of leakage current to report a fault. To test this condition, connect a 9V battery via a 150k resistor between the thermocouple and the ground plug on the power cord of your kiln. MAX31855 will immediately report a fault. A similar leakage current develops from the exposed heating coil to the thermocouple when the air heats up to around a 1000C.

What to do about it: There is no easy solution for getting rid of the underlying problem of having this leakage current. The following options can all be considered:
  • 1. Do nothing. Just ignore the fault codes 2, 4 and 6 (but not 1, which is open circuit) when the temperature is above, say, 700C. MAX31855 will still be reporting the accurate temperature readings alongside the fault bits. Some trivial code modifications in the MAX31855 library may be required. Since the leakage current here is on the order of 50 microamps, this is like 100 times less than the 5 mA tripping threshold of a typical GFCI breaker, and so the operation presumably remains safe. I went with this solution for my muffle furnace.
  • 2. Command the heating coil off for approx.. 150-200 ms before taking the temperature reading from MAX31855. Assuming your heating coil is at neutral / ground potential when turned off (as it should be), there will be no leakage current while MAX31855 is performing the measurement (and most importantly, while it is performing fault detection, which is a separate step), and hence there will be no faults reported. I have tested this approach and it did work as described. However, the leakage current will still be there when the heating coil is energized, it will just not be reported to you. Also, if the heating coil is powered from 2 hot wires (like for example, the 220V setup in the US), it should then be disconnected from both sides. Otherwise, it will remain at a high potential from the ground, and the leakage will still be there. Also, with this approach one is losing like 20% of power, assuming a 1 second PID controller cycle, where there is now a 200ms forced power-off step.
  • 3. Power your furnace from the isolation transformer. Given the typical power levels involved (>1kW) the transformer will certainly not be cheap.
  • 4. Galvanically isolate your MAX31855 sub-system from the mains ground. This will require an isolated power supply for your Arduino, combined with an isolated solution for the serial communication transport to your PC. You can quickly test this approach by powering your Arduino from a battery, and also disconnecting it from the PC. The fault codes should disappear. They will reappear the moment you connect your battery-powered sketch to the PC (unless the PC is a battery-powered laptop) with a serial/USB cable. This is because the PC ground is the same as mains ground, hence you’ve just lost your galvanic isolation.
Hope this helps. It took me a while (and a few MAX31855 from different vendors) to figure it out. The “A-ha!” moment was when I attempted to heat the thermocouple in my furnace with a MAPP torch, and then right around 900C that tripped the GFCI breaker! While the heating coil in the furnace was not energized, it was connected to the hot wire! (I have since re-wired that). This is when I realized that the flame (and the very hot air in general) must be electrically conductive! Well, it sure is - they figured it out 100+ years ago.

User avatar
adafruit_support_bill
 
Posts: 86984
Joined: Sat Feb 07, 2009 10:11 am

Re: MAX31855 problems, unstable readings [SOLVED]

Post by adafruit_support_bill »

Nice diagnostic work! Thanks for posting your findings. I unlocked the previous thread and added a link to this one.

User avatar
jimaek22
 
Posts: 9
Joined: Tue Sep 22, 2020 7:25 pm

Re: MAX31855 problems, unstable readings [SOLVED]

Post by jimaek22 »

Greetings to everybody. I have built a car Exhaust Gas Temp gauge by using an arduino nano, an ssd1306 oled screen a, piezzo buzzer, a Max31855 amplifier and an braid insulated K-Type thermocouple screwed on cars exhaust manifold. The gauge measures temp correctly up to 930-940 Celsius temp but when I am accelerating with wide open throttle the moment the temp reaches 930-940 degrees Celsius then I get 0s or -1 on the OLED screen. Those numbers remain up until I leave my foot from the gas pedal and temp drops below 900 degrees and then the gauge starts working perfectly again. As a remark the gauge has no weird measurement if it operates from room temperature up until 930-940 degrees. My Arduino sketch is being powered by the its usb port which is powered by a step down dc-dc converter that takes the 13.5-14 volts from the car’s source and converts them to 5VDC. Please note down that if I power the Arduino either with a powerbank with the powerbank not being charged ar the same time it powers my sketch (working in battery power mode) then my sketch works perfectly fine, I get accurate readings in the whole temp scale. The same happens if I power the Arduino from a laptop. The moment I get power from the car the problem starts again above 930 degrees Celsius.
Things I tried.

1) Powered the Arduino from 12V lighter power source.
2) Powered the Arduino directly from the car battery.
3) Powered the Arduino from another 13-14V line in the car.
4) Used different step down DC converters.
5) Routed Arduino power cables to different places in car.
6) Used a 30cm shielded wire to wire the Max31855 to the Arduino.
7) Powered the Arduino either from its own voltage regulated input or from its usb port.
8) Checked Arduino voltage levels when stopped and in motion and were perfectly fine.

All the above tries failed. In simple words when the Arduino is powered from a car’s power source then above 930 degrees celsius max31855 produces error temp readings (0 or -1 on the oled screen). EMI seems not to be the issue here as when I power the Arduino from the power bank or from a laptop it works perfectly fine.
My problem is exactly the same as described in this post. So as the OP discovered, it should be some electrical leakage coming from the high gas temps to the common ground that get detected as error by the max31855. As far as I read from the OP workaround and other threads with max31855 temp reading errors in high temps I am planning to built an DC-DC step down galvanic isolated power supply that will get the 13-14V from the car and will convert it to 5V isolated. Then I will connect the converter’s output directly to the Arduino usb port and will bridge the arduino’s ground to the car’s chassis ground.
Please advice if the above solution will help me to mitigate the problem or propose me with you solution. Thank you very much in advance.

User avatar
adafruit_support_bill
 
Posts: 86984
Joined: Sat Feb 07, 2009 10:11 am

Re: MAX31855 problems, unstable readings [SOLVED]

Post by adafruit_support_bill »

It does sound like a very similar problem to the OP. The temperature threshold is similar (>900C) and the problem goes away when you use a power source isolated from the vehicle ground. Your plan for a galvanically isolated power supply sounds like an appropriate solution. Let us know how it goes.

User avatar
jimaek22
 
Posts: 9
Joined: Tue Sep 22, 2020 7:25 pm

Re: MAX31855 problems, unstable readings [SOLVED]

Post by jimaek22 »

adafruit_support_bill wrote:It does sound like a very similar problem to the OP. The temperature threshold is similar (>900C) and the problem goes away when you use a power source isolated from the vehicle ground. Your plan for a galvanically isolated power supply sounds like an appropriate solution. Let us know how it goes.
Thank you Βill for the quick response. Prior using the galvanically isolated power supply i was thinking to connect a wire from the arduino ground to the car's chassis ground as i read somewhere that other posters solved the problem of high temp bad readings. Should i try this approach ?

User avatar
adafruit_support_bill
 
Posts: 86984
Joined: Sat Feb 07, 2009 10:11 am

Re: MAX31855 problems, unstable readings [SOLVED]

Post by adafruit_support_bill »

Not sure that it would help in this case since there is already a connection from the Arduino to vehicle ground via the power supply. According to the OP, the leakage is through the thermocouple to the common ground which is detected as a fault. However, it is a relatively simple test to do and probably worth a shot.

User avatar
jimaek22
 
Posts: 9
Joined: Tue Sep 22, 2020 7:25 pm

Re: MAX31855 problems, unstable readings [SOLVED]

Post by jimaek22 »

adafruit_support_bill wrote:Not sure that it would help in this case since there is already a connection from the Arduino to vehicle ground via the power supply. According to the OP, the leakage is through the thermocouple to the common ground which is detected as a fault. However, it is a relatively simple test to do and probably worth a shot.
Will it help to attach a mica washer between the thermocouple probe and 1/4" NPT Weld Bung that is welded to the car's exhaust manifold and the thermocouple probe is screwed to it?
Also if i use the galvanic isolated switching step down dc-dc power supply will this have any impact to the Max31855 response ? Is there any case to cause any conversion lag to the amplifier?

User avatar
adafruit_support_bill
 
Posts: 86984
Joined: Sat Feb 07, 2009 10:11 am

Re: MAX31855 problems, unstable readings [SOLVED]

Post by adafruit_support_bill »

I don't think a Mica washer would make any difference. If there was conductivity through the mounting stud I'd expect a fault to be reported immediately. From what the OP describes, the problem occurs at >900C when the air itself starts to become conductive.

And galvanic isolation from the vehicle should not adversely affect response or conversion time.

User avatar
jimaek22
 
Posts: 9
Joined: Tue Sep 22, 2020 7:25 pm

Re: MAX31855 problems, unstable readings [SOLVED]

Post by jimaek22 »

Thank you so much Bill for all this useful info. I am struggling with this issue for days and believe me its a big headache and i really need to sort this out as i am in the process to tune my car and the EGT sensor is a must for a turbo engine ECU calibration. Just a small out of topic question, in my arduino code if i dont add a delay at all will this have any negative effect to the temp readings or by default the max31855 will continue to convert temp based on the 70 - 100ms Temperature Conversion Time? If i must add a delay to my code what is the minimum ms should i add in order to have the fastest accurate readings? I want to have the fastest accurate readings possible because the temp in the exhaust manifold rapidly increases in WOT acceleration.

User avatar
adafruit_support_bill
 
Posts: 86984
Joined: Sat Feb 07, 2009 10:11 am

Re: MAX31855 problems, unstable readings [SOLVED]

Post by adafruit_support_bill »

Delays in your code have no effect on the speed or accuracy of the measurements. The MAX31855 performs conversions continuously, independent of your processor. Each conversion cycle take 70-100ms. When you read the device, you get the result of the latest conversion.

User avatar
xonxoff99
 
Posts: 3
Joined: Fri Sep 04, 2020 3:56 am

Re: MAX31855 problems, unstable readings [SOLVED]

Post by xonxoff99 »

Will it help to attach a mica washer between the thermocouple probe and 1/4" NPT Weld Bung that is welded to the car's exhaust manifold and the thermocouple probe is screwed to it?
My understanding is that MAX31855 expects the TC to float. Otherwise it will report a fault immediately. Since you're having it working fine until the ~900C range, I'd assume your TC is already isolated from the vehicle ground. Hence a mica washer will presumably do nothing.

To solve the problem for good, you'd need an isolated DC-DC converter for your Arduino, a floating TC and no connection from the Arduino ground to the car ground. Both your TC and your Arduino would then be floating w.r.t. the car ground. It maybe helpful to connect the Arduino ground to the car ground via a ~10 nF capacitor, to prevent picking up high-frequency noise, though that same capacitor may already be part of your isolated DC-DC converter anyway.

User avatar
jimaek22
 
Posts: 9
Joined: Tue Sep 22, 2020 7:25 pm

Re: MAX31855 problems, unstable readings [SOLVED]

Post by jimaek22 »

xonxoff99 wrote:
Will it help to attach a mica washer between the thermocouple probe and 1/4" NPT Weld Bung that is welded to the car's exhaust manifold and the thermocouple probe is screwed to it?
My understanding is that MAX31855 expects the TC to float. Otherwise it will report a fault immediately. Since you're having it working fine until the ~900C range, I'd assume your TC is already isolated from the vehicle ground. Hence a mica washer will presumably do nothing.

To solve the problem for good, you'd need an isolated DC-DC converter for your Arduino, a floating TC and no connection from the Arduino ground to the car ground. Both your TC and your Arduino would then be floating w.r.t. the car ground. It maybe helpful to connect the Arduino ground to the car ground via a ~10 nF capacitor, to prevent picking up high-frequency noise, though that same capacitor may already be part of your isolated DC-DC converter anyway.

Thank you for the input. I connected an extra cable from the arduino ground pin to the car's chassis ground that made no difference, still getting bad readings above 900C. By the term "floating TC" do you mean an ungrounded thermocouple? If that is the case i am already using an ungrounded K-Type thermocouple. Also, can you elaborate what do you mean by "Both your TC and your Arduino would then be floating w.r.t. the car ground." One friend of mine is building an isolated step down switching DC-DC power supply and will try to connect the whole arduino board with it. I wish this to be the last part of the puzzle that will finish my nightmare with max31855. Is it better the powersupply output to stepdown to 8-9v and get connected to the arduino's Vin (5V Voltage regulator) or to stepdown to 5V and get connected to the arduino's mini usb socket?

User avatar
adafruit_support_bill
 
Posts: 86984
Joined: Sat Feb 07, 2009 10:11 am

Re: MAX31855 problems, unstable readings [SOLVED]

Post by adafruit_support_bill »

By the term "floating TC" do you mean an ungrounded thermocouple? If that is the case i am already using an ungrounded K-Type thermocouple.
Yes. This is required with the MAX31855 and why the mica washer will make no difference.
can you elaborate what do you mean by "Both your TC and your Arduino would then be floating w.r.t. the car ground."
If your Arduino/thermocouple circuit is galvanically isolated from the vehicle, any current flow to the vehicle ground due to the conductivity of the superheated air will not have an adverse effect on the thermocouple readings.
Is it better the powersupply output to stepdown to 8-9v and get connected to the arduino's Vin (5V Voltage regulator) or to stepdown to 5V and get connected to the arduino's mini usb socket?
Either should work. If you want to feed 5v directly to the USB, make sure that the output of your step-down converter is clean and well regulated. If not, you are better off feeding it 7v via the VIN pin and letting the on-board regulator clean things up.

User avatar
xonxoff99
 
Posts: 3
Joined: Fri Sep 04, 2020 3:56 am

Re: MAX31855 problems, unstable readings [SOLVED]

Post by xonxoff99 »

I connected an extra cable from the arduino ground pin to the car's chassis ground that made no difference
Don't do that. Your Arduino should be powered from an isolated DC-DC converter. There should be no DC connectivity between the Arduino ground to the car chassis. There should also be no connectivity between the TC and the Arduino ground (and no connectivity between the TC and the car chassis).

Alternatively, or as a temporary solution, you can modify the MAX31855 Arduino library code to ignore the fault bits. The reported temperature will still be accurate.

User avatar
jimaek22
 
Posts: 9
Joined: Tue Sep 22, 2020 7:25 pm

Re: MAX31855 problems, unstable readings [SOLVED]

Post by jimaek22 »

xonxoff99 wrote: There should also be no connectivity between the TC and the Arduino ground (and no connectivity between the TC and the car chassis).
So if i connect my step down dc-dc isolated power supply input to a car's power source 12~13V and its output to arduino's Vin and GND will i ensure no connectivity between the TC and arduino/car chassis common ground? Is there anything else should i do in max31855 wiring with the K-Type thermocouple and the arduino? In order to reduce noise, will it help to connect the max31855 pins with shielded cable to the arduino?
xonxoff99 wrote: Alternatively, or as a temporary solution, you can modify the MAX31855 Arduino library code to ignore the fault bits. The reported temperature will still be accurate.
As i am a newbie with arduino coding, could you please modify the max31855 Arduino library to ignore the fault bits and provide me with a link to download and use it?
Thanks in advance.

Edit:
If i add a diode between the TC red wire and the max31855 (-) will it help to eliminate connectivity between the TC and car/arduino common ground?

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”