A dewpoint sensor measures moisture-related conditions in air or gas by detecting the dew point, which is the temperature at which water vapor begins to condense under specific conditions.