Sensors 101: The Eyes and Ears of Every Connected Device
Hold your phone perfectly still. Even doing nothing, it knows which way up it is, how bright the room is, how close your face is, and what the air pressure is doing — a dozen tiny devices measuring the physical world thousands of times a second.
Every connected device starts exactly there. Strip away the cloud, the dashboards, the machine learning: IoT makes one simple promise — something, somewhere, is measuring something real. Take the sensors away and the Internet of Things is just the Internet.
Yet sensors are the part every tutorial sprints past. "Wire the DHT22 to pin 4" — with no word on what the thing actually is, why its readings wobble, or why two identical modules disagree by two degrees.
This is Sensors 101: what they are, how they talk, which families matter, and what the datasheet really means. ๐️
The Short Version
A sensor is a transducer — it converts physics (heat, light, motion, chemistry) into an electrical signal. The mental model that actually works: a sensor is a translator — it translates physics into numbers, and every translation loses something. Noise, lag, drift. Every reading is an estimate wearing the costume of a fact.
Sensors speak two dialects:
- Analogue — a raw voltage your board's ADC turns into a number. Simple, but every wire is an aerial for noise.
- Digital — the sensor measures internally, applies factory calibration, and serves finished numbers over I²C or SPI. Prefer digital: you're buying the manufacturer's calibration lab, shrunk into a package.
The Big Six Families
- Temperature & humidity — DHT22 (~$3, tutorial staple), SHT31 (±0.2 °C, the grown-up option), BME280 (adds pressure, the default environmental chip)
- Motion & presence — PIR (~$2, sees moving heat), LIS3DH accelerometer (watches at ~2 ยตA), mmWave radar (detects a person sitting still)
- Distance — HC-SR04 ultrasonic (~$2.50) or VL53L0X laser time-of-flight (millimetre-class)
- Light — LDR for "brighter/darker", BH1750 for actual lux
- Gas & air — MQ series (rough alarms), SGP40 VOC index, SCD40 real CO₂ (~$30)
- Current & power — INA219 for DC, SCT-013 clamp for mains
The Numbers That Actually Matter
Accuracy is how far from reality; precision is how tightly readings cluster; resolution is the smallest step it can report. Confusing them is the classic trap — 23.0625 °C looks exact while being wrong by half a degree. Resolution is how many decimal places the lie is told to.
Add response time (a DHT22 needs 2 s per reading), drift (the slow lie, % per year), and the operating range — cheap humidity sensors get increasingly fictional above 90 % RH.
Why the $3 Module Isn't the $10 One
That $3 DHT22 may be genuine, a factory reject, or a clone of a clone with no calibration at all — two "identical" units disagreeing by 2 °C is the business model, not bad luck. The $10 Sensirion part is a calibration you can trust and a datasheet that means something. And some families demand rituals: MQ gas sensors need 24–48 hours of burn-in before their readings settle. None of this appears in the sketch you copied. All of it appears in your data.
By 2026 the interesting shift is intelligence in the package: gas sensors running classification AI on-chip (BME688), IMUs doing sensor fusion internally, TinyML pushing inference to the sensing element itself.
๐ก Final Thought
Everything above the sensor is bookkeeping. The topics, databases and models just reshape whatever the transducer said. The sensor is the only part of the stack that touches reality — the least glamorous component and the most consequential one.
Respect the translation. Every reading is an estimate with a confidence interval, delivered by a translator with an accent and a history.
Your code can only ever be as honest as its sensors.
→ Full breakdown: the ADC and bus dialects explained, all six families with parts and prices, the five datasheet numbers, the cheap-module economics, the 2026 landscape, and the builder's checklist: Read the deep dive
Follow for more IoT hardware deep dives — part of my ongoing 101-story series. ๐ฌ
Comments
Post a Comment