Printed It: Custom Enclosure Generator

You’ve written your firmware code, etched your own PCB, and now it’s time to put that awesome new project of yours into an enclosure. Unfortunately, all you have is a generic Radio Shack project box that you picked up when they were clearing out their inventory. If you put your project in that, it’ll have all the style and grace of a kid wearing hand-me-down clothes. Your project deserves a tailor-made enclosure, but the prices and lead time on custom plastic enclosures are prohibitive for one-off projects.

In Ye Olde Olden Days, the next step might have been to start bending some sheet metal. But it’s the 21st century, and we’ve got mechanization on our side. The “Ultimate Box Maker” by [Heartman] is a fully parametric OpenSCAD design which allows you to generate professional looking enclosures by simply providing your desired dimensions and selecting from a few optional features. In a couple of hours, you’ll have a custom one-of-a-kind enclosure for your project for a few cents worth of filament.

That’s the idea, at least. For this edition of “Printed It”, I’ll be taking a look at the “Ultimate Box Maker” by generating and printing a basic enclosure. As somebody whose Radio Shack was out of enclosures by the time I got there and who doesn’t want to slice his hand open folding sheet metal, I’m very interested in seeing how well this design works.


So in theory, this design is supposed to work with the Thingiverse Customizer, which is basically just a web front-end for OpenSCAD. You get nice little sliders and dialog boxes, and once you have all your information entered, it will render you a custom STL to download. It’s arguably one of the best ideas MakerBot has come up with in regards to how Thingiverse works. Unfortunately, at the time of this writing, Customizer doesn’t seem to work anymore and just gives an error about missing Sigh.

In that case, we’ll need to download the .scad file from the “Thing Files” tab and open it up in OpenSCAD locally. All the configuration values are up at the top of the file and clearly labeled, which makes this fairly easy.

Obviously, you’re going to want to adjust the overall box dimension variables at the minimum. But there are also a whole set of options for PCB standoffs (position, diameter, screw size, etc), as well as options related to the built-in vents.

Making use of the OpenSCAD import(); function, you can bring in an STL of an existing PCB and see exactly how it will look in the rendered case. As a demonstration, I’ll be making a small enclosure for the Pi Zero, so I’ve imported an STL of it and used that to align the PCB standoffs. But even if you don’t import an STL to use as a guide, there’s a helpful “ghost PCB” that floats around inside the case while your editing the file in OpenSCAD.

Exporting the STL

Once you’ve edited the variables to your liking, you’ll want to scroll a little farther down in the code to find a section that looks like the following:

/* [STL element to export] */
//Coque haut - Top shell
TShell = 0;// [0:No, 1:Yes]
//Coque bas- Bottom shell
BShell = 1;// [0:No, 1:Yes]
//Panneau avant - Front panel
FPanL = 0;// [0:No, 1:Yes]
//Panneau arrière - Back panel
BPanL = 0;// [0:No, 1:Yes]

These options selectively turn on and off the different parts of the model for when it comes time to export the STL. If you don’t turn the other parts off before export, you’ll just get a useless “assembled” STL.

Unfortunately, the script is not smart enough to reposition the objects for STL export; so you’ll have to manually flip over the top piece in your slicer, for example. Another annoyance I found is that, even if you turn off the bottom of the case (BShell), the PCB feet still remain. You need to go back up to the script configuration settings and turn them off manually, look for the option called “PCBFeet”.

Having worked with OpenSCAD for a while I know why [Heartman] wouldn’t have included rotating the parts on export: it’s a whole lot of code to implement something that the end user can do with a click in their slicer. But making sure the PCB standoffs aren’t rendering when the user is just trying to get the top or side panel is a fairly big omission and would really only take a single conditional statement to fix.

Finally, there is some early support for generating customized front and rear panels, including functions to generate openings and labels. But personally, I would suggest just taking the blank panel generated by the OpenSCAD script and importing it into a 3D CAD program your comfortable with. The panel generation code just isn’t ready for prime-time, in my opinion.


The design that [Heartman] has come up with for the case is really quite clever, and shouldn’t pose a problem printing. There are no overhangs so support is unnecessary, though you may want to turn off the vents if your printer has issues with stringing, as the thin openings can get clogged up. I printed my case at 0.2 mm layers and 15% infill, though larger cases could probably get away with 0.3 mm layer height for the sake of speed.

