From ca284487e09a36244c9808156a625cdf22bff093 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Mon, 4 Mar 2019 16:54:45 +0100 Subject: [PATCH 1/2] Support for Arduino Nano, different mounting hole radius and male headers --- arduino.scad | 105 ++++++++++++++++++++++++++++++++++++++++++-------- examples.scad | 12 ++++++ 2 files changed, 102 insertions(+), 15 deletions(-) diff --git a/arduino.scad b/arduino.scad index a122d1b..9ed9945 100644 --- a/arduino.scad +++ b/arduino.scad @@ -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 ); @@ -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 ) { @@ -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 ~1mm 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]); } @@ -239,13 +255,14 @@ PIN = 1; module standoffs( boardType = UNO, - height = 10, - topRadius = mountingHoleRadius + 1, - bottomRadius = mountingHoleRadius + 2, - holeRadius = mountingHoleRadius, + height = 10, mountType = TAPHOLE ) { + topRadius = mountingHoleRadius[boardType] + 1; + bottomRadius = mountingHoleRadius[boardType] + 2; + holeRadius = mountingHoleRadius[boardType]; + holePlacement(boardType = boardType) union() { difference() { @@ -283,6 +300,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] ){ @@ -297,8 +324,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 ); + } + } } } } @@ -412,12 +447,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) @@ -462,6 +497,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 @@ -474,7 +517,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 **********************************/ @@ -502,6 +562,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 @@ -514,7 +581,8 @@ boardShapes = [ 0, //Yun 0, //Intel Galileo 0, //Tre - ngBoardShape //Ethernet + ngBoardShape, //Ethernet + nanoBoardShape //Nano ]; /*********************************** COMPONENTS ***********************************/ @@ -584,7 +652,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 @@ -597,7 +671,8 @@ components = [ 0, //Yun 0, //Intel Galileo 0, //Tre - etherComponents //Ethernet + etherComponents, //Ethernet + nanoComponents ]; /****************************** NON-BOARD PARAMETERS ******************************/ diff --git a/examples.scad b/examples.scad index 97290f6..285e308 100644 --- a/examples.scad +++ b/examples.scad @@ -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=PIN); + boardShape(NANO, offset = 3); + } +} From 80ef9e280852e42c3c739c38ec4d92daaf907f22 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Tue, 5 Mar 2019 09:54:40 +0100 Subject: [PATCH 2/2] Add type NOTCH for standoffs with small radius --- arduino.scad | 28 ++++++++++++++++++---------- examples.scad | 2 +- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/arduino.scad b/arduino.scad index 9ed9945..17f1a59 100644 --- a/arduino.scad +++ b/arduino.scad @@ -100,13 +100,13 @@ module bumper( boardType = UNO, mountingHoles = false ) { } // TODO : Boards are usually not flat on the downside, and pins - // currently colide with the structure (resulting in a ~1mm 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); - } + // 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]); @@ -252,9 +252,10 @@ 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, +module standoffs( + boardType = UNO, height = 10, mountType = TAPHOLE ) { @@ -275,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 diff --git a/examples.scad b/examples.scad index 285e308..ceadb93 100644 --- a/examples.scad +++ b/examples.scad @@ -39,7 +39,7 @@ translate([-140,0,0]) { translate([0,0,75]) enclosureLid(NANO); translate([0,100,-75]) { - standoffs(NANO, mountType=PIN); + standoffs(NANO, mountType=NOTCH); boardShape(NANO, offset = 3); } }