Spending twelve hours to make something that saves two

I recently got a motorcycle, and with it came a problem. My motorcycle jacket has very little pocket space, and I was told that I shouldn’t put any weight (i.e. extra keys) on the keyring. However, I still need to carry my house key and my bulky and heavy garage remote, which means that I need a second keyring just for these two, which is the problem.

Another issue is that using the remote is a hassle, as I have to always be removing my gloves, unzipping my jacket pocket, fishing for the remote in it, pressing the button, zipping the jacket pocket back up, and wearing the gloves again, it’s a nightmare, almost something out of a Lovecraft novel.

However, a thought occurs: Since I have a 3D printer and CAD software and I’m not afraid to use them, I can design an enclosure and mount for the remote so that I can permanently have it mounted on the handlebars, which both frees my pocket and is easily reachable, even with gloves. This thought is so exciting that I can hardly contain myself, and don’t.

In this post, I will take you through the process of designing and 3D printing the mount, complete with all the iterations and facepalms along the way.

Designing the enclosure

The garage door remote

The enclosure is the part of the design that will house the remote itself (ie the top part), and the mount is the part that will screw around the handlebars for mounting. As you can see in the photo, the remote consists of a small PCB (a printed circuit board, the green board where all the components are soldered) with a battery and a few buttons, and a shell. We’re only going to need the button labeled “1”, as that’s the one that opens the door (the others don’t do anything, they’re millennials). I apologize for the previous joke, my editors said I need to be more edgy to increase readership.

The first step in the process is to design a case that will hold the PCB snugly (so it doesn’t move around inside the enclosure) and looks pretty. Unfortunately, I’m terrible at the latter, so we’ll have to settle for just the snugness.

The measurements

The initial few iterations of the design

The main consideration when designing something that has to fit pre-existing components is getting the measurements right. To achieve perfect measurements, you need to have a great pair of calipers. I bought some off AliExpress for $12, but they randomly report things as being 5mm longer, so don’t get those. If you’re going to 3D print the design, you also need to know the tolerances of your printer, as most printers tend to print parts larger by a few tenths of a millimeter, which you need to compensate for.

I prefer to design my parts in Autodesk Fusion 360, which is free for hobbyists (or I’ve made a terrible mistake), but I also use OnShape a lot because Autodesk stupidly refuses to port Fusion to Linux. Fusion is more powerful than OnShape, but OnShape is more than adequate for the simple stuff I design, so if you just want to get started quickly, OnShape is a good choice.

Because I can’t be bothered with doing things the right way the first time around, I obviously didn’t really measure the PCB properly, instead I just kind of held it against the screen at a reasonable zoom level and ballparked the lines. Afterwards, I printed each result and tweaked the fit each time, which is something you might have to do anyway, since it’s hard to get a good fit from the first iteration, no matter how well you design things (or maybe I’m just not very good at it yet).

You can see all the iterations of the enclosure in the photo above.

The sketch

The finished sketch of the final components

CAD designs, like PIN numbers, start with creating the sketch. A sketch is a CAD primitive, a two-dimensional drawing with specified dimensions for each component, which then gets raised into the third dimension to create a solid object. You measure everything as I’ve described and use lines, squares, circles, etc with the measured dimensions to specify the layout of the object you want to create. Then, you “pull” each of the parts of the sketch up (or down) into the third dimension (possibly at varying heights) to create your three-dimensional object, and you’re done! That’s pretty much all there is to 3D design.

In the image above, you see the more-or-less final sketch of the enclosure and the mount, which includes the “ears” the screws will go through to reach the mount. The “ears” and screw holes aren’t rounded yet, but that’s a minor detail. You may also notice some differences between the various photos, which are due to the fact that I printed an iteration and then went back and changed things, but figured the printed design was good enough to use anyway, so it stuck.

All the pieces, with the PCB

As you can see from the image above, the PCB fits quite well in the enclosure. After the six or so iterations above, there is no travel in any of the three directions, and the PCB fits relatively easily in the enclosure with no force, which is ideal.

After the third iteration, I noticed that the battery was rather thicker than the PCB itself, which caused the latter to slant and rest on the bottom of the enclosure, much lower than the battery did. I remedied this by drawing a sort of “ledge” around the inside of the enclosure under the PCB, which the latter can rest on and have its center be at the same height as the battery’s, which made the fit pretty much perfect.

The button

A render

To design the button, I just made a square hole in the top part and drew a square shape that was 1mm smaller on each side. You want to give your parts some “air” so they will move freely, and you want to compensate for your printer’s tolerances, as I mentioned earlier. In my case, 1mm was about perfect to give the button a good fit but still allow it to travel freely.

