Information and documentation on building an embedded board test lab.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

196 lines
6.7 KiB

  1. /* [Screw holes for attaching the Raspberry Pi 4] */
  2. // Make the screw holes this much bigger than the
  3. // actual screw for a more comfortable fit
  4. // (a bigger number here will make the screws fit looser)
  5. screw_hole_fudge = 0.15; // [0:0.05:0.5]
  6. /* [Tray width] */
  7. // Make the tray this much narrower on each side
  8. // for a more comfortable fit in the frame
  9. // (a bigger number here will make the fit looser)
  10. tray_insert_fudge = 0.25; // [0:0.05:0.75]
  11. /* [Hidden] */
  12. tray_width = 58;
  13. tray_length = 85;
  14. tray_depth = 5;
  15. tray_lip_overhang = 10;
  16. inner_wall_thickness = 5;
  17. spacer_depth = 3;
  18. spacer_outer_radius = 3;
  19. screw_radius = 1.25 + screw_hole_fudge;
  20. screw_head_radius = 3;
  21. screw_head_depth = 2;
  22. pcb_depth = 2;
  23. spacer_center_width = 49;
  24. spacer_center_length = 58;
  25. spacer_from_edge = (tray_width - spacer_center_width) / 2;
  26. sd_window_width = 40;
  27. floor_window_width = sd_window_width;
  28. floor_window_border = (tray_width - floor_window_width) / 2;
  29. floor_window_length = tray_length - floor_window_border*2 - inner_wall_thickness;
  30. epsilon = 0.001;
  31. difference() {
  32. union() {
  33. // the main tray
  34. intersection() {
  35. union() {
  36. translate([tray_insert_fudge, 0, 0]) {
  37. cube([ tray_width - 2*tray_insert_fudge,
  38. tray_length + tray_lip_overhang,
  39. tray_depth]);
  40. }
  41. difference() {
  42. // the outer part of the curved handle
  43. translate([ tray_width/2,
  44. -tray_length*0.5 + 7.5,
  45. 0]) {
  46. cylinder(
  47. h=tray_depth + spacer_depth + pcb_depth,
  48. r=tray_length*1.5,
  49. center=false,
  50. $fn=360);
  51. }
  52. // cut away the inside to make it a shell
  53. translate([ tray_width/2,
  54. -tray_length*0.5 + 5.4,
  55. -epsilon]) {
  56. cylinder(
  57. h=tray_depth + spacer_depth + pcb_depth + 2*epsilon,
  58. r=tray_length*1.5,
  59. center=false,
  60. $fn=360);
  61. }
  62. translate([ tray_width,
  63. -tray_length,
  64. -epsilon]) {
  65. cube([ 2*tray_width,
  66. 3*tray_length,
  67. tray_depth + spacer_depth + pcb_depth + 2*epsilon]);
  68. }
  69. translate([ -2*tray_width,
  70. -tray_length,
  71. -epsilon]) {
  72. cube([ 2*tray_width,
  73. 3*tray_length,
  74. tray_depth + spacer_depth + pcb_depth + 2*epsilon]);
  75. }
  76. }
  77. // reinforce the curved handle
  78. translate([epsilon, tray_length, tray_depth]) {
  79. rotate([-75, 0, 0]) {
  80. cube([tray_width - 2*epsilon, 2*sqrt(2), 6]);
  81. }
  82. }
  83. }
  84. // cut away the ears of the tray
  85. // where they jut through the curved handle
  86. translate([ tray_width/2,
  87. -tray_length*0.5 + 7.5,
  88. 0]) {
  89. cylinder(
  90. h=tray_depth + spacer_depth + pcb_depth,
  91. r=tray_length*1.5,
  92. center=false,
  93. $fn=360);
  94. }
  95. }
  96. // place the 4 spacers
  97. for (a=[ [spacer_from_edge,
  98. spacer_from_edge],
  99. [spacer_from_edge + spacer_center_width,
  100. spacer_from_edge],
  101. [spacer_from_edge,
  102. spacer_from_edge + spacer_center_length],
  103. [spacer_from_edge + spacer_center_width,
  104. spacer_from_edge + spacer_center_length]]) {
  105. translate([a[0], a[1], tray_depth-epsilon]) {
  106. // place the spacer
  107. cylinder(
  108. h=spacer_depth + epsilon,
  109. r=spacer_outer_radius,
  110. center=false,
  111. $fn=360);
  112. // place a small cone around it
  113. cylinder(
  114. h=2 + epsilon,
  115. r1=spacer_outer_radius + 1,
  116. r2=spacer_outer_radius,
  117. center=false,
  118. $fn=360);
  119. }
  120. }
  121. // the tray insert edge tabs
  122. for (a=[ tray_insert_fudge,
  123. tray_width - tray_insert_fudge]) {
  124. translate([ a,
  125. 0,
  126. tray_depth/2]) {
  127. intersection() {
  128. rotate([0, 45, 0]) {
  129. translate([-tray_depth/sqrt(2)/2, 0, -tray_depth/sqrt(2)/2]) {
  130. cube([ tray_depth/sqrt(2),
  131. tray_length,
  132. tray_depth/sqrt(2)]);
  133. }
  134. }
  135. translate([-tray_depth/2+0.5, 0, -tray_depth/2]) {
  136. cube([ tray_depth-1,
  137. tray_length,
  138. tray_depth]);
  139. }
  140. }
  141. }
  142. }
  143. }
  144. // punch a hole in the bottom
  145. translate([ floor_window_border,
  146. floor_window_border,
  147. -epsilon]) {
  148. cube([ floor_window_width,
  149. floor_window_length,
  150. tray_depth + 2*epsilon]);
  151. }
  152. // drill the 4 screw holes
  153. for (a=[ [spacer_from_edge,
  154. spacer_from_edge],
  155. [spacer_from_edge + spacer_center_width,
  156. spacer_from_edge],
  157. [spacer_from_edge,
  158. spacer_from_edge + spacer_center_length],
  159. [spacer_from_edge + spacer_center_width,
  160. spacer_from_edge + spacer_center_length]]) {
  161. translate([a[0], a[1], -epsilon]) {
  162. // drill the main screw hole
  163. cylinder(
  164. h=tray_depth + spacer_depth + 2*epsilon,
  165. r=screw_radius,
  166. center=false,
  167. $fn=360);
  168. // drill a recessed hole for the screw head
  169. cylinder(
  170. h=screw_head_depth + epsilon,
  171. r=screw_head_radius,
  172. center=false,
  173. $fn=360);
  174. }
  175. }
  176. }