A basic temperature control example that reads in a temperature via a K-Type thermocouple sensor. The volt output of the sensor is processed by an MAX31855 board and read out by an Arduino Nano. The so gained temperature value is given out to the serial console of the Arduino Nano. On an output pin of the arduino nano a Solid State Relay (SSR) is connected. A PID controller is switching the SSR till the given target temperature is reached.
- Thermocouple
- MAX31855 K-Type thermoelement breakout board for arduino
- Arduino Nano clone
- Solid State Relay
- you will also need a soldering iron, jumper cables, breadbord etc.
Hardware
- Resolder the plug onto the other side of the MAX31855K breakout board, so that it can be easily attach it to the breadboard.
- Connect the Arduino nano with the MAX31855K breakout board according to following circuit diagram.
- You can find the Fritzing wiring diagram file (tempControl.fzz) in the docs folder.
Software
-
Download and install the newest Arduino IDE from https://www.arduino.cc/en/Main/Software.
-
If you need help using Arduino have a look at www.arduino.cc/en/Guide/HomePage.
-
Install the newest Arduino IDE from https://www.arduino.cc/en/main/software (version 1.8.5 at time of writing).
-
Open "Menu->Sketch->Include Libraries->Manage Libraries.." in the Arduino IDE and search for "Adafruit MAX31855" and "PID" by Brett Beauregard (version 1.2.0 at time of writing) and install it.
-
Open the "tempControl.ino" file that you can find here, "Verify" and "Upload" it to your Arduino board via USB connection
-
Once the code upload finishes verifying, open the serial monitor (found in the ‘Tools’ menu). You should be able to read the temperature your thermocouple is detecting on the serial monitor in real time. If it isn’t working, make sure you have assembled the circuit and uploaded the code to your board correctly.
1. K Type Thermocouple
A thermocouple is a kind of temperature sensor, simply made by welding together two metal wires. Because of a physical effect of two joined metals, there is a slight but measurable voltage across the wires that increases with temperature (Seebeck-Effekt). The main advantage of using a thermocouple is the high temperature range (our K type: -200°C to 1200°C). A difficulty in using them is that the voltage to be measured is very small, with changes of about 50 uV per °C. To solve this we are using a thermocouple interface chip (MAX31855K) to measure the voltage between the wires. If you find that the thermocouple temperature goes down instead of up when heated, when connecting the K type thermocouples with the MAX31855K, try swapping the red and yellow wires.
2. MAX31855K
The MAX31855K is a chip that converts the voltage output of the thermocouple to a digital temperature value that is read out via SPI protocol. The first assembly step is creating a reliable, electrical connection from the MAX31855K breakout board to your Arduino. We chose to use a breakout board because we wanted to connect it to a bread board. The hookup is fairly straightforward. Connect the Arduino, MAX31855K and thermocouple as described in the Fritzing wiring diagram.
3. Arduino nano
The Arduino nano communicates with the MAX31855K through SPI protocol. For further details see next point.
4. SPI protocol
The SPI is a fast synchronous protocol that tipically uses uses 4 pins for communication, wiz. MISO, MOSI, SCK, and SS. These pins are directly related to the SPI bus interface.
1. MISO – MISO stands for Master In Slave Out. MISO is the input pin for Master AVR, and output pin for Slave AVR device. Data transfer from Slave to Master takes place through this channel.
2. MOSI – MOSI stands for Master Out Slave In. This pin is the output pin for Master and input pin for Slave. Data transfer from Master to Slave takes place through this channel.
3. SCK – This is the SPI clock line (since SPI is a synchronous communication).
4. SS – This stands for Slave Select. This pin would be discussed in detail later in the post.
5. PID controller
PID Controller is a most common control algorithm used in industrial automation & applications. PID controllers are used for precise and accurate control of various parameters. Most often these are used for the regulation of temperature, pressure, speed, flow and other process variables. For in depth information about how PID controller work see reference section.
Distributed under the GNU LGPL v.3.0.
- Thermocouple
- MAX31855 K-Type thermoelement breakout board for arduino
- Arduino Nano clone
- Solid State Relay
- henrysbench arduino-max31855 tutorial
- MAX31855 specs and datasheet
- ATmega328 Datasheet
- Arduino Nano Pinout Diagram
- Arduino Anleitung
- K-Type Thermocouple specs
- PID diagrams
- Working of a PID controller
- PID controller
- PID controlling algorithm
- PID Arduino library
- PID for dummies
- Solid State Relais
- GUI
- PID tuning
- Change Fritzing pictures and table for hardware SPI.
- Pictures of new setpup with water kettle
- quirxi (https://github.com/quirxi)
- Cubemast3r (https://github.com/Cubemast3r)