- Home
- 1-Wire Humidity Sensor
GuideHumidity
1-Wire humidity sensor guide: DS2438 circuit, compensation, accuracy
A one wire humidity sensor pairs two parts: a capacitive humidity element that produces a voltage, and a DS2438 that measures it and reports over the bus. This guide walks through the circuit, the arithmetic that turns volts into relative humidity, the temperature correction most setups skip, and what accuracy to expect in a cellar, a greenhouse or a living room.

How a 1-Wire humidity sensor is put together
There is no single-chip one wire humidity sensor in the Dallas catalog. Humidity on the bus has always been a small circuit: a humidity element with an analog output, a chip that digitizes that output, and a few passive parts. Dallas Semiconductor sold a reference module of this kind before discontinuing it, and several makers, including Midon Design, AAG and Hobby Boards, built their own versions. Midon's MD3020E combined an HIH-4021 sealed element, a DS2438, a DS18S20 thermometer and an on-board regulator.
The chip at the center is the DS2438, officially a smart battery monitor. It suits humidity work because it carries three things a humidity sensor needs: a 10-bit A/D converter with a general-purpose voltage input (VAD), the ability to measure its own supply voltage (VDD), and an on-chip temperature sensor. Its family code is 26h, which is how interfaces and software recognize it on the bus.
Why a separate element?
Humidity is sensed by a thin polymer film whose capacitance changes as it absorbs water vapor. The element's internal electronics convert that change into a voltage that rises roughly linearly with relative humidity. The DS2438 does not care what the voltage means; it just measures it. All the humidity knowledge lives in the host software, which is why DS2438 humidity readings depend so much on getting the formula right.
The DS2438 humidity circuit, part by part
The classic circuit is short enough to describe in a paragraph. A 5 V supply feeds both the DS2438 VDD pin and the humidity element. The element's output goes to the DS2438 VAD input. The DS2438 DQ pin connects to the bus data line and its ground to bus ground. A decoupling capacitor sits close to the element. That is the whole DS2438 humidity circuit, and most 1-Wire humidity sensor boards of the era followed some version of it.
Power matters
The humidity element needs a steady 5 V, so this circuit cannot run on parasite power alone. The MD3020E documentation states that the DS2438 on that board needs either +5 VDC from the bus cable or a 9 to 30 VDC input, which an on-board regulator brings down to 5 V. AAG sold a humidity sensor that ran only in parasitic mode; the Midon notes flag that as a limitation.
Why measure VDD too?
HIH-4000 family elements are ratiometric: their output scales with their supply. If the 5 V rail sags to 4.8 V at the end of a long cable, the output falls with it even though the humidity has not changed. Because the DS2438 can read both VAD and VDD, the host divides one by the other and the supply error cancels. A DS2438 humidity reading that ignores VDD is only as good as the power supply.
From volts to percent: the circuit math
The HIH-4000 datasheet gives a straight-line transfer function at 25 °C. Written as a procedure, the host software does this on every poll:
- Read VAD and VDD from the DS2438. Each is a 10-bit value with 10 mV resolution.
- Compute the sensor RH: RH = ((VAD / VDD) − 0.16) / 0.0062. This is the datasheet line Vout = VDD × (0.0062 × RH + 0.16) solved for RH.
- Read the temperature from the DS2438 itself or from a nearby DS18S20.
- Apply temperature compensation: true RH = sensor RH / (1.0546 − 0.00216 × T), with T in °C.
- Clamp and report: limit the result to 0 to 100 percent and round to a whole number, since the element cannot resolve tenths.
Some elements ship with an individual calibration sheet giving a slightly different offset and slope. When one is available, use those numbers instead of the typical ones. A serial interface such as the TEMP08 performs these steps internally and prints a line like Humidity #01 = 58%, so the host only stores the result.
Temperature compensation and accuracy limits
Without compensation, the reading drifts as temperature moves away from 25 °C. At room temperature the correction is small, but in a cold cellar or a hot attic it shifts the result by several percentage points. That is the first limit on accuracy, and the easiest to fix.
The second limit is the element. The HIH-4000 datasheet quotes accuracy of about ±3.5 %RH, and the HIH4021 on the MD3020E belongs to the same family. The older Honeywell HIH-3610, used in early 1-Wire humidity designs, is specified at about ±2 %RH, so a well-corrected HIH-3610 reading can be slightly tighter, although the A/D limit below applies to both. The third is the A/D converter: with 10 mV steps on a 5 V supply, one step equals roughly 1.6 %RH, so the DS2438 cannot report finer detail than that even with a perfect element. The table sums up where error comes from.
| Error source | Typical effect | Fix |
|---|---|---|
| No temperature compensation | Grows with distance from 25 °C | Apply the datasheet correction every poll |
| Supply voltage drop | Reading falls with the rail | Divide VAD by the measured VDD |
| Element tolerance | About ±3.5 %RH | Use the element's calibration sheet if supplied |
| A/D resolution | About 1.6 %RH per step | Report whole percent only |
| Self-heating or sun | Reads dry | Shade and ventilate the sensor |
| Condensation | Stuck near 100 % | Keep the element above the dew point |
Put together, a well-built 1-Wire humidity sensor with compensation lands within a few percent of a reference instrument. Two sensors side by side may still disagree by that much, which is normal and not a fault.
Placement: cellars, attics and outdoor shields
Where a 1-Wire humidity sensor hangs matters as much as the circuit. Relative humidity depends on temperature, so a sensor warmed by a nearby lamp, a power supply or sunlight reads drier than the air around it. Mount the board away from heat sources, with air moving freely past the element, and keep the regulator and any LEDs away from the humidity element.
Cellars and crawl spaces
Cellars are a common reason to install a one wire humidity sensor, since damp shows up there first. Mount the sensor at head height, away from the cold outer wall, where it sees the room air rather than a cold surface film. If the reading sits at 100 percent for hours, water has probably condensed on the element; it recovers once dry, but repeated soaking shortens its life.
Outdoors
An outdoor sensor needs the same ventilated radiation shield as an outdoor thermometer. The TEMP08 FAQ points to a pagoda style shield for sunlit probes. Keep rain off the element but let air through, and place the shield over grass rather than pavement.

