Chapters

5 Common Sensors and MEMS

sensors
sensor
types
common

5.1 Choose a Sensor for the Room

This section: Choose a Sensor for the Room — Imagine a smart room needs to know whether it is hot, bright, noisy, occupied, or unsafe.

Imagine a smart room needs to know whether it is hot, bright, noisy, occupied, or unsafe. The team must choose a sensor family for each real change. A smart room needs different evidence for heat, light, noise, occupancy, and a hazardous condition. Match each change to a sensor family, then test a specific part in the room; the family name cannot tell you whether placement, range, or drift will make its reading useful.

5.1.1 Match Each Condition to a Signal

  • Which room condition must the device report?
  • What physical signal can reveal that condition?
  • Will the chosen part respond across the room’s expected range?
  • How will a wrong, drifting, or missing reading be recognized?

Write down the condition, candidate sensor, placement, operating range, response time, and failure behaviour. A temperature sensor and an occupancy sensor should have separate tests because they support different claims.

5.1.2 When a Sensor Family Is Not Enough

A familiar sensor family is a starting point, not a guarantee at this site. The Practitioner depth checks particular devices and compensation needs.

5.2 Start With the Measurement Story

This section: Start With the Measurement Story — A smart-room prototype can sense motion, light, temperature, sound, gas, or orientation, but each family tells a different kind of story about the room.

A smart-room prototype can sense motion, light, temperature, sound, gas, or orientation, but each family tells a different kind of story about the room. The design starts by naming the change that matters and the sensor family that can observe it reliably.

Shows: A smart room matches six kinds of change to the right sensor family.
  1. Illustrated scene: A smart room may sense motion, light, heat, sound, gas, or tilt.

    A smart room may sense motion, light, heat, sound, gas, or tilt.

  2. Illustrated scene: Each sensor family tells a different story about the room.

    Each sensor family tells a different story about the room.

  3. Illustrated scene: Name the physical change and the setting where it must be seen.

    Name the physical change and the setting where it must be seen.

  4. Illustrated scene: Choose the family that can observe that change with clear proof.

    Choose the family that can observe that change with clear proof.

A smart room matches six kinds of change to the right sensor family.

The mathematical gist. A thermocouple measures a difference, V=S(Thot−Tcold)V=S(T_{hot}-T_{cold}), not an absolute temperature. With the chapter’s catalog-typical Type K sensitivity of 41 µV/°C, 4.10 mV means a 100.0 °C junction difference. If the instrument’s cold junction is 22.0 °C, compensation gives Thot=122.0T_{hot}=122.0 °C; ignoring that second temperature under-reads by 22 °C.

Math Bridge · guided foundationsWhy does one thermocouple need two temperatures?Let Phoebe turn Seebeck voltage into a compensated hot-junction reading.

5.3 Sensor Families, Not Guarantees

This section: Sensor Families, Not Guarantees — Common IoT sensors include temperature, humidity, pressure, light, motion, distance, position, current, gas, and contact sensors.

Common IoT sensors include temperature, humidity, pressure, light, motion, distance, position, current, gas, and contact sensors. MEMS devices add tiny mechanical structures for acceleration, rotation, pressure, microphones, and other compact measurements. These families are useful starting points, but a family name does not prove fit.

A sensor becomes acceptable when its measured quantity, operating principle, output form, range, response time, calibration need, interface, power behavior, environmental limit, and failure mode match the application decision. A familiar module can still be wrong if it cannot preserve the evidence the system needs.

The family name is only the first cut, so inspect Figure 5.1 before comparing parts. It makes the physical quantity and the typical sensing method visible together, which is the distinction the selection review needs.

Shows: Figure 5.1: Overview of common IoT sensor families including temperature, humidity, motion, light, pressure, gas, proximity, and accelerometer sensors.
Eight sensor families cover temperature, humidity, motion, light, pressure, gas, proximity and acceleration. Start with the physical quantity, then check range, accuracy, interface and power.
Figure 5.1: Overview of common IoT sensor families including temperature, humidity, motion, light, pressure, gas, proximity, and accelerometer sensors.

Across the top of Figure 5.1, Temperature pairs thermistors, RTDs, thermocouples, and ICs with a very broad “−40°C to 1000°C+” span; that span belongs to the family, not to every device in it. Compare that with Humidity, whose “0–100% RH” label still says nothing about condensation tolerance or accuracy at the endpoints. On the lower row, Proximity groups ultrasonic, IR, ToF, and capacitive ranging even though they observe different physical effects, while Accelerometer connects MEMS and piezoelectric devices to vibration and tilt. The closing SELECTION GUIDANCE therefore supplies the correct next move: refine the family by accuracy, range, interface, and power budget, then verify operating conditions and calibration in the datasheet.

