From 3a2a4a0789024552a6a67597ccd479d0bfb7582d Mon Sep 17 00:00:00 2001 From: "Jan \"Yenya\" Kasprzak" Date: Thu, 16 Apr 2015 14:27:04 +0200 Subject: [PATCH] hc-sr04: higher case and some other mods --- hc-sr04.scad | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/hc-sr04.scad b/hc-sr04.scad index 2e040ff..51700f9 100644 --- a/hc-sr04.scad +++ b/hc-sr04.scad @@ -5,33 +5,34 @@ wall = 1.5; cyl_r = 8 + 0.5; cyl_x = 27 / 2; -cyl_h = 10; // above pcb, max 13.8; +cyl_h = 8; // above pcb, max 13.8; pcb_x = 45 + 0.5; pcb_y = 20 + 0.5; -xtal_h = 4; -pcb_supp = 3; -pcb_h = 5; // 1.2 + space for connector etc +xtal_h = 5; +pcb_supp = 3; // side support thickness +pcb_h = 8; // 1.2 + space for connector etc +pcb_thick = 2; cyl_base = pcb_x/2 + wall - cyl_x; conn_x = 12.5; -conn_y = 10; +conn_y = 12; -cable_w = 5; -cable_h = 2; +cable_w = 7; +cable_h = 3; mount_h = 3; screw_sp = 5; module sensor() { hull() { - // pcb and the space above it + // space above pcb translate([-pcb_x/2, -pcb_y/2, -eps]) - cube([pcb_x, pcb_y, pcb_h+eps]); + cube([pcb_x, pcb_y, pcb_h-pcb_thick+eps]); // connector translate([-conn_x/2, pcb_y/2-eps, -eps]) - cube([conn_x, conn_y+eps, pcb_h+eps]); + cube([conn_x, conn_y+eps, pcb_h-pcb_thick+eps]); } // cable protrusion translate([-cable_w/2, pcb_y/2+conn_y-eps, -eps]) @@ -40,9 +41,12 @@ module sensor() { // cylinders for (x = [-1, 1]) translate([cyl_x*x, 0, pcb_h - eps]) cylinder(r = cyl_r, h = cyl_h + 2+wall + eps); + // pcb + translate([-pcb_x/2, -pcb_y/2, pcb_h-pcb_thick-eps]) + cube([pcb_x, pcb_y, pcb_thick+eps]); // space below the pcb (xtal, etc) - translate([-pcb_x/2+pcb_supp, -pcb_y/2, pcb_h - eps]) - cube([pcb_x - 2*pcb_supp, pcb_y, xtal_h+eps]); + translate([-pcb_x/2+pcb_supp, -pcb_y/2, pcb_h-pcb_thick - eps]) + cube([pcb_x - 2*pcb_supp, pcb_y, xtal_h+pcb_thick+eps]); }; module case_body() { hull() { @@ -54,7 +58,7 @@ module case_body() { for (x = [-1, 1]) translate([cyl_x*x, 0, pcb_h + cyl_h]) cylinder(r = cyl_base, h = wall); - translate([0, 7, pcb_h + cyl_h]) + translate([0, 8, pcb_h + cyl_h]) cylinder(r = cyl_base, h = wall); // connector @@ -73,7 +77,13 @@ module case_body() { difference() { case_body(); - # sensor(); + difference() { + sensor(); + // pcb clip + translate([-8/2, -pcb_y/2, pcb_h-pcb_thick-wall/2]) + rotate([0, 90, 0]) + cylinder(r=wall/2, h = 8, $fn = 4); + } // mount holes for (x = [0, 180]) rotate([0, 0, x]) { translate([pcb_x/2+wall, -screw_sp/2, wall]) @@ -82,7 +92,7 @@ difference() { cube([3, 3, wall + 2*eps]); } // text - translate([0, 3, pcb_h + cyl_h + eps]) + 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, -- 2.43.5