Temperature measurement and control is a large area in automation.

There is a wide range of sensors with various ranges and accuracy.

There is also an equally large number of option to control temperatures.

 

.

 

Temperature Basics

Picture

Temperature, pressure, & flow are the most used process measurements in industry.

As such there are many options to choose from.

For temperature in the process industry, 99% or more of the temperature loops use thermocouples or resistance temperature detectors (RTD). The RTD provides sensitivity (minimum detectable change in temperature), repeatability, and drift that are an order of magnitude better than the thermocouple.

Thermocouples are made up of 2 different metals that produce a voltage that varies with temperature.

That millivolt signal is then amplified for reading.

An RTD is a platinum resistor ( usually 100 ohms ) that varies with temperature.

 A circuit is required to measure that resistance and produce a voltage usually 0 to 5 VDC.

A 3 wire RTD is generally good, but a 4 wire will give the best accuracy with an extra cost.

Accuracy, Range, and Usability of Temperature Sensing Elements

Sensitivity and repeatability are two of the three most important components of accuracy.

The other most important component, resolution, is set by the transmitter.

Drift is important for extending the time between calibrations

Thermistors, which have seen limited use in the process industry despite their extreme sensitivity and fast (millisecond) response, primarily because of their lack of chemical and electrical stability.

Thermistors are also highly nonlinear, but this can be addressed by smart instrumentation.

Also of importance depending on the desired accuracy and repeatability is the effects of noise and calibration.

Determining which type of temperature sensor to use is based on:

1) Mounting - How will you physically mount the sensor to make your measurements ?

     For measuring air temperature in a clean environment, you can get away with using a thermistor or TMP36.

     For measuring a liquids temperature, you will need a protective probe type enclosure.( Usually RTD or thermocouple ).

2) Temperature range is another limiting variable. Too small a range will not work.

3) Accuracy needed.( See Temperature Noise & Calibration.txt )

Temperature Sensing Elements
 

Thermocouple

RTD (Pt 100 ) Thermistor
Repeatability 1-8 0.02-0.5 0.1-1
Drift 1-20 0.01 - 0.1 0.01 - 0.1
Sensitivity ( C ) 0.05 0.001 0.0001
Temperature Range ( C ) -200 to 2000 -200 to 850 -100 to 300
Signal Output (volts) 0-0.06 1 - 6 1 - 3
Power (watts at 100 ohm ) 0.4 2 0.4

NOTE: The TMP36 is a low voltage, precision centigrade temperature sensor. It provides a voltage output that is linearly proportional to the Celsius temperature. It also doesn't require any external calibration to provide typical accuracies of ±1°C at +25°C and ±2°C over the −40°C to +125°C temperature range.

NOTE: Thermocouples come in type of different bi-metal for different ranges.

The most common being J & K type.

J - 0 to 750°C

K - 0 to 1250°C

Some quick & simple Arduino solutions:

TMP 36 / DS18B20 ( Solid State )

These sensors use a solid-state technique to determine the temperature. They use the fact as temperature increases, the voltage across a diode increases at a known rate. (Technically, this is actually the voltage drop between the base and emitter - the Vbe - of a transistor.) By precisely amplifying the voltage change, it is easy to generate an analog signal that is directly proportional to temperature.

TMP36

Temperature range: -40°C to 150°C / -40°F to 302°F

Output range: 0.1V (-40°C) to 2.0V (150°C) but accuracy decreases after 125°C

A simple 3 wire connection.

#1) 2.7 to 5.5VDC VCC

#2) Analog voltage out (A0)

#3) GND

DS18B20

Uses the Dallas 1-Wire protocol, which is somewhat complex, and requires a bunch of code to parse out the communication, but avoids signal issues with long runs.

  • Usable temperature range: -55 to 125°C (-67°F to +257°F)
  • 9 to 12 bit selectable resolution
  • Uses 1-Wire interface- requires only one digital pin for communication
  • Unique 64 bit ID burned into chip
  • Multiple sensors can share one pin
  • ±0.5°C Accuracy from -10°C to +85°C
  • Temperature-limit alarm system
  • Query time is less than 750ms
  • Usable with 3.0V to 5.5V power/data

DHT22 ( thermister )

Good for 0-100% humidity readings with 2-5% accuracy

Good for -40 to 80°C temperature readings ±0.5°C accuracy

No more than 0.5 Hz sampling rate (once every 2 seconds)

This is a thermistor ( temperature sensitive varying resistor ) with a capacitor for humidity.

-200°C to +1350°C output in 0.25 degree increments - note that K thermocouples have about ±2°C to ±6°C accuracy

SPI data output requires any 3 digital I/O pins.

The MAX6675 performs cold-junction compensation and digitizes the signal from a type-K thermocouple.The data is output in a 12-bit resolution, SPI-compatible, read-only format.

RTD-Pt100

Usable temperature range: -200 to 550°C (-328°F to +1,022°F)

±0.5°C Accuracy from -10°C to +85°C

Platinum RTD Sensor - PT100 - 3 Wire

Resistor material is Platinum with a value of 100 ohm at temperature 0°C

Platinum has a positive resistance temperature factor; resistance increases with rising temperature

Resistance variation is a function of temperature: 0.385Ω/°C nominal

RTD to MAX31865 0-5VDC

Raspberry Pi Solutions

MCC 134 Thermocouple Measurement HAT

Provides four thermocouple inputs for adding temperature measurement capability to Raspberry Pi based systems. It features 24-bit resolution and provides professional-grade accuracy which is best in class. The MCC 134 also offers open thermocouple detection so users can monitor for broken or disconnected thermocouples and each channel type is selectable on a per-channel basis. Up to eight MCC DAQ HAT devices can be stacked onto one Raspberry Pi.

Temp Heater Rate

Picture

Temperature heater rate values sent to serial monitor for copy/paste to spreadsheet.
State logic function to set the pwm output  and measure the DS18B20 temperature.
Temperature input measures read with DS18B20. (4.7K pull up resistor to +5VDC needed )

Output to temperature heater (12V 40W 6x20mm Single-Head Cartridge Heater ) via L298N.

NOTE: Max temperature for DS18B20 probe is 125 C.

For higher current use:

3D Printer Heat Bed Power Module 3D Printer Board Expansion Board MOS Tube High Current Load Module

DS18B20

Picture
DS18B20_wiring

DS18B20 Technical specs:

  • Usable temperature range: -55 to 125°C (-67°F to +257°F)
  • 9 to 12 bit selectable resolution
  • Uses 1-Wire interface- requires only one digital pin for communication
  • Unique 64 bit ID burned into chip
  • Multiple sensors can share one pin
  • ±0.5°C Accuracy from -10°C to +85°C
  • Temperature-limit alarm system
  • Query time is less than 750ms
  • Usable with 3.0V to 5.5V power/data

Downloads: DS18B20 Datasheet

The DS18B20 temperature sensor is a one-wire digital temperature sensor. This means that it just requires one data line (and GND) to communicate with the Arduino.

Because they are digital, you don't get any signal degradation even over long distances! These 1-wire digital temperature sensors are fairly precise (±0.5°C over much of the range) and can give up to 12 bits of precision from the onboard digital-to-analog converter. They work great with any microcontroller using a single digital pin, and you can even connect multiple ones to the same pin, each one has a unique 64-bit ID burned in at the factory to differentiate them. Usable with 3.0-5.0V systems.

The only downside is they use the Dallas 1-Wire protocol, which is somewhat complex, and requires a bunch of code to parse out the communication.

Get started by using the Dallas Temperature Control Arduino library which requires also the OneWire Library.

Pre-wired and waterproofed version of the DS18B20 sensor.

Handy for when you need to measure something far away, or in wet conditions.

NOTE:

4.7k resistor  required as a pullup from the DATA to VCC line when using the sensor.

RTD_Digital_MAX31865

Picture
max31865

