Arduino OpenSCAD mounting library (v2.0)

by kellyegan Mar 21, 2013
Download All Files

Thing Apps Enabled

Please Login to Comment

Thanks very much for publishing this. I've learned a lot about Openscad just by looking at your code. Very nice work?

Excellent documentation!

Should have the new file from GitHub now. Let me know if you have problems.

Thanks. This project hasn't gotten a lot of attention lately but I go in and see if I can update it. It may actually be an issue with the file on Thingiverse. If you see the same problem with the download from GitHub (linked above) let me know. I may just add version 2 file to the downloads to solve it as well.

Now I see. You made a commit to fix it more than a year ago... :-)

Nice stuff. Congratulations and thank you!
Just a little thing to say: as someone else stated before, the enclosure lid dimensions are a bit larger than expected (for my aged duemilanove). I think the problem is located in the calls to the boundingBox function in enclosureLid. It's necessary to add the parameter "include=PCB" to match the corresponding calls in enclosure function.

PS: your openscad source is awesome!

Hi there, wonderful work
The lid issue is still there. Why don't you upload a files with new names like arduinoV2 and examplesV2
You may also include the pins.scad that fits, the author may give it a GPL or MIT licence for that.
Would make things tremendousely easier for newbies like me.

How you get the clips that allow for temporary mounting like in the picture? I check and PINS or TAPHOLE don't seem to produce what you have in the image on the far left.

You may need to download the pins library from tbuser http://www.thingiverse.com/thing:33790 in order to get the pins to work.

Pin Connectors V3
by emmett

What size did you make the pins so they'd work with an arduino uno?

Where can I find and download pins.scad? When running, I can compile and render but I get the message: "WARNING: Can't open include file 'pins.scad'."

The pins.scad is tbusers pin library which can be found here: http://www.thingiverse.com/thing:33790 It looks like he has updated since however.

Pin Connectors V3
by emmett

When I tried this library, the basic enclose fit perfectly; however, the lid is a about a centimeter too long. You can see it even within the SCAD visualiation using this modification of the included example code.
include <arduino.scad>
translate([0, 0, 40]) {

Ugh - Thingiverse bug - I downloaded the zip file and it had the old version (no include=PCB in the boundingBox call for the lid).
The individual file and the GitHub versions are correct. The zip file must be cached.

Thanks for checking on this. I'll re-upload the version from GitHub and see if it updates. Thought I did this when I fixed but maybe I missed it.

Ok, I seem to have hit the lid size bug which from the comments should have been fixed in the Nov 11th version. I did an Arduino Mega case and lid and the inside of the case measures (based on NetFab) 107.6mm but the lid measure 113.12.
Is the source for the Openscad up on GITHub so I could look at the deltas? Can someone point me to the changes.

Love this library!!!! It is modular enough I can customize easily enough to hold sheilds and put holes in the sides for wires from the shields. I am printing a case for a mega now and will do the custom case this weekend.

This is very close to being completely usable man. Insane amount of work here, I had to fiddle with it to place the mounting posts into the corner since I didn't need clearance around all sides, and then I had to fiddle a little more to get the usb port moved over to match the mounting posts.
Really great to be able to drop the Arduino in.

I second the nice library comment. I am using it to create a box for a custom board. I defined a custom board (size, holes, components).

I have one question and one bug.
Q, How do I turn the lid over for printing?
Bug, when an object sticks off the left edge the lid clips appear ok, but if my object (Power) sticks off the right edge (more positive X) it pushes the lid clips out to the edge of the lid.
Maybe I am defining the object wrongly for being at the left edge of the board (I place the lower left corner such that the x direction of the object makes it go off the board (more positive) as I felt this was opposite of the -x value used on the left edge object.


So I can mod the library so the default is for the lid to be flat for printing. That probably makes for sense.

Cool that your adding a custom board. I might try and make that more straight forward in a future version. I am going to look at the code but the bug with the clips is probably an issue with whether it is defining the size based on the components or the PCB. It probably didn't come up because none of the Arduino boards have components of the left or right edge. This is a great catch because one of my next mods was to add a Raspberry Pi.

So when the view is set to front, objects extending from the left edge would have a negative x position. The x dimension of the object should still be positive however. The direction ( which way the jack, hole, plug would face ) would probably be -1 for x. This way when using the extension feature to extend out to punch a hole say would go farther left. I say probably because it could be possible for an object to extend off the left edge put be plugged in left or right. Hope that helps.

If you have some example data of what goes wrong I love to try it.

Nice library!

I dont no if I doing anything wrong but my UNO enclosure lid doesn't fit to the enclosure. It gets like 5mm to long.

Your right. Thanks for the catch. I just uploaded a new version of the arduino.scad file, that fixes the problem. Sorry for the bad lid.

This is a great idea...
For an current project i'm looking for something that allows me to select what arduino... then box hight (thou there is a minimum of course), a window for lcd screen... could be simple parameters as size of window and where one of the corners should be. icing on the cake would be options to spec where a tac switch are located..
would that be hard to implement? or would it be better if i tried out myself?

I quickly through this together but the code below sounds like what you are looking for. I didn't take any measurements for the display or button just kind of guessed. I am working on a new version of the library that includes easy creation of the enclosures in the library itself.

include <arduino.scad>

board = "Uno";


union() {

difference() {

    boundingBox(board, offset=6, height=arduinoHeight+25+2);

    translate([0,0,2.5]) {

        boundingBox(board, offset=4, height=arduinoHeight+25+2);

        translate([0,0,8]) {

            power(board, 10);

            usb(board, 10, offset=1);




standoffs(board, height=10);



translate([80,0,0]) {

difference() {

    union() {

        boundingBox(board, offset=6, height=2);

        boundingBox(board, offset=4, height=4);


    //Display window

    translate([5, 20, -0.5]) cube([12, 50, 6]);

    //Button hole

    translate([11, 8, -0.5]) cylinder(r=6, h=6);