• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Temperature read error

Q&A Forum › Category: ESP8266 › Temperature read error
0 Vote Up Vote Down
Larry asked 6 days ago

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);
}

Question Tags: K thermocouple
8 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 6 days ago

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
 

0 Vote Up Vote Down
Larry answered 5 days ago

Thank you , i will try that .

0 Vote Up Vote Down
Larry answered 5 days ago

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);
}

 

0 Vote Up Vote Down
Sara Santos Staff answered 3 days ago

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
 
 
 

0 Vote Up Vote Down
Larry answered 3 days ago

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.

0 Vote Up Vote Down
Larry answered 3 days ago

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 

0 Vote Up Vote Down
Sara Santos Staff answered 3 days ago

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

0 Vote Up Vote Down
Larry answered 3 days ago

Already in process of getting a replacement part , my fear is that this is the second one already and maybe they are having issues with their  ic’s , if the replacement is bad I will just order one from the trusted site listed here. Thanks

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Smart Home with Raspberry Pi, ESP32, and ESP8266 V1.6 September 9, 2025
  • [eBook Updated] Learn LVGL: Build GUIs for ESP32 Projects – Version 1.5 July 7, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.