Back to blog

3D printed Arduino and Raspberry Pi enclosure - getting the sizes right

Published: Updated: 4 min read
3D printed Arduino and Raspberry Pi enclosure - getting the sizes right

A bare board lying on the desk collects dust and short circuits from paper clips. A 3D printed enclosure fits one specific board: the openings are where the connectors are, and the board sits on standoffs, screwed down.

Below are the numbers our electronics enclosure generator uses.

Arduino and Raspberry Pi casesFree toolArduino and Raspberry Pi casesA box for your board with standoffs on its holes, port cut-outs and a screw-on lid

Board and mounting holes

  • Arduino Uno is 68.6 x 53.3 mm with Ø3.2 mm holes, Mega 101.6 x 53.3 mm. Raspberry Pi 4 and 5 are 85 x 56 mm with M2.5 holes on a 58 x 49 mm grid, Pi Zero 65 x 30 mm.
  • The generator places standoffs exactly under the holes from the maker's documentation. For your own board, enter its size and the hole inset from the edge.
  • 5 mm standoffs lift the board off the floor, so the soldered leads underneath do not touch the plastic.
  • A 2.6 mm hole in the standoff takes an M3 screw into plastic, or 4.0 mm takes a heat-set threaded insert if the case will be opened often.

Clearance, walls and height

  • 2 mm clearance around the board - it drops in without forcing, and the walls need no sanding.
  • Walls and floor are 2 mm. Under 1.6 mm they flex, and the generator flags it.
  • 18 mm of free height above the board fits typical headers and shields. Under 8 mm, USB plugs and cables may not fit.
  • The lid screw columns stand in the enclosure corners, not next to the board, so they do not block the connectors at its edges.

Connector cut-outs

For each board the generator suggests cut-outs: on the Uno a 14 x 13 mm USB-B and a 10 x 12 mm power jack, on the Pi 4 USB and Ethernet on one side and USB-C, micro HDMI and audio on another. You can add up to four cut-outs: USB-C 13 x 8 mm, a 20 x 8 mm cable pass-through or your own size.

Connector positions differ between board revisions, so check them with a caliper before printing.

Need a print like this?

Send a model or describe the part - you'll usually get a free quote within 24 hours.

Request a quote

Finish: rounded edges and chamfers

In the “Finish” panel you choose how the edges look: rounded, chamfered or sharp. The model still prints without supports, and the edge on the bed gets a small chamfer (up to 0.45 mm) that hides the “elephant’s foot” of the first layer. Where a part has to fit (hooks, holes, inner sizes), the generator only finishes the edges that do not change the fit. A rounded print looks bought rather than prototyped, and it does not cut your hand.

Lid and printing

  • The lid has a 1.2 mm lip that goes into the box and locates it, plus optional vent slots above the processor.
  • The box prints open side up, the lid flat with the lip up. Both parts come out without supports, and the top edge of each cut-out is a short bridge.
  • For a Raspberry Pi, which runs warm, PETG beats PLA. For Arduino, PLA is enough.
  • Rounded edges and 3 mm corners make the case look bought rather than prototyped.

Frequently asked questions

Does the enclosure fit a Raspberry Pi 5?+

Yes. The Pi 5 has the same board size and hole spacing as the Pi 4 (85 x 56 mm, 58 x 49 mm grid). The connectors are elsewhere, so move the cut-outs to match your board.

Which screws should I use?+

Board and lid take M3 screws into plastic (2.6 mm hole), a Raspberry Pi takes M2.5 screws. If you open it often, choose the 4.0 mm hole for an M3 heat-set insert.

Will a Raspberry Pi overheat in the case?+

Under light load the lid slots are enough. Under constant load add a heatsink or a fan and use PETG, which tolerates higher temperatures than PLA.

Recommended gear for this topic

Affiliate links: if you buy something I get a small commission, and you pay the same. As an Amazon Associate I earn from qualifying purchases.

Sources

  1. Arduino UNO R3 - documentation, Arduino
  2. Raspberry Pi hardware - mechanical drawings, Raspberry Pi Ltd
  3. Modeling with 3D printing in mind, Prusa Research

Author

Bartosz Budny, founder of BnB3D

He has worked in 3D printing for more than 10 years: servicing, building and running printers, and has designed in Fusion 360 for more than 5 years. He writes about what he prints and tests on his own printers in Myszków, Poland (over 4,000 print hours on his MakerWorld models alone).

Got a project to print?

Send a model or a description - you'll usually get a free quote within 24 hours.

Request a quote

Related services