@@ -30,7 +30,7 @@ module arduino(boardType = UNO) {
3030 color ("SteelBlue" )
3131 boardShape( boardType );
3232 translate ([0 ,0 ,- pcbHeight * 0.5 ]) holePlacement(boardType = boardType)
33- color ("SteelBlue" ) cylinder (r = mountingHoleRadius, h = pcbHeight * 2 , $ fn= 32 );
33+ color ("SteelBlue" ) cylinder (r = mountingHoleRadius[boardType] , h = pcbHeight * 2 , $ fn= 32 );
3434 }
3535 // Add all components to board
3636 components( boardType = boardType, component = ALL );
@@ -60,7 +60,7 @@ module bumper( boardType = UNO, mountingHoles = false ) {
6060
6161 // Board mounting holes
6262 holePlacement(boardType= boardType)
63- cylinder (r = mountingHoleRadius + 1.5 , h = bumperBaseHeight, $ fn = 32 );
63+ cylinder (r = mountingHoleRadius[boardType] + 1.5 , h = bumperBaseHeight, $ fn = 32 );
6464
6565 // Bumper mounting holes (exterior)
6666 if ( mountingHoles ) {
@@ -88,10 +88,26 @@ module bumper( boardType = UNO, mountingHoles = false ) {
8888 }
8989 translate ([0 ,0 ,- 0.5 ])
9090 holePlacement(boardType= boardType)
91- cylinder (r = mountingHoleRadius, h = bumperHeight, $ fn = 32 );
91+ cylinder (r = mountingHoleRadius[boardType] , h = bumperHeight, $ fn = 32 );
9292 translate ([0 , 0 , bumperBaseHeight]) {
93- components(boardType = boardType, component = ALL , offset = 1 );
93+ components(boardType = boardType, component = USB , offset = 1 );
9494 }
95+ translate ([0 , 0 , bumperBaseHeight]) {
96+ components(boardType = boardType, component = POWER, offset = 1 );
97+ }
98+ translate ([0 , 0 , bumperBaseHeight]) {
99+ components(boardType = boardType, component = RJ45, offset = 1 );
100+ }
101+
102+ // TODO : Boards are usually not flat on the downside, and pins
103+ // currently colide with the structure (resulting in a ~1mm gap)
104+ translate ([0 , 0 , bumperBaseHeight]) {
105+ components(boardType = boardType, component = HEADER_M, offset = 0 );
106+ }
107+ translate ([0 , 0 , bumperBaseHeight]) {
108+ components(boardType = boardType, component = HEADER_F, offset = 0 );
109+ }
110+ // Cooling opening?
95111 translate ([4 ,(dimensions[1 ] - dimensions[1 ] * 0.4 )/2 ,- 1 ])
96112 cube ([dimensions[0 ] - 8 ,dimensions[1 ] * 0.4 ,bumperBaseHeight + 2 ]);
97113 }
@@ -239,13 +255,14 @@ PIN = 1;
239255
240256module standoffs(
241257 boardType = UNO,
242- height = 10 ,
243- topRadius = mountingHoleRadius + 1 ,
244- bottomRadius = mountingHoleRadius + 2 ,
245- holeRadius = mountingHoleRadius,
258+ height = 10 ,
246259 mountType = TAPHOLE
247260 ) {
248261
262+ topRadius = mountingHoleRadius[boardType] + 1 ;
263+ bottomRadius = mountingHoleRadius[boardType] + 2 ;
264+ holeRadius = mountingHoleRadius[boardType];
265+
249266 holePlacement(boardType = boardType)
250267 union () {
251268 difference () {
@@ -283,6 +300,16 @@ USB = 2;
283300POWER = 3 ;
284301RJ45 = 4 ;
285302
303+ module header(dimensions, female ) {
304+ z = female?dimensions[2 ]:2.54 ;
305+ color ("black" ) cube ( [dimensions[0 ],dimensions[1 ],z] );
306+ for (m = [0 :dimensions[0 ]/2.54 - 1 ]) {
307+ for (n = [0 :dimensions[1 ]/2.54 - 1 ]) {
308+ translate ([0.95 + m* 2.54 , 0.95 + n* 2.54 , - 2.51 ]) color ("yellow" ) cube ([0.64 , 0.64 ,dimensions[2 ] + 2.5 ] );
309+ }
310+ }
311+ }
312+
286313module components( boardType = UNO, component = ALL, extension = 0, offset = 0 ) {
287314 translate ([0 , 0 , pcbHeight]) {
288315 for ( i = [0 :len(components[boardType]) - 1 ] ){
@@ -297,8 +324,16 @@ module components( boardType = UNO, component = ALL, extension = 0, offset = 0 )
297324 + ((components[boardType][i][2 ] * [1 ,1 ,1 ])
298325 * components[boardType][i][2 ]) * extension
299326 + ([1 ,1 ,1 ] - components[boardType][i][2 ]) * offset * 2 ;
300- translate ( position ) color ( components[boardType][i][4 ] )
301- cube ( dimensions );
327+ translate ( position )
328+ if (components[boardType][i][3 ] == HEADER_M) {
329+ header(dimensions, female = false );
330+ } else {
331+ if (components[boardType][i][3 ] == HEADER_F) {
332+ header(dimensions, true );
333+ } else {
334+ color ( components[boardType][i][4 ] ) cube ( dimensions );
335+ }
336+ }
302337 }
303338 }
304339 }
@@ -412,12 +447,12 @@ YUN = 8;
412447INTELGALILEO = 9 ;
413448TRE = 10 ;
414449ETHERNET = 11 ;
450+ NANO = 12 ;
415451
416452/** ******************************** MEASUREMENTS **********************************/
417453pcbHeight = 1.7 ;
418454headerWidth = 2.54 ;
419455headerHeight = 9 ;
420- mountingHoleRadius = 3.2 / 2 ;
421456
422457ngWidth = 53.34 ;
423458leonardoDepth = 68.58 + 1.1 ; // PCB depth plus offset of USB jack (1.1)
@@ -462,6 +497,14 @@ megaHoles = [
462497 [ 50.8 , 96.52 ]
463498 ];
464499
500+ // Original nano holes
501+ nanoHoles = [
502+ [ 1.27 , 1.27 ],
503+ [ 1.27 , 41.91 ],
504+ [ 16.51 , 41.91 ],
505+ [ 16.51 , 1.27 ]
506+ ];
507+
465508boardHoles = [
466509 ngHoles, // NG
467510 ngHoles, // Diecimila
@@ -474,7 +517,24 @@ boardHoles = [
474517 0 , // Yun
475518 0 , // Intel Galileo
476519 0 , // Tre
477- unoHoles // Ethernet
520+ unoHoles, // Ethernet
521+ nanoHoles // Nano
522+ ];
523+
524+ mountingHoleRadius = [
525+ 1.6 , // NG
526+ 1.6 , // Diecimila
527+ 1.6 , // Duemilanove
528+ 1.6 , // Uno
529+ 1.6 , // Leonardo
530+ 1.6 , // Mega
531+ 1.6 , // Mega 2560
532+ 1.6 , // Due
533+ 1.6 , // Yun
534+ 1.6 , // Intel Galileo
535+ 1.6 , // Tre
536+ 1.6 , // Ethernet
537+ 0.92 // Nano
478538 ];
479539
480540/** ******************************** BOARD SHAPES **********************************/
@@ -502,6 +562,13 @@ megaBoardShape = [
502562 [ 0.0 , 96.52 ]
503563 ];
504564
565+ nanoBoardShape = [
566+ [ 0.0 , 0.0 ],
567+ [ 17.78 , 0.0 ],
568+ [ 17.78 , 43.18 ],
569+ [ 0.0 , 43.18 ]
570+ ];
571+
505572boardShapes = [
506573 ngBoardShape, // NG
507574 ngBoardShape, // Diecimila
@@ -514,7 +581,8 @@ boardShapes = [
514581 0 , // Yun
515582 0 , // Intel Galileo
516583 0 , // Tre
517- ngBoardShape // Ethernet
584+ ngBoardShape, // Ethernet
585+ nanoBoardShape // Nano
518586 ];
519587
520588/** ********************************* COMPONENTS ***********************************/
@@ -584,7 +652,13 @@ dueComponents = [
584652 [[27.365 , - 1.1 , 0 ], [7.5 , 5.9 , 3 ], [0 , - 1 , 0 ], USB, "LightGray" ],
585653 [[40.7 , - 1.8 , 0 ], [9.0 , 13.2 , 10.9 ], [0 , - 1 , 0 ], POWER, "Black" ]
586654 ];
587-
655+
656+ nanoComponents = [
657+ [[0 , 2.54 , 0 ], [headerWidth, headerWidth * 15 , headerHeight], [0 , 0 , 1 ], HEADER_M, "Black" ],
658+ [[15.24 , 2.54 , 0 ], [headerWidth, headerWidth * 15 , headerHeight], [0 , 0 , 1 ], HEADER_M, "Black" ],
659+ [[4.9 , - 1.1 , 0 ], [8 , 9 , 3 ], [0 , - 1 , 0 ], USB, "LightGray" ],
660+ ];
661+
588662components = [
589663 ngComponents, // NG
590664 ngComponents, // Diecimila
@@ -597,7 +671,8 @@ components = [
597671 0 , // Yun
598672 0 , // Intel Galileo
599673 0 , // Tre
600- etherComponents // Ethernet
674+ etherComponents, // Ethernet
675+ nanoComponents
601676 ];
602677
603678/** **************************** NON-BOARD PARAMETERS ******************************/
0 commit comments