0

LCD Thermocouple Example issue
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

LCD Thermocouple Example issue

by hbar314 on Tue Jan 29, 2019 12:52 pm

Using MAX31855 thermocouple breakout/amplifier.
That works and I can see the temperature in the serial monitor.

I tested the lcd using the liquid crystal 'hello world' example uploaded and it works, yay!

That was as I worked through this page:
https://learn.adafruit.com/thermocouple/arduino-code

Uploaded the lcdthermocouple example as shown on that page and it doesn't show temperature. It just shows both of these lines on the lcd:
Int. Temp =
T/C Problem

With the second line flashing.

Serial monitor shows int temp and gives an odd value that doesn't change, but continues to repeat the value.

I googled around and some people mentioned that isnan(c) produces floating point numbers which the lcd can't handle which sounds logical but since I'm new I honestly don't know how I would even attempt fixing that.

Code below (just copied from the stock example).

Code: Select all | TOGGLE FULL SIZE
#include "Adafruit_MAX31855.h"
#include <LiquidCrystal.h>

int thermoCLK = 3;
int thermoCS = 4;
int thermoDO = 5;

// Initialize the Thermocouple
Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

 
void setup() {
  Serial.begin(9600);
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
 
  lcd.print("MAX31855 test");
  // wait for MAX chip to stabilize
  delay(500);
}

void loop() {
  // basic readout test, just print the current temp
   lcd.setCursor(0, 0);
   lcd.print("Int. Temp = ");
   lcd.println(thermocouple.readInternal());
   lcd.print("  ");
     
   double c = thermocouple.readCelsius();
   lcd.setCursor(0, 1);
   if (isnan(c))
   {
     lcd.print("T/C Problem");
   }
   else
   {
     lcd.print("C = ");
     lcd.print(c);
     lcd.print("  ");
   }

   delay(1000);
}

hbar314
 
Posts: 3
Joined: Tue Jan 29, 2019 12:42 pm

Re: LCD Thermocouple Example issue

by adafruit_support_bill on Tue Jan 29, 2019 1:00 pm

Please post a sample of the serial output. And also please post some photos showing your soldering and connections.

adafruit_support_bill
 
Posts: 71763
Joined: Sat Feb 07, 2009 10:11 am

Re: LCD Thermocouple Example issue

by hbar314 on Tue Jan 29, 2019 11:02 pm

adafruit_support_bill wrote:Please post a sample of the serial output. And also please post some photos showing your soldering and connections.


No problem.
Here's the serial monitor output:
Serial lcdthermo issue.JPG
Serial lcdthermo issue.JPG (76.43 KiB) Viewed 58 times




Here's looking down onto my setup (data logger shield on top):
FOTO_20190129_194954.jpg
FOTO_20190129_194954.jpg (257.9 KiB) Viewed 58 times

hbar314
 
Posts: 3
Joined: Tue Jan 29, 2019 12:42 pm

Re: LCD Thermocouple Example issue

by petespaco on Thu Jan 31, 2019 4:21 pm

First thing I notice is that there's no room to print the "6" of the "-0.06" temp reading. Maybe this example was originally setup for a 20 character wide display?
Hope I am not wrong. You could eliminate the spaces between Int. Temp and =. And see what happens. That won't solve the whole problem, but at least the LCD reading will match the serial output.
By the way, I don't see the serial output code in the snippet that you sent. (Is it within the library someplace?)
I know that the T/C terminals are labelled "yellow" (+) and "red" (-), but do you have it hooked up this way or did you automatically hook the red lead to the (+) terminal?

Sorry if I am off track here. It's too cold to do much outside today, so you get my attention.

petespaco
 
Posts: 70
Joined: Thu Apr 19, 2012 7:53 pm
Location: west central wisconsin

Re: LCD Thermocouple Example issue

by hbar314 on Mon Feb 04, 2019 4:58 pm

petespaco wrote:First thing I notice is that there's no room to print the "6" of the "-0.06" temp reading. Maybe this example was originally setup for a 20 character wide display?
Hope I am not wrong. You could eliminate the spaces between Int. Temp and =. And see what happens. That won't solve the whole problem, but at least the LCD reading will match the serial output.
By the way, I don't see the serial output code in the snippet that you sent. (Is it within the library someplace?)
I know that the T/C terminals are labelled "yellow" (+) and "red" (-), but do you have it hooked up this way or did you automatically hook the red lead to the (+) terminal?

Sorry if I am off track here. It's too cold to do much outside today, so you get my attention.


That's an interesting idea. Removing the space like you mentioned does bring the -0.06 fully onto the lcd.

However, i figured it out! Looks like I followed the picture setup with had pins 3,4,5 backwards and didn't double check that the example code had them the same to the amplifier.

hbar314
 
Posts: 3
Joined: Tue Jan 29, 2019 12:42 pm

Please be positive and constructive with your questions and comments.