Loading

Arduino OpenSCAD mounting library (v2.0)

by kellyegan, published

Arduino OpenSCAD mounting library (v2.0) by kellyegan Mar 21, 2013

Description

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:
github.com/kellyegan/Arduino-Mounting-OpenSCAD-Library

The library uses tubers pin library for the pin mounts: thingiverse.com/thing:10541

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

* Chu's bumper: thingiverse.com/thing:26237
*

Recent Comments

view all

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.

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.

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.

More from Electronics

view more

Makes

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

Instructions

# 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.

##arduino(boardType)
**boardType** - UNO, LEONARDO, DUEMILANOVE, DIECIMILA, DUE, MEGA, MEGA 2560

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

##bumper(boardType, mountingHoles)
**boardType** - UNO, LEONARDO, DUEMILANOVE, DIECIMILA, DUE, MEGA, MEGA 2560

**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)
**boardType** - UNO, LEONARDO, DUEMILANOVE, DIECIMILA, DUE, MEGA, MEGA 2560

**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)
**boardType** - UNO, LEONARDO, DUEMILANOVE, DIECIMILA, DUE, MEGA, MEGA 2560

**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)
**boardType** - UNO, LEONARDO, DUEMILANOVE, DIECIMILA, DUE, MEGA, MEGA 2560

**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 )
**boardType** - UNO, LEONARDO, DUEMILANOVE, DIECIMILA, DUE, MEGA, MEGA 2560

**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)
**boardType** - UNO, LEONARDO, DUEMILANOVE, DIECIMILA, DUE, MEGA, MEGA 2560

**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.*

##holePlacement()
**boardType** - UNO, LEONARDO, DUEMILANOVE, DIECIMILA, DUE, MEGA, MEGA 2560

*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)
**boardType** - UNO, LEONARDO, DUEMILANOVE, DIECIMILA, DUE, MEGA, MEGA 2560

**component** - ALL, HEADER_F, HEADER_M, USB, POWER

**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.*

Comments

You must be logged in to post a comment.

bytemedwb on Feb 7, 2014 said:

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.

kellyegan on Feb 9, 2014 said:

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.

bytemedwb on Feb 6, 2014 said:

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.

bytemedwb on Feb 5, 2014 said:

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.

Transcendtient on Feb 2, 2014 said:

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.

kraftor80 on Nov 12, 2013 said:

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.

kellyegan on Nov 12, 2013 said:

Thanks!

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.

Wiero on Nov 8, 2013 said:

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.

kellyegan on Nov 11, 2013 said:

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.

boelle on Oct 12, 2013 said:

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?

kellyegan on Oct 12, 2013 said:

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

//Box

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

}

//Lid

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

}

}</arduino.scad>

Top