1+ // Switch Input Module for LipSync
2+ // Makers Making Change
3+ // V1.0
4+ pinSpacing= 2.54 ; // .100" spacing
5+ boardWidth= 21 ;
6+ boardDepth= 27.0 ;
7+ boardHeight= 3 ;// 1.59;
8+ headerDepth= 2.54 + .2 ;
9+ headerHeight= 8.46 ;
10+ headerWidth= 10.7 + .4 ;
11+ // headerPinWidth=.65+.2;//square side
12+ headerPinWidth= .88 + .6 ;// diameter increased twice was.4
13+ headerPinPlugHeight= 6 ;
14+ headerPinTotalHeight= 11.2 ;
15+ ballDia= 3 ; // for ballVia
16+
17+
18+ // pseudo header
19+ difference (){
20+ translate ([0 ,pinSpacing* 4.5 ,headerHeight/2 + boardHeight- .5 ])cube ([headerWidth,headerDepth,headerHeight+ 1 ],center= true ) ;
21+ translate ([0 ,pinSpacing* 4.5 ,headerPinTotalHeight/2 - (boardHeight/2 )])ArrayCentItems(4 ,1 ,pinSpacing,pinSpacing)cylinder (d= headerPinWidth,h= headerPinTotalHeight+ 5 ,center= true ,$ fn= 12 ) ;
22+ translate ([0 ,pinSpacing* 4.5 ,11.5 ])ArrayCentItems(4 ,1 ,pinSpacing,pinSpacing)rotate ([180 ,0 , 45 ])cylinder (h= 1.6 ,r1= 1.6 ,r2= 0 ,$ fn= 4 );// (makes pyramid)
23+ }// diff
24+
25+ translate ([0 ,9 ,7 /2 + boardHeight- .5 ])cube ([6 ,2 ,7 ],center= true ) ; // brace
26+ translate ([- 6.2 ,- 15 ,0 ])cube ([11.4 ,2 ,.6 ],center= false ) ; // support material
27+ // translate ([0,pinSpacing*4.5,headerPinTotalHeight/2-(boardHeight/2)])ArrayCentItems(4,1,pinSpacing,pinSpacing)cube([headerPinWidth,headerPinWidth,headerPinTotalHeight],center=true) ;
28+ difference (){
29+ union (){
30+ translate ([0 ,pinSpacing*- 4.5 ,headerHeight/2 + boardHeight])cube ([headerWidth+ 3 ,headerDepth+ 3 ,headerHeight],center= true ) ;
31+ translate ([- 3 + 5 ,- 1 ,boardHeight/2 ])roundedCube (boardWidth- 10 ,boardDepth,boardHeight,1 );// pseudo PCB board
32+ translate ([- 5 ,- 1 ,boardHeight/2 ])minkowski (){// rounded body
33+ scale ([.75 ,1 ,1 ])cylinder (h = boardHeight- 2 , d = boardDepth- 2 , center = true ,$ fn= 24 );
34+ sphere (r= 1 ,center= true ,$ fn= 30 );
35+ } // end mink
36+ translate ([- 10 ,- 1 ,boardHeight/2 ])minkowski (){// "tail"
37+ cylinder (h = boardHeight- 2 , d = 12 , center = true ,$ fn= 24 );
38+ sphere (r= 1 ,center= true ,$ fn= 30 );
39+ } // end mink
40+ }// end union
41+ // cube([boardWidth,boardDepth,boardHeight],center=true) ;//pseudo PCB board
42+ // roundedCube (boardWidth,boardDepth,boardHeight,1)
43+
44+
45+ translate ([0 ,pinSpacing*- 4.5 ,headerHeight/2 + boardHeight])cube ([headerWidth,headerDepth,headerHeight+ 10 ],center= true ) ;
46+ translate ([- .5 , 5 - 3 , 1 ])rotate ([0 ,180 , 0 ])resistorSlot (8 ,2.6 ,1.2 ,30 );// 5v 100k resistor slot
47+ translate ([pinSpacing* 1 - .5 , 5 - 3 , 1 ])rotate ([0 ,180 , 0 ])resistorSlot (8 ,2.6 ,1 ,30 );// 0v 100k resistor slot
48+
49+
50+
51+
52+ translate ([pinSpacing*- 1 - .5 , 5 - 3 , 1 ])rotate ([0 ,180 , 0 ])resistorSlot (0 ,3 ,1.2 ,30 );// resistor wire
53+ translate ([.3 , - 1 - 3 , boardHeight/2 ])ballVia (boardHeight,1.2 ,ballDia);// 5v 100K/10k resistor hole
54+ translate ([pinSpacing* 1 + .3 , - 4 - 3 , boardHeight/2 ])ballVia (boardHeight,1.2 ,ballDia);// 0v 100k/10k resistor hole
55+ translate ([- 6 , - 1 - 3 , 3 ])rotate ([0 ,0 , 90 ])resistorSlot (8 ,2.6 ,1.2 ,8 + 4 );// 0v 10k resistor slot (underside)
56+ translate ([- 3 , - 4 - 3 , 3 ])rotate ([0 ,0 , 90 ])resistorSlot (8 ,2.6 ,1.2 ,8 + 4 );// 0v 10k resistor slot (underside)
57+
58+ translate ([.3 - 12 , - 1 - 3 , boardHeight/2 ])ballVia (boardHeight,1.2 ,ballDia);// 5v 10k resistor hole
59+ translate ([pinSpacing* 1 + .3 - 12 , - 4 - 3 , boardHeight/2 ])ballVia (boardHeight,1.2 ,ballDia);// 0v 10k resistor hole
60+
61+
62+ translate ([- .5 ,8 ,0 ])cube ([5.5 ,3 ,3.3 ], center = true ); // resistor solder clearance
63+
64+
65+ translate ([- 10 ,0 ,2.5 ])minkowski (){
66+ cube ([3 ,3 ,6 ], center = true ); // cable thru hole
67+ sphere (r= 1 ,center= true ,$ fn= 30 );
68+ } // end mink
69+
70+ translate ([- 5 ,2.5 ,2.5 ])cube ([2.5 ,1.5 ,5 ], center = true ); // cable tie hole
71+ translate ([- 5 ,9.5 ,2.5 ])cube ([2.5 ,1.5 ,5 ], center = true ); // cable tie hole
72+ translate ([5 ,2.5 ,2.5 ])cube ([2.5 ,1.5 ,5 ], center = true ); // 2nd cable tie hole
73+ translate ([5 ,9.5 ,2.5 ])cube ([2.5 ,1.5 ,5 ], center = true ); // 2nd cable tie hole
74+
75+ translate ([- 4.5 ,- 1 ,2.5 ])cylinder (d= 3 ,h= 15.1 ,center= true ,$ fn= 16 );// braid soldering hole
76+ // translate ([0,-10,0])rotate([-30,0, 0])cube([11,5,3], center = true);//old header solder joint clearance
77+
78+ translate ([- 3 ,- 11 ,- 1 ])hull () {
79+ translate ([5 ,0 ,0 ]) rotate ([0 ,0 , 45 ])cylinder (h= 5 ,r1= 7 ,r2= 0 ,$ fn= 4 );// (makes pyramid)
80+ rotate ([0 ,0 , 45 ])cylinder (h= 5 ,r1= 7 ,r2= 0 ,$ fn= 4 );// (makes pyramid)
81+ }// hull
82+
83+ }// end diff
84+
85+
86+
87+ // translate ([0,pinSpacing*-4.5,headerPinTotalHeight/2-(boardHeight/2)])ArrayCentItems(4,1,pinSpacing,pinSpacing)cube([headerPinWidth,headerPinWidth,headerPinTotalHeight],center=true) ;//***temporary
88+ translate ([- 5 ,6 ,4 ])rotate ([0 ,0 , 90 ])cableGrip (); // *** turned off
89+ // ! ! ! ! ! ! ! !!!!!!!!!!!!!! testing !!!!!!!!!!!!!!!!!!!!!!!!!
90+
91+ module cableGrip ()
92+ difference (){
93+ translate ([0 , - 2.5 ,0 ])cube ([6 ,20 ,3 ], center = true );
94+ translate ([0 , - 2.5 ,1 ])rotate ([90 ,0 , 0 ])cylinder (d= 3 ,h= 20.1 ,center= true ,$ fn= 16 ); // cable slot
95+ translate ([0 , 0 ,1 ])rotate ([90 ,0 , 0 ])cylinder (d= 4 ,h= 4 ,center= true ,$ fn= 16 );// cable snagger
96+ translate ([0 , 0 ,2 ])rotate ([90 ,0 , 0 ])cube ([6 ,5 ,3 ], center = true );// cinching slot in cable snagger
97+ translate ([0 , - 10 ,1 ])rotate ([90 ,0 , 0 ])cylinder (d= 4 ,h= 4 ,center= true ,$ fn= 16 );// 2nd cable snagger
98+ translate ([0 , - 10 ,2 ])rotate ([90 ,0 , 0 ])cube ([6 ,5 ,3 ], center = true );// 2nd cinching slot in cable snagger
99+ }// end module cable grip
100+
101+
102+
103+
104+ module resistorSlot (compLeng,compDiam,wireDiam,wireLeng)
105+ // example use: resistorSlot (8,2.6,1,25); //creates standard 1/4 watt resistor slot
106+ {
107+ translate ([0 , 0 ,compDiam/4 ])cube ([compDiam,compLeng,compDiam/2 ], center = true );// component channel
108+ rotate ([90 ,0 , 0 ]) cylinder (d= compDiam,h= compLeng,center= true ,$ fn= 100 );// component bed
109+ translate ([0 , 0 ,compDiam/4 ])cube ([wireDiam,wireLeng,compDiam/2 ], center = true );// wire channel
110+ rotate ([90 ,0 , 0 ]) cylinder (d= wireDiam,h= wireLeng,center= true ,$ fn= 100 ); // rounded wire bed
111+ } // end resistor slot
112+
113+
114+
115+ module ballVia (pcbThick,boreDiam,sphereDiam)
116+ // make sure sphereDiam is always less than board thickness!!!
117+ {
118+ // sphere(d = boreDiam,$fn=24);
119+ // cylinder(D=boreDiam,h=pcbThick-sphereDiam,$fn=100);
120+ cylinder (h = pcbThick, d = boreDiam, center = true ,$ fn= 24 );
121+ translate ([0 ,0 ,pcbThick/2 ])sphere (d = sphereDiam,$ fn= 24 );
122+ translate ([0 ,0 ,pcbThick/- 2 ])sphere (d = sphereDiam,$ fn= 24 );
123+ }// end module ballVia
124+
125+
126+
127+ module ArrayCentItems(xCount,yCount,itemGapX,itemGapY)
128+ {
129+ for (x = [1 :xCount]){
130+ for (y = [1 :yCount]){
131+ translate ([x* itemGapX- (xCount+ 1 )* itemGapX/2 ,y* itemGapY- (yCount+ 1 )* itemGapY/2 ,0 ])
132+ children();
133+ }// for y
134+ }// for x
135+ }// end module
136+
137+ module CircleItems(n,r,myRot)
138+ {
139+ segment= 360 / n;
140+ for (i= [1 :n])
141+ {
142+ rotate ([0 , 0 , segment* i+ myRot])
143+ translate ([r,0 ,0 ])
144+ children();
145+ }// for
146+ }// module
147+
148+
149+ module roundedCube (myBoxWidth,myBoxDepth,myBoxHeight,minkRadius)
150+ // ** Same as regular cube, but with rounded sides and bottom
151+ // ** maintains proper 'cube' dimensions due to compensation for object expansion
152+ // ** that normally occurs while using Minkowski operations in OpenSCAD)
153+ {
154+ union ()
155+ {
156+
157+ minkowski (){
158+ cube ([myBoxWidth- minkRadius* 2 ,myBoxDepth- minkRadius* 2 ,myBoxHeight- minkRadius* 2 ], center = true );// Main plate original cube([90,testSize8,8.5]
159+ sphere (r= minkRadius,center= true ,$ fn= 30 );
160+ } // end mink
161+
162+
163+ }// end union
164+ }// end module roundedCube
0 commit comments