Most projects around here involve some sort of electronics, and some sort of box to put them in. The same is true of pretty much all commercially available electronic products as well.
Despite that, selecting an enclosure is far from a solved problem. For simple electronics it’s entirely possible to spend more time getting the case just right than working on the circuit itself. But most of the time we need to avoid getting bogged down in what exactly will house our hardware.
The array of options available for your housing is vast, and while many people default to a 3D printer, there are frequently better choices. I’ve been around the block on this issue countless times and wanted to share the options as I see them, and help you decide which is right for you. Let’s talk about enclosures!
Cardboard: Great for Both Enclosures and Proofing PCB Layout
You need something quick and dirty and temporary for a proof of concept or a short-lived project. Why not use some cardboard you have laying around?
Cardboard is easy to work with, and you can rapidly put in holes and slots for your interfaces and connectors. Draw on it, shape it, whatever it takes. Use card stock (like a cereal box) for even higher quality finer dimension work. In the world of rapid prototyping, cardboard is a fantastic option for generating quick iterations that test out usability and rough ideas. It also has a similar thickness to a .062″ PCB, making it quick and easy to print your design, glue it to cardboard, cut it out, and have a temporary substitute to do your mechanical work while you’re waiting for the real ones to arrive by mail.
Plastic Food Containers
When you need a little more sturdiness or water resistance, reusable plastic food enclosures, including yogurt containers and Tic Tac packaging, can go a long way as well. This high-fiving mobile disco turtle robot was made under the direction of a 5-year-old. The yogurt container holds the batteries, speaker, Arduino, and all the wiring, securing the sensitive parts just enough for this limited-lifetime monstrosity.
Find something roughly the size and shape you need, and trim and drill as necessary. A utility blade is the only tool needed to make a higher fidelity enclosure, and careful application of heat or glue can seal and stick parts together. Unless your aim is a kitsch-y product, you shouldn’t expect to do more than a couple of these, and their durability is limited, so expect that this will last only a little bit longer than cardboard, and better for wetter environments.
If you have skills with molding and can take a block of material and form it to your vision, then clay might be a good option, or oven-bake polymer (Sculpey). InstaMorph is another tool that consists of plastic that softens at low heat and becomes moldable. It’s available in sheets and pellets and can be softened with hot water or air and worked by hand until it cools.
Use Existing Enclosures
This option doesn’t get enough attention. Existing enclosure are perfect for small volumes, and bridge the gap between prototype and high volume production. Polycase, New Age Enclosures, Takachi, Bud, and Hammond are all places that I have used in the past for enclosures that are injection molded, extruded, or otherwise pre-fabricated, and can easily be modified to suit your exact needs (and no, we’re not being paid to mention any of them).
Once you become familiar with their product lines, you’ll start to recognize their enclosures in other products. You pick out an enclosure of the right size and type, and most of them provide CAD of some form (or at least PDF design drawings with relevant dimensions) and usually even suggested PCB outlines. Order one or a few and you have everything you need for only a couple bucks. When it’s time to take it to production, you can even give these companies drawings of any milling that’s needed, or printing on any face, and they’ll take care of that for you, too, for a small setup fee and per part cost.
There’s no shortage of articles about 3D printing here, and it seems like this is a default choice for people even when faster, cheaper, cleaner-looking options exist.
If your needs extend beyond a box, and you must have some kind of special enclosure to fit a specific shape, or you are trying to make it quickly or miniature, then 3D printing may work. You’ll have to bust out the CAD program of your choice, or find an existing design, and this is one of the things that makes this option less accessible to many, and can be very time consuming. On the plus side, a variety of materials are available, there are services that will 3D print and mail you the part, and many public libraries are even getting in on the 3D printer as a service they offer.
If you have access to it, laser cutting is a decent option as well. Generally these are acrylic or plywood enclosures, though cardboard works well, too, with the edges either interlocking or straight. There are online generators for simple customizable boxes like MakerCase and Boxes.py, and you can modify them after downloading to add your holes and cutouts.
Injection molds are the industry standard for high volume production, capable of spitting out plastic parts at phenomenal rates and running continuously. They can be designed to exact specifications, and last for anywhere from a few thousand up to millions of parts. The downside is the up-front costs, which can be in the thousands of dollars for basic molds, and millions for really high volume hardened steel with slides and multiple cavities and cooling lines. We’ve covered injection molding in detail, but the primary thing to remember about injection molding is that it’s not for a one-off, and you won’t be able to change your design easily once the tool is cut.
Others: CNC, Casting, and Composite
There are countless other options. You could make your enclosure out of wood or metal in a shop using CNC. There are all kinds of casting techniques, including 3D printing the mold and casting inside the mold, or 3D printing the positive, creating a silicone mold of it, and then casting parts inside the mold. You could put everything in a temporary enclosure and pot it (essentially dump epoxy in to fill it up). You could use a combination of methods to make different parts of your enclosure, or even sub-components. I’ve 3D printed and laser cut brackets for use in an existing enclosure.
Before you jump straight to your CAD software to spend a few hours designing a box and 3D printing it, consider other options that may be faster or cheaper or look better. Of course, this article wasn’t an exhaustive list, but if I missed something significant, mention it below.