To prevent it from just sliding out of the hole, I gave the button a short base that is slightly wider than the hole, and which is just high enough to allow it to rest on the PCB’s pushbutton. There’s a delicate balance there, where you want to make sure that there’s no travel when the button is unpressed (otherwise it feels poorly-made), but also that it’s not so snug that the base pushes on the button below when inactive, as that may cause accidental presses just from the forces of the materials.

Looking at it again, the square button doesn’t really fit the rounded aesthetic of the rest of the part, so I should go back and make it round instead.

Designing the mount

Another render

The initial design for the enclosure was just the little orthogonal bit that holds the PCB. Afterwards, when it was time to design the mount, I added the screw-hole “ears” to the cap (the top part of the enclosure) and the base (the bottom part).

There’s a bit of a problem with this sort of design and Fusion 360 (to which Fusion either doesn’t have a solution or I haven’t found it yet): If you look closely, you’ll notice that the screw holes on the “ring” that goes onto the handlebars are on the YZ plane (i.e. looking to the left), but the screw holes on the cap and base are on the XY plane (i.e. looking up). I haven’t yet found a good way to tell Fusion to use the dimension from one plane to drive a dimension in another plane, and I don’t think Use/Project works like that. If you know of a way, please let me know in the comments or on Twitter.

The screw holes

The assembled mount

Designing screw holes for 3D printing needs some special consideration, which I don’t see many people bother with. If you look at my images, you’ll notice that the screws/bolts pass through the lid, the base, and the two sides of the mount ring, before finally reaching the nuts (though the advice I’m about to give you applies to designs without nuts as well).

I’ve noticed most people making screw holes snug enough that the screws or bolts thread their way through the plastic before reaching the nut. I’ve found that this is not the best way to design screw holes, and that the best way is to actually make the holes big enough that the screw can pass through freely.

The assembled mount

This is because if, when finally screwing the parts together, the screw has to thread its way through, then the gaps between the parts won’t tighten when you tighten the screw, because there’s no travel between them. If you make the holes too snug, the screw will have to strip its way through the thread on all the layers in order for the parts to move relative to each other. However, if you make the holes big enough, the screw will only need to “catch” on the topmost part and the nut, making it much easier to tighten all the parts together.

This will also save you many turns of the screwdriver, which is a non-trivial benefit when using very long screws and don’t have an electric screwdriver, so think of the children when designing your holes. It does mean that you will have to design nut pockets into your part, so the nut and screw doesn’t stick out, if you care enough about that.

The other alternative (or you can do both) is to design the part closest to the nut to be narrower, so that the screw will tap a thread when it gets inserted. This way, you get the benefits of both easy insertion and good clamping force, as the screw will have more area to catch on to.

The final assembly

Mounted on the motorcycle

After everything has been designed and printed, and everything fits together properly, it’s time to actually mount the thing. I was somewhat worried about water getting in the enclosure when it rains, so I wrapped the PCB in cling wrap before putting it in the enclosure.

Having spent many hours designing, iterating through and testing this, I excitedly went to mount it on the handlebars, only to discover that the ring is too big. In retrospect, I should have designed it a millimeter smaller than the diameter of the bar, as the ring’s design makes it easy to mount on something larger (just leave a larger gap between the two halves) but hard to mount on something smaller.

At any rate, it was nothing some padding wouldn’t fix, and, a length of silicone pad later, the mount is very snug. It also doesn’t look half bad (although I’ll probably print and mount the rounded iteration now), the button has good travel and is easy to press even with gloves, and the whole thing generally works astonishingly well.

In reality, the above is a lie I have to tell you to impress you and give a sense of closure to the project. Actually, when I tried to test the remote, it turned out that I hadn’t used it for so long (this was my secondary remote) that it had gotten out of sync with the garage door, and it won’t open the door any more. It does work and emit the code, it’s just that the code is not the correct code that the door expects, so it won’t open. This should be easy to fix, though, and I will take it to the shop I got it from to reprogram, at which point it should work perfectly again.

Epilogue

I remember a few months ago, when a friend showed me an enclosure he had designed for one of his circuits, and I was blown away by the fact that he had designed something that could be manufactured into a physical, actual object. I remember thinking that I wouldn’t even know how to start making something like this, and that it would take me ages to do. It turned out that CAD isn’t really that hard, and it only took me around ten to twenty hours of designing things in Fusion before I was able to make things like this mount.

If you have any interest in what you read above, I’d urge you to try Fusion or OnShape (they’re both free and very easy to use), and just design a few small things to get a feel for how 3D parametric design works. It’s not hard at all, and is very enjoyable!

If you liked this post, please share it with your friends. If you want to show me things you’ve made, please tweet to me, I’d be happy to see them. Thank you!