What a sensor actually does
A sensor is a component that responds to something in the physical world, such as heat, light, pressure, motion or the presence of a gas, and produces an electrical signal that changes in a predictable way. The part that does this conversion is often called a transducer. Everything else in a connected device, from the radio to the cloud service, only ever sees the number that comes out at the end.
That number is an estimate, not the truth. Understanding the steps between the physical event and the digital reading explains most of the surprises people meet when they deploy sensors for real.
From physical quantity to digital reading
Most sensor chains follow the same outline.
- Sensing element. A material or structure changes an electrical property when the quantity changes. A thermistor changes resistance with temperature. A photodiode produces current when light hits it. A capacitive element changes capacitance as its surroundings change.
- Conditioning. The raw change is usually tiny or noisy. A circuit amplifies it, filters out unwanted frequencies and converts resistance or capacitance into a voltage.
- Analog-to-digital conversion. An analog-to-digital converter (ADC) measures the voltage and maps it onto a fixed number of steps. A 12-bit converter has 4,096 steps. As a hypothetical example, if it spans 0 to 3.3 volts, each step is about 0.8 millivolts, so differences smaller than that cannot be seen.
- Processing. A microcontroller may average several samples, apply a correction formula and convert the result into units such as degrees or percent.
- Reporting. The value is sent over a network, often along with a timestamp.
Many modern sensors bundle all of these steps into one small chip that talks to the controller over a digital bus, so the designer receives a finished number. That is convenient, but it also hides the compromises made inside, which is why the datasheet matters.
The main sensor families
Thermal
Thermistors, resistance temperature detectors and thermocouples cover most temperature sensing. Thermistors are cheap and sensitive over a narrow range. Thermocouples cope with very high temperatures but produce small signals that need careful handling. Common weak points are self-heating, slow response when the sensor is encased in a thick housing, and readings that reflect the circuit board rather than the air.
Optical
Light sensors range from simple brightness detectors to color sensors, proximity sensors and full image sensors. They are inexpensive and fast, but they are sensitive to dirt on the lens, direct sunlight and unusual lighting such as flickering LEDs.
Motion, position and force
Accelerometers and gyroscopes, often built as tiny microelectromechanical (MEMS) structures, measure movement and tilt. Strain gauges measure force through small changes in a stretched conductor, and pressure sensors measure how much a membrane flexes. These are small and rugged, yet they can accumulate error if their output is integrated over time, because small constant offsets grow into large position errors.
Chemical and gas
Gas sensors react with specific molecules or groups of molecules, and humidity sensors respond to water vapor. They tend to be the least stable family: their response can change with age, temperature, and exposure to other substances. A deeper look at that trade-off appears in the discussion of air quality sensors and humidity sensors.
Electromagnetic and proximity
Hall-effect sensors detect magnetic fields, which makes them useful for door contacts and wheel-speed counting. Inductive and capacitive proximity sensors detect nearby objects without touching them. Radio-based approaches, such as radar, are covered in the guide to motion detection.
Presence and counting
Beam-break sensors, infrared detectors and radar modules infer that something is there, which is the basis of occupancy sensing in buildings. They measure a proxy, such as heat or movement, instead of the thing you actually care about, such as a person.
Where sensors struggle
A few limits show up across nearly every family.
- Noise. Electrical and thermal noise make successive readings differ even when nothing changes. Averaging helps, at the cost of response speed.
- Drift. Components age and shift, so the same condition may produce a slightly different reading months later. The topic of correcting this is covered under sensor calibration.
- Cross-sensitivity. Many sensors respond to more than one quantity. A gas sensor may react to humidity, and a pressure sensor may react to temperature.
- Environment. Dust, moisture, vibration, sunlight and extreme temperatures all change behavior. A part that works well on a bench can behave differently on a rooftop.
- Installation. A sensor measures what is at its own location. Where it sits can matter more than which model it is, a point explored under sensor placement.
- Sampling. If a value is read only occasionally, short events fall between samples. Reading more often costs power, so there is a trade-off with battery life.
Why the reading is not the whole story
Because of these limits, a raw number needs context. Good systems log when a sensor was last checked, flag values outside a plausible range and keep an eye on data quality problems such as flat-lined or jumping signals. Some also use anomaly detection to notice when a sensor starts behaving unlike its neighbors, which can reveal a failing part before anyone notices the readings are wrong.
For anyone choosing sensors, a useful habit is to work backward. Decide what decision the reading will support, how precise it must be, and how it will fail, and only then compare parts. A cheap sensor is fine when a rough trend is enough, while a decision with real consequences calls for more careful selection, verification and maintenance.