Email us

Este artículo está en inglés. Ver el sitio en español

Cet article est en anglais. Voir le site en français

Dieser Artikel ist auf Englisch. Website auf Deutsch ansehen

Este artigo está em inglês. Ver o site em português

Outdoor Arduino garden sensor hub: enclosure and cable runs

Short answer: keep the electronics out of the bed. Mount a sealed 304 stainless box, manufacturer-rated NEMA 4X / IP66 and not UL listed, on a pedestal 2-3 ft [0.6-0.9 m] from the soil. Run 22 AWG stranded cable about 2 m [6.5 ft] to the soil probe through glands in the bottom wall, and put the ambient BME280 outside the box in a radiation shield so it reads the garden, not the enclosure.

NEMA4 Enclosure engineering team · Published November 4, 2026 · 7 min read

Short answer: keep the electronics out of the bed entirely. Put the board in a sealed 304 stainless box, manufacturer-rated NEMA 4X / IP66 and not UL listed, on a pedestal 2-3 ft [0.6-0.9 m] from the bed edge. Run 22 AWG stranded cable about 2 m [6.5 ft] down to the capacitive soil probe, entering through glands in the bottom wall. Put the BME280 that measures the garden outside the box in a radiation shield, so it reads air instead of enclosure. Sealing the box is still the right call even though you log humidity: a vented box reads warm box air rather than ambient, and it invites irrigation mist onto the electronics.

Keep the box off the soil

A box sitting at the bed catches everything the garden throws: hose splash, mulch from the spade, fertilizer dust, and soil moisture wicking into the mounting feet. Give it distance and height instead. Set a post 2-3 ft [0.6-0.9 m] from the bed edge and mount the box with its center 36-48 in [0.9-1.2 m] above grade. That clears the bottom wall of splash, puts the door at a comfortable working height, and lifts the glands away from the wet. Face the door away from the afternoon sun; the gasket and cable jackets age slower and the box runs cooler.

The split that makes the layout work is simple: the probe stays in the bed on its cable, and everything else stays dry on the pedestal. The soil probe is the consumable, because coatings wear and joints corrode, while the enclosure should outlast several of them. A 2 m [6.5 ft] cable turns a dead probe into a five-minute swap instead of a project.

If the only mounting surface is a fence post at grade, keep the lowest gland 2 in [50 mm] above the soil line and rake the mulch back below it. Grade mounting works; the pedestal is simply better.

The rating the garden asks for

What actually hits this enclosure: a hose nozzle at close range, sprinkler jets, wind-driven rain, dust and leaf debris, then a full day of sun. IEC 60529 grades the water. Second digit 6 means the box holds against powerful jets, delivered by a 12.5 mm nozzle at 100 L/min; first digit 6 means dust-tight. IP65, one step down, faces a 6.3 mm nozzle at 12.5 L/min, which covers splashing and drizzle rather than a thumb over the hose end. Sprinklers and wash-down hoses put you in digit-6 territory, so specify IP66.

In NEMA terms that is Type 4X: hose-down plus the corrosion behavior of stainless. Our enclosures are rated NEMA 4X / IP66 by the manufacturer; not UL listed. A UL listed enclosure is one evaluated by UL to UL 50E, and NEMA itself tests, certifies and endorses nothing.

If a mains power supply ever lands inside this box, the rules change with the voltage: NEC 110.28 treats an IP code as no substitute for an enclosure type rating, and a 10 x 8 x 6 in box is a poor home for line voltage. Keep the mains in the house and send low voltage out, and the wiring stays simple all season.

Where the BME280s go

Start with the physics, because it decides the layout. Seal a box at 20 C [293 K] on a mild morning and let the sun take it to 35 C [308 K]: the trapped air rises to 1013 x 308 / 293 = 1065 mbar, a +52 mbar error. Whole weather fronts move 20-30 mbar in a day, so a sensor inside a sealed box logs the box temperature, not the weather. Humidity goes the same way. Air sealed at 50% RH and 20 C reads about 21% RH at 35 C, because saturation pressure climbs from 23.4 to 56.3 hPa; the relative humidity inside an enclosure follows the wall temperature and only that.

