17  Sensor Specifications

In 60 Seconds

Sensor specifications decode as follows: accuracy is closeness to true value (match to application needs – do not overpay), precision is repeatability (fixable only with hardware), resolution is the smallest detectable change (NOT the same as accuracy!), response time determines control loop speed, and operating range defines where the sensor works reliably. A $2 DHT11 suffices for home thermostats; a $50 PT100 RTD is needed for laboratory measurements.

Key Concepts
  • Full-Scale Output (FSO): The algebraic difference between the minimum and maximum output values when the sensor is exposed to the minimum and maximum of its specified measurement range
  • Nonlinearity: The maximum deviation of the sensor’s actual transfer function from the ideal straight line connecting the two endpoint calibration values; expressed as +-% FSO; cannot be corrected by simple two-point calibration
  • Hysteresis: The difference in sensor output when approaching the same measurand value from above versus below; caused by mechanical or magnetic memory effects; important for pressure and position sensors
  • Long-Term Stability (Drift): The change in sensor output over time under constant input conditions; expressed as % FSO per year; critical for sensors deployed years without recalibration
  • Zero-Point Offset: The non-zero output produced when the measurand is at zero or the minimum of the range; corrected by one-point calibration by subtracting the offset from all readings
  • Span: The algebraic difference between the highest and lowest values in the sensor’s measurement range; a temperature sensor with range -40 C to +125 C has a span of 165 C
  • Repeatability: The closeness of agreement between successive measurements under identical conditions within a short period; high repeatability is necessary but not sufficient for accuracy — the sensor may consistently repeat a biased value
  • Time Constant (tau): For first-order sensor dynamics, the time to reach 63.2% of the final value after a step input change; a sensor with tau = 10 s reaches 99% of its final value in approximately 46 s

Learning Objectives

After completing this chapter, you will be able to:

  • Interpret sensor datasheet specifications correctly
  • Distinguish between accuracy, precision, and resolution using real sensor examples
  • Calculate battery life based on sensor power consumption
  • Match sensor specifications to application requirements
  • Detect specification traps and select cost-effective sensor configurations

Sensor specifications are like the nutrition labels on food – they tell you exactly what you are getting. The most important ones are accuracy (how close to the true value), resolution (the smallest change it can detect), and range (the minimum and maximum values it can measure). A common beginner trap is confusing resolution with accuracy: a sensor can show many decimal places (high resolution) while still being far from the true value (low accuracy).

17.1 Prerequisites

17.2 Accuracy: How Close to Reality?

When you look at a sensor datasheet, you will see specifications like “+/-0.5C accuracy” or “2 second response time.” But what do these actually mean for your project? Let us start with the most important one: accuracy.

What it means: If the real temperature is 25.0C, a sensor with +/-0.5C accuracy might read anywhere from 24.5C to 25.5C.

When accuracy matters:

Application Required Accuracy Why Real-World Impact
Home thermostat +/-1C HVAC deadband is typically 1-2C Reading 22C vs 23C does not change comfort
Food storage monitoring +/-0.5C Health regulations require specific ranges 4C vs 5C could mean spoilage
Medical/laboratory +/-0.1C Small variations affect experiments/diagnoses 37.0C vs 37.2C matters for fever detection
Industrial process control +/-0.1C Chemical reactions sensitive to temperature Precision manufacturing requires tight control

Real cost of accuracy:

Different accuracy levels come with dramatically different price tags:

  • +/-2C sensor (DHT11): $2 - Good for basic home automation
  • +/-0.5C sensor (DHT22): $5 - Standard for IoT environmental monitoring
  • +/-0.2C sensor (SHT31): $15 - Industrial and scientific applications
  • +/-0.1C sensor (PT100 RTD Class AA): $50+ - Laboratory and precision manufacturing
Don’t Overpay for Accuracy You Don’t Need

Rule of thumb: Match sensor accuracy to your application’s decision threshold. A $50 precision sensor in a home thermostat is wasted money – the HVAC system itself has a 1-2C deadband, making sub-degree accuracy meaningless.

Decision Factors: Choose high-accuracy sensors when regulatory compliance requires documented calibration (cold chain, medical), or when process control decisions depend on 0.5C differences. Choose low-cost sensors for hobby projects, comfort-only applications with 2-3C deadband, or deployments with 50+ nodes where aggregate data matters more than individual precision.

