S&B Volcano vaporizer remote control with Pi Pico W
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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. /*
  2. * case.scad
  3. *
  4. * https://github.com/kauzerei/OpensCadaver/blob/main/models/pico_stuff.scad
  5. *
  6. * Copyright (c) 2023 Kauzerei (openautolab@kauzerei.de)
  7. * Copyright (c) 2023 Thomas Buck (thomas@xythobuz.de)
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * See <http://www.gnu.org/licenses/>.
  20. */
  21. // prev [bottom,top,button,print,OPT_assembly]
  22. part = "OPT_assembly"; //[bottom,OPT_assembly]
  23. wall = 1.5;
  24. // https://www.waveshare.com/wiki/Pico-LCD-1.3
  25. lcd_w = 52.0;
  26. lcd_h = 26.5;
  27. lcd_d = 1.55;
  28. // https://www.printables.com/model/210898-raspberry-pi-pico-case
  29. use <pico_case.scad>
  30. p_w = 21;
  31. p_h = 51;
  32. p_t = 1.0;
  33. p_usb_h = 2.8;
  34. usb_cut_w = 8.5;
  35. usb_cut_h = p_usb_h + 0.4;
  36. pico_header_h = 2.6;
  37. lcd_header_h = 9.0;
  38. pico_slot_w = p_w + 1.2;
  39. pico_slot_h = p_h + 1.6;
  40. extra=4; //lip on the lid that presses top pcb down
  41. thread=3;
  42. air=0.5;
  43. bissl=1/100;
  44. joystick=6;
  45. $fa=1/1;
  46. $fs=1/2;
  47. add_len = 0.7 + 1; // + 2 * wall + thread;
  48. button = 4;
  49. button_hole = button + 1.0;
  50. button_stem = button - 0.4;
  51. button_cut_side = 0.6;
  52. header_h = pico_header_h + lcd_header_h;
  53. length = pico_slot_w; //26.7+2*air;
  54. width = pico_slot_h; //52.4+1.5+2*air;
  55. height = p_t + p_usb_h + header_h; //16.8+air+extra;
  56. total_width = width + 2 * wall;
  57. total_len = length + 2 * wall;
  58. pwr_w = 5.0;
  59. pwr_h = 10.0;
  60. pwr_gap = 0.3;
  61. pwr_wg = pwr_w + 2 * pwr_gap;
  62. pwr_hg = pwr_h + 3 * pwr_gap;
  63. module lcd() {
  64. color("blue")
  65. translate([-lcd_h / 2, -lcd_w / 2, 0])
  66. cube([lcd_h, lcd_w, lcd_d]);
  67. }
  68. module hw() {
  69. translate([0, 0, header_h])
  70. lcd();
  71. translate([p_w / 2, -p_h / 2, 0])
  72. rotate([0, 180, 0])
  73. pico();
  74. }
  75. module bottom() {
  76. difference() {
  77. translate([0, -add_len, 0])
  78. cube([total_width, total_len + 2 * add_len, height + wall]);
  79. translate([wall, wall, wall])
  80. cube([width, length, height + 0.1]);
  81. // screws
  82. if (0)
  83. #for (tr=[[wall+thread/2,wall+thread/2,height/2+wall],
  84. [wall+thread/2,length+3*wall+1.5*thread,height/2+wall],
  85. [width+wall-thread/2,wall+thread/2,height/2+wall],
  86. [width+wall-thread/2,length+3*wall+1.5*thread,height/2+wall]])
  87. translate(tr) cylinder(h=height/2+bissl,d=thread);
  88. // usb cutout
  89. translate([wall / 2, wall + length / 2, usb_cut_h / 2 + wall])
  90. cube([wall + bissl, usb_cut_w, usb_cut_h], center = true);
  91. // power button cutout
  92. translate([-0.1, wall + length / 2 - pwr_wg / 2, wall + usb_cut_h - 0.1])
  93. cube([wall + 0.2, pwr_wg, pwr_h + 0.1]);
  94. // bootsel button
  95. translate([14.475, 16.05, -0.1])
  96. cylinder(d = 4.5, h = wall + 0.2);
  97. }
  98. // power button
  99. translate([0, wall + length / 2 - pwr_w / 2, wall + usb_cut_h + (pwr_hg - pwr_h)])
  100. cube([wall, pwr_w, pwr_h + 0.1]);
  101. // pico screw posts
  102. translate([total_width / 2, total_len / 2, wall])
  103. for (x = [-p_h / 2 + 2, p_h / 2 - 2])
  104. for (y = [-p_w / 2 + 4.8, p_w / 2 - 4.8])
  105. translate([x, y, 0])
  106. difference() {
  107. cylinder(d = 4, h = p_usb_h);
  108. translate([0, 0, -0.1])
  109. cylinder(d = 2.2, h = p_usb_h + 0.2);
  110. }
  111. }
  112. module top() {
  113. difference() {
  114. cube([total_width, total_len, wall]);
  115. for (tr=[[wall+thread/2,wall+thread/2,-bissl],
  116. [wall+thread/2,length+3*wall+1.5*thread,-bissl],
  117. [width+wall-thread/2,wall+thread/2,-bissl],
  118. [width+wall-thread/2,length+3*wall+1.5*thread,-bissl]])
  119. translate(tr)
  120. cylinder(h=wall+2*bissl,d=thread);
  121. translate([wall+1.5,2*wall+thread,-bissl])
  122. for (i = [0 : 3])
  123. translate([47.7 + air, 5.5 + i * 5.7])
  124. cylinder(h=wall+2*bissl,d=button);
  125. translate([wall+1.5+6.7+air,2*wall+thread+13.8+air,-bissl])
  126. cylinder(h=wall+2*bissl,d=joystick);
  127. translate([wall+13.5+1.5,2*wall+thread,-bissl])
  128. cube([31,27,wall+2*bissl]);
  129. }
  130. translate([wall+13.5+1.5-1.5,2*wall+thread,-extra])
  131. cube([1.5,27,extra]);
  132. translate([wall+13.5+1.5+31,2*wall+thread,-extra])
  133. cube([1.5,27,extra]);
  134. }
  135. module button() {
  136. difference() {
  137. cylinder(h = 1, d = button_hole);
  138. translate([button_hole / 2 * -3 + button_cut_side, -button_hole / 2 - 0.1, -0.1])
  139. cube([button_hole, button_hole + 0.2, 1.2]);
  140. }
  141. cylinder(h = 4, d = button_stem);
  142. }
  143. module bottom_assm() {
  144. %translate([0, 0, wall + p_t + p_usb_h])
  145. rotate([0, 0, 90])
  146. hw();
  147. translate([-total_width / 2, -total_len / 2, 0])
  148. bottom();
  149. }
  150. if (part == "bottom") {
  151. bottom_assm();
  152. } else if (part == "top") {
  153. rotate([180, 0, 0])
  154. top();
  155. } else if (part == "button") {
  156. button();
  157. } else if (part == "print"){
  158. translate([0, 10, 0])
  159. bottom();
  160. translate([0, -10, wall])
  161. rotate([180, 0, 0])
  162. top();
  163. for (i = [1 : 4])
  164. translate([-10, -25 + i * 10, 0])
  165. button();
  166. } else {
  167. difference() {
  168. union() {
  169. bottom_assm();
  170. if (0)
  171. translate([-total_width / 2, -total_len / 2, height + wall])
  172. top();
  173. if (0)
  174. for (i = [0 : 3])
  175. translate([47.7 + air, 5.5 + i * 5.7])
  176. translate([wall + 1.5, 2 * wall + thread, -1])
  177. translate([-total_width / 2, -total_len / 2, height + wall])
  178. button();
  179. }
  180. if (1)
  181. translate([-total_width / 2 - 1, 0, -2])
  182. cube([total_width + 2, (total_len + 2 * add_len) / 2 + 2, height + wall + 10]);
  183. }
  184. }