Back to ARobot Projects Page
This application note in PDF format
This application explains how to connect a DIRRS (Digital Infra-Red Range-finding System) unit to ARobot. The DIRRS unit can be used by your robot to detect objects and aid navigation. It does a similar function as the sonar range finder but has many advantages. The main advantage is current draw. DIRRS draws an average 35 mA. The sonar draws about 100 mA in standby. The DIRRS unit is usually cheaper than most sonar units and is also more compact and easier to attach to a robot. The main disadvantage is that DIRRS does not have the range that sonar does.
This application note assumes that you have completed the bread-board and expansion cable application note. There is very little soldering that is required in this application note.
You can purchase the DIRRS unit directly from
HVW Technologies at http://www.hvwtech.com
|       Parts List |
You may also need connectors, wire and hardware to complete your system.
These electronic parts can also be found at Mouser Electronics http://www.mouser.com or Digi-Key http://www.digi-key.com.
|       Circuit |
The DIRRS unit requires that the input not go above 3V. In order to do this a voltage divider circuit is required for the input pin. The resistors, connector, and even double-sided tape are all included in the DIRRS kit. Before inserting the DIRRS wires into the proto-board, tin the wires with a small amount of solder. Then connect the black wire to ground. The red wire to +5V. The blue wire to wire 10 on the expansion cable. And attach the green wire and wire 9 of the expansion cable to the circuit as shown above.
!! Incorrect wiring will damage DIRRS !!
|       Mounting |
I mounted the DIRRS unit to the top of a servo. I then placed the servo in the middle of the ARobot. This way I can turn the unit and get distance in many directions. Two units could also be installed on two servos on each side of the ARobot.
Use the following software example as a building block for your own program.
|       Software |
You can download this program here.
Here's are some useful sources for parts:
'This routine demonstrates how to use the DIRRS
'system from HVW Technologies with ARobot.
'This is a very useful infra-red range finding
'system. It is similar to the sonar range finder,
'but has several differences.
'It draws less current, easier to interface to,
'and it is cheaper than most sonar units.
'However, it does not detect objects further than
'80 cm(~31.5 inches). It is great for short ranges
'and high resolution/accuracy.
dist var byte
dout con 4 'output to the DIRRS.
din con 5 'input from the DIRRS.
speaker con 9 'speaker pin.
low speaker 'shut off the speaker.
high dout 'raise output pin.
input din 'set to input pin.
gosub DIRRS 'call range finder routine.
debug ? dist 'output finding.
pause 500 'wait a bit to find again.
goto main 'loop back.
low dout 'lower ouput line.
if in5=0 then DIRRS1 'loop until pin high.
shiftin din,dout,2,[dist\8]'shift in data.