Coasterbot gets a pair of eyes
I was featured in MAKE Robot Dispatch #7 — thanks guys! Hard to believe that there is less than a week left in the contest.
One of the requirements of the contest is for the robot to do some obstacle avoidance. The Jameco bundle came with some switches to do bump sensing. While this might be the cheapest solution, it certainly isn’t the simplest. I decided to spend a little bit for a PING))) ultrasonic sensor. This fires a short ultrasonic pulse to determine the distance to the object directly in front of it. I also purchased a mounting bracket kit so that I could rotate the sensor in different directions. (This turned out to be a bit of overkill — I didn’t need the brackets, just the servo itself. But the servo extension cable was useful.)
This was a pretty easy install. No soldering required, I just used 22-gauge wire to plug into the female headers and the breadboard. I needed to run the servos off the 6V batteries in order to get sufficient power. Also, the Arduino servo library requires pin 9 or 10 to be used, which I did not immediately appreciate. For the Ping sensor, there is a user-contributed library which worked fine, again, after I figured out the right pin to use. Pins 0 and 1 are grabbed by Serial which I always use to debug; and pin 2 also seemed to be in use (because it’s an interrupt?), but pin 3 was fine. I am very glad the sensor has a green LED to show when it is firing, otherwise that could have been nasty to debug.
In the video below, the robot is moving, turning the sensor, and taking readings. This shows that the power supply is sufficient, at least with relatively fresh batteries.
There is no obstacle avoidance yet. But with all the hardware in place, this is purely a matter of programming. I am confident that I can get it working, though elegance may be another story. I have some ideas for artistic design which I am hoping to work on tomorrow, with the help of my four year-old daughter.