17.3 Resolution: How Precise Are the Readings?

What it means: The smallest change the sensor can detect and report. Often specified in bits (8-bit, 10-bit, 12-bit, 16-bit).

Bits Steps Example: 0-100C Range Temperature Resolution
8-bit 256 steps 100C / 256 = 0.39C Can see 25.0C vs 25.4C
10-bit 1,024 steps 100C / 1024 = 0.098C Can see 25.0C vs 25.1C
12-bit 4,096 steps 100C / 4096 = 0.024C Can see 25.00C vs 25.02C
16-bit 65,536 steps 100C / 65536 = 0.0015C Can see 25.000C vs 25.002C (rounded)

Try it: ADC Resolution Calculator

Resolution Does Not Equal Accuracy!

A sensor can have high resolution but low accuracy:

  • DHT22: 0.1C resolution (appears precise) but +/-0.5C accuracy (actual error)
  • Reading might show: 25.3C
  • Actual temperature could be: 24.8C to 25.8C

High resolution just means the sensor reports many decimal places – it does not guarantee those decimals are correct!

17.4 Accuracy vs Precision: The Target Analogy

Minimum Viable Understanding: Accuracy vs Precision

Core Concept: Accuracy measures how close a reading is to the true value (systematic error), while precision measures how repeatable readings are (random error).

Why It Matters: A high-precision but low-accuracy sensor can be fixed with calibration. A low-precision sensor produces unreliable data that no amount of calibration can fix.

Key Takeaway: Prioritize precision over raw accuracy – you can calibrate out systematic errors, but you cannot eliminate random measurement noise without hardware changes.

The Four Scenarios:

Scenario Accuracy Precision Fix
High Accuracy, High Precision Excellent Excellent No fix needed
Low Accuracy, High Precision Poor (offset) Excellent Calibrate in software
High Accuracy, Low Precision Excellent (average) Poor (noisy) Hardware fix or averaging
Low Accuracy, Low Precision Poor Poor Replace sensor

17.5 Response Time: How Fast Does It React?

What it means: How quickly the sensor detects a change in the environment. Often specified as “time to 63% of final value” (one time constant, tau).

The Coffee Cup Test:

Imagine moving a temperature sensor from room air (22C) into hot coffee (80C). The temperature change is 58C. The response time specification (tau) is the time to reach 63% of this change:

  • 2-second response time (tau = 2s): Shows ~59C after 2 seconds (63% of 58C change), ~72C after 4 seconds (86%), ~77C after 6 seconds (95%), settles near 80C after ~10 seconds
  • 30-second response time (tau = 30s): Shows ~59C after 30 seconds, ~72C after 60 seconds, settles near 80C after ~150 seconds (2.5 minutes)

When response time matters:

Application Required Response Why Consequence of Slow Response
Fire detection <1 second Every second counts in emergencies Delayed alarm = loss of life/property
Smart oven control <10 seconds Temperature changes in minutes Overshoot/undershoot cooking temperature
HVAC control <30 seconds Room temperature changes slowly Slight comfort lag, minimal impact
Weather station <5 minutes Weather changes over hours Historical logging, trends not affected
Comparison of sensor response times showing how fast and slow sensors approach the final measured value through exponential decay curves with different time constants
Figure 17.1: Sensor response time comparison showing fast and slow sensors reacting to a step change, illustrating exponential approach to final value

Try it: Response Time Calculator

17.6 Operating Range: Where Can It Work?

What it means: The environmental conditions where the sensor functions correctly and provides accurate readings.

Example: DHT22 Temperature/Humidity Sensor

  • Operating temperature range: -40C to 80C
  • Storage range: -40C to 80C (same, but not measuring)
  • Humidity range: 0-100% RH (relative humidity)

Works great for:

  • Indoor climate control (15-30C, 30-70% RH)
  • Outdoor weather stations (-20 to 50C in most climates)
  • Refrigerator monitoring (0-8C)
  • Greenhouse automation (10-35C)

Will FAIL for:

  • Oven monitoring (200C) – far exceeds 80C maximum
  • Cryogenic storage (-196C liquid nitrogen) – below -40C minimum
  • Industrial steam systems (>100C)
