Short answer: give the SHT40 its own vented pocket, 10-20 mm [0.4-0.8 in] from the ESP32-C6 board and the 5000 mAh cell, breathing to the room through slots or an ePTFE membrane patch. Sealed into shared air, a radio node reads typically +0.2 to +1 C high, and over +1.5 C when the radio never sleeps. Each of those degrees reports the humidity about 3 %RH too dry, against a sensor specified at ±0.2 C and ±1.8 %RH. Vent the sensor, seal the electronics, and response time, rating and battery life all fall into line below.
What the sensor needs that the radio does not
The element asks for three things the board never will: a steady exchange of outside air, no liquid water on it, and no dust caked across its opening. Its own dissipation is a non-issue. A Texas Instruments application note on self-heating in thermistors gives the rule that matters: reading error equals dissipated power times thermal resistance. The SHT40 measures on microamp-to-milliamp currents, so that product rounds to zero. The ±0.2 C and ±1.8 %RH on its datasheet are the whole budget you are protecting.
Your neighbours spend it for you. An ESP32-C6 with the radio associated but idle draws 20-40 mA average; with the radio busy, about 85 mA. Seal board, battery and sensor into one cavity and the element reads that cavity instead of the room — the trap behind a humidity sensor sealed in a box with the electronics. Sensirion publishes a design guide for housing and PCB layout around the SHT4x family; keep it open while you place the pocket.
Dust is the quieter failure: a cake across the opening stretches a seconds-long humidity response into minutes-long drift. Give the pocket a membrane or a downward-facing slot, and leave the upward-facing hole out of the design.
Pick the rating by where the node lives
Three cases cover the field. Indoors on a dry wall or shelf: open slots on the underside of the pocket, with the electronics bay sealed behind its glands. Indoors near splash, or in a washdown area: an ePTFE membrane patch over the pocket opening. Outdoors in rain: the same patch, on a body whose door seal carries the same rating.
IEC 60529 sets the water digits, and you should know what each one buys: IPX4 is splashing, IPX5 is jets from a 6.3 mm nozzle at 12.5 L/min, IPX6 is powerful jets from a 12.5 mm nozzle at 100 L/min, and IPX7 is thirty minutes at 1 m. On dust, the first digit 5 is dust-protected and 6 is dust-tight. A patch rated IP66 holds all of that off while passing vapor, and an IP67-rated box still passes water vapor — the one leak you exploit here on purpose. The IP rating chart maps the rest of the codes.
The assembly carries the rating of its weakest part, so the vent decides it. A slotted pocket is IP2X at best and lives indoors; a patch rated IP66 keeps the whole box at IP66. One declaration covers it all: ratings here are manufacturer ratings — our stainless bodies are rated NEMA 4X / IP66 by the manufacturer; not UL listed — and a vent patch carries the same kind of maker's rating.
Why the temperature error shows up as humidity
Warm air at unchanged moisture reads drier, by about 3 %RH per C at 50 % ambient and about 2 %RH at 30 %. Saturation vapor pressure climbs roughly 6 % per kelvin near room temperature, and that is the entire mechanism. So +1.6 C of self-heating shows you 50 %RH air as about 45 %RH, nearly three times the ±1.8 %RH spec. Calibration cannot fix this for you, because the error tracks the radio's duty cycle, not the sensor. The enclosure relative humidity calculation runs the arithmetic in both directions; placement is the cure.
Working the numbers: an ESP32-C6, an SHT40 and a 5000 mAh cell in a 6 x 4 x 2 in box
Start with the inputs, each with its source:
- Body: a 6 x 4 x 2 in [152 x 102 x 51 mm] plastic box; this site's reference wall coefficient for plastic is 3.5 W/m²K.
- Board: 85 mA average at 3.7 V with the radio busy, from the current-by-mode table in the ESP32-C6 datasheet; 20-40 mA associated and idle. Measure yours and substitute.
- Duty cycle: awake 3 s every 300 s, asleep at 0.4 mA in between, typical of a small board whose regulator never fully shuts down.
- Ambient: 22 C on an indoor wall; only the rise above it matters here.
The rule in words: a sealed box floats above ambient by dissipated power divided by the wall coefficient times the outside surface area. Written out:
- Surface: 2 x (0.152 x 0.102 + 0.152 x 0.051 + 0.102 x 0.051) = 2 x 0.0285 = 0.057 m².
- Thermal divider: 3.5 W/m²K x 0.057 m² = 0.20 W/K.
- Radio busy: 3.7 V x 0.085 A = 0.31 W, and 0.31 / 0.20 = 1.6 C above the room — about 4.5 %RH too dry at 50 % ambient.
- Sleeping cycle: (0.085 A x 3 s + 0.0004 A x 297 s) / 300 s = 0.374 / 300 = 1.25 mA average; 3.7 V x 1.25 mA = 4.6 mW, and 0.0046 / 0.20 = 0.02 C.
- Battery, the same two cases: 5000 mAh / 85 mA = 59 h, about 2.5 days; 5000 mAh / 1.25 mA = 4000 h, about 5.5 months.
The threshold is 0.2 C — the sensor's own accuracy. Past it, the sensor leaves the shared cavity, and the busy-radio node misses it by a factor of eight. The sleeping node passes on paper at 0.02 C and still earns the pocket, because every wake warms the air beside the element for the seconds around the reading: read the SHT40 first, transmit second. Box size moves the answer in a straight line — 25 mA of average current is about 0.5 C in this box and about 0.1 C in a 12 x 10 x 4 in box. When a node reads high until you isolate the heat, this is the first arithmetic to run.
Three layouts that work
Pocket and chamber, one body. A divider splits the box: electronics and battery on one side, element on the other, vent on the element side. Hold 10-20 mm between the element and the nearest warm part, and take more if the depth allows. Slots answer in seconds; a patch needs minutes of vapor diffusion, which room and weather changes rarely outrun.
One chamber behind a membrane. A sealed box, the patch low on the wall, everything inside. It works while the average rise stays under 0.2 C, which means the sleeping duty cycle above. The membrane passes vapor, not heat, so it cures a damp box and never a hot one.
Stalk head. The element moves onto a small head outside the box, three wires back through an M12 gland, board and battery sealed behind. Best accuracy, fastest response, and the weather-station pattern. Outdoors, shade the head with a louvered shield — the membrane-versus-shield choice for outdoor sensors covers the sun side — and for the box itself start from the small outdoor enclosure built for a wireless radio board.
Park the cell at the bottom of the electronics chamber, away from the element. It is a thermal mass, and in-box charging adds its own warmth — half-rate charging of a 5000 mAh cell is 2.5 A. One safety note: lithium-ion datasheets set the charging window at 0 C to 45 C, so keep the charger off below freezing.
Body material and the antenna
Plastic and fiberglass pass a 2.4 GHz link straight through the wall; stainless attenuates it. In a steel body, put the antenna outside through a gland, the pattern used for a cellular antenna and battery inside a sealed outdoor enclosure, or let the stalk head carry sensing and RF in one move. In a genuinely hot location, an ESP32 in a sealed IP65 box in a hot attic shows how the degrees stack.
On grade: 304 serves dry indoor and sheltered outdoor walls; take 316L near the coast, along salted roads, and wherever washdown chemicals land, because 304 pits under chloride deposits even at room temperature. Wall material barely moves the reading — 3.7 against 3.5 W/m²K — so the pocket does the work. Sun is the other load: a dark box in the open runs degrees above air temperature, so pick a light finish, an eave, or the shield.
What to put on the order
| Line | What to specify | For a C6 + SHT40 node |
|---|---|---|
| Body | Width x height x depth you set, one-piece stainless | board footprint plus the pocket and 20 mm spare |
| Material | 304 dry indoor; 316L outdoor, coastal, washdown | 316L under an eave |
| Rating basis | NEMA 4X / IP66 by the manufacturer; not UL listed | vent patch carrying the same rating |
| Sensor vent | Round hole to the patch maker's drawing — small patches commonly take 6-12 mm | centered in the pocket, bottom face |
| Divider holding the element 10-20 mm from board and cell | slots indoors, patch outdoors | |
| Cable entry | One M12 gland per cable, antenna or stalk | low on the wall, below the electronics |
| Mounting | Wall flange, vent facing down | shaded wall or eave |
Send the cutout drawing with hole positions and diameters, and the body arrives with them cut — delivered in 10 business days from your approval of the drawing. The custom stainless cutouts page shows what a drawing-based quote needs, and the enclosure selector narrows body and material by environment when you would rather start from a shortlist.
The decision, one line per case:
- Dry indoor node: slotted pocket, plastic or 304 body, slots facing down.
- Splash, washdown or rain: two chambers, a patch rated IP66, 316L wherever salt or chemicals fly.
- Highest accuracy in full sun: stalk head under a louvered shield, sealed 316L body behind it.
Enclosures for this job
Catalog sizes that suit the job this article answers, picked from its subject; open one for its full specifications.
| Enclosure | Material | Outside H x W x D / display | Rating |
|---|---|---|---|
| 16 × 12 × 8 in | 304 stainless | 16 x 12 x 8 in | Rated NEMA 4X / IP66 by the manufacturer; not UL listed |
| 24 × 20 × 8 in | 304 stainless | 24 x 20 x 8 in | Rated NEMA 4X / IP66 by the manufacturer; not UL listed |
| 30 × 24 × 10 in | 304 stainless | 30 x 24 x 10 in | Rated NEMA 4X / IP66 by the manufacturer; not UL listed |
| 12 × 10 × 6 in | 304 stainless | 12 x 10 x 6 in | Rated NEMA 4X / IP66 by the manufacturer; not UL listed |
Questions
How far should the SHT40 sit from the ESP32 board and battery?
Plan on 10-20 mm of separation, plus a divider or vented pocket between them. A board that keeps its radio associated averages 20-40 mA and lifts a small sealed box about 0.4-0.7 C; a busy radio, about 1.6 C. Take the reading before each transmit as well, because the seconds around a transmission are the warmest at the element.
Does an ePTFE membrane vent lower the enclosure's IP rating?
The assembly takes the rating of its vent. Buy a patch the maker rates IP66 and the box stays IP66 end to end: ePTFE blocks the IPX5 jet, a 6.3 mm nozzle at 12.5 L/min, and the IPX6 jet, a 12.5 mm nozzle at 100 L/min, while passing vapor. The cost is lag, minutes to equilibrate, and two patches halve it because diffusion scales with area.
How long will a 5000 mAh battery run an ESP32-C6 sensor node?
About 59 hours with the radio busy at 85 mA average, and roughly 4000 hours — five and a half months — waking 3 s every 300 s at 0.4 mA asleep. Sleep buys the accuracy too, because the same 0.31 W lifts this box 1.6 C. Watch the sleeping current: a board held at 2 mA asleep averages 2.8 mA and runtime falls to about 1750 h, ten weeks.
Can the whole node live in a stainless steel box?
Yes, with the antenna outside: steel walls attenuate a 2.4 GHz link, so pass the antenna or the sensor stalk through an M12 gland, or use a plastic or fiberglass body, which lets the signal through. Pick 316L outdoors, near the coast or in washdown, and 304 for dry indoor walls. Our boxes are rated by the manufacturer, not UL listed.
Why does a temperature error show up in the humidity reading?
Sealed warm air holds the same moisture but reads drier: about 3 %RH per C at 50 % ambient, about 2 %RH at 30 % and about 5 %RH at 90 %. A +1.6 C self-heating error reports 50 %RH air as roughly 45 %RH, nearly three times the SHT40's ±1.8 %RH spec, so the placement of the sensor, not its calibration, is what fixes it.
What about condensation inside the pocket overnight?
A membrane patch passes vapor both ways, so the pocket tracks ambient instead of trapping damp air; mount it on the bottom or a side wall so rain sheds off. For a slotted indoor pocket, make the lowest slot the weep, 3-6 mm, at the chamber's lowest point. Outdoors in real weather, prefer the patch and keep the electronics chamber fully sealed.





