My friend Fatima of Little Egret Studio was interested to monitor the temperature of her pottery kiln, a SKUTT KM822. We came up with a system that uses the kiln’s built-in K-type thermocouple, and the Blynk app on any phone/tablet to monitor the kiln and studio’s temperatures.

WhatsApp Image 2018-04-03 at 11.42.51

Blynk.cc is a popular system for IoT projects, making it quite easy to send data to their server and create an app to visualise the data. They support ESP8266, and together with the WiFiManager library, it’s easy to configure the hardware for a new wifi network without having to update the code.

My first breadboard prototype used a K-type thermocouple that i had from a previous project  (for frying oil and for a friend’s pizza oven, see here). It has a MAX31855 chip, and i used the Adafruit library.

IMG_20180315_104359 - Edited

However, this termocouple sensor+wire is only rated for 400degC, and when we tried it in the kiln, only putting the metal tube inside the klin, it worked all the way up to 1200degC and back down. But this did damage the sensor+wire as in below picture (original and used).

IMG_20180315_104120 - Edited

As the kiln’s built-in thermocouple is also K-type, we tried to connect our hardware to that sensor, and after verifying that it did not influence the temperature reading by the kiln’s own controller, we chose to use this built-in sensor for our system as well.

Inside our box is the NodeMCU v1 (ESP8266), and the MAX31855 thermocouple breakout, with a 0.01uF cap over the inputs. The thermocouple is connected via a barrel connector plug. We power it from a USB cable, with a 1A fuse. 3 LED for diagnostics. Laser cut box in 2.5mm plywood, put together with hot glue.

IMG_20180321_085855

The Blynk app below shows the temperature profile as programmed in the kiln, with a book reference on the right.

Screenshot_20180315-111845 - Edited  IMG_20180315_102730 - Edited

IMG_20180321_085818

Here’s my code:

/*
 Temperature logger for Fatima's kiln
 NodeMCU v1.0 with MAX31855K thermocouple
 blynk app showing internal temp and TC temp
 Tom Tobback - BuffaloLabs Feb 2018

V0 internal temp
 V1 thermocouple temp

************************************************************
 Download latest Blynk library here:
 https://github.com/blynkkk/blynk-library/releases/latest

Blynk is a platform with iOS and Android apps to control
 Arduino, Raspberry Pi and the likes over the Internet.
 You can easily build graphic interfaces for all your
 projects by simply dragging and dropping widgets.

Downloads, docs, tutorials: http://www.blynk.cc
 Sketch generator: http://examples.blynk.cc
 Blynk community: http://community.blynk.cc
 Social networks: http://www.fb.com/blynkapp
 

Blynk library is licensed under MIT license
 This example code is in public domain.

*************************************************************
 This example runs directly on NodeMCU.

Note: This requires ESP8266 support package:
 https://github.com/esp8266/Arduino

Please be sure to select the right NodeMCU module
 in the Tools -> Board menu!

For advanced settings please follow ESP examples :
 - ESP8266_Standalone_Manual_IP.ino
 - ESP8266_Standalone_SmartConfig.ino
 - ESP8266_Standalone_SSL.ino

Change WiFi ssid, pass, and Blynk auth token to run :)
 Feel free to apply it to any other example. It's simple!
 *************************************************************/

#define LED_WIFI 5 // D1
#define LED_BLYNK 4 // D2

///////////////////// THERMOCOUPLE SETUP /////////////////////
/***************************************************
 This is an example for the Adafruit Thermocouple Sensor w/MAX31855K
 Designed specifically to work with the Adafruit Thermocouple Sensor
 ----> https://www.adafruit.com/products/269
 These displays use SPI to communicate, 3 pins are required to
 interface
 Adafruit invests time and resources providing this open source code,
 please support Adafruit and open-source hardware by purchasing
 products from Adafruit!
 Written by Limor Fried/Ladyada for Adafruit Industries.
 BSD license, all text above must be included in any redistribution
 ****************************************************/
