Humidity Sensor: Design Rules and Process Limits
Humidity is one of the harder environmental quantities to measure, because the sensing element is in direct contact with the air and therefore with everything the air carries. Dust, chemical vapours and condensation all affect the reading, and a sensor that is accurate in a clean laboratory can drift badly in a real installation unless the interface and the mechanical arrangement protect it.
Types of Humidity Sensor
A capacitive sensor uses a polymer layer whose dielectric constant changes as it absorbs water vapour, and it is the most common type because it is stable, linear and works over a wide range. A resistive sensor uses a material whose conductivity changes with humidity, and it is cheaper but more affected by contamination and by long term drift.
A thermal conductivity sensor measures the difference between two temperature sensors, one exposed to the air and one in a dry reference, and it works well at high humidities and in condensing conditions. A chilled mirror instrument is the most accurate of all and is used as a reference rather than as a field device.
The choice follows from the range and the environment. A capacitive sensor suits indoor monitoring, while a thermal conductivity device suits drying processes and conditions where condensation is expected. In every case the accuracy quoted in the datasheet is the accuracy of the element, before the interface and the environment are considered.
Capacitive Sensing and the Measurement
capacitive sensing measures a small capacitance, typically between a hundred and two hundred picofarads at fifty percent relative humidity, changing by a fraction of a picofarad per percent of humidity. The change is small, so the measurement circuit has to be stable and the capacitance of the wiring has to be either negligible or calibrated out.
The excitation frequency matters. A low frequency measurement is affected by the surface conductance of the polymer, which changes with contamination, while a high frequency measurement is affected by the inductance of the connections. Most devices are specified for a particular excitation frequency and should be measured at that frequency.
Integrated devices that combine the sensing element and the conversion circuit avoid most of the interface problems, because the capacitance is measured on the die rather than through a cable. Where the element is separate, the connecting cable becomes part of the measurement and has to be short, screened and mechanically fixed so that its capacitance does not change with movement.

Excitation and Measurement Circuits
A capacitance to digital converter is the usual solution for a separate element. It applies an excitation to the sensor and measures the resulting charge, and it is designed for the small capacitance and the low current of a humidity element. The excitation waveform and the reference capacitor are chosen from the sensor specification.
A bridge arrangement with an alternating excitation is an alternative, but it requires care with the phase of the detected signal and with the stray capacitance to ground. Any capacitance from either terminal of the sensor to ground appears in parallel with the sensor and adds an offset that changes with the environment.
The reference capacitor must be stable, because it sets the scale of the measurement. A capacitor with a high temperature coefficient or with a dielectric that changes its value with voltage will shift the reading as the conditions change, and the error is easily as large as the humidity change being measured. A stable dielectric and a low temperature coefficient are the requirements.
Condensation and Recovery
condensation forms on the sensor when its surface falls below the dew point, and it produces a reading of one hundred percent until the water evaporates. The reading is not wrong in the sense of a fault, but it is uninformative, and a repeated cycle of condensation can damage the polymer layer.
Designing for condensation means keeping the sensor warm, protecting it from direct contact with liquid water and allowing it to recover. A sensor placed near a cold surface, or where air can flow past it from a cold region, will condense more often than one in still air. A hydrophobic filter over the opening repels liquid water while allowing vapour through.
Recovery after condensation takes time, and the time depends on the temperature and on the airflow. A sensor that is used for control should ignore readings during the recovery period rather than act on them, and the firmware needs a way to detect that a recovery is in progress. A sudden jump to saturation followed by a slow return is the signature.

Calibration and Drift
calibration converts the sensor output into a humidity value, and it is needed because the relationship between capacitance and humidity varies between parts and shifts over time. A single point calibration at a known reference is enough to correct the offset, while a two point calibration also corrects the slope.
drift is the slow change in the reading for a constant humidity, and it comes from contamination of the polymer layer and from the ageing of the material. Most devices are specified with a drift figure per year, and the value assumes a clean environment. In an atmosphere with solvent vapours or with fine dust the drift is much faster.
Recovering a drifted sensor is possible in some cases. A period at an elevated temperature drives off absorbed contaminants, and some devices include a heater for that purpose. Where the environment is aggressive, the heater is used periodically as part of normal operation rather than as a repair, and the reading is ignored while it operates.
Temperature and Compensation
Relative humidity is defined with respect to the temperature, so an error in temperature appears directly in the humidity reading. The saturation vapour pressure changes by roughly seven percent per degree at room temperature, which means a one degree temperature error produces a humidity error of several percent relative humidity.
The temperature sensor therefore has to measure the same air as the humidity sensor. A sensor placed on the board measures the board, which is warmed by its own dissipation and by the surrounding components, and that difference can easily be several degrees. Placing the temperature sensor beside the humidity element, in the airflow, is the arrangement that gives a representative reading.
Absolute humidity and dew point are derived from the relative humidity and the temperature, and the derived quantities amplify the temperature error further. Where a dew point is used for control, the temperature accuracy requirement is tighter than for a relative humidity reading, and the two measurements should be taken at the same point in the air stream.
Layout and Protection
The sensor opening has to be exposed to the air while the electronics is protected from it. A filter membrane over the opening keeps dust and liquid water out while allowing vapour through, and a recess or a labyrinth prevents a direct path for water to reach the element. The mechanical arrangement is as important as the circuit.
Keep the driving and sensing traces short and stable, and avoid routing them under the sensor opening where they would be exposed. The sensor is often mounted at the edge of the board to give it access to the air, and that placement also keeps it away from the heat generated by the rest of the circuit.
Where the board is coated, the coating must stop short of the sensing element. Coating the element itself blocks the vapour path and destroys the measurement, and the keep out area has to be defined on the assembly drawing. The general practices for selective coating are described in conformal coating.
Verification and Common Faults
Verify the channel against a reference instrument at several humidities, using saturated salt solutions or a calibrated generator. Recording the error across the range shows whether the error is an offset, which calibration corrects, or a slope error, which indicates a problem with the reference capacitor or the measurement circuit.
A sensor that reads high in a dry environment usually has a contamination or a temperature problem. A sensor that reads low at high humidity may have a partially blocked filter, which slows the response and prevents the element from reaching the true value. Both are diagnosed by comparing the response time with the specification.
Products that pass a functional test and drift in the field are usually affected by something in the installation rather than by the assembly. Solvent vapours from adhesives, cleaning agents and packaging are common causes, and allowing the product to settle before the final calibration removes most of them. The tolerance and reliability discipline that applies to these measurements is described in component tolerance and reliability, and the release documentation in PCB design release checklist should record the calibration method used in production.
FAQ
How accurate is a typical humidity sensor? Between two and five percent relative humidity for a good capacitive device, before considering the temperature error and the drift over time.
Why does my reading go to one hundred percent after a cold night? Condensation has formed on the element. Keep the sensor warm, shield it from liquid water and ignore the reading while it recovers.
How often should a humidity channel be calibrated? Most devices hold their calibration for a year in a clean environment. In an atmosphere with solvents or dust, more frequent checks are needed.