Common Gotcha: Out-of-Range Operation

A sensor operating outside its range might not fail catastrophically – it often just reports wrong data. A DHT22 exposed to 90C will not explode, but it will report garbage readings or freeze at its maximum value.

17.7 Power Consumption: Battery Life Impact

Understanding sensor power consumption is critical for battery-powered IoT devices. Most sensors have two power states:

Sensor Active Power Sleep Power Reading Time Total Energy per Reading
DHT22 1.5 mA @ 3.3V 50 uA 2 seconds 3 mA-s (active only)
BME280 0.34 mA @ 3.3V 0.1 uA 0.5 seconds 0.17 mA-s active
DS18B20 1 mA @ 3.3V 1 uA 0.75 seconds 0.75 mA-s active
MQ-2 Gas 150 mA @ 5V 150 mA Continuous No sleep mode!

Battery life calculation example:

Scenario: Environmental monitoring node

  • Battery: 1500 mAh (CR123A lithium)
  • Reading interval: Every 5 minutes (288 readings/day)

With DHT22:

  • Active time/day: 288 readings x 2 sec = 576 seconds = 9.6 minutes = 0.16 hours
  • Active consumption: 0.16 hours x 1.5 mA = 0.24 mAh/day
  • Sleep consumption: 23.84 hours x 0.05 mA = 1.19 mAh/day
  • Total: ~1.43 mAh/day -> 1,049 days (2.9 years) battery life

With BME280:

  • Active time/day: 288 readings x 0.5 sec = 144 seconds = 0.04 hours
  • Active consumption: 0.04 hours x 0.34 mA = 0.014 mAh/day
  • Sleep consumption: 23.96 hours x 0.0001 mA = 0.002 mAh/day
  • Total: ~0.016 mAh/day -> 93,750+ days (theoretical; battery self-discharge limits real life to ~10 years)

Try it: Battery Life Calculator

Low-Power Sensor Selection Tips
  1. Avoid continuous-operation sensors (like many gas sensors) for battery applications
  2. Prioritize sensors with sleep modes – look for uA (microamp) not mA (milliamp) sleep current
  3. Digital sensors often beat analog – they can power down completely
  4. Consider reading frequency – do you really need readings every minute?

17.8 Worked Example: Cold Chain Monitoring

Scenario: A pharmaceutical distributor needs to monitor temperature during vaccine transport. Vaccines must stay between 2-8C. Regulatory requirement: continuous logging with alarms if temperature leaves the 2-8C range for more than 30 minutes.

Step 1 – Accuracy requirement: The 2-8C window is only 6C wide. If your sensor has +/-2C accuracy, a reading of 5C could mean anything from 3C to 7C. That is usable but gives only 2C of margin on each side. With +/-0.5C accuracy, a reading of 5C means 4.5-5.5C – much safer. Decision: Need +/-0.5C accuracy minimum.

Step 2 – Response time requirement: A vaccine cooler losing power warms at roughly 0.5-1C per hour. To detect a breach 30 minutes before the 8C limit, the sensor must detect a 0.5C change. With +/-0.5C accuracy, you need readings every 5 minutes to reliably distinguish a 0.5C/30-min trend from sensor noise. Decision: 5-minute reading interval or faster.

Step 3 – Operating range: Transport temperatures range from -20C (winter truck) to 45C (summer loading dock). The sensor must function across this range even though the monitored range is 2-8C. Decision: -40C to 80C operating range – DHT22 or DS18B20 both qualify.

Step 4 – Battery life: Transport duration is typically 1-3 days. With readings every 5 minutes, a CR2032 coin cell (225 mAh) powers a DS18B20 (1 mA active x 0.75s per reading, 1 uA sleep) for:

  • Active: 288 readings/day x 0.75s x 1mA = 0.06 mAh/day
  • Sleep: 23.94 hours x 0.001 mA = 0.024 mAh/day
  • Total: 0.084 mAh/day – 2,678 days theoretical (battery self-discharge is the limit, not sensor power)

Step 5 – Cost at scale: 500 shipments/month x 2 sensors each = 1,000 units.

Sensor Unit Cost Accuracy Interface Total (1,000 units)
DS18B20 $2.50 +/-0.5C 1-Wire $2,500
SHT31 $12 +/-0.2C I2C $12,000
PT100 RTD $45 +/-0.1C Analog $45,000