The same family can hide very different evidence burdens. A temperature reading might come from a thermistor, RTD, thermocouple, or digital IC. A motion claim might come from PIR detection, radar presence, a MEMS accelerometer, or a camera pipeline. Those options can all look familiar on a parts list while carrying different mounting, firmware, privacy, calibration, and maintenance requirements.

For that reason, treat common families as comparison bins rather than answers. First decide what the system must prove, then narrow the family by the physical coupling, signal path, interface, power state, and failure behavior that match the installed device.

If you only need the intuition, use this rule: choose a common sensor by the decision it must support, not by popularity. Name the physical quantity, evidence limit, interface, calibration burden, and retest trigger.

Environmental Sensors

Temperature, humidity, pressure, air-quality, and light sensors support comfort, weather, storage, equipment, and environmental monitoring claims.

Motion and Position Sensors

PIR, accelerometers, gyroscopes, magnetometers, encoders, and proximity sensors support occupancy, movement, tilt, vibration, rotation, and position claims.

Active Range Sensors

Ultrasonic, optical time-of-flight, radar, and similar devices emit energy, so review power, target surface, field of view, interference, and safety limits.

Evidence Limits

Datasheet values, module defaults, library examples, and bench demos must be checked against mounting, enclosure, calibration, aging, and field conditions.

Check your understanding: Use the questions below to check the key idea

5.4 Evidence-Based Comparison

This section: Evidence-Based Comparison — A useful comparison record keeps the design from overfitting to a familiar module.

A useful comparison record keeps the design from overfitting to a familiar module. It names candidate sensor families, the evidence each can preserve, what each cannot prove, and which field change would force a retest. The record should be short enough to use during procurement and specific enough to survive maintenance.

Environmental families are a good place to make the comparison concrete. For light, separate the photometric unit from the sensing element: candela describes luminous intensity, lumens describe total visible light emitted by a source, and lux describes illuminance falling on a surface. An LDR or photoresistor changes resistance with light and is useful for simple threshold or daylight-trend decisions. A photodiode produces photocurrent and is better when response speed and linear readout matter. A phototransistor adds gain, so it can be sensitive in simple circuits, but it trades off linearity, saturation behaviour, and low-light performance. A color sensor takes this further by splitting incoming light into filtered red, green, and blue photodiode channels instead of reporting one intensity, so it can support test-strip reading, color sorting, ambient-light calibration, and color-matching decisions that a single-channel LDR or photodiode cannot.

Before acting on evidence-based comparison, inspect Figure 5.2 because it condenses the evidence path: the TCS3200 board shows what “splitting incoming light” means in hardware: the small central package contains an 8-by-8 filtered photodiode array, and its interface converts the selected color channel’s current into a frequency the controller can count. Photo: SergeMoutou, CC BY-SA 4.0.

A TCS3200 color-sensor board appears beside a magnified schematic of its central 8-by-8 photodiode array. Arrows lead from the array to a current-to-frequency converter and square-wave output, with S0 through S3 control labels beneath the blocks.
Figure 5.2: The TCS3200 board shows what "splitting incoming light" means in hardware: the small central package contains an 8-by-8 filtered photodiode array, and its interface converts the selected color channel's current into a frequency the controller can count. Photo: SergeMoutou, CC BY-SA 4.0

Read Figure 5.2 from the central optical package to the surrounding board connections, then use the adjacent array view to separate the red-, green-, blue-, and clear-filtered photodiodes. The selected channel becomes a frequency output that the controller counts; it is not already a calibrated colour name. That path connects the hardware to the comparison record: illumination geometry, integration time, surface distance, channel calibration, and saturation must be controlled before two candidates can be compared fairly.

For temperature, a thermocouple uses the Seebeck effect and survives very wide temperature spans, an NTC thermistor is cheap and sensitive in a narrower range, and an RTD is more linear and stable when the budget supports the front end. For humidity, capacitive and resistive devices commonly report relative humidity, while thermal-conductivity methods respond to moisture content; their useful record should include response time, hysteresis, long-term stability, condensation exposure, and temperature compensation. These concrete family names help procurement, but the acceptance still depends on the same evidence: range, accuracy, calibration, placement, interface, power state, and retest trigger.

