Hello, I have been trying to use my Arduino UNO R3 to read three MAX6675 K type thermocouples and write the temperature reading on a ILI9341 controlled LCD screen. The thermocouple temp is reading 32° even when I do not have MAX6675 chip plugged into my breadboard. Code will compile. Here is my code.
Hello cedarlakeinstruments, even if I have the MAX6675 chip plugged into my breadboard and a lighter held to the thermocouple it outputs the temp as 32°. The keyword (readFahrenheit) is what is listed in the library as the call for temp output in degress Fahrenheit. I think I have it in the correct places but I could be completely wrong.
If you are using the Adafruit MAX6675 library, try using different pins for MAX6675 SCK and MISO. That library uses software SPI and if hardware SPI is in use it may interfere.
I was skeptical of that until I looked at the GitHub. I thought they would have at least included an option for Hardware SPI. I've seen much better driver code from Adafruit.
I made changed my Sck pin and MISO pins as jim-p suggested now on the serial monitor I receive correct data from the MAX6675 chips but now my TFT display only shows a white screen. I have added lines of code to determine if the TFT is initializing and it reports it is. Anyone have any suggestions on how to get my TFT back to displaying the data?
I receive no data from max6675 chips. If I switch my SCK pin to 3 and MISO pin to 2 I get serial data from the max6675 chips but my TFT goes white. Any ideas on how to fix this?
I would take 20 minutes and rewrite Adafruit's MAX6675 library to use hardware SPI. I know some people treat libraries as Holy Writ and never to be altered by mere users; I'm not one of them. Even with lots of interruptions, it's only a 20 minute job.
And after the call to read() you can check with getStatus() thw quality of the connection, and get the temperature in Celsius by getTemperature(). Conversion to Fahrenheit is not in my library.
I guess I was not clear about using different pins.
Your display will use the following pins for SPI
SCK (13)
MISO (12)
MOSI (11)
TFT_CS (10)
So for the MAX6675 you cannot use 10,11,12,or 13 since the display uses those pins.
Using pins 3 and 2 for SCK and MISO for the MAX6675, is fine and what you should do.
Does you display work with any of the Adafruit examples?