The design is forgiving in terms of tolerances, and no cleanup was needed after printing to get the parts together. The fit on the front and rear panels is perfect; loose enough that they don’t need to be sanded to git in the channels but tight enough that they don’t rattle around once the lid is screwed down. Incidentally, you must screw the lid down, as the two pieces don’t actually have any interlocking components. A potential improvement to the design would be a way to make the lid snap-fit.

Final Thoughts

Overall, I think the enclosures generated by the “Ultimate Box Maker” OpenSCAD script are fantastic. They look extremely professional, are very sturdy, and print easily. This is definitely a design I’ll be adding to my regular bag of tricks going forward.

I especially like that this is a printable design that clearly addresses a valid need. One-off projects need one-off enclosures, and 3D printing is perfect for that. While we’ve previously covered printed tools that deserve a spot on your bench, the argument could always be made that you’d be better off buying the “real thing”. But I believe this project offers a solution which is actually superior to traditional methods in a number of ways.

Thingiverse’s Customizer dropping the ball on this one is especially annoying, as [Heartman] went through the trouble of making sure his design worked with it — there’s some special syntax Thingiverse has you add to OpenSCAD to make their front-end work. Having a web-based tool to generate custom enclosures would be extremely handy, and I wonder if somebody in the community might just take up the challenge of restoring the service MakerBot seems not to maintain?

Chopper And Chopper-Stabilised Amplifiers, What Are They All About Then?

One of my first jobs as a freshly minted graduate engineer involved the maintenance of a set of analogue chart recorders. They were museum pieces by the early 1990s: a motorized roll of graph paper across which a pen would traverse in proportion to the voltage on the input terminals. Inside was a simple servo, with a differential amplifier comparing the feedback via a potentiometer from the mechanism with the amplified input.

The recorders dated from the early 1960s, and internally their electronics were from the germanium transistor era: many Mullard OC-series devices, black-painted glass tubes with a red dot, and, unexpectedly, a large electromagnet connected to the 50 Hz AC supply with a reed switch through its middle, something completely new to an overconfident youngster who thought she knew everything.

What I’d stumbled upon was a chopper amplifier, a slightly ungainly and long superseded solution to the problem of DC amplification from the days before ubiquitous integrated circuit op-amps. We have become so used to DC amplifiers that just work, that we have forgotten that there was a time when such devices were an impossibility. The close matching of properties between devices on the same wafer allowed integrated circuit op-amps to achieve stable DC amplification in a way that the best attempts at the same circuits with discrete transistors had failed, but before they happened some desperate measures were called for. Continue reading “Chopper And Chopper-Stabilised Amplifiers, What Are They All About Then?”

Skull Cane Proves Bondo Isn’t Just for Dents

[Eric Strebel] is quickly becoming a favorite here at Hackaday. He’s got a fantastic knack for turning everyday objects into something awesome, and he’s kind of enough to document his builds for the viewing pleasure of hackers and makers everywhere. It also doesn’t hurt that his voice and narration style gives us a real Bob Ross vibe.

The latest “Happy Accident” out of his workshop is a neat light-up cane made from a ceramic skull found at a local store. But while the finished cane itself might not be terribly exciting, the construction methods demonstrated by [Eric] are well worth the price of admission. Rather than using Bondo like the filler we’re all accustomed to, he shows how it can be used to rapidly build free-form structures and components.

After building up layers of Bondo, he uses a cheese grater to smooth out the rough surface and a hobby knife to clean up the edges. According to [Eric], one of the benefits of working with Bondo like this is that it’s very easy to shape and manipulate before it fully hardens; allowing you to really make things up as you go.

[Eric] also shares a little secret about how he makes his gray Bondo: he mixes some of the toner from a laser printer cartridge into it. This allows you to very cheaply augment the color of the filler, and is definitely something to file away for future reference.

If the video below leaves you hungry for more [Eric Strebel], check out his fantastic series on working with foam core, which should lead you right down the rabbit hole to his DIY foam core spray painting booth.

Continue reading “Skull Cane Proves Bondo Isn’t Just for Dents”

Deconstructing A Simple Op-Amp

Maybe you are familiar with the op-amp as an extremely versatile component, and you know how to quickly construct a huge variety of circuits with one. Maybe you even have a favorite op-amp or two for different applications, covering many possible niches. Standard circuits such as an inverting amplifier are your bread and butter, and the formula gain=-Rf/Ri is tattooed on your forearm.

But you can know how to use op-amps without really knowing how they work. Have you ever peered under the hood of an op-amp to find out what’s going on in there? Would you like to? Let’s take a simple device and examine it, piece by piece.