A vent fixes the pressure and nothing else. The air in a vented box is still box air, warmed by a sunlit wall and slow to exchange, and the vent is an open path for dust and hose mist. So give the garden its own sensor: a second BME280 outside the box in a radiation shield, 12 in [300 mm] from the box on the shaded side, on an I2C lead under 1 m [3 ft]. The I2C-bus specification caps the bus at 400 pF of capacitance, and garden-length leads overrun it into random read errors. The outdoor humidity sensor guide works through the shield-versus-membrane choice in detail. That one outside sensor then gives you honest temperature, humidity and pressure together.

Keep the first BME280 inside only to watch enclosure humidity as a condensation warning, a legitimate job that the humidity sensor in a sealed enclosure article explains. If day-night pressure cycling concerns you, fit a membrane vent plug rated IP66 or better: it passes vapor and pressure while holding the jet rating. The weakest part sets the assembly's rating, so a vent, drain or connector below IP66 pulls the whole box down to that level.

The cable runs

The analog soil probe is the easy run. A capacitive probe draws about 5 mA at 3.3 V, and 22 AWG stranded wire is 52.9 milliohm per metre, so a 2 m [6.5 ft] run is a 4 m loop of 0.21 ohm. The drop is 5 mA x 0.21 ohm, about 1 mV, three hundredths of a percent of the 3.3 V supply and far below the ADC's own noise. Runs to 2 m [6.5 ft] are proven garden practice; stranded beats solid at this length because it survives weeding and seasonal flex. Hold the I2C BME280 lead under 1 m [3 ft] as above.

Route the probe cable through 1/2 in [13 mm] electrical conduit buried about 6 in [150 mm] under the bed, rising up the pedestal to the box. Conduit buys you a re-pull when the probe dies, and it beats bare surface cable and direct burial against spades and rodents alike. The soil sensor cable entry layout shows the entry spacing and strain relief at the box end.

Bring both cables in through glands in the bottom wall, with a 4 in [100 mm] drip loop hanging below each gland so water running down the cable drips off in free air. An M12 (PG7) gland with a 3-6.5 mm [0.12-0.26 in] sealing range takes typical 4-5 mm sensor cable, and the cutouts and glands guide sets the hole sizes. A gland on any face but the bottom collects water at the seal, the same failure mode as glands facing up on an outdoor box.

At the probe end, insert the prong to the line marked on it and keep everything above that line, the chip end and the soldered joint, out of the soil. Slide adhesive-lined heat shrink over the joint so the only wetted part is the coated prong. Inside the box, land the runs on a terminal strip rather than straight into the board, the layout the outdoor sensor cable connections article draws out; it pays for itself at the first probe swap.

Heat: what sealing costs you

