Home           Info Request           Quote/Order           Contact           Site Map           About           Search           Support/FAQ  

 ARobot Mobile Robot Sonar App Note
Back to ARobot Projects Page

This application note in PDF format

sonar on ARobot

Polaroid Sonar

This application note describes how to attach a Polaroid Sonar (Ultrasonic) range finder to ARobot. Sonar will allow your robot to detect the distance to the nearest objects to aid navigation. The Polaroid sonar system includes a #6500 driver board and a transducer. Several transducers are available that will work with the #6500 driver board. You will have to modify the driver board, build a cable to connect the driver board to ARobotís controller board, and mount the driver board and the transducer to the robotís body. You may also mount the transducer on a movable servo motor to allow scanning.

The sonar system pulls approximately 100ma of current while powered on and short bursts of 2 amps when pinging. Take this into account when calculating battery usage.

Polaroid sonar package

Driver Modification

A 100uf 16 volt capacitor must be added to the driver board to prevent power dips during usage. This capacitor is available at most electronic supply stores including Mouser (www.mouser.com), DigiKey (www.digikey.com), and Radio Shack (www.radioshack.com) - RS catalog #: RSU-11935210. Mount and solder the capacitor to the driver board according to the drawing below. Notice polarity of the capacitor.

Driver Modification

Driver Modification


Next youíll need to make a cable to connect the driver board to the robotís expansion port. The expansion port uses a common 40 pin flat cable connector. Solder the wires from the 40 pin connector directly to the special flat cable which is normally provided with the driver board. If you donít have the special flat cable which attaches to the driver board, youíll need to solder the wires directly to the driver board. Follow the pin out shown. Make sure that the flat cable is installed in the driver boardís connector correctly.

sonar cable detail

Cable Pinout
   Expansion      Driver Board
   Connector       Connector
   2   (Gnd)       1   (Gnd)
   3   (+5v)       9   (+5v)
   9   (P4)        4   (Init)
   10  (P5)        7   (Echo)
   11  (P6)        8   (Binh)


Mount the driver board and transducer to ARobotís body using metal or plastic brackets and hardware as needed. Drilling of the body may be necessary Ė prevent metal filings from getting on electronic circuits. Make sure that no wire or exposed part of the driver board makes contact with any metal hardware or the robotís body. The picture below shows the transducer mounted to the body using a small metal bracket and a dab of the robot builder's best friend - hot glue.

Transducer mounting

Note: DO NOT place the driver board or transducer near the ARobot controller board or other controller boards to prevent electrical noise from causing malfunctions.


The driver board and transducer my have 100 volts or more present at various locations. Do not touch!


You can cut and paste this code example into your editor then download it to the Basic Stamp II for execution.

Or Download sonar.bs2 here.

'sonar example program.
dist	var	word		'sonar distance var.
redled	con	10
speaker	con	9
				'sonar pins.
init	con	4		'change these for different pins.
binh	con	6
echo	con	5

output init			'sonar init.
output binh			'sonar binh.
output speaker			'speaker output.
output redled			'red led.
input echo			'echo pin.

				'setup for sonar.
low init				'init pin.
low binh				'binh pin.

low speaker			'turn off speaker.
low redled			'turn on red led.

	gosub sonar		'get sonar reading.
	debug dec ? dist		'print it to serial port.
	pause 1000		'pause 1 sec.
	goto test			'loop back.

	high init			'hit transducer.
	pause 1			'pause for ringing.
	high binh			'raise inhibit.

	rctime echo,0,dist		'wait for echo.

	dist=dist/73+9		'dist has number of inches.
				'offset for ringing is 9 inches.
				'sound travels 1 inch in about 73us.
				'rctime increments in 2us increments.

	pause 40			'give it a rest.
	low init			'reset sonar stuff.
	low binh
	return			'done.


The Polaroid 6500 driver and transducer can be purchased from Wirz Electronics. See their web site at www.wirz.com.

Here's some other Polaroid Sonar Links of interest:

  Home           Info Request           Quote/Order           Contact           Site Map           About           Search           Support/FAQ  
Copyright (c) Arrick Robotics - ArrickRobotics.com