Sensors & Measurement · Study deck

Common Sensor Mistakes

Picture a room sensor that suddenly reports zero degrees.

Physics Phoebe is your guide for this deck.

sensortypescommon
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Diagnose the top 10 sensor mistakes using a systematic debugging checklist
  • Construct voltage divider circuits and pull-up resistor configurations that prevent hardware damage
  • Validate sensor readings with a three-layer error-checking pattern (NaN, range, rate-of-change)
  • Calculate the cost impact of sensor deployment failures and justify prevention investments
iotclass.org

Major section

Start With the Measurement Story

The room may be cold, but the same number can also mean a loose wire, wrong power, blocked data line, or reading taken too soon.

  • A safe design keeps those states separate.
  • A sampling rate means how often a sensor takes a reading.
  • GPIO means general purpose input and output pins on a controller.
iotclass.org

Major section

Phoebe's Field Notes: Two Different "Sampling Rate" Limits

The mathematical gist: Three limits must not be confused.

  • Its BMP280 example's 157 Hz output rate gives a 78.5 Hz Nyquist ceiling.
  • The DHT22's 0.5 Hz rating instead means one completed conversion every 2 s; faster polling repeats stale codes rather than creating an alias spectrum.
  • Working with sensors can be frustrating when things do not work, but most problems come from the same handful of mistakes.
iotclass.org

Major section

Voltage Mismatch Damage

Why it works initially then fails: The protection circuit can handle brief overvoltage spikes (ESD events), but continuous overvoltage causes cumulative thermal stress.

  • After minutes to hours, the junction fails permanently.
  • Why: I2C and 1-Wire use open-drain outputs - resistors "pull" the line HIGH when not driven LOW.
  • After voltage is safe, the next group of mistakes is about trust over time.
iotclass.org

Major section

Try It: Sampling Rate vs Sensor Limits

Different sensors have different maximum sampling rates.

  • Explore what happens when your code polls faster than the sensor can respond, and see how many valid vs stale readings you get.
  • Mistake: Using default I2C address when sensor has address pin.
  • Prevention cost is roughly $424 for pull-ups, decoupling capacitors, and ventilated enclosures.
iotclass.org

Major section

Accuracy, Precision, Drift

The mistake checklist above keeps sensors alive and communicating.

  • The companion page separates the measurement-quality errors that often remain after wiring is correct: accuracy, precision, drift, hysteresis, resolution, and uncertainty.
  • Hint: The code compiles and the logic looks correct, but readings are garbage.
  • Problem: HC-SR04 ECHO pin outputs 5V logic, but ESP32 GPIO18 is only 3.3V tolerant.
iotclass.org

Major section

Check Max Ratings

Recommended operating conditions describe the specified functional range; absolute maximum ratings mark stress levels beyond which permanent damage can occur, with the gap depending on the device.

  • Exceeding absolute maximum ratings, even briefly during power-up transients, can permanently damage the sensor.
  • Some sensors have separate DGND and AGND pins, both of which must be connected.
  • Connecting only one causes incorrect measurements or communication failures.
iotclass.org

Deck summary

Key takeaways

The room may be cold, but the same number can also mean a loose wire, wrong power, blocked data line, or reading taken too soon.

  • The mathematical gist: Three limits must not be confused.
  • Why it works initially then fails: The protection circuit can handle brief overvoltage spikes (ESD events), but continuous overvoltage causes cumulative thermal stress.
  • Different sensors have different maximum sampling rates.
  • The mistake checklist above keeps sensors alive and communicating.
iotclass.org

Retrieval practice

Recall check 1 of 4

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

Q1Which habit prevents many common sensor-selection mistakes?

AChoose the cheapest sensor first and define requirements afterward
BMatch range, accuracy, environment, interface, power, calibration.
CSelect from typical accuracy figures measured at room temperature.
DChoose the finest resolution within the available budget.
Show answer

Answer: B Most sensor mistakes come from selecting hardware before matching requirements and operating conditions.

iotclass.org

Retrieval practice

Recall check 2 of 4

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

Q2Your HC-SR04 ultrasonic sensor outputs a 5V signal on the ECHO pin. You connect it directly to an ESP32 GPIO input (3.3V max). What happens?

AThe ESP32 accepts 5 V input safely on every GPIO pin.
BThe reading shifts slightly but both devices remain safe.
CThe ESP32 output damages the ultrasonic sensor's ECHO pin.
DThe 5 V ECHO level can damage a GPIO rated only to 3.3 V.
Show answer

Answer: D see answers page

iotclass.org

Retrieval practice

Recall check 3 of 4

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

Q3Your MQ-135 air quality sensor gives wildly inaccurate readings for the first hour of operation. What is the most likely cause?

AThe sensor is defective and should be returned
BThe ADC reference voltage is incorrect
CWait for MQ warm-up before trusting readings.
DThe sensor needs calibration with a reference gas
Show answer

Answer: C MQ-series gas sensors use a heated sensing element that requires an extended burn-in period (24-48 hours for initial use, 5-10 minutes for subsequent power-ons) to stabilize.

iotclass.org

Retrieval practice

Recall check 4 of 4

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

Q4An I2C scanner finds no devices. Power and SDA/SCL wiring have been verified, but the open-drain lines have no confirmed pull-ups. What should you check next?

AReplace the sensor immediately
BChange the I2C clock speed to 100kHz
CSwap SDA and SCL wire connections
DVerify pull-up resistors on SDA and SCL.
Show answer

Answer: D see answers page

Q5What startup mistake produces a nonrepresentative reading when a sensor needs time to stabilise?

ARaw ADC Without Calibration
BIncorrect Wiring
CMissing Pull-Up Resistors
DIgnoring Warm-Up Time
Show answer

Answer: D Warm-up belongs to startup timing because some sensors need stabilisation before a reading is representative.

iotclass.org

Print reference

Answers 1 of 3

Answer key.

  1. B · Most sensor mistakes come from selecting hardware before matching requirements and operating conditions.
  2. D · ESP32 GPIO pins are rated for a maximum of 3.3V. Applying 5V directly will likely damage the GPIO pin (and potentially the entire chip). The fix is to use a voltage divider (e.g., 2k and 3.3k resistors) to step down the ECHO signal, or use a dedicated 3.3V-compatible ultrasonic sensor variant.
iotclass.org

Print reference

Answers 2 of 3

Answer key.

  1. C · MQ-series gas sensors use a heated sensing element that requires an extended burn-in period (24-48 hours for initial use, 5-10 minutes for subsequent power-ons) to stabilize.
  2. D · I2C uses open-drain outputs that require external pull-up resistors (typically 4.7kohm) to work. Without pull-ups, the bus cannot transition to HIGH state, and communication fails silently. Many breakout boards include pull-ups, but generic modules often do not. Always check for pull-ups before assuming hardware failure.
iotclass.org

Print reference

Answers 3 of 3

Answer key.

  1. D · Warm-up belongs to startup timing because some sensors need stabilisation before a reading is representative.
iotclass.org