Products for USB Sensing and Control
Products for USB Sensing and Control

Distance Phidget Tutorial

DST1001


by Phidgets Education

Introduction

The Distance Phidget is a distance sensing Phidget. It uses infrared light to determine how far away an object is. You can use it in your projects to measure short distances or detect the motion of objects passing by

In this tutorial you will

  • Connect your Phidget to your computer.
  • Learn about data collected from your Phidget.
  • Practice using your Phidget in a mini-project.

Hardware Setup

Using the Phidget

In order to connect your Distance Phidget to your computer you will need the following:

Connect Device



Connect your Distance Phidget to your VINT Hub using the Phidget cable and connect your VINT Hub to your computer with the USB Cable.


When all components are connected, open the Phidget Control Panel on your computer and find the Distance Phidget entry.


Double-click on the Distance Phidget entry to ensure the Phidget is connected. Leave these windows open for the next section.




Device Properties

Distance Reflections

The Distance Phidget works by reflecting an infrared (IR) light off an object. It can report the distance of the object it's pointed at as often as every 30 milliseconds. Since infrared light is what it uses for the measurement, highly reflective objects will be easier to measure.


Out-of-Range Error

The DST1001 will fire out-of-range error events when the reflected IR light doesn't reach the sensor, meaning the object is out of range. Objects that do not reflect light well might be harder to detect at greater distances.


Mini-Projects

Now that you have your DST1001 connected and working, the next step is writing some code. Write a program in the language of your choice that outputs the distance that the DST1001 is measuring. Your code should have the following flow:


Conclusion

You have completed the DST1001 - Distance Phidget Tutorial. You are now ready to use your Phidget in a project.