Other Arduino Codes and Videos by Robojax

MAX6675 Thermocouple k type sensor with LCD1602 I2C and Arduino

MAX6675 Thermocouple k type sensor with LCD1602 and Arduino

Arduino code to read temperature using MAX6675 chip and k-type thermocouple and display it LCD1602 I2C display.

Resources for this sketch


 // original library source:
// www.ladyada.net/learn/sensors/thermocouple
 /*
 * Arduino code to read temperature using MAX6675 chip and k-type thermocouple
 * and display on LCD1602 I2C Display
 * 
 * Watch video instruction for this code: https://youtu.be/BlhpktgPdKs
 * 
 * Download this code from Robojax.com
 *  
 * updated by Ahmad Shamshiri for Robojax.com on Saturday November 24, 2018 
 * in Ajax, Ontario, Canada
 * 
 
 * This code is "AS IS" without warranty or liability. Free to be used as long as you keep this note intact.* 
 * This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */


#include "max6675.h"// this file is part of the library. See video for details

// start of settings for LCD1602 with I2C
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>// this file is part of the library. See video for details
// Set the LCD address to 0x3F for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x3F, 16, 2);
// end of settings for LCD1602 with I2C

int soPin = 4;// SO=Serial Out
int csPin = 5;// CS = chip select CS pin
int sckPin = 6;// SCK = Serial Clock pin

MAX6675 thermocouple(sckPin, csPin, soPin);


void setup() {
  // Robojax.com MAX6675 video with LCD1602 20181124
  lcd.begin();// initializ the LCD1602
  lcd.backlight();// turn the backlight ON for the LCD
      lcd.print("Robojax MAX6675");
      lcd.setCursor(0,1);
      lcd.print("Thermocouple");  
          
  Serial.begin(9600);// initialize serial monitor with 9600 baud
  Serial.println("Robojax MAX6675"); 
    
 delay(3000);// give time to user to read the display at the beginning
 // Robojax.com MAX6675 video with LCD1602 20181124
}

void loop() {
  // basic readout test, just print the current temp
  // Robojax.com MAX6675 video with LCD1602 20181124
   Serial.print("C = "); 
   Serial.println(thermocouple.readCelsius());
   Serial.print("F = ");
   Serial.println(thermocouple.readFahrenheit());

  lcd.clear();// clear previous values from screen 
      lcd.setCursor(0,0);// set cursor at character 0, line 0       
      lcd.print("Temperature");


      lcd.setCursor(0,1);// set cursor at character 0, line 1
      lcd.print(thermocouple.readCelsius()); 
      lcd.setCursor(5,1);// set cursor at character 9, line 1
      lcd.print((char)223); 
      lcd.setCursor(6,1);// set cursor at character 9, line 1
      lcd.print("C");    
                  
      lcd.setCursor(7,1);// set cursor at character 9, line 1
      lcd.print(" ");       
      lcd.setCursor(8,1);// set cursor at character 9, line 1
      lcd.print(thermocouple.readFahrenheit()); // print temperature in ahrenheit
      lcd.setCursor(14,1);// set cursor at character 9, line 1      
      lcd.print((char)223); 
      lcd.setCursor(15,1);// set cursor at character 9, line 1
      lcd.print("F"); 
 // Robojax.com MAX6675 video with LCD1602 20181124            
   delay(1000);
}

   

If you found this tutorial helpful, please support me so I can continue creating contents like this.