A temperature and humidity sensor looks like it should directly describe the room: 25°C, 55% RH, comfortable or not.
That is too simple.
The sensor measures the local air around itself. The reading may not represent the whole room, the air outside the enclosure, or how a person feels.
The first model is: a temperature and humidity sensor measures the temperature and water-vapor state of air near the sensing element. Enclosure, airflow, self-heating, response time, and contamination decide whether that local air represents the environment you care about.
Ambient air reaches sensor
-> Temperature-sensitive and humidity-sensitive structures respond
-> ADC reads the response
-> Calibration and compensation
-> Temperature and relative humidity output
Where Is It Measuring?
The sensor measures its own surroundings.
If it is inside a plastic case, behind a decorative grille, close to a warm PCB, or mounted on a wall, it measures the air and heat environment there. That may differ from the room center, the user’s breathing zone, or the device exterior.
Common local differences include:
- Air near a window
- Air inside a cabinet
- Air near a vent
- Air heated by electronics
- Air trapped inside an enclosure
This is the most important boundary: the reading may be accurate for the sensor location and still wrong for the application.
How Temperature Is Measured
Small digital temperature sensors usually rely on semiconductor temperature behavior. Other systems may use thermistors, RTDs, or thermocouples.
The common chain is:
temperature changes material behavior
-> voltage, current, or resistance changes
-> ADC and calibration
-> temperature output
The sensor does not measure “room temperature” directly. It measures the temperature of its sensing structure, which is coupled to nearby air, PCB, case, and radiation.
Humidity Is Relative
Relative humidity is not the absolute amount of water in air. It is the ratio between current water vapor and the maximum water vapor the air can hold at that temperature.
That means temperature and humidity readings are coupled. If air contains the same water vapor but temperature rises, relative humidity drops. If temperature falls, relative humidity rises and may approach condensation.
This is why a sensor that is slightly warmer than the room often reports lower relative humidity.
How Humidity Is Measured
Many humidity sensors use a polymer or dielectric layer whose capacitance changes as it absorbs water vapor.
water vapor enters sensing layer
-> dielectric property changes
-> capacitance changes
-> humidity estimate
The sensing layer has response time, hysteresis, contamination sensitivity, and aging. It also needs temperature compensation because relative humidity depends on temperature.
Self-Heating Matters
Sensors and nearby electronics dissipate heat. A temperature sensor placed near a regulator, MCU, Wi-Fi chip, battery charger, display, or LED can read higher than ambient.
If the sensor is warmer than the real air, relative humidity can appear lower as well.
Common causes:
- Sensor too close to hot components
- Small sealed enclosure with poor airflow
- Continuous high-rate measurement
- Sunlight or warm wall heating the case
- Battery charging or radio transmission
Calibration cannot fix a sensor that is placed in the wrong thermal environment. It can only compensate a known and stable offset.
Enclosure and Airflow Decide Response
A sensor measures the air that reaches it. If the enclosure has small openings, dead cavities, waterproof membranes, dust screens, or poor airflow, the reading lags behind the real environment.
Response time is not only a chip parameter. It includes:
- Sensor package
- PCB thermal mass
- Enclosure volume
- Vent openings
- Membranes and filters
- Airflow around the device
If the device is mounted against a wall, inside a cabinet, near a vent, or under sunlight, it may represent that local microclimate, not the room.
Comfort Is Not Only Temperature and Humidity
Human comfort depends on more than air temperature and relative humidity:
- Airflow
- Radiant heat from windows and walls
- Clothing and activity
- Skin evaporation
- Local drafts
- Sunlight
Two rooms with the same 25°C and 55% RH can feel different if one has direct sunlight or strong airflow.
So a temperature-humidity sensor is useful, but it is not a full comfort sensor.
Condensation, Dust, and Aging
Humidity sensors can be affected by condensation, dust, oil vapor, chemical contamination, salt, and long-term aging. Condensation is especially harmful because liquid water on the sensing layer can cause slow recovery, drift, or temporary wrong readings.
Gas sensors, air purifiers, humidifiers, kitchens, bathrooms, and outdoor installations need special care. Waterproof membranes can protect the sensor but also slow response.
Calibration Cannot Fix Bad Installation
Calibration can correct sensor offset and scale under known conditions. It cannot make stagnant internal air represent room air. It cannot remove self-heating from a bad layout unless the heat error is stable and modeled. It cannot make a sealed enclosure respond quickly.
If the product requires room-level readings, mechanical design and airflow path must be solved before calibration.
Debugging Checklist
When readings look wrong, check:
- Is the sensor near a heat source?
- Is there airflow through the enclosure?
- Is the opening blocked by dust, membrane, or decoration?
- Is the device mounted on a hot/cold wall?
- Has condensation occurred?
- Are readings compared against a reference at the same location?
- Is the system expecting comfort, room average, or local air?
Engineering Takeaway
Temperature and humidity readings are local physical measurements, not room truth.
Before trusting the value, ask:
- Is the sensor thermally isolated from hot components?
- Can air reach it quickly?
- Is it inside a dead cavity?
- Is it near a vent, wall, window, sun, or heat source?
- Can condensation or contamination occur?
- Is the application about local air, room average, or human comfort?
The key sentence is:
The sensor reports the air near the sensing element.
Whether that represents the target environment is an installation question.