Changing PWM duty cycle causes MAX31855 malfunction

I hope this is the correct forum for this inquiry

I am currently working on an engineering senior design project to make a PID temperature controller for a Big Green Egg charcoal smoker. The whole system is an Arduino Uno R3, a 12V DC fan, a MAX31855 thermocouple amplifier, and an OMEGA type K thermocouple. We are using the Arduino library AutoPID for our PID calculations and the fan speed is controlled by varying the PWM duty cycle on an N-channel MOSFET gate. We made a prototype version with a solderless breadboard and it worked great. This week we transferred everything to a permanent breadboard with soldered connections and an issue arose.

When the PWM duty cycle changes, it causes our MAX31855 board to return the reference cold junction temperature (32 F) instead of the real measured temperature. We confirmed this by first setting the PWM duty cycle constant (the problem was resolved then) and then by disconnecting the Arduino pin used for the PWM (the problem was also resolved).

We have checked for continuity on all of our connections and tested all of the individual components (fan, MAX31855) to ensure they function correctly. The problem really seems to be isolated to when the PWM duty cycle changes.

I have attached our wiring diagram and code.

Does anyone have any ideas on what may be happening or how to resolve this?

BGE_Temperature_Controller_Master_Code.ino (17.2 KB)

You mention the temperature sensor works when you have constant pwm duty cycle. What happens if you manually set 50% in one test. And then set 55% in a different test? That is manually changing duty cycle. Then at least you can get closer to tracing the issue.

Did you measure the pwm output with a multimeter in dc voltage mode or oscilloscope to ensure your arduino is outputting the pwm correctly?

Southpark:
You mention the temperature sensor works when you have constant pwm duty cycle. What happens if you manually set 50% in one test. And then set 55% in a different test? That is manually changing duty cycle. Then at least you can get closer to tracing the issue.

Did you measure the pwm output with a multimeter in dc voltage mode or oscilloscope to ensure your arduino is outputting the pwm correctly?

Manually changing the PWM duty cycle does not cause the error. I have not checked the PWM output with an oscilloscope, but running code that only checks the function of the fan (basically modulation the fan speed from 0 to 100 back to 0) works fine.

I found the 31855 very sensitive to RF interference. I switched to the 31865 (platinum RTD sensor) and had no problems after that.

ltalexan:
Manually changing the PWM duty cycle does not cause the error. I have not checked the PWM output with an oscilloscope, but running code that only checks the function of the fan (basically modulation the fan speed from 0 to 100 back to 0) works fine.

Ok. Thanks.

Also, did you try this link here?

click here

Notice the capacitor. Could try that out. Eg. a CERAMIC 0.1 microfarad capacitor. Put it as close as you can get across the Vin and GND pins. Solder the capacitor legs to your module's Vin and GND pins if you want to...... up the top somewhere.

Southpark:
Ok. Thanks.

Also, did you try this link here?

click here

Notice the capacitor. Could try that out. Eg. a CERAMIC 0.1 microfarad capacitor. Put it as close as you can get across the Vin and GND pins. Solder the capacitor legs to your module's Vin and GND pins if you want to...... up the top somewhere.

We will explore this, but I just wanted to ask how a capacitor would help with rf interference? None of my team members or me are well versed in electronics or circuits.

We will explore this, but I just wanted to ask how a capacitor would help with rf interference?

Think of EMI (electromagnetic interference) as being like vibration in a some device. A capacitor to EMI is like a shock absorber to vibration. In both cases they resist fast changes.

Also note a type K thermocouple provides very low voltage, approximately 41µV / °C.

The above suggested capacitor is a good idea, in addition I would:

  • Move the ground on the Max31855 board to the unused ground pin on the Uno. This is to reduce the possibly of switching noise getting into the Max board.
  • Physically separate the board and thermocouple wire from the switching wires and power supply.
  • Add two capacitors across Vin (from the power supply, right after the diode). Should be ~ 100µF and 0.1µF.

The reason for two capacitors is: the 100µF is good for low frequency reduction when the 0.1µF is good for high frequency reduction.

You can think of capacitors as electronic duct tape. If it moves and it shouldn’t use a capacitor. Also in general more is better (or at least can’t hurt)

The MAX31855 datasheet also shows a capacitor across the thermocouple connection. It didn't work in my case but it may help yours.

JohnRob:
Think of EMI (electromagnetic interference) as being like vibration in a some device. A capacitor to EMI is like a shock absorber to vibration. In both cases they resist fast changes.

Also note a type K thermocouple provides very low voltage, approximately 41µV / °C.

The above suggested capacitor is a good idea, in addition I would:

  • Move the ground on the Max31855 board to the unused ground pin on the Uno. This is to reduce the possibly of switching noise getting into the Max board.
  • Physically separate the board and thermocouple wire from the switching wires and power supply.
  • Add two capacitors across Vin (from the power supply, right after the diode). Should be ~ 100µF and 0.1µF.

The reason for two capacitors is: the 100µF is good for low frequency reduction when the 0.1µF is good for high frequency reduction.

You can think of capacitors as electronic duct tape. If it moves and it shouldn't use a capacitor. Also in general more is better (or at least can't hurt)

We moved the MAX31855 ground from the breadboard to the Arduino and .... problem solved. Thank you so much!