So I have a Wemos D1 R1 with a SSD1306 display and max6675 interface that was reading correctly and for some reason is no longer reading correctly. Constant read 32F but room temp 69 degrees. I thought possibly I had either a bad k couple of interface so I did purchase another setup and still reading 32 F . Hard to believe they are both open circuits of just plain bad .
Start your code here
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <MAX6675.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
// MAX6675 pins
int thermoSO = D6;
int thermoCS = D7; // use D7 instead of D2 to avoid I2C conflict
int thermoSCK = D5;
MAX6675 thermocouple(thermoSCK, thermoCS, thermoSO);
void setup() {
Serial.begin(9600);
// Initialize OLED
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F(“SSD1306 allocation failed”));
for(;;);
}
display.clearDisplay();
display.setTextSize(2);
display.setTextColor(SSD1306_WHITE);
}
void loop() {
float tempC = thermocouple.getCelsius();
float tempF = tempC * 9.0 / 5.0 + 32.0;
// Debug output
Serial.print(“Temp: “);
Serial.print(tempF);
Serial.println(” F”);
// Display on OLED
display.clearDisplay();
display.setCursor(0, 0);
display.print(“Temp: “);
display.print(tempF, 1); // one decimal place
display.print(” F”);
display.display();
delay(1000);
}
Hi.
If it’s constantly reading 32F, it means the sensor is always reading 0.
So, the sensor is either faulty, or not connected properly, or you’re using GPIOs that are not the best for that task.
Try to test only the sensor, without the OLED display.
Instead of declaring the GPIOs with the D, declare them with the corresponding numbers. For example:
int thermoSCK = 14; //instead of D5
And so on….
I hope this helps.
Let me know your results
Regards,
Sara
Tried that with 2 different Mxx6675 and K couples , still reading 32 constantly
Start your code here
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <MAX6675.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
// MAX6675 pins
int thermoSO = 12;
int thermoCS = 16;
int thermoSCK = 14;
MAX6675 thermocouple(thermoSCK, thermoCS, thermoSO);
void setup() {
Serial.begin(9600);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
display.setTextSize(2);
display.setTextColor(SSD1306_WHITE);
delay(500);
}
void loop() {
double tempC = thermocouple.getCelsius();
double tempF = tempC * 9.0 / 5.0 + 32.0;
display.clearDisplay();
display.setCursor(0, 10);
display.print(“Temp: “);
display.print(tempF, 1);
display.print(” F”);
display.display();
Serial.print(“Temperature: “);
Serial.print(tempF);
Serial.println(” F”);
delay(1000);
}
Your code looks fine to me.
So, it can only be related to the hardware.
Do you have another board to test with? Try with another board to see if it is related to the GPIOs of that particular board.
Double-check that the probes of the thermocouple are wired correctly to the amplifier.
Let me know if you can proceed.
Regards,
Sara
So i have 2 boards and k thermocouples. I tried to mix and match them thinking it has to be one parr or thr other. Still get 32c
So this morning i decided to test with a heat source, i heated the tips of the K couple and read the mv , both responded. So i have to say that the MAX 6675 is the issue. These were purchased from HiLeGo website actually Amazon website., live and learn. Hit ir miss when you purchase these items on there.
Thank you again for taking the time with this issue.
So i have 2 boards and k thermocouples. I tried to mix and match them thinking it has to be one parr or thr other. Still get 32c
Yes. It seems that the MAX6675 might be the issue.
You can try to contact the seller to see if they have any fixes for that, or to return the defective hardware.
Then, let me know if you end up being successful.
Regards,
Sara