#include <SPI.h>
#include "Adafruit_MAX31855.h"
// Default connection is using software SPI, but comment and uncomment one of
// the two examples below to switch between software SPI and hardware SPI:
#define MAXDO 12 // D6
#define MAXCS 13 // D7
#define MAXCLK 15 // D8
// initialize the Thermocouple
Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);

//////////////////// BLYNK SETUP //////////////////////////////
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxxx";
// Your WiFi credentials.
// Set password to "" for open networks.
//char ssid[] = "xxxx";
//char pass[] = "xxxx";

BlynkTimer timer;

//////////////////// WIFI MANAGER ////////////////////////////
#include <DNSServer.h> //needed for wifimanager library
#include <ESP8266WebServer.h> //needed for wifimanager library
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager

///////////////////////////////////////////////////////////////

void myTimerEvent() // read thermocouple and push data to blynk
{
 float internal_t = thermocouple.readInternal();
 int tc_t = thermocouple.readCelsius();

if (isnan(internal_t) || isnan(tc_t) || tc_t > 1500) { // if thermocouple does not return a number
 Serial.println("Something wrong with thermocouple!");
 } else {
 Serial.print("Internal Temp = ");
 Serial.print(internal_t);
 Serial.print("\t Thermocouple Temp = ");
 Serial.print(tc_t);
 if (tc_t < 2000) {
 Serial.println("\t Sending to blynk..");
 Blynk.virtualWrite(V0, internal_t);
 Blynk.virtualWrite(V1, tc_t);}
 else {
 Serial.println("\t Temperature not right, not sending to Blynk..");
 }
 }

}

////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////

void setup()
{
 Serial.begin(9600);

pinMode(LED_BUILTIN, OUTPUT);
 pinMode(LED_WIFI, OUTPUT);
 pinMode(LED_BLYNK, OUTPUT);
 digitalWrite(LED_BUILTIN, LOW); // on board LED (inverted) ON when powered on
 digitalWrite(LED_WIFI, LOW);
 digitalWrite(LED_BLYNK, LOW);

for (int i = 0; i < 10; i++) {
 digitalWrite(LED_WIFI, HIGH);
 delay(100);
 digitalWrite(LED_WIFI, LOW);
 delay(100);
 }

WiFiManager wifiManager;
 // wifiManager.resetSettings(); // known networks are saved so need to reset for testing
 wifiManager.autoConnect("BuffaloLabsAP", "BuffaloLabs");
 digitalWrite(LED_WIFI, HIGH); // wifi connected successfully

// Blynk.begin(auth, ssid, pass); // original line
 Blynk.config(auth);
 // Setup a function to be called every 10 seconds
 timer.setInterval(10000L, myTimerEvent);
}

////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////

void loop()
{
 Blynk.run();
 timer.run(); // Initiates BlynkTimer
 digitalWrite(LED_BLYNK, Blynk.connected()); // LED on when connected to Blynk
}

////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
Blynk thermocouple for pottery kiln (ESP8266)