Relative humidity is water-vapour partial pressure divided by saturation vapour pressure at the same temperature, expressed as a percentage. Record which humidity quantity the device reports and how temperature is accounted for. A capacitive humidity sensor sandwiches a thin moisture-sensitive dielectric, often a polymer or metal-oxide film, between two electrodes, and capacitance rises as the film absorbs water. A resistive humidity sensor changes resistance through a salt, polymer, or other conductive medium as moisture content changes. A thermal-conductivity humidity sensor pairs two thermal elements — one sealed in dry nitrogen as a reference, one exposed to the ambient air — and compares how much heat each element loses; the exposed element's heat loss tracks the air's actual moisture content, so airflow, temperature compensation, and contamination can dominate its evidence. The record should say which mechanism is installed before assuming that one humidity module can stand in for another.

Two more common families deserve a name of their own. Hall-effect sensors detect magnetic fields. Linear devices report a field-dependent value; switches and latches report thresholded states. With a suitable magnet and geometry, they can support rotation, proximity, or position sensing; suitable current sensors infer current from its magnetic field. A microphone converts sound pressure into an electrical signal and supports audio recording, wake-word or speech-recognition front ends, and even echolocation-style distance sensing when paired with an emitted pulse.

Specialized sensing needs a precise measurement claim. Electronic noses combine chemical-response patterns; tactile sensors may measure contact or force, with additional sensing and processing needed for material properties. Glucose sensors may measure blood or interstitial fluid, depending on the device. EEG electrodes record electrical potentials; localization and interpretation require additional modelling and validation. Check the specific device and validated application before accepting health, safety, or diagnostic claims.

Sensor Family
Evidence to Keep
Common Weak Point
Retest Trigger
Temperature and humidity
Range, accuracy condition, response time, condensation exposure, airflow, enclosure effect, calibration, and drift evidence.
Comfort-room assumptions are reused for outdoor, refrigerated, wet, heated, or poorly ventilated installations.
Enclosure, placement, airflow, operating range, calibration interval, condensation exposure, or alert threshold changes.
Motion, tilt, and vibration
Axis orientation, mounting rigidity, sample rate, filtering, range, saturation, noise, baseline, and event-label evidence.
Bench movement is accepted even though field mounting changes the vibration, tilt, shock, or activity signal.
Mounting, enclosure, sample rate, feature window, filter, machine type, user population, or event definition changes.
Light, distance, and presence
Field of view, target material, ambient light, reflection, occlusion, distance range, response time, and false-trigger evidence.
A sensor detects one target in a lab but fails with dark surfaces, soft targets, sunlight, angle, clutter, or multi-path behavior.
Target material, lighting, mounting angle, distance range, enclosure window, field of view, or occupancy definition changes.
Gas, current, and contact state
Selectivity, warm-up or stabilization, calibration, baseline, cross-sensitivity, safety boundary, wiring, isolation, and diagnostic evidence.
A threshold output is treated as a precise measurement or a safety claim without calibration and false-state review.
Gas mixture, environment, sensor age, power profile, isolation boundary, wiring, threshold, or safety requirement changes.

MEMS sensors deserve the same treatment. An accelerometer, gyroscope, pressure sensor, or microphone may be compact and low power, but the evidence still depends on mounting, orientation, noise, temperature behavior, packaging, sampling, and signal processing.

Common-sensor selection record template Measurement claim: what condition the sensor must prove and which decision uses it. Candidate families: environmental, motion, range, presence, gas, current, contact, MEMS, or another family. Accepted evidence: range, accuracy, response, interface, power, calibration, mounting, environment, diagnostics, and field validation. Known limit: the claim this sensor does not approve, such as safety alarm, precise metrology, forensic reconstruction, or unsupported environment. Owner: who maintains calibration, replacement, firmware, thresholds, diagnostics, and installation guidance. Retest trigger: the exact sensor, mounting, enclosure, range, threshold, sample rate, environment, interface, calibration, or application change that reopens review.
Check your understanding: Use the questions below to check the key idea
Practise

Hands-on lab · 30 min · Wokwi ESP32

Measure ultrasonic distance with an ESP32

I have explained distance-sensor limits; now let's time an echo and compare the calculated distance with the setting.

Open the lab

5.5 Common Sensor Boundary Failures

This section: Common Sensor Boundary Failures — Most sensor-family failures happen at the boundary between the physical world and the digital record.

Most sensor-family failures happen at the boundary between the physical world and the digital record. The transducer may be right for the category but wrong for the mounting. The output may be digital but calibrated poorly. The reading may be stable but biased by enclosure heat, airflow, sunlight, vibration, humidity, power state, or target material.

MEMS devices make this boundary easy to miss because the sensing structure, analog front end, ADC, and compensation logic often sit inside one small package. The package may output a clean acceleration, rotation, pressure, or microphone value, but the proof mass, diaphragm, or resonant structure still reacts to stress, temperature, orientation, shock, vibration, and board mounting. Treat the package output as interpreted evidence, not raw truth.

