Scanbot 69420

One of my hobbies is shaping surfboards by hand. A problem I was having was replicating the contours of a board I’d made that worked really well. I solved this problem by making a special surfboard scanner, cobbled together from old computer junk, that I call Scanbot 69420.

Surfboards are typically not flat on the bottom, they usually have contouring that changes how the water flows across the board. Some boards have single concaves, double concaves, or vees carved into the bottom, and others have even more complex contours than this. For example, here is my favorite surfboard that I’ve made:

Horcrux surfboard bottom

I shaped this particular board one afternoon, and it surfs unbelievably well. The bottom contours help it go fast and rip turns, but I couldn’t remember exactly how I’d carved them. I wanted to make a way to digitize the bottom of it so I could preserve the shape I’d made and help guide me when making similar boards in the future. So I made Scanbot 69420, a surfboard scanner I created from hacked computer mouse parts and a Harbor Freight digital indicator gauge. By placing a flat reference across the bottom of a surfboard, and rolling the scanbot mouse along that flat surface, it can capture even the most complex bottom contours. The mouse ball records the x-axis position, and the tip of the indicator gauge traces along the surfboard bottom capturing the z-axis data. A tiny microcontroller inside the mouse keeps track of everything and sends those data to a computer over USB. Software on the computer reads the data from the mouse scanner, and produces full-scale drawings of my board. I can use this drawing to help me shape another one!

All the code and electronics is available in my GitHub with a lot more technical details than I’ll go into here. The Github repo contains all the software, firmware, electronics schematics and circuit board layout, and the Readme is much more technical than this post.

Scanbot scanning a board

One of my main goals of the project was to try to keep all the electronics inside the mouse itself, and to try to keep the mouse looking as “stock” as possible. To do this I had to completely gut the mouse, replacing its original circuit board with one that I designed to fit in the same space. I was stoked to even be able to keep the buttons of the mouse functional!

Scanbot looks like a mouse

Hardware

I found an old ball mouse from the ’90s, and wanted to fit everything inside the original mouse body. I thought it would be funniest if it looked just like a normal old mouse (with a probe mounted to the front of it), with a single USB plug that would just plug into the computer. This meant completely replacing the mouse’s original circuitry with my own, and finding a tiny Arduino that was small enough to fit inside the mouse.

Here’s how a ball mouse works: first, the ball rubs up against a roller and spins it. On the other end of the roller inside the mouse, is an optical rotary encoder, which is basically a disc with evenly spaced holes around the edge. There’s an LED on one side of the disc and a light detector on the other side; as the disc spins, the LED light either shines through the holes or is blocked by the disc, producing a blinking pattern on the detector that you can count and deduce how far you’ve gone.

If you remember these old mice, you’ll remember that the ball itself was annoying and the rollers always needed to be cleaned. The ball also had way more resolution than I needed, so I threw out the ball and replaced it with a small rubber wheel from an R/C airplane that I mounted directly on to the roller as it if were an axle.

Scanbot guts

The depth axis is measured by a cheapo depth indicator gauge that I got from Harbor Freight (a US retailer of cheap tools of varying quailty). It turns out that there’s a hidden serial data port on these gauges, and various folks on the internet have published how to read data from it. I found an incredible blog post detailing exactly how to do this, including some sample Arduino code which became the basis of my firmware. There are several other pages I found with information about these.1 2 3 4

From a hardware standpoint, the hardest part about reading the gauge is that the gauge runs on a single 1.5v battery, which is too low of a voltage to trigger a HIGH state in the Arduino, but it is enough to fire a transistor. We can use transistors to boost the gauge’s clock and data lines up to the 5v high that will make the Arduino code easy to write.

Software

Scanbot Screencast

The software is written in Node.js, mainly because I wanted to use the epic Paper.js vector drawing toolkit. It reads the data from the serial port, saves it to a file, then renders it as a vector drawing.

To use Scanbot, first fire up the software from the command line and you’ll be prompted to input the name of your scan and the description. Place the mouse in position and click the button. The LED will start blinking, and a little spinner will appear on the computer letting you know that it’s in scanning mode. Slide the mouse slowly along the straight edge, and click the button when you’re done. You’ve just made the first scan! You can make as many scans as you like… for example a surfboard might have one scan every foot along the length of the board, with some extra scans through the tail section. Once you’re all done scanning press the q key on the computer to let the software know you’re done. It will then prompt you to name each scan. With that complete, it will render out all your scans as a full-scale SVG drawing! Now you have a drawing that you can use to replicate a hand-shaped surfboard.

Scanned Horcrux

References