Esp32 + max31865

Hey Guys, I try to build an temperature controller with an esp32.

The parts I've used:

ESP32-WROOM-32D https://de.aliexpress.com/item/1005006336964908.html

MAX31865 https://de.aliexpress.com/item/1005006221400411.html

ETM-01-1 https://de.aliexpress.com/i/1005001793272558.html

The code i am using:

/*
  MAX31865 - ESP32
  VIN - 3V3
  GND - GND
  3V3 -
  CLK - VSPI_CLK (GPIO18)
  SDO - VSPI_MISO (GPIO19)
  SDI - VSPI_MOSI (GPIO23)
  CS  - VSPI_SS (GPIO5)
  RDY -
  PT100 3Wire - MAX31865
  WBlue - F+
  WBlue - RTD+
  WRed  - RTD-
      - F-
  Nota:
  WBlue <- ~102Ω -> WRed
  WBlue <- ~2Ω -> WBlue
  Cortar unión entre contacto 24-3 sobre Rref
*/

#include <Adafruit_MAX31865.h>

// Use software SPI: CS, DI, DO, CLK
Adafruit_MAX31865 thermo = Adafruit_MAX31865(5, 23, 19, 18);
// use hardware SPI, just pass in the CS pin
//Adafruit_MAX31865 max = Adafruit_MAX31865(10);

// The value of the Rref resistor. Use 430.0 for PT100 and 4300.0 for PT1000
#define RREF      4300.0
// The 'nominal' 0-degrees-C resistance of the sensor
// 100.0 for PT100, 1000.0 for PT1000
#define RNOMINAL  1000.0

#define WINDOW_SIZE 128
int16_t results[WINDOW_SIZE] = {0};
int current_result = 0;

volatile float Temperatura;

void setup() {
  Serial.begin(115200);
  Serial.println("Adafruit MAX31865 PT100 Sensor Test!");

  thermo.begin(MAX31865_2WIRE);  // set to 3WIRE or 4WIRE as necessary
}


void loop() {

  int time = millis();
  uint16_t rtd = thermo.readRTD();

  Temperatura = (thermo.temperature(RNOMINAL, RREF));
  Temperatura = (Temperatura - 1.52); //correccion de temperatura
  Serial.print("Temperatura: ");
  Serial.print(Temperatura);
  Serial.print(" °C");
  Serial.println("");


  int d = (1000 / 16) - (millis() - time);
  if (d > 0) {
    delay(d);
  }
}

Serial Monitor:
Adafruit MAX31865 PT1000 Sensor Test!
Temperatura: -223.68 °C

Temperatura: -223.68 °C

Temperatura: -223.68 °C

Temperatura: -223.68 °C

Temperatura: -223.71 °C

Temperatura: -223.68 °C

Temperatura: -223.68 °C

Temperatura: -223.65 °C

Wireing:
I soldiered the 2/3 Wire and the 2 Wire jumper together.

I don't know what i need to do.. i tried fixing it since yesterday :confused:

It seems that your setup is not designed for a 200 Ohm sensor, which is common for many exhaust gas sensors. Based on your description, you are using a PT1000, which is a 1K Ohm sensor. To test this, try running your setup with a PT1000 sensor—I believe it will work just fine.

Thank you for the reply!
Can I solder a 200Ohm Res. instead of the [431] part?


:rocket:

Are there some other ways to solve this issue guys?

See this tutorial:

Thank you for your reply!
I've read through the article. I've double chekt my soldering and electronic circut. Everything seems fine and matches. But on my MAX31865 I've got an [401] Rref (401 Ohm). Regarding to the article (and if my sensor is actual a PT1000) I would need a 4300 Ohm Resistor [4300] Rref. How can I find out how many Ohms my sensor would need? Icould not find an datasheet :frowning:
Thats the sensor: ETM-01-1 https://de.aliexpress.com/i/1005001793272558.html

Thanks you Guys for your help <3

Why do you think it is an RTD and not just a cheap thermistor?

I've contacted the supplier to get a datasheet. Unfortunatly he will send it tomorrow haha..
Thats where the temp probe normally get used. looks decent to me tho. What are you guys thinking about that probe?

Should I buy a diffrent one?

An amazing find, azon gives you a link to the Adafruit MAX31865 data which you will find the MAX part number which is readily available. Chasing the links I came up with this:
To calculate the reference resistor for a MAX31865 using a 200-ohm sensor, you need to understand the relationship between the sensor and the reference resistor. The MAX31865 is designed for use with RTD (Resistance Temperature Detectors) like PT100 (100 ohms at 0°C) or PT1000 (1000 ohms at 0°C), but the same principles apply when using a 200-ohm sensor.

Here’s how you can calculate the reference resistor:

1. Determine the sensor type:

  • You’re using a PT200 sensor (200 ohms at 0°C).

2. Choosing the reference resistor value:

  • The MAX31865 compares the resistance of the RTD sensor with the reference resistor to measure the temperature.
  • The reference resistor should closely match the nominal resistance of the RTD at 0°C. For a PT200 sensor, the reference resistor should ideally be a precision resistor with a value close to 200 ohms.
  • Using a 200-ohm precision resistor (with a tolerance of 0.1% or better) ensures accurate readings.

3. Why the reference resistor value matters:

  • The MAX31865 measures the ratio of the RTD resistance to the reference resistance. A reference resistor that closely matches the sensor’s nominal resistance helps maintain accuracy. Be sure to make good connections as this is a low resistance load.
  • For a PT200 sensor, using a 200-ohm reference resistor simplifies the calculations and improves the linearity of the measurements.

4. Calculation example:

  • If you have a 200-ohm RTD sensor, and you use a 200-ohm reference resistor, the MAX31865 will read the resistance ratio directly.
  • At 0°C, the RTD will have a resistance of 200 ohms, and the reference resistor will also be 200 ohms, resulting in a 1:1 ratio, which the MAX31865 can use to compute the temperature accurately.

What you need to do:

  1. Choose a reference resistor that is as close as possible to 200 ohms, with a tolerance of ±0.1% or better to ensure accuracy. This can be a measured value.
  2. Connect the RTD sensor and the reference resistor to the MAX31865 according to the datasheet, making sure that the reference resistor is in place where the chip expects it.
  3. The MAX31865 will now use this reference resistor to calculate the resistance of the RTD sensor and determine the temperature.

The rest would be in your software.

401 is 400ohm and 432 is 4300ohm...

The data sheet has this to say about the choice of reference resistor:

Application Circuits. The reference resistor current also
flows through the RTD. The voltage across the reference
resistor is the reference voltage for the ADC. The voltage
across the RTD is applied to the ADC’s differential inputs
(RTDIN+ and RTDIN-). The ADC therefore produces
a digital output that is equal to the ratio of the RTD
resistance to the reference resistance. A reference
resistor equal to four times the RTD’s 0ºC resistance is
optimum for a platinum RTD. Therefore, a PT100 uses
a 400Ω reference resistor, and a PT1000 uses a 4 kΩ
reference resistor.

A good place to go is Adafruit.
They use 430/4300 ohm for a PT100/PT1000.
See this page.
Leo..

See post #7

That's the first thing I would test. There are resistance tables on the net.
A PT100 is 100 ohm @ zero degrees C, and about 110 ohm @ 25C.
A thermistor could be 10k @ 25 C, with a much larger resistance deviation.
Leo..