DEV Community

Cover image for Snap-Fit Cases, Ball Joints and Magnets: 3D Printing an Enclosure for Your ESP32-CAM
flarelab
flarelab

Posted on Originally published at flarelab.com

Snap-Fit Cases, Ball Joints and Magnets: 3D Printing an Enclosure for Your ESP32-CAM

An ESP32-CAM board costs about the price of a coffee, but out of the bag it is a naked green rectangle with a camera lens hanging off one edge. Point it at your front door and you have a security camera; leave it loose on a shelf and you have a board that falls behind the shelf. A new case kit shared on MakerWorld by the maker i-BoxIt closes that gap, and it is a small clinic in three techniques every 3D printing beginner should learn: snap-fit closures, printed ball joints, and magnet pockets.

Start with the snap fit. Instead of screws, the lid has a thin lip that bends outward as it slides past a ridge on the case, then springs back to lock. The whole trick lives in the clearance, usually 0.15 to 0.25 mm of deliberate gap between the two parts. Too tight and the lid will not go on. Too loose and it drops off when you pick the camera up. The kit covers both micro-USB and USB-C board variants, because the connector cutout is the one dimension you cannot fudge.

The mount is the more interesting half. A printed ball joint gives you a camera that aims anywhere, and the kit fixes the ball to the case using a short piece of filament as a pin, which is about as elegant as scrap-bin engineering gets. Add an optional 10x2 mm magnet in the base and the camera sticks to any steel surface: a radiator, a metal door frame, the side of a filing cabinet. A separate wall mount takes a screw or an 8x2 mm magnet. If you are running the board from a cable rather than a battery, the cable threads through the ball mount so nothing dangles.

Printing it is undramatic, which is the point. A 0.4 mm nozzle at 0.2 mm layer height is plenty. Use three perimeters so the snap arms have material to flex without delaminating, and 15 to 20% infill. Orient the case open-face down and you will need no supports at all. PLA works for an indoor build; choose PETG if the camera will sit in a window or anywhere warm, since PLA softens around 60 C. Print one lid first and test the fit before committing to the full set.

Try it on your printer. Enclosures are the ideal second or third project after the calibration cube, because they teach tolerance in a way no test print can: either the lid clicks or it does not. Grab a spool, print a single test lid, dial in your clearance, then run the whole kit. Filament, magnets and printer supplies are all at flarelab.com, and Flick is always happy to see another board get a proper home.

Frequently asked questions

How much clearance should a snap-fit lid have?

Start at 0.2 mm between the lid and the case wall, then adjust. If the lid rattles, drop to 0.15 mm; if you have to force it, go to 0.25 mm. Every printer and every filament shrinks slightly differently, so one test lid saves a whole failed enclosure.

Which filament is best for an electronics case?

PETG is the safer pick for anything near heat or sunlight, because PLA starts softening around 60 C. PLA is fine for an indoor desk camera and prints more easily. For snap arms that flex repeatedly, PETG or ABS holds up far better than PLA, which fatigues and snaps.

Do I need supports for a case like this?

Usually no. Well-designed enclosures orient the open face down so walls print as vertical perimeters. Lens holes and USB cutouts print as bridges, which most printers handle up to about 15 mm. If your slicer wants supports everywhere, try rotating the part instead.

How do I stop magnets from popping out of their pockets?

Model the pocket about 0.1 mm undersized and pause the print one layer before the pocket closes, drop the magnet in, then resume so the print seals it permanently. If you prefer glue, a drop of cyanoacrylate works, but check magnet polarity before it cures.

Why use a piece of filament as a hinge pin?

A 1.75 mm filament offcut is a free, perfectly round pin that is already the same material as the print, so it expands and contracts at the same rate. Push it through the ball joint, snip it flush, and touch the ends with a hot soldering iron tip to mushroom them into place.

Source: the ESP32-CAM Case Kit by i-BoxIt, spotted via Adafruit's #3DThursday roundup. Rewritten and expanded by Flarelab.

Originally published at flarelab.com.

Top comments (0)