Quantcast
Channel: Sensors - Arduino Forum
Viewing all articles
Browse latest Browse all 1071

Esp32 + max31865

$
0
0

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:

11 posts - 6 participants

Read full topic


Viewing all articles
Browse latest Browse all 1071

Trending Articles