1101 - IR Distance Adapter

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Product Manual

1101 - IR Distance Adapter


Phidgets 1101 - Product Manual
For Board Revision 0
© Phidgets Inc. 2009
Contents
4 Product Features
4 Applications
4 Connections
4 Type of Measurement

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)

• 3521 - Sharp Distance Sensor GP2Y0A21YK0F (10-80cm)

• 3522 - Sharp Distance Sensor GP2Y0A02YK0F (20-150cm)

Connections
Designed to connect to a:

• 1010 - PhidgetInterfaceKit 8/8/8 Mini-Format

• 1011 - PhidgetInterfaceKit 2/2/2

• 1018 - PhidgetInterfaceKit 8/8/8

• 1019 - PhidgetInterfaceKit 8/8/8 w/6 Port Hub

• 1072 - PhidgetSBC2

• 1203 - PhidgetTextLCD

Type of Measurement
The adapter uses ratiometric measurement.

1101_0_Product_Manual - April 13, 2011 4


Getting Started

Checking the Contents

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

Connecting all the pieces

1. Connect the IR Distance sensor to the 3


Distance Adapter Board using the interface
cable. We are using a 3521 - Sharp Distance
Sensor GP2Y0A21YK0F (10-80cm). 1
2. Connect the Distance Adapter Board to the
Analog Input 1 on the PhidgetInterfaceKit 2
8/8/8 board using the sensor cable.
3. Connect the PhidgetInterfaceKit board to your
PC using the USB cable.

Testing Using Windows 2000/XP/Vista/7


Downloading the Phidgets drivers
Make sure that you have the current version of the Phidget library installed on your PC. If you don’t, do the
following:
Go to www.phidgets.com >> Drivers
Download and run Phidget21 Installer (32-bit, or 64-bit, depending on your PC)

You should see the icon on the right hand corner of the Task Bar.

Running Phidgets Sample Program

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.

1101_0_Product_Manual - April 13, 2011 5


Double Click on the icon to activate the
Phidget Control Panel and make sure that the
Phidget InterfaceKit 8/8/8 is properly
attached to your PC.

1. Double Click on Phidget InterfaceKit


8/8/8 in the Phidget Control Panel 1
to bring up InterfaceKit-full and
check that the box labelled Attached
contains the word True.
2. Make sure that the Ratiometric box
is Ticked.
3 5
3. Place an object in front of the IR
Sensor. A number less than 1000 2
should be returned. 4
4. You can adjust the input sensitivity
by moving the slider pointer.
5. Click on the Sensors button to bring
up the Advanced Sensor Form.

1. In the Sensor 1 box, select the 1101 - IR


1
Distance Adapter from the drop down 2
menu.
3
2. The distance of the object from the sensor
is shown here.
3. Formula used to convert the analog input
SensorValue into distance.

Testing Using Mac OS X


• Click on System Preferences >> Phidgets (under Other) to activate the Preference Pane
• Make sure that the Phidget InterfaceKit 8/8/8 is properly attached.

• 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.

1101_0_Product_Manual - April 13, 2011 6


Programming a Phidget

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.

Coding for your Sensor


Phidget analog sensors do not have their own API, but instead their output is a voltage that is converted to a digital
value and accessed through the SensorValue properties and events on a PhidgetInterfaceKit. It is not possible to
programmatically identify which sensor is attached to the Analog Input. Your application will need to apply any
formulas from this manual to the SensorValue to translate it into usable data.
See the PhidgetInterfaceKit product manual for an overview of its API and a description of our architecture.

1101_0_Product_Manual - April 13, 2011 7


Technical Information

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.

• 3520 - Sharp Distance Sensor 2D120X (4-30cm)

• 3521 - Sharp Distance Sensor 2Y0A21 (10-80cm)

• 3522 - Sharp Distance Sensor 2Y0A02 (20-150cm)

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.

1101_0_Product_Manual - April 13, 2011 8


Other Interfacing Alternatives
If you want maximum accuracy, you can use the RawSensorValue property from the PhidgetInterfaceKit. To adjust a
formula, substitute (SensorValue) with (RawSensorValue / 4.095)
If the sensor is being interfaced to your own Analog to Digital Converter and not a Phidget device, our formulas can
be modified by replacing (SensorValue) with (Vin * 200). It is important to consider the voltage reference and input
voltage range of your ADC for full accuracy and range.

Compatible Infrared Sensors


The following is a list of distance sensors that are known to work with the IR Distance Adapter Board. If the product
is not listed here, it can be assumed to be incompatible.

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)

Note: Most of the above components can be bought at www.digikey.com

1101_0_Product_Manual - April 13, 2011 9


Analog Input Cable Connectors

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]

1101_0_Product_Manual - April 13, 2011 10

You might also like