Continue reading “Deconstructing A Simple Op-Amp”

Invasion of the Tiny Magnetic PCB Vises

[Proto G] recently wrote in to share a very slick way of keeping tabs on all the tiny PCBs and devices that litter the modern electronics workbench. Rather than a big bulky PCB vise for each little board, he shows how to make tiny grippers with magnetic bases for only a couple bucks each. Combined with a sheet metal plate under an ESD mat, it allows him to securely position multiple PCBs all over his workspace.

The key to this hack is the little standoffs that are usually used to mount signs to walls. These already have a clamping action by virtue of their design, but the “grip” of each standoff is improved with the addition of a triangular piece of plastic and rubber o-ring.

With the gripping side of the equation sorted, small disc magnets are glued to the bottom of each standoff. With a suitable surface, the magnets are strong enough to stay upright even with a decently large PCB in the jaws.

An especially nice feature of using multiple small vises like this is that larger PCBs can be supported from a number of arbitrary points. It can be difficult to clamp unusually shaped or component-laden PCBs in traditional vises, and the ability to place them wherever you like looks like it would be a huge help.

We’ve recently covered some DIY 3D printed solutions for keeping little PCBs where you want them, but we have to say that this solution looks very compelling if you do a lot of work on small boards.

Continue reading “Invasion of the Tiny Magnetic PCB Vises”

Roll Your Own Rotary Encoders

[miroslavus] hasn’t had much luck with rotary encoders. The parts he has tested from the usual sources have all been problematic either mechanically or electrically, resulting in poor performance in his projects. Even attempts to deal with the deficiencies in software didn’t help, so he did what any red-blooded hacker would do — he built his own rotary encoder from microswitches and 3D-printed parts.

[miroslavus]’s “encoder” isn’t a quadrature encoder in the classic sense. It has two switches and only one of them fires when it turns a given direction, one for clockwise and one for counterclockwise. The knob has a ratchet wheel on the underside that engages with a small trip lever, and carefully located microswitches are actuated repeatedly as the ratchet wheel moves the trip lever. The action is smooth but satisfyingly clicky. Personally, we’d forsake the 3D-printed baseplate in favor of a custom PCB with debouncing circuitry, and perhaps relocate the switches so they’re under the knob for a more compact form factor. That and the addition of another switch on the shaft’s axis to register knob pushes, and you’ve got a perfectly respectable input device for navigating menus.

We think this is great, but perhaps your project really needs a legitimate rotary encoder. In that case, you’ll want to catch up on basics like Gray codes.

Continue reading “Roll Your Own Rotary Encoders”

Retrotechtacular: AM Radios, Core Memory, And Color TV, What Was Hot In Chips In ’73

As part of writing tech stories such as those we feature here at Hackaday, there is a huge amount of research to be done.  We trawl through pages and pages of obscure blogs, videos, and data sheets. Sometimes we turn up resources interesting enough that we file them away, convinced that they contain the nucleus of another story at some point in the future.

Today’s topic of entertainment is just such a resource, courtesy of the Internet Archive. It’s not a video as we’d often provide you in a Retrotechtacular piece, instead it’s the February 1973 edition of the Fairchild Semiconductor Linear Integrated Circuits Catalog. Books like this one that could be had from company sales representatives were highly prized in the days before universal Internet access to data sheets, and the ink-on-paper datasheets within it provide a fascinating snapshot of the integrated electronics industry as it was 45 years ago.

The first obvious difference between then and now is one of scale, this is a single volume containing Fairchild’s entire range. At 548 pages it wouldn’t have been a slim volume by any means, but given that Fairchild were at the time one of the big players in the field it is unimaginable that the entire range of a 2018 equivalent manufacturer could be contained in the same way. Given that the integrated circuit was at the time an invention barely 15 years old, we are looking at an industry still in relative infancy.

The catalog has a series of sections with familiar headings: Operational amplifiers, comparators, voltage regulators, computer/interface, consumer, and transistor/diode arrays with analog switches. Any modern catalog will have similar headings, and there are even a few devices you will find have survived the decades. The μA741 op-amp (page 64) from its original manufacturer has not yet become a commodity product here, and it sits alongside familiar devices such as the μA7800 series (page 201) or μA723 (page 194) regulators.

Continue reading “Retrotechtacular: AM Radios, Core Memory, And Color TV, What Was Hot In Chips In ’73”