Here is the arithmetic that settles the cooling question. A Nano-class ESP32 board with WiFi burst traffic averages roughly 0.15 A at 5 V, call it 0.75 W; the BME280 adds milliwatts.

  • Heat to shed: 0.75 W
  • Box: 10 x 8 x 6 in [254 x 203 x 152 mm], surface about 2 x (0.254 x 0.203 + 0.254 x 0.152 + 0.203 x 0.152) = 0.24 m2
  • Stainless wall, k = 3.7 W/m2K (this site's reference value)
  • Temperature rise: 0.75 / (3.7 x 0.24) = 0.8 C

So on a 43 C [110 F] high-summer day the electronics sit near 44 C with no airflow at all. Even the 6 x 6 x 4 in box, at 0.11 m2 of surface, rises only 1.9 C at the same load. Venting buys a fraction of a degree here and costs you the rating.

The sun, not the board, is the heat problem. A sealed box in direct sun sits above air temperature for hours, which is the reason an outdoor temperature sensor reads high. That is why this layout shades the box and puts the ambient sensor in its own shield 12 in [300 mm] away. Material barely matters thermally at 0.75 W: painted steel manages k = 5.5 W/m2K and plastic 3.5, so the 0.1 C difference is noise. Choose stainless for the corrosion behavior and the hinged, gasketed door.

What to order

Line item What to specify
Enclosure 10 x 8 x 6 in 304 stainless wall-mount, hinged gasketed door, removable mounting panel
Smaller builds 8 x 8 x 4 in or 6 x 6 x 4 in, same grade and rating
Grade 304 inland; 316L near salt water, same sizes
Rating Manufacturer-rated NEMA 4X-type / IP66 - not UL listed
Cable entries Two M12 glands in the bottom wall, 4 in [100 mm] drip loops
Sensor runs Probe on 2 m [6.5 ft] of 22 AWG stranded; ambient BME280 lead under 1 m [3 ft]
Optional Membrane vent plug rated IP66 or better, for pressure equalization

The 10 x 8 x 6 in box gives a terminal strip, the 5 V regulator and spare room; the 8 x 8 x 4 in fits a board and a strip comfortably; the 6 x 6 x 4 in is the floor for a Nano-class board plus two glands. All three come in 316L for coastal sites, and wall-mount enclosures lists the full size run, with the enclosure selector as the starting point when the post already fixes your height and width. Put the gland holes and any door cutout on the drawing and they arrive cut from one piece; delivery is 10 business days, counted from your order, or from your approval of the drawing for custom work.

The whole decision in one line: 304 stainless, sealed and manufacturer-rated NEMA 4X / IP66, on a pedestal 2-3 ft [0.6-0.9 m] out, the probe in the bed on a 2 m [6.5 ft] cable, and the ambient BME280 in a shield 12 in [300 mm] from the box.

Enclosures in this article

EnclosureMaterialOutside H x W x D / displayRating
6 × 6 × 4 in304 stainless6 x 6 x 4 inRated NEMA 4X / IP66 by the manufacturer; not UL listed
8 × 8 × 4 in304 stainless8 x 8 x 4 inRated NEMA 4X / IP66 by the manufacturer; not UL listed
10 × 8 × 6 in304 stainless10 x 8 x 6 inRated NEMA 4X / IP66 by the manufacturer; not UL listed

Questions

Should the sensor cables be buried or left on the surface?

Bury them in 1/2 in [13 mm] conduit about 6 in [150 mm] down, or clip UV-stable cable under the mulch. Spades and rodents kill bare runs long before water does, and conduit lets you pull a replacement probe without digging up the bed. Bring the conduit up the pedestal on the side away from the main sprinkler arc.

Does the box need to be 316L stainless instead of 304?

304 holds up at an inland garden through seasons of watering and fertilizer dust. Move to 316L within about 1 mile [1.6 km] of salt water, or where chloride-rich fertilizer sits on the box all year; the molybdenum in 316L resists chloride pitting, and 304 can pit in a wet gasket crevice even at room temperature. Both grades share the same 60 C [140 F] chloride stress-corrosion threshold.

How do I get power out to the pedestal?

Send 12 V DC from the house on 18 AWG cable and drop it to 5 V at the box. A 30 ft [9 m] run is 18 m of loop, about 0.38 ohm; at a steady 150 mA that drops 0.06 V, which is nothing at 12 V. A 0.4 A WiFi transmit burst on the same loop drops 0.15 V, about 3% of a 5 V feed but trivial on 12 V.

Will the electronics overheat in a sealed box?

No. At 0.75 W in the 10 x 8 x 6 in box the rise through the stainless wall is 0.8 C, and double the load still stays under 2 C. The sun is the real heat source, which is why the box goes on the shaded side of the pedestal and the ambient sensor lives in its own shield 12 in away.

Can the soil probe hang out of the bottom of the box into the ground?

Only if the box sits on the soil, and then it lives in permanent damp with an unsealed probe passing through the wall. On the pedestal the probe reaches the bed on its 2 m [6.5 ft] cable, so a corroded probe becomes a five-minute gland swap instead of opening the electronics in the rain.

Checklist before you order

Specify it once, built to your drawing

  • Environment and NEMA type: Type 1, Type 3R, Type 4, Type 4X, Type 6P, Type 12, Type 13 (manufacturer ratings, not UL listed)
  • Material: 304 stainless steel, 316L stainless steel, Powder-coated carbon steel, Aluminum, Polycarbonate, Fiberglass (FRP)
  • Size: inside or outside height, width and depth, with the depth your deepest component needs
  • Cutouts, glands and windows, dimensioned from one datum on each face
  • Mounting and access: wall, pole or stand, hinge side, mounting panel
  • Quantity: from one piece

Delivered in 10 business days, anywhere in the world. Counted from your order; for custom work, from your approval of the drawing.

Build it from 6 × 6 × 4 inRequest a custom quote

Check the heat load in the calculator · NEMA 4X enclosures: sizes for this job

Keep reading

More on outdoor, heat and moisture

All articles

Buying guides

The guides behind this answer

All guides