Jan 2, 2016

A Fancy 3D Printed Raspberry Pi Enclosure

The Raspberry Pi helps make learning about computers fun and accessible for many people - and has given the maker community a powerful computing platform in a tiny package. Actually - it's a small integrated circuit board without a  "package" - it doesn't always even come with a case.

When my daughter opened up her new Kano Raspberry Pi kit that she got as a gift, the "package" - the enclosure for the electronics - was one of the things that made the kit approachable and easy. Then, within hours of that insight, a good friend and blogger asked me if I had designed a Raspberry Pi enclosure for 3D Printing. My response was a fast "Not yet, but it's on the way".

Design Goals


I wanted my Raspberry Pi enclosure design to be more than just a box with holes for the wires. I wanted it to be good looking and inviting. I decided I would use the Raspberry Pi logo itself as the design for the box. Of course the box had to also be functional. The Pi had to fit in there easily and have a way to secure it and, of course, all the wire ports need to be accessible. Of course, like so many designs I do, I wanted it to be easily printable without supports - and I expected it to be two parts - a bottom to hold the board, and a fitted top, preferably one which held securely without screws.

Summary of This Design Journey


There were a few forks in this design road - so I figured I should just summarize them first so readers get a sense of how I ended up with the current design.

    1) I started with the Raspberry Pi version 1 Model B (Two USB ports) - which has a specific size and layout of interface ports - implying layout of the holes in the sides of the case. Then I realized (after I got the general sizing all correct and printed) that most people, including my daughter, now have the version 2 design. (more info on Pi Models)

    2) I moved to the Raspberry Pi 2 layout - using my daughter's Kano board as my basis for measurement. That got me designing in the right direction,  and I completed a box design with the right layout to fit that Pi 2 board. But it seemed boring.

    3) I added a Raspberry Pi Logo-shaped bottom to the box, then created a custom top which was also in the shape and design of the Raspberry Pi logo. This looked really good - and had plenty of challenge creating the fitted top.

    4) The shape of the Raspberry Pi logo was so nice, that I decided to make the whole box that shape - with adjustments to fit the board within it. I was finally satisfied after some adjustments to the top to make the Raspberry-ness really show, some strengthening of the walls, better fittings to make the top snap in place and addition of optional screw holes. 

    This is where I am with my current design, but I'll fill in the details now for those who want to know more.

    Basic Design Of The Box


    I started with a box - figuring I would add the design elements as shapes on top and bottom of the box to give the whole package the appearance of the Raspberry Pi logo. So the focus to start was the alignment of the wire holes and screw holes and the general fit of the IC board.

    After measuring the Pi board (approx 85mm x 56mm), I created a basic rectangle with those outer dimensions plus an additional 3mm extra space on all sides - that's 2mm walls with 1mm space on each side. The rectangle is now 91mm x 62mm - and I use the "Shell" command and define 2mm walls to get the hollowed out box where the Pi will fit.

    Useful Trick for Early Design Testing


    Drawing with all measurements
    The placement of the seven (7!) port holes was critical to the success of the design, and no amount of measurement makes for a fool proof design or print. So, when I thought I had the whole bottom box design ready to go, I didn't want to print the whole thing until I was sure I hadn't messed something up. So, I came up with a method for testing a smaller version of my print to test that the placement of screw holes and wire port holes was correct.

    It's worth mentioning that I created a Google Drawing which documented all the measurements in once place visually.
    bottom portion only as a test

    I only needed to test the bottom half inch of height - about 20% of the total printed object - to see if the mounting holes and wire port holes were positioned correctly. To isolate that portion of the object, I created a big rectangle which was slightly larger than the whole box and positioned it over a copy of the box,  specifically positioning it over the portion of the box I did NOT want to print.

    Then I did a "Combine" / "Subtract" to remove the whole top of the copy of the box. That left me with the bottom portion. I printed that - which took about 45 minutes rather than the 3 hours the whole box would have taken, checked that it worked out, made adjustments and repeated. Two tries and it was done.

    The subtraction shapes used to cut the wire ports and SD slot

    Making Wire and Port Holes


    I had to make 7 holes in the sides of this basic box. It seemed the best way to do this to allow for a few later adjustments would be to create and position 7 rectangles which would be used to subtract material from the box. Any later adjustments I made, even to the box itself, would allow me to re-subtract these same boxes, in their correct positions, from the adjusted box. This turned out to be an insightful move, as I made many box adjustments that otherwise would have been hard to maintain the holes if they were pre-made in the box itself. Once the boxes were positioned correctly, I did the "combine"/"subtract" command - with all 7 rectangles as the source - and voila, the box had 7 holes in it.

    Screw mounts added where needed

    Securing the Pi Board (screw holes)


    To offer a way to secure the Pi board to the case seemed easy enough - since the Pi 1 has two screw holes and the Pi 2 has 4. But now that I had all my port and wire holes positioned, I realized that I needed to lift the board up a bit from the bottom of the case to give room for screws. This was luckily easier than it may have been, given the method I used to subtract the holes from the box. I just lifted all the subtraction shapes up 3mm and re-subtracted them from the box. I then placed small 3mm high rectangles (about 5mm square each) in the areas where the screw holes were needed and carefully measured as many angles as possible to get the holes positioned relative to the box sides and to each other. I used 1.25mm Radius cylinders to subtract holes from those shapes and aligned them to sit on the bottom of the box. Theses would also serve to hold the Pi board away from the bottom of the case with enough room for the bottom-mounted SD card and the small soldering nubs that stick out the bottom.

    The Raspberry Shape - from Simple to Complex


    To get the Raspberry Pi logo turned into a 3D object, I used an old trick that I've written about a couple of times. I pulled an image of the logo into Google Drawings and traced over it with the Polyline tool to create the Scalable Vector Graphics version that my 3D Modeling software can understand. With some foresight, I actually traced the outline of the raspberry separately from the inner designs of the raspberry, so that I would have some flexibility with the final objects.

    I went through several iterations of using this design. As mentioned earlier, first I created a base with the outer shape - and this definitely made the plain old box look more interesting. Then I created the top with all the inner designs subtracted out. This was also a huge improvement to the plain old box.

    Ultimately, after printing a very successful box shaped container with a top and bottom raspberry shape, I decided that the whole box should be raspberry shaped. The start was easy. I created the box with the raspberry outline extruded to 27mm, then hollowed out using the "Shell" tool in 123D Design. I then moved over the original box and started combining shapes - removing walls where they overlapped in areas which would be in the way of the Pi board, and combining walls where more support was needed.

    Then, my original idea to save the subtraction shapes for the 7 side holes came in super handy. I moved them over, in their relative positions, to the raspberry shaped box, and subtracted them again. This worked wonderfully! The Pi Board screw holes were also moved in their original positions after adding another 1mm of height to the mounts to give the board more breathing room and the screw holes more depth.

    Securing the Removable Box Top


    Making the top snap into place in a way which did not require top screws was one of my design goals, and became the toughest part of this design. I experimented with a few methods before settling on opposing and offset half-round, 1mm deep rim pieces. I originally added too many of these sets of snap-together parts, and the fit was too tight - but with four of these sets, the fit was just right.

    Even with the snap-togetherness of the top, I decided to add screw holes and mounts for people who want an ultra-secure enclosure. This was easy-ish - using tall 6x6mm towers on the inside of the box, and subtracting 2.5mm diameter screw holes 15mm deep into them, and through the top at the same time (to get perfect alignment).

    The Final Model


    There were lots of last minute adjustments, and overall, if I'm really honest about how much time I spent creating this model, I would estimate 10 hours of work not including printing time. I really obsessed over the design of the top, the combination of etched designs and full-through holes, which are functional in a case for something that might heat up like the Pi.

    The final model is now available on PinShape. Please post pictures of your print on PinShape or on Twitter and include @MkrClub !

    No comments:

    Post a Comment