Hallo,
bin seit ner weile wieder mal dabei mich mit arduino zu beschäftigen und auf folgendes problem gestoßen.
Der Max gibt mir nur 0 Ohm und -242° im monitor aus.(2 Wire beide Jumper gelötet)(4301Ohm Ref Wiederstand) und bin mittlerweile etwas ahnungslos hab mich im forum umgeschaut jedoch leider keine lösung gefunden.
Anbei die beiden Sketches mit denen ich es unter anderm versucht hab.
#include <Adafruit_MAX31865.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
//////////////////////////////////////////// CONFIGURATION OF LCD /////////////////////////////////////////////////
// set LCD address, number of columns and rows
// if you don't know your display address, run an I2C scanner sketch
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
//////////////////////////////////////////// CONFIGURATION OF RTD /////////////////////////////////////////////////
// Use software SPI: CS, DI, DO, CLK
//Adafruit_MAX31865 thermo = Adafruit_MAX31865(10, 11, 12, 13);
//Adafruit_MAX31865 thermo2 = Adafruit_MAX31865(9, 11, 12, 13);
// use hardware SPI, just pass in the CS pin
Adafruit_MAX31865 max = Adafruit_MAX31865(10);
Adafruit_MAX31865 max2 = Adafruit_MAX31865(9);
// 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
//////////////////////////////////////////// CONNECTIONS /////////////////////////////////////////////////
int POT_1_Pin = A1;
int POT_2_Pin = A2;
int Relay_Pin = 8;
//////////////////////////////////////////// LOGICAL VARIABLES /////////////////////////////////////////////////
int POT_1_ADC = 0;
int POT_2_ADC = 0;
int POT_1_STS = 0;
int POT_2_STS = 0;
int LCD_State = 0;
float Temperature_1_STS = 0;
float Temperature_2_STS = 0;
float Temperature_1_Setpoint = 0;
float Temperature_2_Setpoint = 0;
int Pump_STS = 0;
// Generally, you should use "unsigned long" for variables that hold time
// The value will quickly become too large for an int to store
unsigned long previousMillis_1 = 0;
// Generally, you should use "unsigned long" for variables that hold time
// The value will quickly become too large for an int to store
unsigned long previousMillis_2 = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Arduino UNO Setup_Stage");
Pin_Modes_Configuration();
RTD_Setup_Stage();
LCD_Setup_Stage();
}
void loop() {
// put your main code here, to run repeatedly:
unsigned long currentMillis_1 = millis();
if (currentMillis_1 - previousMillis_1 >= 10000) {
// save the last time you blinked the LED
previousMillis_1 = currentMillis_1;
LCD_Loop_Stage();
}
unsigned long currentMillis_2 = millis();
if (currentMillis_2 - previousMillis_2 >= 10000) {
// save the last time you blinked the LED
previousMillis_2 = currentMillis_2;
RTD_Loop_Stage();
Logical_Operations();
}
Waiting();
}
void Logical_Operations() {
Serial.print("Temperature_1_STS");
Serial.println(Temperature_1_STS);
Serial.print("Temperature_2_STS");
Serial.println(Temperature_2_STS);
Serial.print("Temperature_1_Setpoint");
Serial.println(Temperature_1_Setpoint);
Serial.print("Temperature_2_Setpoint");
Serial.println(Temperature_2_Setpoint);
if (Temperature_1_STS >= Temperature_1_Setpoint) {
Serial.println("Heating System Pump Turned ON!");
Pump_STS = 1;
digitalWrite(Relay_Pin, HIGH);
} else if (Temperature_2_STS >= Temperature_2_Setpoint) {
Serial.println("Heating System Pump Turned OFF!");
Pump_STS = 0;
digitalWrite(Relay_Pin , LOW);
}
}
void Pin_Modes_Configuration() {
pinMode(POT_1_Pin, INPUT);
pinMode(POT_2_Pin, INPUT);
pinMode(Relay_Pin, OUTPUT);
}
void LCD_Setup_Stage() {
lcd.begin(16,2);
lcd.setBacklight(HIGH);
// initialize LCD
//lcd.init();
// turn on LCD backlight
//lcd.backlight();
}
void LCD_Loop_Stage() {
if (LCD_State >= 7) {
Serial.println("LCD_State RESETTED! ");
} else {
LCD_State = LCD_State + 1;
Serial.print("LCD_State = ");
Serial.println(LCD_State);
}
if (LCD_State == 1) {
lcd.clear();
// set cursor to first column, first row
lcd.setCursor(0, 0);
// print message
lcd.print("Temperature 1 = ");
// set cursor to first column, second row
lcd.setCursor(0, 1);
lcd.print(Temperature_1_STS);
} else if (LCD_State == 2) {
lcd.clear();
// set cursor to first column, first row
lcd.setCursor(0, 0);
// print message
lcd.print("Temperature 2 = ");
// set cursor to first column, second row
lcd.setCursor(0, 1);
lcd.print(Temperature_2_STS);
} else if (LCD_State == 3) {
lcd.clear();
// set cursor to first column, first row
lcd.setCursor(0, 0);
// print message
lcd.print("Temperature_1_Setpoint = ");
// set cursor to first column, second row
lcd.setCursor(0, 1);
lcd.print(Temperature_1_Setpoint);
} else if (LCD_State == 4) {
lcd.clear();
// set cursor to first column, first row
lcd.setCursor(0, 0);
// print message
lcd.print("Temperature_2_Setpoint = ");
// set cursor to first column, second row
lcd.setCursor(0, 1);
lcd.print(Temperature_2_Setpoint);
} else if (LCD_State == 5) {
lcd.clear();
// set cursor to first column, first row
lcd.setCursor(0, 0);
// print message
lcd.print("Pump_STS = ");
// set cursor to first column, second row
lcd.setCursor(0, 1);
lcd.print(Pump_STS);
delay(10000);
LCD_State = 1;
}
}
void RTD_Setup_Stage() {
Serial.println("Adafruit MAX31865 PT100 Sensor Test!");
max.begin(MAX31865_2WIRE); // set to 2WIRE or 4WIRE as necessary
max2.begin(MAX31865_2WIRE); // set to 2WIRE or 4WIRE as necessary
}
void RTD_Loop_Stage() {
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(1000, RREF));
Temperature_1_STS = max.temperature(RNOMINAL, 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();
uint16_t rtd2 = max2.readRTD();
Serial.print("RTD value: "); Serial.println(rtd2);
float ratio2 = rtd2;
ratio2 /= 32768;
//Serial.print("Ratio2 = "); Serial.println(ratio2, 8);
//Serial.print("Resistance2 = "); Serial.println(RREF * ratio2, 8);
Serial.print("Temperature2 = "); Serial.println(max2.temperature(1000, RREF));
Temperature_2_STS = max2.temperature(RNOMINAL, RREF);
// Check and print any faults
uint8_t fault2 = max2.readFault();
if (fault2) {
Serial.print("Fault2 0x"); Serial.println(fault2, HEX);
if (fault2 & MAX31865_FAULT_HIGHTHRESH) {
Serial.println("RTD High Threshold");
}
if (fault2 & MAX31865_FAULT_LOWTHRESH) {
Serial.println("RTD Low Threshold");
}
if (fault2 & MAX31865_FAULT_REFINLOW) {
Serial.println("REFIN- > 0.85 x Bias");
}
if (fault2 & MAX31865_FAULT_REFINHIGH) {
Serial.println("REFIN- < 0.85 x Bias - FORCE- open");
}
if (fault2 & MAX31865_FAULT_RTDINLOW) {
Serial.println("RTDIN- < 0.85 x Bias - FORCE- open");
}
if (fault2 & MAX31865_FAULT_OVUV) {
Serial.println("Under/Over voltage");
}
max2.clearFault();
}
Serial.println();
}
void Waiting() {
POT_1_ADC = analogRead(POT_1_Pin);
POT_2_ADC = analogRead(POT_2_Pin);
POT_1_STS = map(POT_1_ADC, 0, 1025, 0 , 100);
POT_2_STS = map(POT_2_ADC, 0, 1025, 0 , 100);
Temperature_1_Setpoint = POT_1_STS;
Temperature_2_Setpoint = POT_2_STS;
delay(30);
}
#include <Adafruit_MAX31865.h>
// Use software SPI: CS, DI, DO, CLK
Adafruit_MAX31865 thermo = Adafruit_MAX31865(10, 11, 12, 13);
// use hardware SPI, just pass in the CS pin
//Adafruit_MAX31865 thermo = 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
void setup() {
Serial.begin(115200);
Serial.println("Adafruit MAX31865 PT100 Sensor Test!");
thermo.begin(MAX31865_2WIRE); // set to 2WIRE or 4WIRE as necessary
}
void loop() {
uint16_t rtd = thermo.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(thermo.temperature(RNOMINAL, RREF));
// Check and print any 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();
}
Serial.println();
delay(1000);
}