Sensors & Measurement · Study deck

Temperature Sensor Labs: Comparing Sensor Types

Picture a freezer sensor showing 85 C just after power returns.

Physics Phoebe is your guide for this deck.

sensortemperature
Physics Phoebe, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Interface DS18B20 sensors: Configure 1-Wire bus and read multiple temperature sensors on a single pin
  • Analyse thermocouple operation: Explain how thermocouples generate temperature-dependent voltages via the Seebeck effect and calculate output voltages using the Seebeck coefficient
  • Evaluate humidity sensors: Differentiate capacitive, resistive, and thermal conductivity sensing methods based on accuracy, response time, and application suitability
  • Construct temperature monitoring systems: Wire and program robust temperature acquisition circuits with correct pull-up resistors and multi-sensor addressing
iotclass.org

Major section

Start With the Measurement Story

The number is valid data but not a valid freezer reading.

  • The lab must separate a real temperature from a startup or link fault.
  • A cyclic redundancy check, or CRC, is a short code used to detect changed data.
  • General purpose input output, or GPIO, means a configurable pin on a small computer board.
iotclass.org

Major section

Start With the Measurement Story (continued)

This runway does not prove accuracy across every range or mounting condition.

  • The deeper sections compare sensor types, wiring, conversion timing, calibration, error codes, and heat-flow limits.
  • A temperature lab is not just a wiring exercise.
  • The useful story is heat moving through the sensor package, the reading lagging behind reality, and calibration evidence showing when the number can be trusted.
iotclass.org

Major section

Temperature Sensors Overview

In Figure: Lab checklist view, voltage, ground, GPIO choice, and pull-up presence are acceptance conditions before energising the circuit.

  • The first reading is then compared with a known reference rather than judged by plausibility alone.
  • This checklist turns the overview's broad loop into evidence you can record for every sensor in the chapter.

Why it matters

Those loops matter because firmware cannot compensate for every wiring fault, and calibration cannot legitimise an unstable interface.

Sensor Implementation Workflow: From Research to Deployment with Debug Loops
Sensor Implementation Workflow: From Research to Deployment with Debug Loops
iotclass.org

Major section

DS18B20 (1-Wire Digital Temperature)

The DS18B20 is one of the most popular digital temperature sensors for IoT projects.

  • It uses the 1-Wire protocol, which means multiple sensors can share a single GPIO pin -- each sensor has a factory-programmed unique 64-bit address that distinguishes it on the bus.

Numbers to remember

750 msThis takes up to 750 ms at 12-bit resolution

Why it matters

The shared wire works because addressing and conversion timing are explicit parts of the protocol.

A black TO-92 package DS18B20 temperature sensor with three metal leads, next to a short length of cable
A black TO-92 package DS18B20 temperature sensor with three metal leads, next to a short length of cable
iotclass.org

Major section

DS18B20 (1-Wire Digital Temperature) (continued)

That relationship explains how discovery, conversion delay, and per-device reads must be verified before several DS18B20s can share the bus reliably.

  • The DS18B20 stores temperature as a 16-bit signed integer in 12-bit resolution mode, where the lower 4 bits represent the fractional part and each LSB represents 0.0625C.
  • CRC error marker: The DallasTemperature library returns -127C (DEVICE_DISCONNECTED_C) when data integrity fails or the sensor is unreachable.
  • This takes up to 750 ms at 12-bit resolution, 375 ms at 11-bit, 187.5 ms at 10-bit, or 93.75 ms at 9-bit.
iotclass.org

Deck summary

Key takeaways

The number is valid data but not a valid freezer reading.

  • This runway does not prove accuracy across every range or mounting condition.
  • In Figure: Lab checklist view, voltage, ground, GPIO choice, and pull-up presence are acceptance conditions before energising the circuit.
  • The DS18B20 is one of the most popular digital temperature sensors for IoT projects.
  • That relationship explains how discovery, conversion delay, and per-device reads must be verified before several DS18B20s can share the bus reliably.
iotclass.org

Retrieval practice

Recall check

Physics Phoebe says: answer from memory, then check your reasoning.

Q1Several DS18B20 sensors share one GPIO. What lets the controller distinguish their readings?

AThe common supply voltage as an identity code
BThe order in which cable colors appear
CEach sensor’s unique stored address
DA separate ADC channel for each sensor
Show answer

Answer: C The chapter ties shared-bus discovery and per-device reads to individual digital identities.

Q2The lab sensor returns the documented incomplete-conversion value. What should the firmware check?

AWhether another sensor’s address can replace the result
BWhether conversion time elapsed before reading
CWhether the dashboard assigned a different color
DWhether to treat the value as a confirmed temperature
Show answer

Answer: B The troubleshooting table ties that result to reading before conversion completes.

iotclass.org

Print reference

Answers

Answer key.

  1. C · The chapter ties shared-bus discovery and per-device reads to individual digital identities.
  2. B · The troubleshooting table ties that result to reading before conversion completes.
iotclass.org