Arduino OpenSCAD mounting library (v2.0)

by kellyegan, published

Arduino OpenSCAD mounting library (v2.0) by kellyegan Mar 21, 2013
5 Share
Download All Files

Thing Apps Enabled

Order This Printed View All Apps


Liked By

View All

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

Thing Statistics

32842Views 9714Downloads Found in Electronics


This is a library of OpenSCAD modules for mounting Arduino boards. It has modules for creating enclosures, bumpers, mounting holes, punch out holes for jacks like USB and power and board dimensions. If you are making a custom enclosure or are mounting an Arduino board to a larger project this should make it easier.
Included is an example scad file and some stls of bumpers generated with the library. The long term goal is to make this useful for a variety of boards not just Arduinos.

This is version 2.0. If your looking for the original look the v1.0 release at my Github repository:

The library uses tbuser's pin library for the pin mounts: http://www.thingiverse.com/thing:10541

There are a number of great designs for individual Arduino board enclosures that I used for inspiration including:


OpenSCAD Arduino Mounting library

The library has a variety of modules for creating Arduinos and Arduino mounts. Here is a basic description of the included modules. It includes all official boards through the Due. For examples see the included example SCAD.


This module creates an Arduino board with USB connector, power supply and headers.

bumper(boardType, mountingHoles)

mountingHoles - (OPTIONAL) True or false for external mounting holes for bumper.
Create a simple bumper style encloser for a particular board

enclosure(boardType, wall, offset, heightExtension, cornerRadius, mountType)

wall - Thickness of enclosure walls. Default is 3.
offset - Distance of PCB from walls.
heightExtension - Additional space at the top of the box.
cornerRadius - Corner radius for outside of box.
mountType - TAPHOLES, PINS How the standoffs attach to the board either using tap holes for screws or pins.
Creates a box enclosure with a snap-on lid for a particular board

enclosureLid(boardType, wall, offset, cornerRadius, ventHoles)

wall - Thickness of enclosure walls. Default is 3.
offset - Distance of PCB from walls.
cornerRadius - Corner radius for outside of box.
ventHoles - true, false for holes in the lid.
Creates a lid for the box enclosure

standoffs(boardType, height, bottomRadius, topRadius)

height - height of standoffs
bottomRadius - Radius of bottom of standoff cylinder.
topRadius - Radius of top of standoff cylinder.
holeRadius - Radius of tap hole in the standoff.
This creates standoffs for mounting holes. These are simple cylinders that can be tapered. For custom standoffs use the holePlacement() module.

boardShape( boardType, offset, height )

offset - creates the shape offset from actual board size. Negative values create an inset shape.
height - default is pcb height but can be any value needed.
This creates the shape of the PCB with no holes. The default create a basic Uno PCB.

boundingBox(boardType, offset, height, cornerRadius, include)

offset - creates the shape offset from actual board size. Negative values create an inset shape.
height - default is board height (including components) but can be any value needed.
cornerRadius -
include - BOARD, PCB, COMPONENTS What to include in bounding box, just the PCB, just the components or both (BOARD)
This creates a box whos dimensions are the extremes of the board.


This is used for placing holes and is the basis of the standoff module. holePlacement takes a child element and places it at each of the mounting hole centers for a given board.

components(boardType, component, extension, offset)

extension - Extention off the board in direction of connector. The default is the standard dimension of the connector, but can be set to an arbitrary value.
offset - Offsets the connector cube in the other two dimensions.
Creates the components( headers, power and usb jacks) for a given board. Also used for creating punchout, by using the extension and offset values.

More from Electronics

view more

All Apps

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App

Print through a distributed network of 3D printing enthusiasts from across the US, at a fraction of the cost of the competitors. We want to change the world for the better through technology, an...

App Info Launch App

Quickly Scale, Mirror or Cut your 3D Models

App Info Launch App

3D Print a wide range of designs with Treatstock. Easy to use tools to get the perfect result. The global 3D printing network that connects you with high-quality and fast working print services nea...

App Info Launch App

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);