Other Arduino Codes and Videos by Robojax

cod and video for using MAX6675 K-Type Thermocoupl with Relay and Display Robojax.com

TTP223B Capacitive Touch with Relay and AC load code

This video shows you how to turn AC load like bulb ON and off using TTP223B touch module with a relay. This demonstration and code will shows how to use it with Arduino and without arduino. You will also learn how to connect if your relay is different. The last section of the video shows you how to control the time, the AC bulb or load is ON. download the code and datasheet: http://robojax.com/learn/arduino/
  1. download MAX6675 Library (from Robojax.com)
  2. download MAX6675 Library (from GetHub)

Arduino code for MAX6675 Thermocouple K-Type (without relay and display)


 /*
 * This is the Arduino code for MAX6675 Thermocouple K-Type with Relay and Display
* this code has been explained in our video at https://youtu.be/cD5oOu4N_AE

 * 
 * Written by Ahmad Nejrabi for Robojax Video
 * Date: Dec 09, 2017, in Ajax, Ontario, Canada
 * Permission granted to share this code given that this
 * note is kept with the code.
 * Disclaimer: this code is "AS IS" and for educational purpose only.
 * 
 */

 // this example is public domain. enjoy!
// www.ladyada.net/learn/sensors/thermocouple

#include "max6675.h"


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


MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;
  
void setup() {
  Serial.begin(9600);
  // use Arduino pins 
  pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
  pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);
  
  Serial.println("Robojax: MAX6675 test");
  // wait for MAX chip to stabilize
  delay(500);
}

void loop() {
  // basic readout test, just print the current temp


   Serial.print("C = "); 
   Serial.println(thermocouple.readCelsius());
   Serial.print("F = ");
   Serial.println(thermocouple.readFahrenheit());

   // if temprature goes above 80.0C, turn the relay ON
   if(thermocouple.readCelsius() > 80.00){
    digitalWrite(10, LOW);// set pin 10 LOW
   }else{
    digitalWrite(10, HIGH);// set pin 10 HIGH
   }
    
 
   delay(1000);
}


   

Arduino code for MAX6675 Thermocouple K-Type with Relay (no display)


 /*
 * This is the Arduino code for MAX6675 Thermocouple K-Type with Relay and Display
 * the output pen 10 is connected to relay 
 * by when the temprature reaches desired value, the in 10 turns the 
 * the relay ON.

 * this code has been explained in our video at https://youtu.be/cD5oOu4N_AE

 * 
 * Written by Ahmad Nejrabi for Robojax Video
 * Date: Dec 09, 2017, in Ajax, Ontario, Canada
 * Permission granted to share this code given that this
 * note is kept with the code.
 * Disclaimer: this code is "AS IS" and for educational purpose only.
 * 
 */

 // this example is public domain. enjoy!
// www.ladyada.net/learn/sensors/thermocouple

#include "max6675.h"


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


MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;
  
void setup() {
  Serial.begin(9600);
  // use Arduino pins 
  pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
  pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);
    pinMode(10, OUTPUT);// set pin 10 as output
	
  Serial.println("Robojax: MAX6675 test");
  // wait for MAX chip to stabilize
  delay(500);
}

void loop() {
  // basic readout test, just print the current temp


   Serial.print("C = "); 
   Serial.println(thermocouple.readCelsius());
   Serial.print("F = ");
   Serial.println(thermocouple.readFahrenheit());

   // if temprature goes above 80.0C, turn the relay ON
   if(thermocouple.readCelsius() > 80.00){
    digitalWrite(10, LOW);// set pin 10 LOW
   }else{
    digitalWrite(10, HIGH);// set pin 10 HIGH
   }
    
 
   delay(1000);
}


   

Arduino code for MAX6675 Thermocouple K-Type with Relay and Display

This code beside using MAX6675 K-Thermocouple with relay, it shows the temprature on 7-Segment display.

  1. Watch the TM1637 Display video and get the code

 /*
 * This is the Arduino code for MAX6675 Thermocouple K-Type with Relay and Display
 * the output pen 10 is connected to relay 
 * by when the temprature reaches desired value, the in 10 turns the 
 * the relay ON.
 * the temprature is also displayed on the display.
 * you must include the TM1637 library to make the display work. 
 * you can download the TM1637 from http://robojax.com/learn/library
 * this code has been explained in our video at https://youtu.be/cD5oOu4N_AE

 * 
 * Written by Ahmad Nejrabi for Robojax Video
 * Date: Dec 09, 2017, in Ajax, Ontario, Canada
 * Permission granted to share this code given that this
 * note is kept with the code.
 * Disclaimer: this code is "AS IS" and for educational purpose only.
 * 
 */

 // this example is public domain. enjoy!
// www.ladyada.net/learn/sensors/thermocouple

#include "max6675.h"
#include <Arduino.h>
#include <TM1637Display.h>

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

// code for display 
#define CLK 2
#define DIO 3
#define TEST_DELAY   2000
TM1637Display display(CLK, DIO);
// code for display end

MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;
  
void setup() {
  Serial.begin(9600);
  // use Arduino pins 
  pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
  pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);
  pinMode(10, OUTPUT);// set pin 10 as output
	
  Serial.println("Robojax: MAX6675 test");
  // wait for MAX chip to stabilize
  delay(500);
}

void loop() {
  // basic readout test, just print the current temp

	// code for display
  display.setBrightness(0x0f);
    // All segments on
  uint8_t data[] = { 0x0, 0x0, 0x0, 0x0 };
  display.setSegments(data);
  delay(1);
  int temp = (int) thermocouple.readCelsius();
  display.showNumberDec(temp, true, 3, 0);
  // code for display end
   Serial.print("C = "); 
   Serial.println(thermocouple.readCelsius());
   Serial.print("F = ");
   Serial.println(thermocouple.readFahrenheit());

   // if temprature goes above 80.0C, turn the relay ON
   if(thermocouple.readCelsius() > 80.00){
    digitalWrite(10, LOW);// set pin 10 LOW
   }else{
    digitalWrite(10, HIGH);// set pin 10 HIGH
   }
    
 
   delay(1000);
}