The Sharp GP2Y0A41SK0F is an infrared proximity sensor. You can grab them from SparkFun, Pololu, or many other vendors. (There’s a bunch of different models, but I’m using the GP2Y0A21YK right now. The GP2Y0A21YK appears to be roughly the same physical size.)
If you’re using it with an Arduino, Jeroen Doggen has a nice library called Arduino-distance-sensor-library (which should be easily extendable). It’s just a few lines of code to read distance in Centimeters, so it can be used for robotics or physical computing projects quite easily.
Since I’m using this sensor, I needed a way to mount it. As usual, I look around for a datasheet. Datasheets will often contain the technical drawings of a part. If you’re lucky, they’ll be vector based (Hello, Inventables!) but if not, you can still use them to determine the dimensions of things, or where mounting holes need to go.
Often I’ll pull a datasheet into Inkscape, put it on the bottom layer, lower its transparency, and draw on top of it. Sometimes that works, and sometimes you just need to pull out the calipers and take a few measurements. In an ideal world, all vendors would release technical drawings of their products in vector formats. (Well, at least in my ideal world.)
You may notice that some of these parts look familiar. Indeed, I grabbed part of the motor mounts from my FND upgrade.
Oh, I should note than I want this sensor mounted on the inside of things. If you want it mounted on the outside, you really just need two holes for the mounts, and maybe one for the wires.
If you were wondering about that part with the notch, that’s to make the sensor level while mounting it inside, and the notch is for the wire connector.
One more note on the mounting holes. They are 3.2mm in diameter, which means using a 3mm screw would make sense, but I only had Imperial hardware handy. I also only had 6-32, which is 3.5052mm in diameter, and no 5-40 which is 3.175mm in diameter. No worries, since the sensor is plastic, a quick shave with an X-ACTO knife on the inside of the holes made them fit quite easily.
At some point I’ll need to test how multiple sensors react to each other in the same physical space… That should be interesting!