]> www.fi.muni.cz Git - things.git/commitdiff
hc-sr04: different screw clips, bigger pcb
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Tue, 5 May 2015 18:04:49 +0000 (20:04 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Tue, 5 May 2015 18:04:49 +0000 (20:04 +0200)
hc-sr04.scad

index dc5b789f8abf691d168e326e5f3a311c03725761..cb06fa5dff861fd65700d6e9cbee615c8bfcd85c 100644 (file)
@@ -4,11 +4,11 @@ infty = 100;
 wall = 1.5;
 
 cyl_r = 8 + 0.5;
-cyl_x = 27 / 2;
+cyl_x = 26.2 / 2;
 cyl_h = 8; // above pcb, max 13.8;
 
-pcb_x = 45 + 1.0;
-pcb_y = 20 + 1.0;
+pcb_x = 45.6 + 1.0;
+pcb_y = 20.2 + 1.0;
 xtal_h = 5;
 pcb_supp = 3; // side support thickness
 pcb_h = 8; // 1.2 + space for connector etc
@@ -20,10 +20,11 @@ conn_x = 10 + 0.5;
 conn_y = 15;
 
 cable_w = 7;
-cable_h = 3.5;
+cable_h = 4;
 
-mount_h = 3;
-screw_sp = 5;
+screw_head = 7.5;
+screw_d = 4;
+screw_base = 2*wall;
 
 clip_r = 1;
 clip_h = 8;
@@ -67,40 +68,39 @@ module case_body() {
                // connector
                translate([-conn_x/2-wall, pcb_y/2-wall, 0])
                        cube([conn_x+2*wall, conn_y+2*wall, pcb_h-pcb_thick+wall]);
-       }
-       for (x = [0, 180]) rotate([0, 0, x]) hull() {
-               // eps-wide cube
-               translate([pcb_x/2-eps, -4/2-wall, pcb_h + cyl_h + wall -eps])
-                       cube([eps, 4+2*wall, eps]);
-               // bottom plate
-               translate([pcb_x/2+wall, -screw_sp/2-wall, 0])
-                       cube([screw_sp+wall, screw_sp+2*wall, wall]);
+               // screw mounts
+               for (x = [1, -1]) scale([x, 1, 1])
+                       translate([pcb_x/2+wall, -screw_head/2-wall, 0])
+                               cube([screw_head, screw_head+2*wall, screw_base]);
        }
 }
 
-rotate([180, 0, 0]) // rotate it for easier print
-difference() {
-       case_body();
+module case() {
        difference() {
-               sensor();
-               // pcb clip
-               translate([-clip_h/2, -pcb_y/2, pcb_h-pcb_thick-clip_r/2])
-               rotate([0, 90, 0])
-               cylinder(r=clip_r, h = clip_h, $fn = 4);
-       }
-       // mount holes
-       for (x = [0, 180]) rotate([0, 0, x]) {
-               translate([pcb_x/2+wall, -screw_sp/2, wall])
-                       cube([screw_sp +wall+eps, screw_sp, pcb_h + cyl_h + eps]);
-               translate([pcb_x/2+1+wall, -3/2, -eps])
-                       cube([3, 3, wall + 2*eps]);
+               case_body();
+               difference() {
+                       sensor();
+                       // pcb clip
+                       translate([-clip_h/2, -pcb_y/2, pcb_h-pcb_thick-clip_r/2])
+                       rotate([0, 90, 0])
+                       cylinder(r=clip_r, h = clip_h, $fn = 4);
+               }
+               // mount holes
+               for (x = [-1, 1]) scale([x, 1, 1]) {
+                       translate([pcb_x/2+wall, -screw_head/2, screw_base])
+                               cube([screw_head+eps, screw_head, infty]);
+                       // screw hole
+                       translate([pcb_x/2+wall+screw_head/2-screw_d/2, -screw_d/2, -eps])
+                               cube([screw_d, screw_d, infty]);
+               }
+               // text
+               translate([0, 3.5, pcb_h + cyl_h + eps])
+                       rotate([0, 0, 90])
+                       linear_extrude(height=wall)
+                       text("CVT FI", font="DejaVu Sans:style=Bold", size=5,
+                               halign="center", valign="center");
        }
-       // text
-       translate([0, 3.5, pcb_h + cyl_h + eps])
-               rotate([0, 0, 90])
-               linear_extrude(height=wall)
-               text("CVT FI", font="DejaVu Sans:style=Bold", size=5,
-                       halign="center", valign="center");
-
 }
 
+// rotate([180, 0, 0]) // rotate it for easier print
+       case();