Gas sensors can look very certain. A screen may show CO2 800 ppm, TVOC 0.5 mg/m3, formaldehyde 0.08 mg/m3, or “air quality good”.
Many low-cost sensors are not that certain.
The first model is: a gas sensor usually does not count molecules directly. It lets gases affect a sensitive material, electrode reaction, optical path, or ionization process, then interprets the response as concentration, index, or alarm state.
Gas enters sensor
-> Sensitive material, electrode, or optical path responds
-> Resistance, current, or light intensity changes
-> Compensation and calibration
-> Concentration, index, or alarm output
Two distinctions matter:
- A response does not mean the sensor knows which gas caused it
- An alarm does not mean accurate quantitative measurement
What a Gas Sensor Actually Measures
A gas sensor measures a response chain, not the abstract idea of “air quality”.
Common routes include:
MOS: gas changes resistance of a heated metal-oxide layer- Electrochemical: target gas produces current through an electrode reaction
NDIR: gas absorbs infrared light at specific wavelengthsPID: ultraviolet light ionizes some VOCs and the ion current is measured
The first question should not be “is the number accurate?” It should be: what principle produced this number, and is it a single-gas concentration, a total index, an equivalent value, or a vendor algorithm output?
MOS: Sensitive but Broad
Many low-cost air-quality, VOC, smoke, and gas modules use MOS metal-oxide sensors.
They heat a sensitive layer. Gas adsorption and surface reactions change the layer resistance.
Heated sensitive layer
-> Gas adsorption and reaction
-> Resistance changes
-> Concentration or index estimate
MOS sensors are small, cheap, and sensitive. They are also often poorly selective. Alcohol, perfume, cooking fumes, cleaning agents, gas, VOCs, smoke, and humidity changes can all cause a response.
So a low-cost module labeled “TVOC” or “formaldehyde” may be producing an equivalent value or index, not a clean measurement of one compound.
MOS sensors also need warmup and baseline handling. If a device learns its baseline in polluted air, it may treat pollution as normal.
MOS Warmup and Baseline
Warmup has two layers:
- Short-term stabilization after power-on
- Longer aging or burn-in stabilization for new or long-unpowered sensors
Baseline learning is also risky. If the device never sees truly clean air, automatic baseline correction can drift.
Electrochemical Sensors: More Specific, but Consumable
Electrochemical sensors are common for CO, NO2, O2, H2S, and similar gases.
The target gas diffuses to electrodes and participates in a reaction, generating current related to concentration.
Target gas diffuses in
-> Electrochemical reaction at electrode
-> Current generated
-> Concentration estimate
They are often more selective than MOS sensors, but they have lifetime limits. Electrolyte dries or degrades, electrodes age, and seals change.
They also have cross-sensitivity. Other gases may produce current at the electrode and bias the reading.
NDIR CO2 Is More Direct, but Still Not Perfect
NDIR is common for carbon dioxide.
CO2 absorbs infrared light at specific wavelengths. The sensor sends IR through a chamber and measures how much light is absorbed.
Infrared light passes through chamber
-> CO2 absorbs specific wavelength
-> Received light decreases
-> CO2 concentration estimate
This is more specific than estimating air quality from a broad MOS response. But NDIR still has limits:
- IR source aging
- Dust, condensation, or contamination in the optical path
- Temperature and pressure effects
- Chamber design and response time
- Automatic baseline calibration errors
If a CO2 sensor assumes it periodically returns to outdoor fresh-air level, but it stays in a poorly ventilated room, its baseline may drift low.
VOC and Formaldehyde Are Easily Misread
VOC is a category, not one gas. Alcohol, perfume, paint, glue, cleaning agents, plastics, cooking fumes, and many other compounds can contribute.
TVOC is usually a total or equivalent indicator. It does not tell you the concentration of each component.
Formaldehyde is also difficult to measure accurately at low cost. A cheap “formaldehyde sensor” based on broad MOS response may react strongly to alcohol, perfume, or cleaning agents.
These devices are useful for trends and rough screening, but not as professional lab measurements.
Temperature and Humidity Effects
Gas readings are sensitive to environment.
Temperature affects reaction rates, diffusion, material resistance, electrolyte behavior, infrared absorption, and sensor offsets.
Humidity affects MOS surface adsorption, electrochemical electrolyte state, condensation risk, and VOC adsorption/release.
Many gas sensors include temperature and humidity compensation, or require external temperature/humidity data. Compensation helps, but it cannot fully handle rapid changes, condensation, oil vapor, dust, or chemical contamination.
Airflow and Placement
Placement matters because the sensor measures nearby air:
- Small enclosure openings slow response
- Corners exchange air slowly
- Vents may dilute the target gas
- Heat sources bias compensation
- Oil, dust, water vapor, and smoke can contaminate the sensor
Alarm Device and Instrument Are Different
A gas alarm and a precision instrument have different goals.
An alarm needs reliable triggering near a safety or abnormal threshold. It cares about response time, false alarms, missed alarms, certification, and long-term reliability.
A precision instrument needs trustworthy concentration values. It cares more about calibration, selectivity, cross-sensitivity, drift, temperature/humidity compensation, sampling path, and maintenance cycle.
A sensor that can alarm is not automatically a quantitative instrument. A display with ppm is not automatically trustworthy in every environment.
Debugging Checklist
When gas readings look wrong, do not start with code.
Check:
- Sensor principle: MOS, electrochemical, NDIR, PID
- Warmup and baseline state
- Temperature and humidity changes
- Condensation or contamination
- Cross-sensitive gases such as alcohol, perfume, cleaning agents, smoke, cooking fumes, or fuel gas
- Airflow path and enclosure openings
- Sensor lifetime and calibration state
Engineering Takeaway
A gas sensor value is not automatically true concentration.
MOS: cheap and sensitive, but broad and baseline-dependent
Electrochemical: more specific, but has lifetime and cross-sensitivity
NDIR: more direct for CO2, but depends on optical path and baseline
PID: useful for many VOCs, but not compound identification
Before trusting the number, ask:
- What gas is the target?
- Alarm or quantitative measurement?
- What are the cross-sensitive gases?
- Warmup and baseline requirements?
- Temperature and humidity range?
- Lifetime and calibration interval?
- Airflow and mounting position?
The key sentence is:
Gas sensors measure a response chain.
Gas name and concentration are interpretations based on principle, compensation, and calibration.