Decision: DS18B20 at $2.50 per unit. Its +/-0.5C accuracy meets the regulatory requirement, 1-Wire interface allows daisy-chaining multiple sensors in one cooler, and the ultra-low sleep current means disposable units are practical. The SHT31 offers better accuracy but at 5x the cost – unnecessary when the regulatory window is 6C wide.

17.9 Worked Example: Smart Agriculture Soil Monitoring

Scenario: A vineyard deploys 500 soil moisture sensors across 50 hectares. Each sensor node runs on solar power with a backup coin cell. The agronomist needs to detect when soil moisture drops below 25% volumetric water content (VWC) to trigger irrigation.

Step 1: Define what “good enough” means

The irrigation system has a 5% deadband (triggers at 25%, stops at 30%). This means the sensor only needs to reliably distinguish “below 25%” from “above 30%.” A sensor with +/-3% VWC accuracy could read 28% when the true value is 25% – missing the irrigation trigger. With +/-1% VWC accuracy, a reading of 26% reliably means “between 25-27%.”

Decision: Need +/-2% VWC accuracy or better.

Step 2: Evaluate candidates

Spec Capacitive ($8) TDR ($120) Resistive ($3)
Accuracy +/-2% VWC +/-0.5% VWC +/-5% VWC
Response time 2 seconds 0.1 seconds 10 seconds
Soil contact req. Good contact Probe insertion Probe insertion
Calibration needed Per soil type Factory calibrated Per soil type
Lifespan (in soil) 3-5 years 10+ years 6-12 months (corrosion)
Power consumption 15 mA active, 5 uA sleep 50 mA active, 10 uA sleep 20 mA active, 0 uA (off)

Step 3: Hardware and Calibration Cost over 5 years (500 sensors)

Cost Component Capacitive TDR Resistive
Hardware (500 units) $4,000 $60,000 $1,500
Replacements (5 years) $0 $0 $6,000 (replace yearly x4)
Per-soil calibration labor $2,500 (once) $0 $12,500 ($2,500/year x5)
5-year total $6,500 $60,000 $20,000

Note: This table covers hardware and calibration only. Field visit labor adds significantly to resistive sensor costs – see the detailed TCO analysis below.

Decision: Capacitive sensors at $8 each. The +/-2% accuracy is sufficient for a 5% irrigation deadband, and the 3-5 year lifespan avoids the recurring replacement cost of resistive sensors. TDR offers superior accuracy but at 15x the hardware cost – unnecessary when the irrigation system cannot act on sub-2% differences anyway.

Why NOT resistive? Despite being cheapest per unit, corrosion in wet soil means annual replacement. With 500 sensors, that is 500 field visits per year. Even at a modest $5 labor per visit, that adds $2,500/year in field labor on top of $1,500/year in replacement hardware. The “cheap” option costs over 3x more than capacitive over 5 years when you include calibration.

17.10 The Hidden Cost of Sensor Replacement at Scale

The agriculture example above illustrates a broader pattern. When evaluating sensor specifications, total cost of ownership over the deployment lifetime often matters more than unit price:

Cost Factor Cheap Sensor ($3 resistive) Mid-Range Sensor ($8 capacitive) Premium Sensor ($45 TDR)
Unit cost (500 sensors) $1,500 $4,000 $22,500
Lifespan in soil 6-12 months (corrosion) 3-5 years 10+ years
Replacements over 5 years 2,000 units ($6,000) 0 units ($0) 0 units ($0)
Field visit cost per replacement $50/visit x 2,000 = $100,000 $0 $0
Recalibration visits $25/visit x 500/year x 5 = $62,500 $25/visit x 500 x 1 = $12,500 $0 (factory calibrated)
5-year total $170,000 $16,500 $22,500
Per-sensor-year $68 $6.60 $9.00

The $3 sensor costs $68 per sensor-year. The $45 premium sensor costs $9.00 per sensor-year. Field visits are the dominant cost – not hardware. This pattern repeats across nearly every outdoor IoT deployment: the cheapest sensor is rarely the cheapest system.

Total cost of ownership reveals counterintuitive economics. For 500 sensors over 5 years:

