This Roach has a servo mounted on its body with a Sharp GP2D12 Proximity Sensor
on top. The BasicX code has two multi-tasks... one to rotate the sensor servo,
and another checking the sensor readout. The Roach can then determine which
way it should head to avoid the object by checking the current position of the
sensor servo.
This setup works REALLY well! I set him loose in all kinds of environments,
and he detected white objects, black objects, shoes, pants, even my cats! I
have plans to mount similar turrets underneath the Roach using micro servos...
possibly mini stepper motors.
The code for the edge finding sensor isn't included, nor is the buzzer code,
but they're simple enough to add on your own!
 |
View 1 of the Roach with the Sharp GP2D12 Sensor on a Turret |
 |
Closeup of the 90 degree angle bracket I made from a piece of sheet metal.
The bracket is then screwed onto a standard servo arm, with 3 of the 4 pieces
cut off. Krylon is a beautiful thing... |
 |
Closeup of the BasicX and my wiring. Pretty neat job, all the wires are
coiled under the Roach to keep them neat and out of the way. |
 |
Closeup of the head mounted edge finding sensor. |
 |
The Roach in "Attack" position! |
 |
Another view... |