My thought is to hook an ultrasonic sensor to it, to do some simple obstacle avoidance. Since I’ve never worked with any of these components before (servo’s, ultrasonic sensors, motor-drivers, etc), I want to break down each step so I can really grasp how this stuff works.
I was looking at my bucket of parts and it dawned on me: I have a servo, I have a Ping))) sensor, a spare Arduino Uno, a bunch of Erector Set parts, and knowledge of Processing programming: I could (should!) make a simple sonar system. So the “Ponar” was born: Ping))) + Arduino + Servo + Processing = Ponar.
How it works:
The Arduino program sweeps the servo back and forth over a 90deg arc. At each degree, the Ping))) sensor returns back a distance reading. The degrees and distance values are passed over the serial port to the PC, where the Processing application turns them into a ‘traditional looking’ (in my head at least) sonar read-out.
See it in action:
Want to make one too? Here’s the steps I went through:
- Arduino Uno (older models should work fine)
- Paralax Ping))) sensor
- Ping))) Mounting Bracket Kit (includes the servo).
- Mini breadboard.
- Jumper wires.
- Various Erector Set parts. This is the set I had picked up.
- USB cable to connect Arduino to your ‘puter.
- Arduino software.
- Processing software.
- The Arduino Sketch which you’ll load on your Arduino.
- The Processing Sketch which you’ll run from Processing.
- Assemble the servo, bracket, ping, and erector set into a pleasing arrangement.
- Connect the Arduino’s 5v and ground pins to the mini beadboard with the jumpers.
- Use jumpers to connect the Vin of the Ping))) and the servo to the Arduino powered row on the mini breadboard.
- Use jumpers to connect the ground of the Ping))) and the servo to the Arduino grounded row on the mini breadboard.
- Use a jumper to connect the signal line of the Ping))) to the Arduino’s digital pin 7.
- Use a jumper to connect the signal line of the servo to the Arduino’s digital pin 9.
- Connect the Arduino to the PC with the usb cable.
- Upload the Arduino sketch to the Arduino: It should start sweeping left and right.
- Run the Processing sketch: It should sample the serial stream being passed from the Arduino, and display the sonar view on-screen.
For a couple days work, it was really informative, and actually pretty fun.