\[\text{Cost per sensor-year} = \frac{\text{Unit cost} + \text{Replacements} + \text{Field visits} + \text{Calibration}}{500 \times 5}\]

Cheap sensor ($3): \(\frac{1{,}500 + 6{,}000 + 100{,}000 + 62{,}500}{2{,}500} = \$68\)/sensor-year

Premium sensor ($45): \(\frac{22{,}500 + 0 + 0 + 0}{2{,}500} = \$9.00\)/sensor-year

Field visits at $50 each dominate costs. The $42 premium for a durable sensor pays for itself in 0.84 avoided field visits – less than one replacement over 5 years.

Sammy the Sensor had some confusing numbers on his datasheet, and the Squad helped him understand them.

“Accuracy means how CLOSE to the real answer you are,” explained Max the Microcontroller. “If the real temperature is 25 degrees and you say 25.4, you are off by 0.4 – that is your accuracy error.”

“But what about resolution?” asked Lila the LED. Max drew a picture: “Resolution is how many decimal places you can report. A sensor with 0.1 degree resolution can say 25.1 or 25.2 but NOT 25.15. More resolution means more decimal places.”

“HERE IS THE TRICKY PART!” Sammy shouted. “High resolution does NOT mean high accuracy! I can report 25.37 degrees (lots of decimals!) but still be wrong by 2 degrees. It is like a clock that shows seconds but is 5 minutes slow – very precise display, but inaccurate time!”

Bella the Battery cared most about power: “Active power is what the sensor uses when measuring. Sleep power is what it uses when resting. For battery life, sleep power matters MORE because sensors spend 99% of their time sleeping!”

“Response time is how fast I react,” Sammy added. “For a fire alarm, I need to react in less than 1 second. For a weather station, a few minutes is fine. Do not buy a sports car when a bicycle will do!”

Max summed it up: “Match the specs to your project. A $50 laboratory sensor in a home thermostat is like wearing a spacesuit to the grocery store – technically works, but way overkill!”

17.11 Summary

Key takeaways for sensor specifications:

  1. Match accuracy to application – do not overpay for precision you do not need
  2. Resolution is not accuracy – high resolution with poor accuracy gives false confidence
  3. Bias (accuracy error) can be calibrated out; poor precision cannot – prioritize repeatable hardware
  4. Response time matters for control loops – fast for safety, slow is acceptable for logging
  5. Operating range must cover all conditions – including environmental extremes
  6. Power consumption dominates battery life – check sleep current, not just active current
  7. Total cost of ownership beats unit price – field visits dominate deployment costs at scale

17.12 Try It Yourself

Scenario: Design the sensor system for a 500 m2 commercial greenhouse growing tomatoes. The system must monitor temperature, humidity, and soil moisture across 20 zones.

Requirements:

  • Temperature: Alert if any zone exceeds 18-28C range
  • Humidity: Track trends, no critical alerts
  • Soil moisture: Trigger irrigation at 25% VWC threshold
  • Battery-powered nodes (solar trickle charge)
  • 10-minute reading interval
  • 5-year deployment lifetime

Your Task: For each measurement type, specify:

  1. Required accuracy (with justification)
  2. Acceptable response time
  3. Maximum power budget per reading
  4. Sensor recommendation with cost
Hint: Start with the decision thresholds
  • Temperature: 18-28C range with alert = need to detect when crossing threshold
  • If sensor has +/-2C accuracy, reading of 27C could mean 25-29C (threshold unclear!)
  • What accuracy ensures reliable threshold detection?

For power budget:

  • 10-min interval = 144 readings/day
  • 5-year life = 262,800 readings total
  • Solar provides ~50 mAh/day average (cloudy winter days)
  • How much can each reading consume?
Solution: Greenhouse Sensor Specification

Temperature Sensors (20 nodes):

Requirement Specification Reasoning
Accuracy +/-0.5C 18-28C range with alert. +/-2C sensor at 27C could be 25-29C (unreliable). +/-0.5C at 27C = 26.5-27.5C (safe margin).
Response time <60 seconds Temperature changes slowly in greenhouses (minutes/hours). 1-minute response adequate for HVAC control.
Resolution 0.1C Sufficient for trend tracking. Higher resolution wasted (accuracy is +/-0.5C anyway).
Power budget <1 mAh per reading Solar provides ~50 mAh/day. Temperature sensor: 1.5 mA for 2 sec = 0.83 uAh. Sleep: 50 uA x 598 sec = 8.3 uAh. Total: 9.1 uAh = 0.0091 mAh.
Recommendation DHT22 $5/unit x 20 = $100. Accuracy +/-0.5C, response 2 sec, power 1.5 mA active. Meets all requirements at lowest cost.