Choosing parts and dew point for a 1-Wire humidity sensor
The Dallas module, the MD3020E and the AAG unit are all discontinued, so a new build usually means assembling the circuit yourself from a DS2438 and an HIH-4000 family element. Keep the DS2438 and the element on the same small board so both see the same temperature, and route the bus cable in with the 5 V pair. The sensors page describes the MD3020E board and its RJ-12 jack, which is a useful layout reference.
TEMP05 gained humidity support with firmware V4.14, and its successor TEMP08 reads humidity from multiple DS2438 sensors, including the MD3020E and Hobby Boards designs. The Sensirion SHT11/SHT71 digital sensors are a different story: they use a two-wire interface that Midon Design judged unsuitable for long remote runs, so TEMP05 and TEMP08 never supported them.
Dew point from the same data
With temperature and relative humidity on hand, the dew point follows from the Magnus approximation: γ = ln(RH/100) + 17.62 × T / (243.12 + T), then dew point = 243.12 × γ / (17.62 − γ), with T in °C. Dew point is often more useful than RH in a cellar, because it shows directly how close a cold pipe or wall is to sweating.

Further reading: DS2438 smart battery monitor (Analog Devices) · OWFS 1-Wire file system
Questions and answers
Can a 1-wire humidity sensor run on parasite power?
Not reliably. The capacitive humidity element needs a steady 5 V supply, and parasite power cannot provide it. Midon's MD3020E required +5 VDC from the cable or a 9 to 30 VDC input with an on-board regulator. AAG built a parasite-only version, but that design was noted as a limitation.
How accurate is a 1-wire humidity sensor built with a DS2438?
With temperature compensation and supply correction, expect a result within a few percent RH of a reference instrument. The HIH-4000 element is specified at about ±3.5 %RH, and the DS2438's 10 mV steps limit resolution to roughly 1.6 %RH on a 5 V supply. Whole-percent reporting reflects that honestly.
Why does the DS2438 measure its own supply voltage?
HIH-4000 family elements are ratiometric, so their output scales with the supply voltage. By reading both the element output (VAD) and the supply (VDD), the host can divide one by the other. That cancels voltage drop on long cables and makes the humidity figure independent of small power supply changes.
Does the TEMP08 work with humidity sensors?
Yes. The TEMP08 reads relative humidity from multiple DS2438 based sensors on the same bus, including the Midon MD3020E and Hobby Boards designs. It does not support Sensirion SHT11 or SHT71 sensors, whose two-wire interface was judged unsuitable for long remote runs.
Why does my humidity reading stay at 100 percent?
Most often water has condensed on the element because it is colder than the dew point of the surrounding air, for example on a cold cellar wall or outdoors at dawn. The reading recovers as the element dries. Move the sensor into moving air and away from cold surfaces to prevent it.
Related pages
TEMP08 Serial One Wire Interface
TEMP08 linked a PC serial port to the 1-Wire bus: up to 60 sensors for temperature, humidity, rain, wind and relays, plus a real-time clock and RJ-12 jack.
Sensors
1-Wire sensor chips used with Midon Design kits: DS18S20, DS18B20 and DS1822 thermometers, DS2438 humidity, DS2423 counters, DS2450, DS2408 and iButtons.
TEMP08 Frequently Asked Questions
TEMP08 FAQ: parasite power, sensor wiring and distance, serial settings, DS1820 vs DS18S20 vs DS18B20 vs DS1822, weather station versions and odd readings.
1-Wire Weather Station
How a 1-Wire weather station reads its rain gauge, wind speed and wind direction sensors, from DS2423 counters and DS2450 vanes to a TEMP08 serial log.