I’m currently working on a project using an ESP32 microcontroller, a PT100 temperature sensor, and a MAX31865 temperature-to-digital converter. However, I'm experiencing an issue where the temperature readings remain consistently at 0°C.
Hardware Setup:
Microcontroller: ESP32 (WROOM32-D)
Temperature Sensor: PT100
ADC: MAX31865
Wiring:
The wiring appears to be correct, and I have checked the connections multiple times. The PT100 sensor is connected to the MAX31865 as per the standard 3-wire configuration. The wiring is connected to the corresponding pins on the MAX31865 and the ESP32, which I have verified are correct.
Software:
I am using the Adafruit MAX31865 library to interface with the sensor. Here is a brief overview of what I've done so far:
Initial Code: I started with a basic example from the Adafruit library, which initializes the MAX31865 in 3-wire mode.
Testing Outputs: When running the code, I consistently receive a reading of 0Ω for the RTD value and no change in temperature readings, even when I physically heat the PT100 sensor.
Troubleshooting Steps Taken:
Check the Multimeter: I measured the resistance of the PT100 sensor using a multimeter and found a reading of 109.2Ω, which is consistent with the expected value at approximately 31°C. This suggests that the PT100 sensor itself is functioning correctly.
MAX31865 Connection Verification: I double-checked the connections on the MAX31865 board and ensured that the wiring was secure and correct.
Referencing Resistor: I verified that the reference resistor (Rref) on the MAX31865 is the correct value (430Ω).
Library Initialization: I attempted to initialize the MAX31865 in both 2-wire and 3-wire modes within the code, but the readings remained at 0.
Request for Assistance
Despite all the above steps, I am still unable to get a valid reading from the MAX31865. Has anyone experienced similar issues or have any suggestions for further troubleshooting? Any help would be greatly appreciated!
Thank you!
#include <Adafruit_MAX31865.h>
// Pin configuration
#define MAX31865_CS 5 // Chip select pin for MAX31865
#define MAX31865_MISO 23 // Master In Slave Out pin
#define MAX31865_MOSI 19 // Master Out Slave In pin
#define MAX31865_CLK 18 // Clock pin
// Create the MAX31865 object
Adafruit_MAX31865 thermo = Adafruit_MAX31865(MAX31865_CS, MAX31865_CLK, MAX31865_MOSI, MAX31865_MISO);
void setup() {
Serial.begin(115200);
thermo.begin(MAX31865_3WIRE); // Initialize MAX31865 in 3-wire mode
}
void loop() {
uint16_t rtd = thermo.readRTD(); // Read the RTD value
Serial.print("RTD Value: ");
Serial.println(rtd);
float temperature = thermo.temperature(100.0, 430.0); // Calculate temperature (PT100, Rref = 430Ω)
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
delay(1000); // Wait for a second before the next reading
}
Why don't you use the Adafruit example code. It checks for faults and will tell you what is wrong.
In the IDE click on Files->Examples->Adafruit MAX31865 library
Your schematic does not show a connection to SDO (pin 5) on the MAX31865 module. Looks like it should go to IO19 of the ESP according to your setup code. If that is true, you are not getting any data back from the MAX31865.
It sounds like you've already done a thorough job troubleshooting so far! Here are a few additional steps that might help you resolve the issue.
Verify SPI Communication:
Ensure that the SPI communication between the ESP32 and MAX31865 is functioning correctly. Double-check the SPI pin connections and ensure they match the pin definitions in your code.
Check Power Supply:
Verify that the MAX31865 is receiving a stable power supply. Fluctuations in power can cause erratic readings.
Use Hardware SPI:
If you are using software SPI, try switching to hardware SPI for more reliable communication. Update your code to use the hardware SPI pins on the ESP32.
Test with a Known Resistor:
Replace the PT100 sensor with a known resistor (e.g., 100Ω) to see if the MAX31865 can read the resistance correctly. This can help determine if the issue is with the sensor or the MAX31865.
Example Code with Fault Detection:
#include <Adafruit_MAX31865.h>
// Pin configuration
#define MAX31865_CS 5 // Chip select pin for MAX31865
#define MAX31865_MISO 23 // Master In Slave Out pin
#define MAX31865_MOSI 19 // Master Out Slave In pin
#define MAX31865_CLK 18 // Clock pin
// Create the MAX31865 object
Adafruit_MAX31865 thermo = Adafruit_MAX31865(MAX31865_CS, MAX31865_CLK, MAX31865_MOSI, MAX31865_MISO);
void setup() {
Serial.begin(115200);
thermo.begin(MAX31865_3WIRE); // Initialize MAX31865 in 3-wire mode
}
void loop() {
uint16_t rtd = thermo.readRTD(); // Read the RTD value
Serial.print("RTD Value: ");
Serial.println(rtd);
float temperature = thermo.temperature(100.0, 430.0); // Calculate temperature (PT100, Rref = 430Ω)
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
// Check for faults
uint8_t fault = thermo.readFault();
if (fault) {
Serial.print("Fault 0x"); Serial.println(fault, HEX);
if (fault & MAX31865_FAULT_HIGHTHRESH) {
Serial.println("RTD High Threshold");
}
if (fault & MAX31865_FAULT_LOWTHRESH) {
Serial.println("RTD Low Threshold");
}
if (fault & MAX31865_FAULT_REFINLOW) {
Serial.println("REFIN- > 0.85 x Bias");
}
if (fault & MAX31865_FAULT_REFINHIGH) {
Serial.println("REFIN- < 0.85 x Bias - FORCE- open");
}
if (fault & MAX31865_FAULT_RTDINLOW) {
Serial.println("RTDIN- < 0.85 x Bias - FORCE- open");
}
if (fault & MAX31865_FAULT_OVUV) {
Serial.println("Under/Over voltage");
}
thermo.clearFault();
}
delay(1000); // Wait for a second before the next reading
}
but its more like i also want to know and understand why the "clone" aint working"
I have another max31865 board here, but with an 431 href. so i would have solder the two resistors out and switch them. maybe u are right and the second board is just shit