Alternative: SHT31 (+/-0.2C, $15) offers better accuracy but unnecessary when decision threshold is 10C wide.

Humidity Sensors (20 nodes, same DHT22):

Requirement Specification Reasoning
Accuracy +/-5% RH Trend tracking only, no alerts. +/-5% adequate for identifying “getting drier” vs “getting wetter” patterns.
Response time <5 minutes Humidity changes slowly. Hourly trends matter more than instant values.
Power budget Shared with temperature DHT22 measures both in single reading. No additional power cost.
Recommendation DHT22 Already selected for temperature. “Free” humidity measurement.

Soil Moisture Sensors (60 sensors: 3 per zone):

Requirement Specification Reasoning
Accuracy +/-2% VWC Irrigation triggers at 25% VWC. +/-5% sensor at 25% could be 20-30% (unreliable). +/-2% = 23-27% (acceptable margin).
Response time <10 minutes Soil moisture changes over hours/days. 10-minute reading interval is sufficient.
Lifespan 3-5 years in soil Resistive sensors corrode in 6-12 months. Capacitive sensors last 3-5 years (budget for partial replacement in year 4-5). TDR lasts 10+ years.
Power budget <0.5 mAh per reading 15 mA for 2 sec = 8.3 uAh active. Sleep <5 uA. Total: ~8.3 uAh = 0.0083 mAh.
Recommendation Capacitive sensor $8/unit x 60 = $480. Accuracy +/-2%, 3-5 year life. TDR ($120/unit = $7,200) is 15x more expensive for minimal benefit when threshold is 25% +/-2%.

Total System Cost:

  • Temperature/Humidity: $100 (20x DHT22)
  • Soil Moisture: $480 (60x capacitive)
  • Total sensors: $580

Key Insight: The 10C temperature range (18-28C) allows using a $5 DHT22 instead of a $15 SHT31. The 5% moisture deadband (irrigation on at 25%, off at 30%) allows $8 capacitive sensors instead of $120 TDR. Matching sensor specs to actual decision thresholds saves over $6,900 in hardware ($7,500 for SHT31+TDR vs $580 for DHT22+capacitive) while meeting all functional requirements.

Common Pitfalls

Accuracy expressed as +-1% of full scale on a 0-100 C sensor means +-1 C anywhere in the range. Accuracy as +-1% of reading means +-0.1 C at 10 C but +-1.0 C at 100 C. These are fundamentally different error models — clarify which interpretation applies before error budgeting.

A sensor with 0.5% FSO hysteresis produces different outputs when heating versus cooling through the same set-point temperature. A thermostat using this sensor without software deadband will oscillate around the set-point. Add a deadband at least as wide as the sensor’s hysteresis specification.

A sensor specified as accurate +-1% from 0-60 C has no accuracy guarantee outside that range, even if the output appears reasonable. Operating outside rated conditions may produce plausible-looking values that are actually far outside specification. Design appropriate out-of-range alarms.

Response time is how quickly the sensor’s physical element tracks a change. Sampling rate is how fast the MCU reads the output. Sampling at 10 Hz with a sensor time constant of 30 s captures 10 readings per second of a slowly-changing signal — but you still cannot detect events faster than the sensor’s physical response, regardless of sampling rate.

17.13 What’s Next

Now that you can interpret sensor specifications and match them to application requirements:

Chapter Description
Signal Processing Apply filtering and noise reduction to raw sensor readings
Calibration Techniques Correct systematic errors using calibration procedures
Common IoT Sensors Explore popular sensors and MEMS devices with real datasheets
Sensor Interfacing Protocols Connect sensors using analog, I2C, SPI, and UART interfaces
Sensor Selection Guide Apply a structured decision framework for choosing sensors
Datasheets Read and interpret real-world sensor datasheets

Continue to Signal Processing ->