2 // GNU AGPLv3 (or later at your option)
3 // project available at these locations:
4 // https://gitorious.org/ozzloy/challenge-bot
5 // https://github.com/waynegramlich/challenge-bot
8 this holds an hc-sr04 sonar sensor to a 3/16 inch deck.
9 http://fritzing.org/projects/hc-sr04-project
10 it can hold the sonar sensor either facing down, or forwards.
11 when facing down, it can detect if it passes over the edge of a table.
12 when facing forwards, it can detect and follow something in front of it.
21 // 3/16 inch in mm deck_depth = 4.7625;
22 // 1/4 inch in mm = 6.35
23 // subtract a little to be a squeeze fit
24 deck_depth
= 4.7625 - 0.4;
25 // sonar sensor measurements taken with calipers:
26 // 10.82 in between, 42.33 outside, 15.82 diameter
27 // measured diameter of 15.82 with calipers,
28 // but when printed ends up being too small, so add some
29 sonar_diameter
= 15.82 + 0.4;
30 sonar_radius
= sonar_diameter
/ 2;
32 between_sonar_centers
= sonar_diameter
+ 10.82;
33 // the sonar cylinders are placed on the pcb at slightly different positions
34 // from one sensor to the next, so this allows for that variance.
35 between_sonar_centers_variance
= 2;
36 // keep at least this much plastic surrounding the sonar cylinder on all sides
38 sonar_holder_length
= buffer
+ between_sonar_centers
+ sonar_diameter
+ buffer
;
39 sonar_holder_width
= buffer
+ sonar_diameter
+ buffer
;
40 // sonar_holder_depth is deck_depth minus a little bit to make arm fit
42 sonar_holder_depth
= deck_depth
- 0.7875;
44 deck_holder_length
= sonar_holder_depth
* 2 + deck_depth
+ 15;
47 translate([between_sonar_centers
/ 2, 0, 0]){
48 cylinder(r
= sonar_radius
, h
= sonar_height
);}
49 // for the variance with which the physical sonar cylinders are placed
50 translate([between_sonar_centers
/ 2 - between_sonar_centers_variance
, 0, 0]){
51 cylinder(r
= sonar_radius
, h
= sonar_height
);
52 translate([0, -sonar_radius
, 0]){
53 cube([between_sonar_centers_variance
, sonar_diameter
, sonar_height
]);}}
54 translate([-between_sonar_centers
/ 2, 0, 0]){
55 cylinder(r
= sonar_radius
, h
= sonar_height
);}}
57 module
sonar_holder(){
58 elbow_length
= deck_depth
- 0.5;
60 cube([sonar_holder_length
, sonar_holder_width
, sonar_holder_depth
]);
61 translate([sonar_holder_length
/ 2, sonar_holder_width
/ 2, -0.05]){
63 translate([sonar_holder_length
, 0, 0]){
64 cube([elbow_length
, deck_depth
, sonar_holder_depth
]);
65 translate([elbow_length
, 0, 0]){
66 linear_extrude(height
= sonar_holder_depth
){
68 [sonar_holder_depth
, 0],
69 [sonar_holder_depth
, sonar_holder_width
/ 2],
71 sonar_holder_width
/ 2 + sonar_holder_depth
]]);}
72 translate([0, (sonar_holder_width
+ sonar_holder_depth
) / 2, 0]){
73 cube([sonar_holder_depth
/ 2,
74 (sonar_holder_width
- sonar_holder_depth
) / 2 + 0.8,
75 sonar_holder_depth
]);}
76 translate([-1.7, sonar_holder_width
+ 0.8, 0]){
77 linear_extrude(height
= sonar_holder_depth
){
79 [sonar_holder_depth
/ 2 + 1.7, 4],
80 [sonar_holder_depth
/ 2 + 1.7, 0]]);}}}}}
83 deck_holder_width
= sonar_holder_width
- deck_depth
;
84 deck_holder_height
= sonar_holder_depth
* 2 + deck_depth
;
85 linear_extrude(height
= deck_holder_width
){
87 square([deck_holder_length
, deck_holder_height
]);
88 translate([sonar_holder_depth
, sonar_holder_depth
]){
90 translate([deck_holder_height
, sonar_holder_depth
]){
91 square([deck_holder_length
- (deck_holder_height
), deck_depth
]);}}}
92 translate([deck_holder_length
- oshw_dy
* 0.05, 0, deck_holder_width
/ 2])
94 rotate(v
= [1, 0, 0], a
= 90)
96 linear_extrude(height
= 0.5)
98 translate([deck_holder_length
- oshw_dy
* 0.05,
99 deck_holder_height
+ 0.5,
100 deck_holder_width
/ 2])
101 rotate(v
= [1, 0, 0], a
= 90)
104 linear_extrude(height
= 0.5)
108 translate([0, sonar_holder_depth
* 2 + deck_depth
+ 2, 0]){