A Raspberry Pi board sitting on a desk isn't a finished object. Without a case it gathers dust, short-circuits on the first stray screw, and always ends up dangling off the end of the Ethernet cable. Off-the-shelf cases are fine when the project looks like every other project. As soon as there's a specific HAT, an extra fan, a cable that has to exit on one particular side, or a wall installation planned, a custom 3D printed case becomes the right answer. This guide covers what you need to know before ordering a custom electronics enclosure.
Why a custom case rather than a generic model
The Raspberry Pi cases sold for ten euros on consumer sites cover one use case: a bare Pi 4 or Pi 5, lying flat, with the original ports accessible. As soon as you move away from that scenario, they get in the way more than they help.
The first mismatch is mechanical. A HAT (Hardware Attached on Top) adds height, and most closed cases no longer close. A PoE HAT, a TFT screen, a relay board, an audio converter: anything that plugs in above the Pi assumes a case designed for it, or an open case that leaves the board exposed. Custom work lets you plan the exact height and the connector cutouts needed.
The second mismatch is thermal. A Pi 4 or 5 under sustained load gives off enough heat to hit frequency throttling inside a closed case with no ventilation. Generic black ABS models with no openings at all are the first affected. A custom printed case can incorporate vent grilles, a housing for a 30 or 40 mm fan, or even a passive heatsink on one side of the SoC. It's a chance to calibrate cooling to the board's real use rather than to a theoretical scenario.
The third mismatch is contextual. A home automation project hidden in an electrical cupboard doesn't face the same constraints as a media center on the TV unit or a sensor sitting in a greenhouse. Mounting, appearance, port orientation: everything depends on where the board is going to live. And that's exactly what on-demand 3D printing addresses one unit at a time, with no minimum order.
Existing model or custom design
Before modeling from a blank page, look at what already exists. For the most widespread boards, dozens of cases are available as free downloads, and some are excellent.
The libraries to explore first
The main free 3D model libraries host a considerable number of cases for common electronics boards. You'll find standard Raspberry Pi 4 and 5 cases as well as versions with a slot for a specific HAT, DIN rail mounts for installation in an electrical cabinet, Arduino Uno, Mega and Nano cases, shells for ESP32 and ESP8266, and holders for Raspberry Pi Zero and Pico.
Before ordering, check three things on the model's page. First, the exact revision of the board targeted. A Pi 4 and a Pi 5 don't have the same USB layout, and a case designed for one leaves the ports offset on the other. Second, the presence of source files (STEP or the original CAD file) alongside the STL: that's what makes a later modification possible. Third, print feedback from other users: a case that looks lovely in renders but has overly tight tolerances will have you ordering a part that won't close.
When to go custom
Custom work becomes relevant as soon as one of these situations applies: your Pi is paired with several specific daughter boards (HAT plus screen plus a particular fan); the case has to fit a wall niche, an under-desk space or a cabinet with constrained dimensions; you want to expose some connectors and hide others; or you're planning a small run of identical cases for a club, school or professional project.
In those cases, starting from a known source file (often available as STEP on maker forums) and adapting it costs less than drawing everything. Our service handles both printing a file you provide and designing from precise measurements or a schematic — see the STL file guide to prepare a submission properly.
The specific constraints of an electronics enclosure
A case housing electronics doesn't have the same requirements as a cable tidy or a shelf. Four points deserve particular attention.
Ventilation and heat dissipation
A Pi 5 can draw 5 to 8 W under load, almost all of which becomes heat. Add any USB peripherals, an NVMe SSD via HAT, or a radio module. Without ventilation, the internal temperature climbs quickly.
Three strategies coexist. The simplest is passive ventilation: grilles or slots on the top and one side, staggered, create natural draft. Count on 25 to 30% open area per face. The most effective is active ventilation: a 30 or 40 mm fan built into the case, powered from the Pi's GPIO pins. The case then provides the fan housing, its fixings and the cable route. The most discreet is passive dissipation through the shell: a metal heatsink is pressed against the SoC through a cutout, with the case acting as a structural element. That last approach demands very precise dimensions and stays reserved for polished projects.
Access to ports and connectors
The devil is in the cable openings. On a Pi 5 there are two USB-A, two USB 3.0, two micro-HDMI, the USB-C power input, the 3.5 mm jack, Ethernet, the microSD card, and the 40 GPIO pins. On a Pi Zero or an ESP32 the inventory is shorter, but so is the room for maneuver.
Two classic traps. First trap: cutouts that are too tight. Connectors have a real dimension slightly larger than the datasheet indicates, because the connector's plastic shell sometimes protrudes. Allow 0.5 to 1 mm of clearance around each opening. Second trap: an inaccessible microSD. On a Pi mounted board-down, it's easy to forget that the microSD is removed downward and therefore needs a slot, not just a hole.
Holding the board inside
The board has to be held without vibrating and without resting on its solder joints. Three solutions, in increasing order of robustness.
Clip-in posts built into the case hold the board by its mounting holes. That's quick to print, but the posts eventually break if you open and close often.
Heat-set M2.5 metal inserts are the reference in serious projects. Four inserts embedded in the plastic with an insertion press, four screws: the board is firmly fixed and the case survives dozens of openings. It's the approach to favor as soon as there's repeated professional or teaching use.
Screws driven directly into the plastic are the middle ground: you drive an M2.5 into a hole slightly smaller than the thread and the plastic acts as a nut. Solid on first assembly, more fragile under repeated tightening.
Sealing and protection
For a project exposed to dust (workshop, garage), ambient moisture (cellar, bathroom) or the outdoors (terrace, greenhouse), plan a case with no direct ventilation on top, with cable glands and a seal along the joint. FDM 3D printing alone doesn't guarantee IP65 sealing (the layers let a little air through), but a well-designed case with an EPDM or silicone seal reaches IP54 without difficulty, which is enough for most sheltered home automation projects.
Which material to choose
Material choice depends on the thermal context and the environment. The three main filaments available are reviewed in our guide to PLA, PETG and wood PLA; here's the specific reading for an electronics enclosure.
| Material | Indoor temperate case | Case near a heat source | Sheltered outdoor case |
|---|---|---|---|
| PLA | Very good | Avoid (deforms above 55-60 °C) | Acceptable if no direct sun |
| PETG | Very good | Good (holds to 70-80 °C) | Very good |
| Wood PLA | Attractive, not technical | Avoid | Avoid |
For the vast majority of home automation projects sitting in a living space or a cupboard, standard PLA is more than enough. If the case sits near a radiator, in an uninsulated attic, or houses a board that runs hot (Pi 5 plus NVMe SSD under load), PETG is safer. Wood PLA stays reserved for projects where looks come first, typically a media center in a living room.
Designing or adapting a case: the right reflexes
If you're starting from an existing file to modify, or designing from scratch, a few principles make for a clean print.
Closing tolerances
A two-part case (lid plus base) closes with clips, screws or a sliding fit. For a sliding fit in PLA, allow 0.2 to 0.3 mm of clearance around the perimeter. For clips, provide a chamfer on both sides of the contact: without it, the clip breaks on first opening. For a screw closure with inserts, the screw hole should be 0.3 mm larger than the nominal diameter so nothing is forced.
Print orientation
Printing a case upright (on its side face) rather than flat improves the finish of vent grilles and avoids supports inside, but demands more care on the first layer. Flat, the print is more stable but layers are visible on the sides and supports complicate rounded openings. State your preference in the quote request, or leave the choice to the service: on an electronics enclosure, it's rarely a neutral decision.
Clearance under the board
Allow 4 to 6 mm of clearance between the underside of the board and the bottom of the case to make room for solder joints and any adhesive. On a Pi 5, some components protrude more than on a Pi 4 — check the datasheet or eyeball it before fixing the height.
Three typical use cases
To make it concrete, here are three projects and the case that suits each.
The 24/7 home automation server (Home Assistant on a Pi 4 or 5, in an electrical cupboard) calls for a well-ventilated PETG case, with a DIN rail on the back, GPIO openings for Zigbee/Z-Wave antennas on a HAT, and a 40 mm intake fan. The board is fixed with metal inserts to make maintenance easier.
The media center (Pi 5 plus USB-C power, next to the TV) calls for a discreet case, matte finish or wood PLA, passive ventilation only (for silence), HDMI openings aligned with the TV cable, and an easily removable lid for changing the microSD.
The measurement sensor (Pi Zero W or ESP32 in a greenhouse, a chicken coop, a workshop) calls for a compact PETG case, IP54 sealing with a silicone gasket, a cable gland for the power lead, and wall mounting with two through-screws or 3M VHB adhesive tape depending on the surface.
What an on-demand printing service changes
Having a custom case printed rather than equipping yourself with a personal printer has two advantages for a maker. First, you don't have to invest in a printer, a filament storage setup or a calibration routine: all of that is the service's responsibility. Second, you get access to several materials you wouldn't buy by the reel for a single case — a black PETG for this project, a wood PLA for the next, without storing four kilos of each.
In use, count on 3 to 7 days of production depending on complexity and material — detailed in our pricing guide. For an order of one to ten identical pieces, it's almost always the fastest and cheapest route, nowhere near the cost of molding or machining.
If you have a project in mind, an STL or STEP file to print, or simply dimensions and a board layout to work around, get in touch with whatever you have. We'll come back with a proposed material, a lead time and a quote within 48 working hours.
