1101 - IR Distance Adapter
1101 - IR Distance Adapter
1101 - IR Distance Adapter
5 Getting Started
5 Checking the Contents
5 Connecting all the pieces
5 Testing Using Windows 2000/XP/Vista
6 Testing Using Mac OS X
7 Programming a Phidget
7 Code Samples
7 Coding for your Sensor
8 Technical Information
8 Other Interfacing Alternatives
9 Compatible Infrared Sensors
10 Analog Input Cable Connectors
10 Device Specifications
10 Product History
10 Support
Product Features
Applications
• Designed to bridge compatible Sharp IR sensors to PhidgetInterfaceKit analog inputs such as:
• 3520 - Sharp Distance Sensor GP2D120XJ00F (4-30cm)
Connections
Designed to connect to a:
• 1072 - PhidgetSBC2
• 1203 - PhidgetTextLCD
Type of Measurement
The adapter uses ratiometric measurement.
You should have received: In order to test your new Phidget you will also
• An IR Distance Adapter need:
• A 60cm Sensor Cable • A compatible Sharp IR Distance Sensor
• An Interface Cable for connecting the
IR Distance Sensor to the Adapter • A PhidgetInterfaceKit 8/8/8 or a PhidgetText LCD
• A USB Cable
You should see the icon on the right hand corner of the Task Bar.
Double clicking on the icon loads the Phidget Control Panel; we will use this program to make sure that your
new Phidget works properly. Since the sensor is connected to a 1018, the computer will see only the 1018. The
sensor is providing data through the Analog input it is connected to.
The source code for the InterfaceKit-full sample program can be found under C# by clicking on www.phidgets.com
>> Programming.
• Double Click on Phidget InterfaceKit 8/8/8 in the Phidget Preference Pane to bring up the InterfaceKit-Full
example. This example will function in a similar way as the Windows version, but note that it does not include an
Advanced Sensor Display.
Phidgets’ philosophy is that you do not have to be an electrical engineer in order to do projects that use devices
like sensors, motors, motor controllers, and interface boards. All you need to know is how to program. We have
developed a complete set of Application Programming Interfaces (API) that are supported for Windows, Mac OS X,
and Linux. When it comes to languages, we support VB6, VB.NET, C#.NET, C, C++, Flash 9, Flex, Java, LabVIEW,
Python, Max/MSP, and Cocoa.
Code Samples
We have written sample programs to illustrate how the APIs are used.
Due to the large number of languages and devices we support, we cannot provide examples in every language for
every Phidget. Some of the examples are very minimal, and other examples will have a full-featured GUI allowing
all the functionality of the device to be explored. Most developers start by modifying existing examples until they
have an understanding of the architecture.
Go to www.phidgets.com >> Programming to see if there are code samples written for your device. Find the
language you want to use and click on the magnifying glass besides “Code Sample”. You will get a list of all the
devices for which we wrote code samples in that language.
If this is your first time writing a program to control a Phidget, you should read the Getting Started Guide for the
language you are planning to use.
The function of the IR Distance Adapter Board is to regulate the power requirement of the connected sensor.
Although the specified current consumption may be low for these types of sensors, they may draw much more
current for short periods of time during measurements. If two or more of these sensors are directly connected to the
analog inputs of a PhidgetInterfaceKit, (which can source a maximum of 500mA current total) then the InterfaceKit
may potentially experience an overload. Up to eight Sharp IR Distance sensors can safely be connected to the
PhidgetInterfaceKit 8/8/8 at the same time through IR Distance Adapter Boards, which prevents the possibility of
overcurrent.
Sharp IR distance sensors are recommended for use with the IR Distance Adapter board. The sensor values given
will be outside the specified range when no object is present, and fall between a specific range when an object is
detected. For analog type sensors, the output is roughly inversely proportional to the distance between the specific
range. For digital type sensors, output below a certain value can be treated as a detection.
Make sure that the distance of the object being measured is within the distance range of the sensor. When the
object is outside the valid sensor’s distance range, the returned value should be discarded. You must be especially
careful when the object is closer than it should be, as the returned value might be within the SensorValue range but
is not meaningful.
Formulas
These formulas are derived from the Sharp datasheets to compute distance and are only valid for the
Sharp Distance Sensors that we stock and sell on Phidgets.com.
The formula to translate SensorValue into Distance for Sharp 4-30cm analog sensor is:
Distance (cm) = 2076/(SensorValue - 11)
This formula is only valid over the SensorValue range 80-530.
The formula to translate SensorValue into Distance for Sharp 10-80cm analog sensors is:
Distance (cm) = 4800/(SensorValue - 20)
This formula is only valid over the SensorValue range 80-500.
The formula to translate SensorValue into Distance for Sharp 20-150cm analog sensors is:
Distance (cm) = 9462/(SensorValue - 16.92)
This formula is only valid over the SensorValue range 80-490.
For digital distance sensors, SensorValue will be greater than 200 if the distance of the object being measured is less
that the detection distance of the sensor. Otherwise the SensorValue will be less that 200.
Note: The output of this sensor will vary from unit to unit, and based on the characteristics of the target
(reflectance, size, direction of motion, object alignment, ...). Our formula is based on the data provided by Sharp.
If you find that you are not getting good results with the standard formulas, you may want to derive your own
formula to better characterize your situation.
IR Distance Sensors
Manufacturer Part Number Description
Sharp GP2Y0A02YK0F 20-150cm Analog
Sharp GP2Y0A02YK 20-150cm Analog (non-RoHS)
Sharp GP2Y0D21YK0F 24cm Digital
Sharp GP2Y0D21YK 24cm Digital (non-RoHS)
Sharp GP2D14J0000F 24cm Digital
Sharp GP2D15 24cm Digital (non-RoHS)
Sharp GP2Y0D02YK0F 80cm Digital
Sharp GP2Y0D02YK 80cm Digital (non-RoHS)
Sharp GP2D150AJ00F 15cm Digital
Sharp GP2D140A 15cm Digital (non-RoHS)
Sharp GP2Y0A21YK0F 10-80cm Analog
Sharp GP2D12 10-80cm Analog (non-RoHS)
Sharp GP2Y0A21YK 10-80cm Analog (non-RoHS)
Sharp GP2D120XJ00F 4-30cm Analog
Sharp GP2D120 4-30cm Analog (non-RoHS)
Each Analog Input uses a 3-pin, 0.100 inch pitch locking connector.
Pictured here is a plug with the connections labeled. The connectors
are commonly available - refer to the Table below for manufacturer part
numbers.
Cable Connectors
Manufacturer Part Number Description
Molex 50-57-9403 3 Position Cable Connector
Molex 16-02-0102 Wire Crimp Insert for Cable Connector
Molex 70543-0002 3 Position Vertical PCB Connector
Molex 70553-0002 3 Position Right-Angle PCB Connector (Gold)
Molex 70553-0037 3 Position Right-Angle PCB Connector (Tin)
Molex 15-91-2035 3 Position Right-Angle PCB Connector - Surface Mount
Note: Most of the above components can be bought at www.digikey.com
Device Specifications
Characteristic Value
Current Consumption 3mA
Output Impedance 1K ohms
Supply Voltage 4.75VDC to 5.25VDC
Product History
Date Board Revision Comment
October 2005 n/a Product Release
May 2008 Board Revision 0A
Support
Call the support desk at 1.403.282.7335 9:00 AM to 5:00 PM Mountain Time (US & Canada) - GMT-07:00
or
E-mail us at: [email protected]