Skip to content
Open

Nano #11

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 101 additions & 18 deletions arduino.scad
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module arduino(boardType = UNO) {
color("SteelBlue")
boardShape( boardType );
translate([0,0,-pcbHeight * 0.5]) holePlacement(boardType = boardType)
color("SteelBlue") cylinder(r = mountingHoleRadius, h = pcbHeight * 2, $fn=32);
color("SteelBlue") cylinder(r = mountingHoleRadius[boardType], h = pcbHeight * 2, $fn=32);
}
//Add all components to board
components( boardType = boardType, component = ALL );
Expand Down Expand Up @@ -60,7 +60,7 @@ module bumper( boardType = UNO, mountingHoles = false ) {

//Board mounting holes
holePlacement(boardType=boardType)
cylinder(r = mountingHoleRadius + 1.5, h = bumperBaseHeight, $fn = 32);
cylinder(r = mountingHoleRadius[boardType] + 1.5, h = bumperBaseHeight, $fn = 32);

//Bumper mounting holes (exterior)
if( mountingHoles ) {
Expand Down Expand Up @@ -88,10 +88,26 @@ module bumper( boardType = UNO, mountingHoles = false ) {
}
translate([0,0,-0.5])
holePlacement(boardType=boardType)
cylinder(r = mountingHoleRadius, h = bumperHeight, $fn = 32);
cylinder(r = mountingHoleRadius[boardType], h = bumperHeight, $fn = 32);
translate([0, 0, bumperBaseHeight]) {
components(boardType = boardType, component = ALL, offset = 1);
components(boardType = boardType, component = USB, offset = 1);
}
translate([0, 0, bumperBaseHeight]) {
components(boardType = boardType, component = POWER, offset = 1);
}
translate([0, 0, bumperBaseHeight]) {
components(boardType = boardType, component = RJ45, offset = 1);
}

// TODO : Boards are usually not flat on the downside, and pins
// currently colide with the structure (resulting in a gap)
//translate([0, 0, bumperBaseHeight]) {
// components(boardType = boardType, component = HEADER_M, offset = 0);
//}
//translate([0, 0, bumperBaseHeight]) {
// components(boardType = boardType, component = HEADER_F, offset = 0);
//}
// Cooling opening?
translate([4,(dimensions[1] - dimensions[1] * 0.4)/2,-1])
cube([dimensions[0] -8,dimensions[1] * 0.4,bumperBaseHeight + 2]);
}
Expand Down Expand Up @@ -236,16 +252,18 @@ module boundingBox(boardType = UNO, offset = 0, height = 0, cornerRadius = 0, in
//Creates standoffs for different boards
TAPHOLE = 0;
PIN = 1;
NOTCH = 2; // Recommended for small radius (< 1.5mm) on FDM printers.

module standoffs(
boardType = UNO,
height = 10,
topRadius = mountingHoleRadius + 1,
bottomRadius = mountingHoleRadius + 2,
holeRadius = mountingHoleRadius,
module standoffs(
boardType = UNO,
height = 10,
mountType = TAPHOLE
) {

topRadius = mountingHoleRadius[boardType] + 1;
bottomRadius = mountingHoleRadius[boardType] + 2;
holeRadius = mountingHoleRadius[boardType];

holePlacement(boardType = boardType)
union() {
difference() {
Expand All @@ -258,7 +276,14 @@ module standoffs(
translate([0, 0, height - 1])
pintack( h=pcbHeight + 3, r = holeRadius, lh=3, lt=1, bh=1, br=topRadius );
}
}
if( mountType == NOTCH ) {
$fn = 16;
translate([0, 0, height]) {
cylinder(r= holeRadius *0.9 , h=pcbHeight+0.1);
translate([0, 0, pcbHeight+0.1]) cylinder(r1 = holeRadius + 0.15, r2 = holeRadius * 0.7, h=0.8);
}
}
}
}

//This is used for placing the mounting holes and for making standoffs
Expand All @@ -283,6 +308,16 @@ USB = 2;
POWER = 3;
RJ45 = 4;

module header(dimensions, female ) {
z = female?dimensions[2]:2.54;
color("black") cube( [dimensions[0],dimensions[1],z] );
for (m = [0:dimensions[0]/2.54 -1]) {
for (n = [0:dimensions[1]/2.54 -1]) {
translate([0.95 + m*2.54, 0.95 + n*2.54, -2.51]) color("yellow") cube([0.64, 0.64,dimensions[2] + 2.5] );
}
}
}

module components( boardType = UNO, component = ALL, extension = 0, offset = 0 ) {
translate([0, 0, pcbHeight]) {
for( i = [0:len(components[boardType]) - 1] ){
Expand All @@ -297,8 +332,16 @@ module components( boardType = UNO, component = ALL, extension = 0, offset = 0 )
+ ((components[boardType][i][2] * [1,1,1])
* components[boardType][i][2]) * extension
+ ([1,1,1] - components[boardType][i][2]) * offset * 2;
translate( position ) color( components[boardType][i][4] )
cube( dimensions );
translate( position )
if(components[boardType][i][3] == HEADER_M) {
header(dimensions, female = false);
} else {
if(components[boardType][i][3] == HEADER_F) {
header(dimensions, true);
} else {
color( components[boardType][i][4] ) cube( dimensions );
}
}
}
}
}
Expand Down Expand Up @@ -412,12 +455,12 @@ YUN = 8;
INTELGALILEO = 9;
TRE = 10;
ETHERNET = 11;
NANO = 12;

/********************************** MEASUREMENTS **********************************/
pcbHeight = 1.7;
headerWidth = 2.54;
headerHeight = 9;
mountingHoleRadius = 3.2 / 2;

ngWidth = 53.34;
leonardoDepth = 68.58 + 1.1; //PCB depth plus offset of USB jack (1.1)
Expand Down Expand Up @@ -462,6 +505,14 @@ megaHoles = [
[ 50.8, 96.52 ]
];

// Original nano holes
nanoHoles = [
[ 1.27, 1.27 ],
[ 1.27, 41.91 ],
[ 16.51, 41.91 ],
[ 16.51, 1.27 ]
];

boardHoles = [
ngHoles, //NG
ngHoles, //Diecimila
Expand All @@ -474,7 +525,24 @@ boardHoles = [
0, //Yun
0, //Intel Galileo
0, //Tre
unoHoles //Ethernet
unoHoles, //Ethernet
nanoHoles //Nano
];

mountingHoleRadius = [
1.6, //NG
1.6, //Diecimila
1.6, //Duemilanove
1.6, //Uno
1.6, //Leonardo
1.6, //Mega
1.6, //Mega 2560
1.6, //Due
1.6, //Yun
1.6, //Intel Galileo
1.6, //Tre
1.6, //Ethernet
0.92 //Nano
];

/********************************** BOARD SHAPES **********************************/
Expand Down Expand Up @@ -502,6 +570,13 @@ megaBoardShape = [
[ 0.0, 96.52 ]
];

nanoBoardShape = [
[ 0.0, 0.0 ],
[ 17.78, 0.0 ],
[ 17.78, 43.18 ],
[ 0.0, 43.18]
];

boardShapes = [
ngBoardShape, //NG
ngBoardShape, //Diecimila
Expand All @@ -514,7 +589,8 @@ boardShapes = [
0, //Yun
0, //Intel Galileo
0, //Tre
ngBoardShape //Ethernet
ngBoardShape, //Ethernet
nanoBoardShape //Nano
];

/*********************************** COMPONENTS ***********************************/
Expand Down Expand Up @@ -584,7 +660,13 @@ dueComponents = [
[[27.365, -1.1, 0], [7.5, 5.9, 3], [0, -1, 0], USB, "LightGray" ],
[[40.7, -1.8, 0], [9.0, 13.2, 10.9], [0, -1, 0], POWER, "Black" ]
];


nanoComponents = [
[[0, 2.54, 0], [headerWidth, headerWidth * 15, headerHeight], [0, 0, 1], HEADER_M, "Black"],
[[15.24, 2.54, 0], [headerWidth, headerWidth * 15, headerHeight], [0, 0, 1], HEADER_M, "Black"],
[[4.9, -1.1, 0], [8, 9, 3], [0, -1, 0], USB, "LightGray" ],
];

components = [
ngComponents, //NG
ngComponents, //Diecimila
Expand All @@ -597,7 +679,8 @@ components = [
0, //Yun
0, //Intel Galileo
0, //Tre
etherComponents //Ethernet
etherComponents, //Ethernet
nanoComponents
];

/****************************** NON-BOARD PARAMETERS ******************************/
Expand Down
12 changes: 12 additions & 0 deletions examples.scad
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,15 @@ translate([0, 0, -75]) {
translate([0, 0, 75]) {
enclosureLid();
}

translate([-140,0,0]) {
translate([0,0,2.2]) arduino(NANO);
translate([0,100, 0]) bumper(NANO, mountingHoles = true);
translate([0,0,-75]) enclosure(NANO);
translate([0,0,75]) enclosureLid(NANO);

translate([0,100,-75]) {
standoffs(NANO, mountType=NOTCH);
boardShape(NANO, offset = 3);
}
}