Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAX31855 Linearization #13

Open
djObsidian opened this issue Jan 21, 2022 · 5 comments
Open

MAX31855 Linearization #13

djObsidian opened this issue Jan 21, 2022 · 5 comments

Comments

@djObsidian
Copy link

According to datasheet, page 8, max31855 assumes a linear relationship between temperature and voltage, which is not accurate. For accurate results linearisztion needs to be performed. Otherwise there will be temperature error >10 degrees at real TC temperatures greater than 200 degrees.
Here is an example of arduino code for linearising max31855 data
https://github.com/heypete/MAX31855-Linearization

@djObsidian
Copy link
Author

This is a serious issue. I, not being aware of the need for additional data correction, even contacted Maxim Integrated tech support. I measured the readings of max31855 and compared them with the expected ones. As you can see from the table below, the error is significant.

t ref mV theor. mV measured t max31855
26 0 0 27
100 2.09 2.0 84
200 5.23 5.5 177
300 8.66 8.6 261
350 10.45 10.4 326

The response from tech support was following:

While the MAX31855 does perform automatic cold-junction compensation, it does not perform any linearization calculations. Linearizing the thermocouple results needs to be performed externally using the NIST calculations and coefficients: http://srdata.nist.gov/its90/main/

As an alternative, the MAX31856 performs on board linearization for all supported thermocouple types.

@Saur0o0n
Copy link
Owner

Saur0o0n commented Jan 21, 2022

Well, to be honest I had no idea if this is significant. Previously I've used modified Adafruit MAX31856 library that had additional linearization (not by default - also mod)

double Adafruit_MAX31855::linearizeCelcius(double internalTemp, double rawTemp) {
  //////////////////////////////////////////////////////////////////////////
  // Function:       Takes the thermocouple temperature measurement and
  //                   corrects the linearity errors.
  // Input:
  //   double internalTemp  = value from readInternal()
  //   double rawTemp       = value from readCelsius()
  //
  // Returns:
  //   double               = Corrected Celsius thermocouple temperature
  //////////////////////////////////////////////////////////////////////////
  // Adapted from https://github.com/heypete/MAX31855-Linearization
  // Equations and coefficients from: https://srdata.nist.gov/its90/main/its90_main_page.html
  // Retrieved 2018-09-01

But this library was less reliable and trow different errors - also it introduced, at some point, some additional dependent libraries (Adafruit) that I thought are too much and complicated everything beyond usefulness.

@djObsidian
Copy link
Author

As far as I can see the library you are using now doesn't has any linearization. IMHO, that's significant, because you don't want your kiln to read 950 degrees when it's actually 1050. At temperatures below 300 degrees, that might be not a big deal

@Saur0o0n
Copy link
Owner

It should be relatively easy to add it to library - it's just math - but since author still haven't accept my last commit, I've asked if we can add it.

@ruffner
Copy link

ruffner commented Sep 17, 2024

Looks like it would be straight forward to add this snipped in, since enjoyneering hasn't addressed your PR yet. https://learn.adafruit.com/calibrating-sensors/maxim-31855-linearization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants