Arduino is an open-source hardware and software company, project and user community that designs and manufactures single-board microcontrollers and microcontroller kits for building digital devices.

Its hardware products are licensed under a CC-BY-SA license, while software is licensed under the GNU Lesser General Public License (LGPL) or the GNU General Public License (GPL) permitting the manufacture of Arduino boards and software distribution by anyone.

Arduino boards are available commercially from the official website or through authorized distributors.

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.

Arduino General Info

Arduino has many low cost microprocessors.( Uno, Mega, Due. . . )

The Arduino Home Site can be found at:

https://www.arduino.cc/

Arduino is a nice simple solution for many C programming ( C++ if you want ) automation projects, so we will begin with this.

There are many different Arduino boards depending on your desires.

Arduino is a microcontroller with limited memory ( Uno 32k ,Mega 256K, Due 512K).

The I/O is limited, but sufficient if you think of it as a dedicated sub process.

The Analog inputs have a 10 bit (1024) DAQ for input and the PWM output can be filtered for a near analog constant value.

Digital inputs are made for ( 0-5 VDC for Uno & Mega 0-3.3VDC Due) and Digital Outputs can all be ON/OFF limited 40mA current with a PWM output option for several designated outputs.

A great starting point for anyone learning Arduino:

Topic: Useful links - check here for reference posts / tutorials

 

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

LCD 1602 Keyboard Shield

Picture

This is a simple example of a LCD 16 character 2 line (1602) shield that mounts directly on an Uno or Mega.

This also has an addition benefit of 5 built in buttons with built in series resistors that all use the A0 input.

The buttons use a series of resistors that act as voltage dividers giving each button a unique voltage.

Since resistors do vary, you will need to run the program (Keys_1602shield) to set the voltage ranges.

In serial monitor, you will see the key and the bit integer value.

Write down these values.

In the program, set the break values between these measurements.

NOTE: this LCD shield wiring differs from some LCDs with the code:

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

Then run the LCD_KS_Menu program for a simple menu example.

Use the UP/Down to scroll the menu items.

Use the RIGHT button to set the Digital ouput.

Use the LEFT button to return to the menu and turn the output off.

 

Serial Monitor Basic PC to Arduino

Picture
Serial Monitor

Here is a basic USB PC - Arduino Interface via the Arduino IDE included Serial Monitor.
You can send single character commands to the Arduino program with the Serial Monitor SEND button
You will see the Arduino response in the Serial Monitor text display
The advantage is you can command the Arduino without any PC code.
The disadvantage is your portable Arduino needs to be attached to your PC with a 6 foot max USB cable
as you can see with the sendReading, you can still do other things too