above: The servo turning with the sonar sensor mounted on top.



Above is a screen shot of a BASIC program that loops through in X degree steps: 1)calls servo driver to move it to correct position 2)take a sonar reading 3) plot the point on the graphics screen, relative to the bottom, middle of the screen 4)repeat until done.

The small dot in the bottom/middle of the screen is the sonar sensor. the line that gets plotted represents (roughly) the shape/coordinates of the edge of "obstructed" and "unobstructed" space around the sensor, the latter being the area closest to the sensor.

This could be used in a number of applications. robotics for information about the environment/walls/obstructions. a sensor on the back of your truck or motor home to let you know what is behind you while backing up.

The drivers for the sonar sensor and the servo were done in 6502 assembly. The program to plot to the graphics screen is in BASIC and calls the assembly drivers to turn the servo/read the sonar sensor. The program uses the parallel card for i/o, but could be modified to use the joystick connector or internal game connector.







The R.C. Servo I already had. The sonar sensor was $1.50 at the thrift store, hacked out of a polaroid camera. http://rich12345.tripod.com