The MAX31865 is default configured for a 4 wire RTD.

If you are using a  3 wire RTD you need to solder together the open solder connections marked 2/3 wire and the 4/3 connection marked 243. Or the easiest is to use a jumper wire on the terminal blocks.

If you are using a  2 wire RTD just short the two terminal blocks.

Wire the power from the arduino to the same VCC and GND pins on each.

Connect the CLK pin to Digital #13 but any pin can be used later

Connect the SDO pin to Digital #12 but any pin can be used later

Connect the SDI pin to Digital #11 but any pin can be used later

Connect the CS pin Digital #10 but any pin can be used later

Adafruit MAX31865 RTD PT100 or PT1000 Amplifier

 

 

DHT 22 Temp & Humidity

Picture
DHT22 wiring

DHT22

Good for 0-100% humidity readings with 2-5% accuracy

Good for -40 to 80°C temperature readings ±0.5°C accuracy

No more than 0.5 Hz sampling rate (once every 2 seconds)

This is a thermistor ( temperature varying resistor ) with a capacitor for humidity.

You will want to place a 10 Kohm resistor between VCC and the data pin, to act as a medium-strength pull up on the data line. The Arduino has built in pullups you can turn on but they're very weak, about 20-50K

Using a DHTxx Sensor

Download 2 library zips for Arduino IDE:

You will need to install the DHT sensor library  :

/DHT-sensor-library

You will also need to install the Adafruit_Sensor library :

adafruit/Adafruit_Sensor

 

 

TMP 36

Picture
tmp36

TMP36

Because these sensors have no moving parts, they are precise, never wear out, don't need calibration, work under many environmental conditions, and are consistant between sensors and readings. Moreover they are very inexpensive and quite easy to use.

Temperature range: -40°C to 150°C / -40°F to 302°F

Output range: 0.1V (-40°C) to 2.0V (150°C) but accuracy decreases after 125°C

A simple 3 wire connection.

#1) 2.7 to 5.5VDC VCC

#2) Analog voltage out (A0)

#3) GND

These sensors use a solid-state technique to determine the temperature. They use the fact as temperature increases, the voltage across a diode increases at a known rate. (Technically, this is actually the voltage drop between the base and emitter - the Vbe - of a transistor.) By precisely amplifying the voltage change, it is easy to generate an analog signal that is directly proportional to temperature.

Temp in °C = [(Vout in mV) - 500] / 10

So for example, if the voltage out is 1V that means that the temperature is ((1000 mV - 500) / 10) = 50 °C

Using TMP36 by adafruit

MAX6675 K-Thermocouple

Picture
MAX6675 with thermocouple

Measuring temperatures is one of the basics of most process controls.Thermocouples have been used  for a long time.Thermocouples consist of two dissimilar metal wires joined at a hot junction; as temperature changes, a millivolt signal is generated. The most common alloy combinations are known as type J and type K thermocouples.

Type K Temperature Range: Thermocouple grade wire, –454 to 2,300F (–270 to 1260C)

Advantages of thermocouple sensors include: low cost, small size, wider temperature ranges and faster response than RTDs.

The disadvantages of using temperature thermocouples include: they are less linear and accurate than RTDs, a matching extension wire is needed, and thermocouples are sensitive to electrical noise.

To read the millivolt signal and compensate for the non-linearity, we need to use the MAX6675.

The MAX6675 performs cold-junction compensation and digitizes the signal from a type-K thermocouple.The data is output in a 12-bit resolution, SPI-compatible, read-only format.

Arduino library for interfacing with MAX6675 thermocouple amplifier

NOTE:

MAX6675 temperature range 0 to 1023 Celcius

MAX31855 temperature range -200 to 1350 Celcius

Order MAX31855

 

Tutorials

Here are some helpful tutorials on some the systems available with Scada123 to try on your own.

You can view videos at:     Youtube Channel Scada LLC

Sort through Topics on the left Menu "Tutorial Menu"

Click on one the Topic Tags that interest you.

License : All programs in the tutorial section are 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.