21 thoughts on “Blynk thermocouple for pottery kiln (ESP8266)

  • 13/06/2018 at 05:30
    Permalink

    hello so did you program it with arduino or another one ? can i have the programme please im kinda working on the same thing

    Reply
    • 29/06/2018 at 10:50
      Permalink

      hi, yes programmed with the Arduino IDE, starting from a standard Blynk example for ESP8266

      Reply
  • 05/09/2018 at 12:55
    Permalink

    Exactly what I’ve been looking for! Do you have a blueprint of this, or a list of all the pieces used? Did you go in between the thermocouple and the kiln controller, and kind of tapped out the data from there?

    Reply
    • 10/09/2018 at 08:39
      Permalink

      hi, yes as you can see in the picture, we connect to the thermocouple sensor on the kiln, in parallel to the existing setup.

      Reply
  • 27/09/2018 at 00:15
    Permalink

    Can you please attach wiring diagram and code for your kiln project? I’m sure everyone would appreciate your help

    Reply
    • 13/11/2018 at 09:29
      Permalink

      hi, i hope the wiring is clear from the pictures, text and code. it is really just 4 wires for the thermocouple, and 3 LEDs

      Reply
  • 22/05/2019 at 22:38
    Permalink

    Nice project, can I also have the code?

    Reply
    • 29/05/2019 at 07:48
      Permalink

      hi, i added the code to the post

      Reply
  • 15/01/2020 at 15:15
    Permalink

    *WM: AutoConnect
    *WM: Connecting as wifi client…
    *WM: No saved credentials
    *WM: Connection result:
    *WM: 0
    *WM:
    *WM: Configuring access point…
    *WM: BuffaloLabsAP
    *WM: BuffaloLabs
    *WM: AP IP address:
    *WM: 192.168.4.1
    *WM: HTTP server started
    What does the above message mean? Cn you please help me interpret it?

    I am getting this message on the serial monitor. After uploading the code to NodeMcU and setting wifi ssid and password in the code.

    PS: I am still learning the process therefore I have not yet connected any sensors as of now. I am using a Node MCU.

    Reply
    • 15/01/2020 at 15:45
      Permalink

      hi, that means the WifiManager is running, so you can use your laptop or phone to make the ESP connect to your wifi network. first connect your laptop/phone to the BuffaloLabsAP and then browse to 192.168.4.1 you should find the config webpage there. for more info, check out https://github.com/tzapu/WiFiManager

      Reply
      • 14/02/2020 at 01:49
        Permalink

        Thanks a lot. I appreciate your timely response.

        Reply
  • 21/02/2020 at 14:19
    Permalink

    Hi again! I was about to order the thermocouple sensors but before ordering I just wanted to check if I can use MAX6675 Module instead of MAX31855 , since I just need to use it for basic lab experiments and the max temperature that we’ll be dealing with is around 110 degree Celsius max.

    Will I need to change the code that you have provided if I use MAX6675 instead of MAX 31855.

    Reply
      • 23/02/2020 at 02:11
        Permalink

        Later on I might require thermocouple for projects involving higher temperatures, therefore I just wanted to know if I can use the same code for MAX 6675 because the code that you have used is for MAX 31855 and in my area MAX 31855 sensor is not easily available and its expensive whereas MAX 6675 is easily available and cheap too.

        I am using your code for my college work too and I don’t want to change the code again. Hence I asked if with the same existing code can I use MAX 6675 instead if Max31855

        Reply
  • 08/03/2020 at 12:51
    Permalink

    Hi, I am happy to share that I was able to successfully implement a similar thermocouple with the help of your guidance. Thank a lot!

    Just wanted a small advice…. Can I use the K-type thermocouple probe to insert it in water and measure water temperature?
    Can the thermocouple and probe deal with water? I am asking because I don’t want to end up spoiling any of the components.
    Thanks in advance

    Reply
    • 09/03/2020 at 09:42
      Permalink

      hi, thanks for the update. i don’t know what kind of thermocouple probe you are using, you better check with the supplier if it is waterproof. if the metal tip is long enough to insert it in the water without getting the wiring wet i’d think it should be fine.
      again, it would not be much work to add a DS18B20 sensor that comes in a nice waterproof package.

      Reply
  • 30/07/2020 at 21:33
    Permalink

    Hi, this is exactly what I was looking for, my only problem is the ‘Blynk’ – I am looking for a loud alarm sound (at least 10 seconds) to be played on the mobile phone when a certain temperature os reached (heating up a sauna). Is there an option – couldn’t find any in Blynk, or a workaround?
    Thanks for your answer!
    Best, Eduard

    Reply
  • 11/11/2020 at 11:27
    Permalink

    Hi, can you share the schematic and setting in blynk? thanks before…

    Reply

Leave a Reply to Tom Cancel reply

Your email address will not be published. Required fields are marked *