MAX31865模块采样原理及操作指南

MAX31865模块

MAX31865是一款易于使用的电阻-数字转换器,针对铂电阻温度检测器(RTD)进行了优化。外部电阻器设置所用RTD的灵敏度,精密Δ-∑ADC将RTD电阻与参考电阻的比率转换为数字形式。MAX31865的输入受到保护,不会出现Q45V的过电压故障。包括RTD和电缆开路和短路条件的可编程检测。

应用场合

  • 工业设备
  • 医疗器械
  • 仪表
  • 特性

  • 1.支持100Ω至1kΩ (0°C时)铂电阻RTD (PT100至PT1000);
  • 2.兼容于2线、3线和4线传感器连接;
  • 3.SPI兼容接口;
  • 4.15位ADC分辨率,标称温度分辨率为0.03125°C (随RTD非线性变化);
  • 5.整个工作条件下,总精度保持在0.5°C (0.05%满量程);
  • 6全差分VREF输入;
  • 7.转换时间:21ms (最大值);
  • 8.集成故障检测,增加系统稳定性:(RTD开路、RTD短路到量程范围以外的电压或 RTD元件短路)。
  • MAX31865模块

    arduino采样程序

    使用Adafruit_MAX31865库

    /*************************************************** 
      This is a library for the Adafruit PT100/P1000 RTD Sensor w/MAX31865
    
      Designed specifically to work with the Adafruit RTD Sensor
      ----> https://www.adafruit.com/products/3328
    
      This sensor uses SPI to communicate, 4 pins are required to  
      interface
      Adafruit invests time and resources providing this open source code, 
      please support Adafruit and open-source hardware by purchasing 
      products from Adafruit!
    
      Written by Limor Fried/Ladyada for Adafruit Industries.  
      BSD license, all text above must be included in any redistribution
     ****************************************************/
    
    #include <Adafruit_MAX31865.h>
    
    // Use software SPI: CS, DI, DO, CLK
    Adafruit_MAX31865 max = Adafruit_MAX31865(10, 11, 12, 13);
    // use hardware SPI, just pass in the CS pin
    //Adafruit_MAX31865 max = Adafruit_MAX31865(10);
    
    // The value of the Rref resistor. Use 430.0!
    #define RREF 430.0
    
    
    void setup() {
      Serial.begin(115200);
      Serial.println("Adafruit MAX31865 PT100 Sensor Test!");
    
      max.begin(MAX31865_3WIRE);  // set to 2WIRE or 4WIRE as necessary
    }
    
    
    void loop() {
      uint16_t rtd = max.readRTD();
    
      Serial.print("RTD value: "); Serial.println(rtd);
      float ratio = rtd;
      ratio /= 32768;
      Serial.print("Ratio = "); Serial.println(ratio,8);
      Serial.print("Resistance = "); Serial.println(RREF*ratio,8);
      Serial.print("Temperature = "); Serial.println(max.temperature(100, RREF));
    
      // Check and print any faults
      uint8_t fault = max.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"); 
        }
        max.clearFault();
      }
      Serial.println();
      delay(1000);
    }
    
    

    三线制硬件配置

    MAX31865模块当使用三线制时,必须要进行一下硬件跳线的配置,否则会出现采样数据错误的问题。
    1、当仅仅焊接2/3 Wire线时,采样的数据会偏高,导线较长时,会出现温度较高的问题。
    2、当焊接2/3 Wire,并连接右侧跳线时,会出现采样值为0,报警短路的情况

    当使用三线制时,需要按以下方式进行配置:
    1、首先将左侧2/3 Wire跳线焊接上
    2、三段选择的位置24部分的连接线分开,焊接中间引脚和3的位置

    处理后:

    结果

    正常配置后,可以得到正常的采样值:

    MAX31865模块三线制采样数据异常原因

    在手册中,可以看到,FORCE2引脚在2/4线模式下,是需要接地的,而在三线制模式下,是需要接到PT100的一个正极的。所以必须将PT100的负极两根线短接外,还需要配置FORCE2脚的模式

    物联沃分享整理
    物联沃-IOTWORD物联网 » MAX31865模块采样原理及操作指南

    发表评论