January 2, 2012 Leave a comment
I love Sparkfun. I’m on their site at least once a day. I love looking at all of their new products and getting ideas for projects I’d like to try. I love Sparkfun so much that I even made the pilgrimage from St. Paul, MN to Boulder, CO in September, 2011 just so I could stand in their warehouse and imagine what it would be like to have 24 uninterrupted hours with all of the supplies at hand.
One product that Sparkfun recently started carrying is a motorized slide potentiometer, or slide pot. This component is similar to the slide pots inside of mixing boards in recording studios. Not only can a person manually side the pot up and down to create resistance (think of a dimmer switch on a light bulb), but it is also motorized, allowing a micro controller to move the slider to a specific point as well. The idea is that a preset point or set of points could be stored and a micro controller could override the manual setting with an automated one.
That’s spiffy enough as it is, but let’s look at it from the reverse. The motor is moving the slider along a linear path. Basically, that is a linear actuator. The difference between a normal linear actuator and this is that this product has the built-in pot, which sends an analog signal back to whatever is controlling the motor to say where along the linear path it exists. Since these are 10k linear pots, we can say that if the micro controller receives 7k of resistance, it is 70% of the way across the slide. If we want the slider to be at 40%, the micro controller can send the signal to the motor to move it down the slide until it reaches 40% and it stops at that point.
At this point, we can control where an object is along a one axis over the course of the length of the slide pot. One axis is pretty cool, but let’s take it up a notch and add a second axis. If a second pot where mounted to the slider of the first pot perpendicularly, this would give us two axis of movement. The original would move across an x-axis and the second would move across the y-axis. As the x-axis slider actuates, the y-axis slider is moved across the x-axis. The slide of the y-axis slider creates the y-axis movement.
Now we have control over a mount whose position can be controlled over two axis. What is cooler that this? Lasers. That’s right, we are adding lasers tot he mix. Hot damn.
While Sparkfun can be the source of most things awesome, there are some sites that sill need to be reviewed for the awesome things that Sparkfun might not carry. For example, Parallax has some pretty exciting components as well. The slice of heaven I found yesterday was the laser range finder. This sensor shoots a laser at an object and reads the distance to the point where the laser hits it. Oh, 21st century, how much do I love you.
According to the laser range finder documentation, it works best when the distance it is reading is between 6 and 48 inches, but it can read distances up to 8 feet. Yep, this will do nicely. By adding the laser module to the existing x/y articulation platform, perpendicular to the x/y plane, we can now measure the distance from the module to a three-dimensional object (z-axis) among all points on an x/y grid.
The procedure would look like this: The micro controller would utilize four digital output pins, two for each slide pot. As one pin goes high for a specific slider and the other goes low, the slider will move in one direction. If the first goes low and the second goes high, it will move in the opposite direction. If both are low, it will stop. The slider pot also receives 5 volts from the micro processor and returns the analog voltage to an analog input for reading. This is done on both sliders as well. The laser range finder uses a serial output, which is read by the micro controller.
The micro controller reads the x and y axis from the analog inputs and sets both sliders to 0 as necessary. The micro controller then reads the serial input from the range finder. Knowing that it set both x and y to zero and learning the distance of z, all measurements for that x/y/z point are now available and written out to something (micro sd card, usb out, etc). The micro controller then moves the x-axis slider one unit (the distance of the unit depends on the resolution of the slider motor) and a new x/y/z point is created. Since y hasn’t moved, it would have the same value, but x would definitely be different, and z may have a different value based on the object being measured. Once the x axis is maxed out, it is brought back to zero and y is incremented one unit. When both x and y are maxed, all points have been mapped. The array of x/y/z coordinates can then be piped into a 3D rendering program or 3D chart application for display on the computer, thus producing a 3d scanner.