Article & guide
Read the full article
## Begin with the question Before choosing a module, write one sentence describing the decision your project needs to make. “Is the room getting darker?” is a different problem from “What is the illuminance in lux?” The first may work with a relative signal; the second requires a suitable measurement method and calibration. ## Make a comparison sheet For each candidate sensor, record the physical quantity, expected range, supply requirements, output type and logic levels. Add the connector pinout, useful sampling rate, likely environmental exposure and a link to the manufacturer's datasheet. Leave unknown fields marked unknown rather than filling them with a guess. A module that accepts 5 V power does not automatically produce a 3.3 V-compatible signal. Check the output specification separately. Boards with similar-looking connectors may use different pin orders. Read the exact module documentation before connecting it to an ESP32 input. ## Understand the interface An analogue output needs a suitable ADC input and a plan for noise and scaling. A digital interface needs compatible voltage levels, the correct protocol and working software support. The presence of an I2C address or an example library does not prove that a module meets your accuracy, response-time or environmental needs. ## Design a small comparison test Choose at least three relevant conditions, keep the arrangement repeatable and record several readings per condition. Include a stable reference if you have one. Write down the placement, power supply and software version. Compare the spread of values, missing readings and the time taken to settle. If you have no reliable reference, describe the result as a comparison or relative observation. Do not claim a calibrated accuracy from a few plausible numbers. Repeating a reading consistently is useful, but repeatability and accuracy are different properties. ## Decide with evidence Select the simplest sensor that meets the documented requirement. State what it cannot tell you. Keep a fallback plan for disconnected sensors, implausible values and stale data: a device should not silently treat an old reading as fresh. This guide is a planning worksheet, not a recommendation for medical, protective or other safety-critical use. Those applications need a separate validated engineering process. ## Cover note The AI-generated image illustrates a variety of small sensor parts. It does not identify exact models, pinouts or verified performance.
1. Write a requirement
Complete: I need to detect ___ between ___ and ___, with an update every ___, in an environment where ___. Mark estimates clearly.
2. Check compatibility
Create rows for supply voltage, output levels, pinout, interface, current needs and software support. Use the exact manufacturer documentation for the sensor and controller you actually own.
3. Plan failure handling
Describe how your interface will show a missing, invalid or stale reading. Record how you will test each of those states before adding automatic control.