Transduction Boundary

Resistance, capacitance, optical reflection, acoustic timing, pressure, magnetic field, chemical response, and MEMS motion each have different interference paths.

Signal Boundary

Analog outputs, pulse timing, threshold pins, and digital buses need different evidence for noise, timing, reference voltage, parsing, and error state.

Energy Boundary

Passive sensors observe existing conditions; active sensors emit, heat, illuminate, ping, or process, so duty cycle and recovery behavior matter.

Lifecycle Boundary

Sensor age, contamination, drift, recalibration, firmware changes, replacement parts, and support ownership determine whether evidence remains valid.

Selection should also protect against false precision. A module may produce a number with many decimal places even when accuracy, placement, or calibration does not support that level of trust. A binary output may look decisive even when the threshold, delay, warm-up, or false-trigger behavior is poorly understood.

The under-the-hood rule is to ask what can make the common sensor lie. If that failure mode would change the application decision, it belongs in the selection record with a diagnostic, fallback, known limit, or retest trigger.

That question should include software boundaries too. Library defaults can hide averaging windows, unit conversions, compensation tables, debounce rules, and invalid-state handling. When those defaults change, the sensor family has not changed, but the evidence path has.

Check your understanding: Use the questions below to check the key idea

5.6 Match a Greenhouse Need to a Sensor Family

This section: Match a Greenhouse Need to a Sensor Family — A greenhouse controller needs leaf-zone temperature, damp-air warning, door position, and fan vibration.

A greenhouse controller needs leaf-zone temperature, damp-air warning, door position, and fan vibration. Those are four different physical effects, so one attractive breakout board cannot stand in for the whole sensor plan. The family view in Figure 5.1 separates temperature, humidity, proximity, motion, light, pressure, and other sensor choices before a part number enters the discussion. In Figure 5.2, the coloured channels show that even “light” may mean several wavelength bands rather than one brightness value.

Using the same illustrative constant-sensitivity model, 4.10 mV gives approximately 4100/41=100 ∘C4100/41=100\ ^\circ\text{C} junction difference, or about 122 °C with a 22 °C cold junction. This temperature calculation does not apply to a door reed switch, which reports a contact state.

5.6.1 Predict the Greenhouse Sensor Choice

The fan bearing adds a placement test. An accelerometer on the rigid motor housing sees vibration better than the same sensor on a loose plastic guard. Sensor family and physical coupling must both match the greenhouse question.

  • Predict: A capacitive humidity sensor is moved beside a mist nozzle. What should be checked before trusting 99% readings? Check: Check condensation limits and recovery behaviour; liquid water can saturate a humidity package.
  • Predict: A colour sensor sees the grow lamp brighten but the control question is whether the door opened. Is it the right family? Check: No. A reed or proximity sensor maps more directly to door state.

5.7 Summary

This section: Summary — Start by common IoT sensors are useful families, not automatic design approvals.

Start by common IoT sensors are useful families, not automatic design approvals. Then sensor choice should start with the measurement claim and the decision that will use the reading. Next environmental, motion, position, distance, gas, current, contact, and MEMS sensors differ by operating principle, output, interface, power, calibration, and field limits. After that digital output does not prove physical accuracy, and a familiar module still needs mounting, enclosure, environment, calibration, and lifecycle evidence. Finally a changed sensor, mounting, enclosure, sample rate, threshold, interface, calibration, environment, target, or application decision should reopen the sensor selection review.

Key Takeaway

Choose common sensors by evidence fit. The accepted record should tie measured quantity, operating principle, interface, calibration, environment, known limit, owner, and retest trigger to the IoT decision.

5.8 See Also

This section: See Also

Sensor Classifications

Classify sensors by measured quantity, signal form, power behavior, and evidence limits before comparing specific families.

Sensor Specifications

Interpret range, accuracy, resolution, response time, drift, noise, and calibration claims before accepting a device.

How to Read Sensor Datasheets

Trace datasheet conditions, interface details, operating limits, and test assumptions for a chosen part.

Sensor Selection Guide

Turn family comparison into a practical selection record with tradeoffs, rejection reasons, and retest triggers.

Find help

3 reviewed answers.

Where should I start in a module?

Open the module page from the sidebar to see its chapters in order. Use the module map to return to a topic you need.

Modules and paths

Reviewed

What can I try when a project does not work?

Check the symptom, then work through the diagnostic steps. Keep the error message and the smallest example that reproduces it.

When you are stuck

Reviewed

How do interactive examples work?

Use the interactive guide to check how examples and simulations work before changing your project.

Interactive examples guide

Reviewed