I decided to buy an Arduino board and some components to go with it. I have some 10-or-more-year-old servos sitting in a box from when I experimented with them directly connected to a PC so it made sense to plug them into a board plugged into the Arduino and see how they work.
I was able to get a servo moving around with a few lines of code. It took a while to understand the documentation for the servo controller board because, well, most documentation any anything interesting, is hard to understand. It’s especially tough when there are different protocols for sending data and the documentation for them is mixed together on the page.
The second thing I did was connect an optical distance sensor to the server to see if it could act like a Radar and track objects. I only wrote about 20 lines of code to do this so it’s fairly terrible at tracking. But it did succeed at finding something close and then pointing to it.
The video shows the tracking hardware at work. Some interesting idea came up while I was working on this: Can the distance sensor work while moving? Is there enough lag that I need to figure out where the servo was pointing a moment earlier? What would the software need to do to get better readings when tracking a target (like keep track of all close vs. far information and figure out a center point instead of just using the first close point as the “center” point for tracking)?
I didn’t do more work on this because my goal is to create a balance beam “sculpture” that can move a 1-inch steel ball along a beam. I don’t want to use the optical sensor since it is big and ugly and any optical sensor would be visible at one end of the track. My idea is to use resistance wire, the kind used to create heat, as a variable resistor by placing it along the tracks and sending power through it. The ball will complete the circuit and the ball position on the track will affect how much of the wire is in the circuit. Sending that voltage/current through an amplifier, since the variation in power through the wire is minuscule, will get a voltage that I can read with a ADC (Analog to Digital Converter).
I have most of the parts I need. I’m still learning about analog electronics so I only have guesses about how to build the sensor components. if it works, it will look cool with the ball on a track being moved around by a servo that changes the angle of the track.
One more idea that my dad suggested is to wrap the wire around the track to get more resistance. That would be awesome but so far, I can’t find resistance wire that is insulated. This stuff is used for heating, like if you wanted to make a styrofoam cutting tool using a length of thin wire, so it’s not going to be insulated. I don’t think I can just rub some glue on it but maybe it wold work. We’ll see.