Temperature Sensors
LoopString supports six categories of temperature sensors, from $4 hobby sensors to industrial-grade RTD probes accurate to ±0.1°C. This guide helps you pick the right one, wire it up, and configure it in the Configurator.
All sensors read in Celsius by default. Your dashboard will convert to Fahrenheit or Kelvin automatically based on your unit preferences (Settings → Units).
Choosing a Sensor
Not sure which sensor to use? Start here:
- Outdoor air or soil temperature → DS18B20 (waterproof probe, runs through long cable runs)
- Indoor ambient air, grow rooms, HVAC → SHT31-D (most accurate for air, ±0.3°C)
- All-in-one air quality (temp + humidity + pressure + VOC) → BME680
- Budget indoor temperature + humidity → DHT22
- Industrial liquid or process temperature → PT100 RTD via Sequent RTD HAT
- High-temperature surfaces: kettles, smokers, ovens, forges → MAX31855 with K-type thermocouple
DS18B20 Waterproof Temp Probe
Part ID: ds18b20-1wire | Interface: 1-Wire | Estimated cost: ~$6
The DS18B20 is the go-to sensor for outdoor and liquid temperature monitoring. It comes in a sealed stainless steel probe that you can submerge in soil, water, or nutrient solution. Multiple probes can share a single GPIO pin on the same wire.
Specifications:
- Range: -55°C to +125°C
- Accuracy: ±0.5°C from -10°C to +85°C
- Interface: 1-Wire (single data wire)
- Power: 3.3V
Wiring the DS18B20
- Power off your Pi before connecting any wires.
- Red wire (VCC) → Pi 3.3V (Pin 1)
- Black wire (GND) → Pi GND (Pin 6)
- Yellow/white wire (DATA) → GPIO 4 (Pin 7)
- Add a 4.7kΩ resistor between the DATA wire and 3.3V. This pullup resistor is mandatory — without it, the sensor will always report 85°C (its error value).
If you are connecting multiple DS18B20 probes, all DATA wires connect to the same GPIO pin with a single shared pullup resistor.
Enable 1-Wire on the Pi: Open a terminal and run sudo nano /boot/config.txt. Add the line dtoverlay=w1-gpio at the bottom, save, then reboot.
Configuration Fields
- GPIO Pin (BCM) — The GPIO pin number where the DATA wire is connected. Default:
4. GPIO 4 (Pin 7) is the Linux kernel default for 1-Wire. - Sensor ROM ID — The unique 64-bit address of this probe. Format:
28-xxxxxxxxxxxx. To find yours, runls /sys/bus/w1/devices/on the Pi after wiring — each probe shows up as a folder starting with28-. Copy that folder name here. - Sample Interval — How often to read the probe. Default:
30 seconds. Minimum: 1 second (12-bit conversion takes ~750ms).
DHT22 / DHT11 Temperature & Humidity Sensor
Part ID: dht22-gpio | Interface: GPIO (single-wire) | Estimated cost: ~$4
The DHT22 is a low-cost combined temperature and humidity sensor. It outputs two signals: temperature and humidity. The Configurator supports both DHT22 (recommended) and DHT11 (budget). This sensor is slower than I2C sensors — it can only take a reading every 2 seconds minimum.
Specifications (DHT22):
- Temperature range: -40°C to +80°C
- Temperature accuracy: ±0.5°C
- Humidity range: 0–100% RH
- Humidity accuracy: ±2–5% RH
- Interface: Single GPIO pin with built-in single-wire protocol
- Power: 3.3V
DHT11 (budget option): Narrower range (0–50°C), lower accuracy (±2°C / ±5% RH). Only use DHT11 if cost is the primary constraint.
Wiring the DHT22
- Power off your Pi before connecting any wires.
- VCC → Pi 3.3V (Pin 1)
- GND → Pi GND (Pin 6)
- DATA → your chosen GPIO pin (default: GPIO 4, Pin 7)
- Add a 10kΩ resistor between DATA and 3.3V. Without this pullup resistor, you will get frequent checksum errors and missing readings.
Configuration Fields
- DHT Model — Select
DHT22(recommended) orDHT11(budget). Default:DHT22. - GPIO Pin (BCM) — GPIO pin number where the DATA wire is connected. Default:
4. Valid range: 2–27. - Sample Interval — How often to read. Default:
30 seconds. Minimum:2 seconds(the DHT22 hardware limitation).
SHT31-D Temperature & Humidity
Part ID: sht31-i2c | Interface: I2C | Estimated cost: ~$9
The SHT31-D from Sensirion is the highest-accuracy ambient air sensor in the LoopString library. At ±0.3°C and ±2% RH, it is well suited for precision grow room VPD monitoring, food storage, and any application where sensor drift would cause control problems. It communicates over I2C, so it only needs 4 wires and no pullup resistors (the Pi's I2C bus has built-in pullups).
Specifications:
- Temperature range: -40°C to +125°C
- Temperature accuracy: ±0.3°C
- Humidity accuracy: ±2% RH
- Interface: I2C
- Power: 3.3V only — do not connect to 5V
Wiring the SHT31-D
- Power off your Pi.
- VDD → Pi 3.3V (Pin 1)
- VSS → Pi GND (Pin 6)
- SDA → Pi GPIO 2 (Pin 3)
- SCL → Pi GPIO 3 (Pin 5)
- ADDR pin → Leave connected to GND for address 0x44, or connect to VCC for address 0x45.
I2C is a bus — you can connect multiple I2C sensors to the same SDA/SCL pins simultaneously, as long as they all have different addresses.
Enable I2C on the Pi: Run sudo raspi-config, go to Interface Options → I2C, and enable it. Reboot.
Configuration Fields
- I2C Bus — Almost always
1(the main I2C bus on GPIO 2/3). Default:1. - I2C Address —
0x44when the ADDR pin is connected to GND (default), or0x45when connected to VCC. Changing this lets you connect two SHT31 sensors to the same Pi. - Sample Interval — How often to read. Default:
30 seconds. Minimum:1 second.
BME680 Temp / Humidity / Pressure / VOC
Part ID: bme680-i2c | Interface: I2C | Estimated cost: ~$18
The BME680 from Bosch is a four-in-one environmental sensor: temperature, humidity, barometric pressure, and a VOC (volatile organic compound) gas index for indoor air quality (IAQ). If you want a single sensor that covers all basic environmental parameters, the BME680 is the right choice.
Note: The LoopString parts library uses the BME680 (which includes VOC sensing). The BME280 (an older Bosch sensor without VOC) is not in the current parts library. If you have a BME280 breakout, use the BME680 part and it will read temperature and humidity correctly — pressure will also work, and the IAQ output will be inactive.
Specifications:
- Temperature accuracy: ±1°C
- Humidity accuracy: ±3% RH
- Pressure accuracy: ±1 hPa
- Outputs: Temperature, Humidity, Pressure, IAQ index
- Interface: I2C
- Power: 3.3V
Wiring the BME680
- Power off your Pi.
- VCC → Pi 3.3V (Pin 1)
- GND → Pi GND (Pin 6)
- SDA → Pi GPIO 2 (Pin 3)
- SCL → Pi GPIO 3 (Pin 5)
- SDO pin → Connect to GND for address 0x76, or to VCC for address 0x77.
Configuration Fields
- I2C Bus — Default:
1. - I2C Address —
0x76(SDO → GND, default) or0x77(SDO → VCC). - Sample Interval — How often to read all parameters. Default:
60 seconds. Minimum:1 second. Note that the VOC/IAQ index requires a warmup period of several minutes after first power-on to produce meaningful readings.
The BME680 produces four output ports in the flow editor: Temperature, Humidity, Pressure, and IAQ. You can wire each independently to different dashboard cards, PID controllers, or loggers.
PT100 RTD Temperature Probe (Waterproof)
Part ID: pt100-rtd-probe | Interface: Analog (via Sequent RTD HAT) | Estimated cost: ~$12 probe + ~$50 HAT
A PT100 is a platinum resistance thermometer — an industrial-grade sensor used in food processing, pharmaceutical, brewing, and HVAC applications. It measures resistance that changes predictably with temperature, giving you Class A accuracy of ±0.15°C. Unlike the DS18B20 or DHT22, a PT100 probe is a passive element that needs an interface board to read it digitally.
LoopString uses the Sequent Microsystems RTD HAT (sm-rtd-hat) or 8 RTD HAT (sm-8rtd-hat) as the interface board. These HATs plug directly onto the Pi's 40-pin header and can read 8 PT100 or PT1000 probes each. Up to 8 HATs can be stacked (64 channels total).
Specifications:
- Range: -50°C to +200°C (PT100 probe) | -200°C to +765°C possible with HAT
- Accuracy: Class A ±0.15°C at 0°C
- Interface: Screw terminal block on Sequent HAT (I2C to Pi)
- Power: Powered by HAT (Pi 5V rail)
Wiring the PT100
- Power off your Pi and install the Sequent RTD HAT on the 40-pin GPIO header.
- Connect the 3-wire PT100 probe to the screw terminal block on the HAT for your chosen channel (CH1–CH8). The three wires connect to: RTD+, RTD−, and REF (the compensation wire).
- For 2-wire probes, connect the two wires to RTD+ and RTD−, leaving REF unconnected.
- Power on the Pi.
Configuration Fields
- Sequent HAT Stack Level — The stack level set by solder jumpers on the HAT (0–7). If you have only one HAT, set this to
0. Default:0. - RTD Channel — Which channel on the HAT the probe is connected to (1–8). Default:
1. - RTD Type —
PT100(most common) orPT1000(better for long cable runs, higher resistance). Default:PT100. - Sample Interval — How often to read. Default:
30 seconds. Minimum:1 second.
MAX31855 K-Type Thermocouple Amplifier (SPI)
Part ID: max31855-spi | Interface: SPI | Estimated cost: ~$15 breakout + $5–20 thermocouple
The MAX31855 is an SPI amplifier board that reads K-type thermocouples. K-type thermocouples can measure up to 1350°C — far beyond any other sensor in this library. This makes them the right choice for high-temperature applications: BBQ smokers, pizza ovens, brewing kettles, kilns, and industrial furnaces.
A K-type thermocouple is a pair of dissimilar metal wires (usually yellow jacket: positive is yellow, negative is red in US standard) that you attach directly to the surface or insert into the medium you want to measure.
Specifications:
- Range: -200°C to +1350°C (K-type thermocouple)
- Accuracy: ±2°C
- Cold-junction compensation: Built into MAX31855 chip
- Interface: SPI (4 wires)
- Power: 3.3V only — do not connect to 5V
- Fault detection: Open circuit, short to VCC, short to GND
Wiring the MAX31855
- Power off your Pi. The MAX31855 operates at 3.3V — do not use the 5V rail.
- VCC → Pi 3.3V (Pin 1)
- GND → Pi GND (Pin 6)
- CLK → Pi GPIO 11 / SPI0 SCLK (Pin 23)
- DO (Data Out) → Pi GPIO 9 / SPI0 MISO (Pin 21)
- CS (Chip Select) → Pi GPIO 8 / CE0 (Pin 24) for SPI channel 0, or GPIO 7 / CE1 (Pin 26) for channel 1
- Connect the K-type thermocouple to the screw terminals on the MAX31855 breakout board. Polarity matters: positive wire (yellow in US standard) to the positive terminal.
For two thermocouples, use two MAX31855 boards sharing CLK and DO, but with separate CS wires (CE0 and CE1).
Enable SPI on the Pi: Run sudo raspi-config, go to Interface Options → SPI, and enable it. Reboot.
Configuration Fields
- SPI Chip-Enable Channel —
CE0(GPIO 8, Pin 24) orCE1(GPIO 7, Pin 26). Default:CE0. If you only have one thermocouple, use CE0. - Sample Interval — How often to read. Default:
5 seconds. Minimum:1 second. The MAX31855 needs ~100ms per conversion; 5 seconds is recommended for stability.
Real-World Use Cases
Use Case 1: Mushroom Fruiting Room
A small-scale mushroom farm uses a Raspberry Pi 4B to monitor and control a converted refrigerator used as a fruiting chamber.
Sensors used:
- SHT31-D for ambient air temperature and humidity (high accuracy needed for VPD control)
- DS18B20 probe inserted into the substrate block to track internal colonization temperature
Configuration:
- SHT31-D: I2C address 0x44, sample every 30 seconds, wired to SDA/SCL
- DS18B20: GPIO 4, 4.7kΩ pullup, sample every 60 seconds, ROM ID discovered via
ls /sys/bus/w1/devices/ - Both connected to a PID controller targeting 18°C fruiting temperature with a relay-controlled heater
Why this combination: The SHT31 gives accurate ambient readings for the PID. The DS18B20 gives substrate temperature as a secondary diagnostic — it lags behind ambient but shows you whether the block itself is warming up.
Use Case 2: BBQ Smoker Pit Controller
A competition BBQ team instruments their offset smoker to maintain a precise 225°F (107°C) pit temperature and monitor meat internal temperature.
Sensors used:
- Two MAX31855 boards with K-type probes: one in the smoke chamber (pit temperature), one inserted into the meat
- A SG90 servo controlling the intake vent damper, driven by a PID controller
Configuration:
- Pit MAX31855: SPI CE0, sample every 5 seconds
- Meat MAX31855: SPI CE1, sample every 5 seconds
- PID controller: pit temperature as process variable, 107°C setpoint, servo as output
Why this works: Standard thermistors max out around 125°C — useless for a smoker running at 250°C+ fire box temperatures. K-type thermocouples handle 1350°C with ease. The cold-junction compensation built into the MAX31855 means you get accurate readings even as the Pi's ambient temperature changes.
Troubleshooting
DS18B20 always reads 85°C
85°C is the power-on reset value for the DS18B20 — it means the sensor is not being read successfully.
- Check that the 4.7kΩ pullup resistor is installed between DATA and 3.3V. This is the most common cause.
- Confirm
dtoverlay=w1-gpiois in/boot/config.txtand the Pi was rebooted after adding it. - Verify the ROM ID in the Configurator matches exactly what
ls /sys/bus/w1/devices/shows on the Pi. - Try a different GPIO pin if GPIO 4 is shared with another device.
DHT22 shows "invalid data" or missing readings
- The DHT22 minimum sample interval is 2 seconds. Do not set the interval below 2000ms.
- Add or verify the 10kΩ pullup resistor between DATA and 3.3V.
- DHT22 sensors are sensitive to wire length. Keep the DATA wire under 20m, or switch to a DS18B20 for longer runs.
- If readings appear occasionally but not reliably, try a 4.7kΩ resistor instead of 10kΩ — some breakout boards work better with a lower value.
- The DHT22 can fail in very high humidity environments (condensation inside the sensor). Use the SHT31-D for humid environments.
SHT31-D / BME680 not detected on I2C
- Run
i2cdetect -y 1on the Pi (install withsudo apt install i2c-tools). You should see the sensor address (0x44, 0x76, etc.) appear in the grid. If it does not appear, the sensor is not wired correctly or I2C is not enabled. - Confirm I2C is enabled:
sudo raspi-config→ Interface Options → I2C → Enable. - Check for loose connections on SDA (GPIO 2, Pin 3) and SCL (GPIO 3, Pin 5).
- If two I2C sensors show the same address, change the address of one using its ADDR or SDO pin.
MAX31855 reads a very large negative number or shows fault
- A very large negative temperature (e.g., -1000°C) means the MAX31855 detected a thermocouple fault.
- Check the thermocouple connections at the screw terminals. An open-circuit fault means the thermocouple wire is not making contact.
- Verify polarity — positive wire to the positive terminal.
- Ensure the MAX31855 is powered from 3.3V, not 5V.
- Enable SPI on the Pi:
sudo raspi-config→ Interface Options → SPI → Enable, then reboot.
PT100 reads wildly inaccurate temperatures
- Verify the RTD probe type (PT100 vs PT1000) matches the configuration field setting. A PT1000 configured as PT100 will read approximately 10x off.
- For 3-wire probes, ensure the compensation (REF) wire is connected. A missing REF wire causes lead resistance errors.
- Check the Sequent HAT stack level — if two HATs are installed at the same stack level, they will conflict on the I2C bus.
Known Limitations
- DHT22 minimum sample rate: 2 seconds. Faster reads will result in invalid data and missed readings. If you need sub-second temperature sampling, use the SHT31-D or DS18B20.
- DS18B20 parasitic power mode is not supported. Always use 3-wire mode (VCC, GND, DATA + pullup resistor). Parasitic mode (2-wire, no VCC) produces unreliable readings with the current Node-RED driver.
- BME680 VOC/IAQ warmup: The IAQ index requires approximately 5 minutes of warmup time after power-on before it reports stable values. Temperature and humidity are available immediately.
- MAX31855 thermocouple type: Only K-type thermocouples are supported with the current Node-RED package. J-type, T-type, and other thermocouple types require a different amplifier (e.g., MAX31856).
- PT100 requires Sequent HAT: The
pt100-rtd-probepart is designed for use with the Sequent Microsystems RTD HAT. It does not work with generic MAX31865 SPI breakout boards without custom Node-RED configuration. - SHT31-D address conflict: Only two SHT31-D sensors can be connected to one Pi (addresses 0x44 and 0x45). For more sensors, use DS18B20 on the 1-Wire bus (supports up to 100 probes on one pin) or multiple Sequent RTD HATs.
Related Documentation
- Adding Rooms and Parts — How to add a sensor part to your Configurator project
- Wiring Flows — Connect sensor outputs to controllers and dashboard cards
- Deploying to Pi — Push your configured flow to the Raspberry Pi
- Controller Pairing Guide — Wire a temperature sensor to a PID or hysteresis controller