Skip to content

Instantly share code, notes, and snippets.

@ednisley
Last active November 10, 2016 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ednisley/beb4491fc8db1e6960ebe8ec7dc56e7b to your computer and use it in GitHub Desktop.
Save ednisley/beb4491fc8db1e6960ebe8ec7dc56e7b to your computer and use it in GitHub Desktop.
OpenSCAD source code: TCRT5000 proximity sensor mount
// TCRT5000 Proximity switch sensor mount
// Ed Nisley KE4ZNU - October 2016
Layout = "Build"; // Show Build
//- Extrusion parameters must match reality!
ThreadThick = 0.25;
ThreadWidth = 0.40;
HoleWindage = 0.2;
Protrusion = 0.1; // make holes end cleanly
inch = 25.4;
function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
//----------------------
// Dimensions
Sensor = [5.9,10.0,7.0];
SensorHoleCutter = 3/8 * inch;
echo(str("Cutter dia: ",SensorHoleCutter," mm"));
echo(str("Cutter motion: ",Sensor[1]," mm"));
PanelThick = 5.0;
StemLength = PanelThick + 6*ThreadThick;
FlangeThick = 3 * ThreadThick;
//----------------------
// Flange model
module ProxFlange() {
difference() {
union() {
linear_extrude(height=FlangeThick)
hull()
for (i=[-1,1], j=[-1,1])
translate([i*Sensor[0],j*Sensor[1]])
circle(r=Sensor[0]/2,$fn=8*4);
translate([0,0,-StemLength])
linear_extrude(height=StemLength)
hull()
for (j=[-1,1])
translate([0,j*Sensor[1]/2])
circle(d=SensorHoleCutter,$fn=8*4);
}
translate([0,0,-Protrusion])
cube(Sensor + [HoleWindage,HoleWindage,2*(PanelThick + Protrusion)],center=true);
}
}
//----------------------
// Build it
if (Layout == "Show")
ProxFlange();
if (Layout == "Build")
translate([0,0,FlangeThick])
rotate([180,0,0])
ProxFlange();
@ednisley
Copy link
Author

More details on my blog at http://wp.me/poZKh-6ho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment