Short answer: size the enclosure from the installed envelope, not from the controller's body dimensions. A DIN-rail controller with connectors and cable bend needs about 4.7 in [120 mm] of usable depth: 0.3 in of rail, 1.8 in of device, 2.6 in of plugs and bend. A 6 in [150 mm] deep box covers that once the door takes its 0.8 in. Width and height come from row arithmetic, with a 2 in [50 mm] wiring row beside the rail and margins at both ends. Then the heat check gets the last word. Sealed stainless sheds heat slowly: at 35 C [95 F] ambient, 16 W of electronics needs about 0.9 m² of wall to stay under 40 C. That often picks a bigger box than the rail layout did.
The depth stack, measured from the wall
Enclosures come up shallow for one reason: the datasheet quotes the case, and the installation adds the rail, the plugs and a bent cable. Measure from the mounting surface — rear wall or backplate — out to the furthest point of the assembled gear, then add the door. For a typical compact controller the stack looks like this:
| Layer | Depth | Where it comes from |
|---|---|---|
| TS35 rail and clips (IEC 60715) | 0.3 in [8 mm] | rail height plus clip |
| Device body behind its terminals | 1.8 in [46 mm] | datasheet depth from the rail face |
| Connector bodies plus cable bend | 2.6 in [66 mm] | 0.9 in [23 mm] plugs + 1.7 in [43 mm] bend |
| Usable depth needed | 4.7 in [120 mm] | sum of the three layers |
| Formed door, gasket compressed | 0.8 in [20 mm] | enclosure section drawing |
| Nominal depth to order | 6 in [150 mm] | round 5.5 in up one increment |
The 1.7 in [43 mm] bend term is four times the cable OD, the minimum bend radius cable makers print for control and communications cable — here 4 x 0.43 in [11 mm]. Front-exit connectors change the arithmetic. Add their full body length to the stack and start at 8 in [200 mm] of depth.
The trustworthy version of this table is physical. Clip a foot of rail to an offcut panel, hang the deepest device, plug in the fattest connector and lay in a real cable with its service loop. The panel-to-cable-outside measurement is the number you order to. A 6 in [150 mm] nominal depth leaves about 5.2 in [130 mm] usable, so the 4.7 in stack fits with 0.5 in [13 mm] to spare.
Width and height from the row arithmetic
Width is one row across the box. Stack the pieces and add margins:
| Item | Width | Note |
|---|---|---|
| Rail end anchors | 0.4 in [10 mm] | 2 x 0.2 in |
| Controller | 3.9 in [100 mm] | datasheet |
| Service gap between neighbours | 0.5 in [13 mm] | air, fingers, removal |
| 120 W power supply | 1.9 in [48 mm] | datasheet |
| Wiring duct | 2.0 in [50 mm] | vertical duct at the row end |
| Side margins | 1.5 in [38 mm] | 2 x 0.75 in |
| Sum | 10.2 in [259 mm] | order 12 in [305 mm] |
Height runs the same way: 2.5 in [64 mm] of gland row and slack at the top, 4.5 in [114 mm] of rail row, 2.0 in [50 mm] of cable bend at the bottom and 1.0 in [25 mm] of margin. That sums to 10.0 in [254 mm], so order 12 in [305 mm] and bank the spare as future rail. The backplate and DIN rail layout guide carries the full set of layout habits; this is the arithmetic that sets the shell around them.
Hold the duct to 50% of its cross-section. That is the fill limit the duct tables in that guide use, citing NFPA 79-2012 section 13.5.2. Round cables leave enough air gaps that 50% is what physically fits. If your wires will not go in at 50%, add a second duct row rather than packing the first.
If the box also lands the mains feed, NEC 312.6 sets wire bending space at terminals by size — 2.5 in [64 mm] for 2 AWG with one wire per terminal — and more where the conductor leaves the wall opposite its terminal (Table 312.6(B)). Give that terminal row its room before you fix the height. For getting cables from the glands to those terminals, the routing rules are in controller enclosure cable entry for machine wiring.
What you need before you start
- Datasheets that print depth measured from the rail face and connector projection, not just the case outline.
- The fattest cable with its real plug — RJ45, M12 or ferruled end — for the physical check.
- A foot of TS35 rail and clips for the mock-up: the same parts you will use to hang the rail later, covered in how to mount DIN rail on a backplate.
- The heat numbers: supply efficiency at your actual load, and each device's draw in watts.
- A rule or caliper, and the enclosure section drawing for the door term.
Step by step to the size you order
- List everything that hangs inside: every DIN device, the supply, duct, glands, terminals — and the relay that appears after commissioning.
- Pull width, height and depth-from-rail for each device, plus connector projection where the datasheet prints it.
- Build the depth stack for the worst device: 0.3 + 1.8 + 2.6 = 4.7 in [120 mm] here. Add 0.8 in [20 mm] of door and round up to a 6 in [150 mm] nominal depth.
- Lay the row for width: anchors, devices, 0.5 in [13 mm] gaps, a 2 in [50 mm] duct and 0.75 in [19 mm] margins. That sums to 10.2 in [259 mm]; order 12 in [305 mm].
- Lay the height: gland row, rail row, bend space, margin — 10.0 in [254 mm] here; order 12 in [305 mm].
- Add terminal bending space if feeders land in the box: 2.5 in [64 mm] for 2 AWG, one wire per terminal, under NEC 312.6.
- Run the heat check below. At 35 C [95 F] ambient it usually wins and grows the box.
- Send width x height x depth with every gland and operator hole laid out in the cutout designer with your quote for a custom enclosure. Custom boxes are delivered in 10 business days anywhere in the world. For custom work the count starts from your approval of the drawing we send back.
The heat check picks the final size
A box that fits can still cook the gear, so run this check before the order rather than after the first trip. The worked example, end to end:
- Load: a 24 V, 5 A supply — 120 W of output at 92% efficiency — feeding a controller that draws 6 W.
- Heat in the box: the controller's 6 W plus the supply's losses, 120 x (1 - 0.92) / 0.92, or about 10 W. Total 16 W.
- Surface of the 12 x 12 x 6 in [305 x 305 x 150 mm] box: 2 x (0.305 x 0.305 + 2 x 0.305 x 0.152) = 0.37 m².
- Rise: temperature rise = power / (k x A) = 16 / (3.7 x 0.37) = 11.7 K, with stainless walls at k = 3.7 W/m²K, the value our thermal guides use.
At 25 C [77 F] in a control room the box holds 25 + 11.7 = 36.7 C. That is under the 40 C [104 F] drives and most electronics are rated for, so order that box. At 35 C [95 F] on a plant floor the same 16 W gives 46.7 C, over the limit. The load now needs a rise of 5 K or less, so A must reach 16 / (3.7 x 5) = 0.87 m² of surface, call it 0.9 m². A 24 x 20 x 8 in [610 x 508 x 203 mm] box carries 1.07 m², so the rise is 16 / (3.7 x 1.07) = 4.0 K and the inside sits at 39.0 C.
Rule worth keeping: a sealed 12 x 12 x 6 stainless box sheds about 7 W for a 5 K rise (1.37 W/K x 5 K = 6.9 W). A fan or filtered vent moves more heat, but the assembly then carries the vent's rating. On a washdown box that trades away Type 4X, and the larger sealed box is usually the better trade. The measurement side of this is in power supply enclosure cooling and temperature checks; the enclosure selector narrows candidate sizes by DIN module count once the load is known.
| Where the panel lives | Ambient | Size to order |
|---|---|---|
| Air-conditioned control room | 25 C [77 F] | 12 x 12 x 6 in [305 x 305 x 150 mm] |
| Warm plant floor | 35 C [95 F] | 24 x 20 x 8 in [610 x 508 x 203 mm], or cut the heat under 7 W |
| Washdown or outdoor site | 35 C [95 F] plus water | same box as the plant floor, in 304 stainless; 316L where salt air or brine finds it |
One line on ratings: these boxes are rated NEMA 4X / IP66 by the manufacturer; not UL listed. NEMA does not test or certify enclosures.
Checks when the panel is built
- Fit: dress every real cable, close the door on its gasket, and confirm nothing presses the service loop. Each device should unclip from the rail without removing the duct.
- Thermal: run the loaded panel for 4 h and measure the air in the top third of the box. The example box at 25 C should read about 37 C. A reading near the devices' 40 C limit means less heat or more box, not patience.
- Glands: seals seated on the cable and nuts tight before the first washdown. A loose gland is the first leak on any cut wall.
- Kill the feed and lock it out before a hand goes in to re-dress wiring.
Mistakes that cost the space or the rating
- Ordering from body depth. Do not drop the 2.6 in [66 mm] of plugs and bend — it is over half the 4.7 in stack, and it is the mistake most panels make.
- Field-cut holes. Every gland hole belongs on the drawing you approve. A hole cut later, with a gland that does not seat, pulls the whole assembly down to that gland's rating — what NEMA rating a panel keeps after you cut it and mount devices shows the arithmetic.
- Taking nominal depth as usable. The 0.8 in [20 mm] door term is real on every formed-door box; read usable depth off the section drawing.
- Duct packed past 50% fill. Compressed wires walk out of terminals; a second duct run costs less than the callback.
- No spare. Leave 4 in [100 mm] of spare rail and one spare duct position for the device added in year two. It costs one width increment now and saves a new enclosure later.
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 |
|---|---|---|---|
| 12 × 12 × 6 in | 304 stainless | 12 x 12 x 6 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 |
| 16 × 12 × 8 in | 304 stainless | 16 x 12 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 |
Questions
How deep does an enclosure need to be for DIN rail devices?
Plan for 4.7 in [120 mm] of usable depth for a typical controller: 0.3 in of TS35 rail, 1.8 in of device body and 2.6 in of connector projection plus cable bend. A 6 in [150 mm] nominal depth covers that once the door takes its 0.8 in [20 mm]. If the connectors exit the front face instead of the top edge, add their full body length and start at 8 in [200 mm].
How much wiring space should I leave beside DIN rail devices?
Leave a 2 in [50 mm] duct beside the row and hold it to 50% fill — the limit the duct tables use, citing NFPA 79-2012 section 13.5.2, because round cables leave air gaps. Add 0.2 in [5 mm] end anchors at each rail end and a 0.5 in [13 mm] service gap between neighbours. Two inches of honestly filled duct carries most of a small panel's control wiring.
Can a 12 by 12 by 6 inch enclosure cool a controller and power supply?
A sealed 12 x 12 x 6 in [305 x 305 x 150 mm] stainless box sheds about 7 W for a 5 K rise at k = 3.7 W/m²K. With 16 W inside — a 120 W supply at 92% efficiency plus a 6 W controller — the rise is 11.7 K: 36.7 C in a 25 C room, 46.7 C at 35 C ambient. At 35 C ambient move to about 0.9 m² of surface, for example a 24 x 20 x 8 in [610 x 508 x 203 mm] box, which holds 39 C.
Does the door or mounting panel reduce usable enclosure depth?
Both do. Devices sit on the backplate, the backplate stands off the rear wall, and the formed door with its gasket sits about 0.8 in [20 mm] inside the nominal depth. Measure usable depth from the mounting surface to the inside face of the closed door: on a 6 in [150 mm] nominal box that is about 5.2 in [130 mm], which fits the 4.7 in [120 mm] DIN stack with 0.5 in [13 mm] to spare.





