Product Manual

1018 - PhidgetInterfaceKit 8/8/8

Phidgets 1018 - Product Manual For Board Revision 2 © Phidgets Inc. 2010

0 or 6.0 9 Programming a Phidget 9 9 9 9 10 10 Architecture Libraries Programming Hints Networking Phidgets Programming Manual Getting Started Guides 10 Documentation 10 API Guides 10 Code Samples 10 API for the InterfaceKit 8/8/8 10 11 Functions Events 12 Technical Section 12 Analog Inputs 12 Using the Analog Inputs with Sensors provided by Phidgets .Contents 5 Product Features 5 5 5 5 5 Analog inputs Digital Inputs Digital Outputs Programming Environment Connection 6 Getting Started 6 6 6 6 6 8 8 8 Checking the Contents Connecting all the pieces Testing Using Windows 2000/XP/Vista Downloading the Phidgets drivers Running Phidgets Sample Program Testing Using Mac OS X If you are using Linux If you are using Windows Mobile/CE 5.

12 12 12 12 13 13 13 13 14 Using the Analog Inputs with your own sensors Mechanical Electrical Ratiometric Configuration Non-Ratiometric Configuration Factors that can affect Accuracy Changing the Data Rate Connecting non-Phidget devices to the Analog Inputs Interfacing to an arbitrary sensor 14 Non Phidgets Sensors 15 Digital Inputs 15 15 15 15 15 Digital Input Hardware Filter Digital Input Hysteresis Digital Input Sampling Characteristics 5Volt Terminal Block Functional Block Diagram 15 Using the Digital Inputs 18 Digital Outputs 18 18 18 Functional Block Diagram Ground Protection 5Volt Terminal Block 18 Using the Digital Outputs 20 Device Specifications 21 Product History 21 Support .

It provides a generic. transistors. Flash 9. etc. 1018_2_Product_Manual . 1 Ground. etc. Java. solid state relays (have a look at our SSR board). 1 Ground. limit switches. larger LEDs. Analog inputs Analog Inputs are used to measure continuous quantities.phidgets. Digital Inputs Digital Inputs can be used to convey the state of push buttons. VB. convenient way to interface your PC with various devices. Windows CE. Python.com >> Programming. Here is a list of sensors currently available: IR Distance Sensor Force Sensor Rotation Sensor Mini Joy-Stick Slide Sensor IR Reflective Sensor Humidity Sensor Voltage Divider Pressure Sensor Sound Sensor Vibration Sensor Temperature Sensor Touch Sensor Voltage Sensor Light Sensor Magnetic Sensor Motion Sensor Current Sensor Each analog input can be adjusted to sample at a data rate ranging from 1 sample to up to 1000 samples per second. and 1 5V. Connection The board connects directly to a computer’s USB port. and 1 5V. relays. 8 digital inputs and 8 digital outputs. Note that data rate is limited to 16ms when opening over the Phidget Webservice. We provide 8 digital input terminals. Linux. anything that will accept a CMOS signal. pressure. logic levels. 2011 5 . lights. Digital outputs can be used to control devices that accept a +5V control signal. Samples are transmitted to your PC every 8ms. and Cocoa. We provide 8 digital output terminals. position. Max/MSP. Digital Outputs Digital Outputs can be used to drive LEDs. Programming Environment Operating Systems: Windows 2000/XP/Vista/7. and Mac OS X Programming Languages (APIs): VB6. Flex. With transistors and some electronics experience. other devices can be controlled. humidity. C++. Examples: Many example applications for all the operating systems and development environments above are available for download at www..NET. relays. in fact.. such as buzzers.February 11. Phidgets offers a wide variety of sensors that can be plugged directly into the board using the cable included with the sensor. such as temperature.Product Features The PhidgetInterfaceKit 8/8/8 allows you to connect devices to any of 8 analog inputs. This feature is very useful for setting up the resolution of your data logging.NET. C#. LabVIEW.

com >> Drivers Download and run Phidget21 Installer (32-bit.com >> Programming.phidgets. 2. If you don’t. 3. The source code for the InterfaceKit-Full sample program can be found under C# by clicking on www. The analog ports are numbered from 0 to 7 starting from the left. Running Phidgets Sample Program Double clicking on the icon loads the Phidget Control Panel. 1018_2_Product_Manual . Connect one end of the wire to digital input port 0 and the other end to the ground connection. Connect the LED by inserting the long LED wire into the digital output 0 and the shorter wire into Ground.February 11.phidgets. we will use this program to make sure that your new Phidget works properly. 2011 6 . Connect the InterfaceKit board to the PC using the Mini-USB cable.Getting Started Checking the Contents You should have received: • A PhidgetInterfaceKit 8/8/8 board • A Mini-USB Cable In order to test your new Phidget you will also need: • A piece of wire to test the digital inputs • An LED to test the digital outputs • An Analog Sensor to test the analog inputs. 2 3 1 4 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. Connecting all the pieces 1. 4. or 64-bit. do the following: Go to www. depending on your PC) You should see the icon on the right hand corner of the Task Bar. Connect the Analog Sensor to the analog input port 6 using a Phidgets sensor cable.

6. 7. This is the amount that an input must change to trigger an event that will modify the value in the Analog In box. 1018_2_Product_Manual . Double Click on PhidgetInterfaceKit 8/8/8 in the Phidget Control Panel to bring up InterfaceKit-full and check that the box labelled Attached contains the word True. Clicking again will turn the LED off. The tick mark in the box will go away. 2011 7 . 5. 1. Check the sensor product manual if you are not sure. 1 3 2.February 11. 2 5 7 6 4 3. the calculated value and the formula are displayed under the drop down menu. while the top row displays the status of the digital output as reported by the device. The bottom row shows the status of the request. Click on the Ratiometric Box if your sensor is ratiometric. Test the Analog Input by activating your sensor and check your results in Analog In number 6. Click on Sensors to launch the Advanced Sensor Form. 1. Test the digital output by clicking on the white box to turn on the LED. In our case we select the 1129 . Test the digital input by disconnecting the wire end connected to the digital input connector. In the drop down menu.Touch Sensor. 1 2 2. select the Sensor you have attached to the analog input port 0 of the 1018. Note: If you have connected a sensor that uses a formula. You can adjust the input sensitivity by moving the slider pointer. The state of the Touch Sensor is shown here.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. 4.

whether you are compiling to machine code or the . or udev/hotplug must be configured to give permissions when the Phidget is plugged in. Go to www. 2011 8 .phidgets. .NET and C#). If you are using Windows Mobile/CE 5. It may be necessary to uninstall these drivers for our libraries to work properly.NET Compact Framework (VB. ARMV4I or MIPSII.February 11. The CE libraries are distributed in .phidgets.com >> Drivers Download Linux Source • Have a look at the readme file • Build Phidget21 The most popular programming languages in Linux are C/C++ and Java. depending on the platform you are using.CAB files.0 or 6.CAB format. A desktop version of Visual Studio can usually be configured to target your Windows Mobile Platform. Mini-itx and ICOP systems will be x86. 1018_2_Product_Manual . Notes: Many Linux systems are now built with unsupported third party drivers.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. Applications typically have to be run as root. If you are using Linux There are no sample programs written for Linux.NET Compact Framework.com >> Drivers Download x86.0 Go to www. • Double Click on Phidget InterfaceKit 8/8/8 in the Phidget Preference Pane to bring up the InterfaceKit-Full example. including XScale based systems will run the ARMV4I. Phidget21 for Linux is a user-space library. The most popular languages are C/C++. and most mobile devices. Windows Mobile/CE is able to directly install . This example will function in a similar way as the Windows version. but note that it does not include an Advanced Sensor Display.

February 11. 1018_2_Product_Manual . even of the same type. motors. • Each Phidget you have plugged in is controlled from your application using an object/handle specific to that phidget. Libraries The lowest level library is the C API. until . The C API can be programmed against on Windows. you don’t have to worry about where in the USB bus you plug your Phidget in. Architecture We have designed our libraries to give you the maximum amount of freedom. 2011 9 . you can write cross-platform code.NET 1.CLOSE is called. The . by default is cross-platform . the Phidget APIs are designed to be used in an event driven architecture. C#. which acts as a network proxy on a computer.OPEN group of commands. This association will stay.0 Framework. The Java API is built into the C API Library. C++. For systems with minimal resources (small computers). Mac OS X.NET 2. This link between the Phidget and the software object is created when you call the . We do not impose our own programming model on you. The COM API is programmed against when coding in VB6. If you have more than one Phidget. and Cocoa.0 Library relies on a communication link with a PhidgetWebService (see below).NET API also relies on the C API.NET API is for . The ActionScript 3. we support VB6. motor controllers. ALL of our APIs have the capability to communicate with Phidgets on another computer that has the PhidgetWebService running.NET libraries for . Python. Unlike USB devices which model themselves as a COM port.0 is used in Flex and Flash 9. instead of polling. and interface boards. Excel (VBA). C/C++.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. LabVIEW.NET Compact Framework (CE). their serial numbers enable you to sort them out at runtime. Flash 9. Applications that require receiving all the data streaming from the device will have to use event handlers. VBScript. • For full performance. When it comes to languages. The COM API relies on the C API.NET. even if the Phidget is disconnected/reattached. Flex. Networking Phidgets The PhidgetWebService is an application written by Phidgets Inc. Programming Hints • Every Phidget has a unique serial number . and Linux. With the C API. OS X and Linux. through the PhidgetDictionary object. The PhidgetWebService also makes it possible to communicate with other applications that you wrote and that are connected to the PhidgetWebService. We have developed a complete set of Application Programming Interfaces (API) that are supported for Windows.but your particular platform may not support it (CE). Java. The PhidgetWebService will allow other computers on the network to communicate with the Phidgets connected to that computer. Delphi and Labview. CE.this allows you to sort out which device is which at runtime. but we also have . Java.NET. the C API may be the only choice. Max/MSP. C. ActionScript 3. All you need to know is how to program. To achieve this goal we have implemented the libraries as a series of layers with the C API at the core surrounded by other language wrappers. VB.1 and . Our default .

phidgets. int OutputCount() [get] : Constant = 8 Returns the number of digital outputs supported by this PhidgetInterfaceKit. Reading the OutputState immediately after setting it will not return the value set . Find the language you want to use and click on the magnifying glass besides “Code Sample”. Functions int InputCount() [get] : Constant = 8 Returns the number of digital inputs supported by this PhidgetInterfaceKit. and other examples will have a full-featured GUI allowing all the functionality of the device to be explored. Due to the large number of languages and devices we support. refer to the associated API manual. Setting this to true will activate the output. The Guides can be found at www. and are listed under the appropriate language. You will get a list of all the devices for which we wrote code samples in that language. To look at the API calls for a specific Phidget.Documentation Programming Manual The Phidget Programming Manual documents the Phidgets software programming model in a language and device unspecific way. Action Script.com >> Programming. providing a general overview of the Phidgets API as a whole. If the manual exists for the language you want to use. we cannot provide examples in every language for every Phidget. These API References can be found under www. Digital inputs read True where they are activated and false when they are in their default state. Getting Started Guides We have written Getting Started Guides for most of the languages that we support. For exact values. API for the InterfaceKit 8/8/8 We document API Calls specific to this product in this section. Most developers start by modifying existing examples until they have an understanding of the architecture.com >> Programming. check its Product Manual. C (Windows/Mac OSX/Linux).it will return the last state reported by the Phidget. API Guides We maintain API references for COM (Windows). phidgets.com >> Programming and are listed under the appropriate language.Net and Java. phidgets.phidgets. For calling conventions under a specific language.com >> Programming to see if there are code samples written for your device. 2011 10 . refer to the device specifications. this is the first manual you want to read. Some of the examples are very minimal.February 11. int SensorCount() [get] : Constant = 8 Returns the number of sensors (Analog Inputs) supported by this PhidgetInterfaceKit. You can find the manual at www. Note that there is no way of determining is a sensor is attached. Go to www. . These references document the API calls that are common to all Phidgets. Functions common to all Phidgets and functions not applicable to this device are not covered here. This section is deliberately generic.set] Sets/returns the state of a digital output. False is the default state. and what sensor is attached. Code Samples We have written sample programs to illustrate how the APIs are used. 1018_2_Product_Manual . bool InputState(int InputIndex) [get] Returns the state of a particular digital input. bool OutputState (int OutputIndex) [get.

t an internal precision 5V reference. which can be set to 0 if a constant data rate is required. bool State) [event] An event that is issued when the state of a digital input changes.February 11. bool State). This is a more accurate version of SensorValue. Setting an unsupported data rate (ie. in milliseconds. int DataRate (int SensorIndex) [get.set] Sets/returns the state of Ratiometric. Ratiometric = true configures the Analog Inputs to measure w. in milliseconds. 1018_2_Product_Manual . int SensorValue). Data Rate is in milliseconds and corresponds to the amount of time between events. For data rates less then the maximum. It is recommended to explicitly set Ratiometric when the Interfacekit is opened. The data rate is superseded by SensorChangeTrigger.set] Gets/sets the data rate for an analog input. Events OnInputChange(int InputIndex. After changing the ratiometric state. double SensorChangeTrigger (int SensorIndex) [get. OnOutputChange(int OutputIndex. This is usually 1000.. This value is by default set to 10 for most Interface Kits with analog inputs. data is still sampled at the maximum speed. an exception will be thrown when the data bandwidth has been exceeded.int SensorValue(int SensorIndex) [get] Returns the sensed value of a particular Analog Input. SensorChangeTrigger is sometimes referred to as sensitivity. and averaged between events for the user. This is based on the 0-1000 range provided by getSensorValue. 2. Note however that the analog outputs on the Interface Kit 8/8/8 are only 10-bit values and this value represents an oversampling to 12-bit. Ratiometric = false configures the Analog Inputs to measure w. 3. This is the amount that an inputs must change between successive SensorChangeEvents. 17) will result in a thrown exception. If you are using an Analog Sensor from Phidgets Inc. Note that data rate is limited to 16ms when opening over the Phidget Webservice. it’s manual will specify the formula used to convert SensorValue into the measured property. Data Rate is bounded by DataRateMax and DataRateMin. The analog inputs cannot all be set to the fastest data rate at the same time . 4.set] Returns the change trigger for an analog input. int DataRateMin (int SensorIndex) [get] The minimum data rate that can be set for an analog input. [event] An event that is issued when the state of a digital output changes. int SensorRawValue (int SensorIndex) [get] Returns the full resolution of the Analog Input. 2011 11 . OnSensorChange(int SensorIndex. Ratiometric is not updated from the Phidget. Supported data rates are: 1.if this is attempted. 9. [event] An event that is issued when the returned value from a sensor (Analog Input) varies by more than the SensorChangeTrigger property. bool Ratiometric() [get. corresponding to the 0-5V input range of the Analog Input.t VCC (nominal 5V).r. SensorValue varies between 0-1000. The valid range is 0-4095. int DataRateMax (int SensorIndex) [get] The maximum data rate that can be set for an analog input. and every multiple of 8 until DataRateMin. 8. This is corresponds to the fastest rate at which SensorChange events will be fired. wait until the ratiometric property matches what was set before reading analog data.r.

Please note that the sampling is actually done with an oversampled 10-bit ADC.refer to the Table below for manufacturer part numbers.100 inch pitch locking connector. ground. Using the Analog Inputs with your own sensors For users who wish to interface their own sensors.Technical Section Analog Inputs Using the Analog Inputs with Sensors provided by Phidgets Analogs Inputs are used to interface many different types of sensors. it is said to be ratiometric. pressure. etc. Cable Connectors Manufacturer Molex Molex Molex Molex Molex Molex Part Number 50-57-9403 16-02-0102 70543-0002 70553-0002 70553-0037 15-91-2035 Description 3 Position Cable Connector Wire Crimp Insert for Cable Connector 3 Position Vertical PCB Connector 3 Position Right-Angle PCB Connector (Gold) 1 3 Position Right-Angle PCB Connector (Tin) 2 3 Position Right-Angle PCB Connector . The connectors are commonly available . Each Analog Input provides power (Nominal +5VDC). If you are using a sensor whose output changes linearly with variations in the sensor’s supply voltage level. we describe the Analog Inputs here. 5V PW R Sensing the va In this c e. 0. Pictured here is a plug with the connections labeled. poten tiometer 1018_2_Product_Manual . position. The RawSensorValue property brings out a 12-bit value (0-4095) for users who require maximum accuracy. A sensor value of 1 unit represents a voltage of approximately 5 millivolts. Mechanical Each Analog Input uses a 3-pin. The PhidgetInterfaceKit continuously measures this return voltage and reports it to the application. 2011 Phidg et Analo g Input 12 1K . The analog measurement is represented in the software through the SensorValue as a value between 0 and 1000. Analog Inputs are used to measure continuous quantities.Surface Mount Detail of Analog Input +V Note: Most of the above components can be bought at www. Most of the sensors sold by Phidgets are ratiometric (this is specified on the web 5V PW R product page and in the sensor’s product manual).digikey.February 11. an F as Phidg et Analo g Input x 1 SAMPL ING SWIT CH 5V PW R Phidg et Analo g Input ANAL OG INPUT 20pF ANAL OG INPUT 1K 1M 1K 100nF GROUND GROUND Ratiometric Configuration Sensing the p osition of a The group of Analog Inputs can be collectively set to Ratiometric mode from software using the Ratiometric B property. such as temperature. Phidgets offers a wide variety of sensors that can be plugged directly into the board using the cable included with the sensor. but reported as a 12-bit value to allow future expansion. and an analog voltage return wire driven by the sensor to some voltage.com Electrical The maximum total current consumed by all Analog Inputs should be A limited to 400mA. humidity.

February 11. When Ratiometric is enabled. If your output impedance is high. not the transmission rate. Changing the Data Rate You can change the data rate for each Analog Input from 1 millisecond to 1 second. for example. 5V PW R +V Phidget Analog Input x1 SAMPL ING SWIT CH 5V PW R Phidget Analog Input ANALOG INPUT 20pF FSR Sensing the value of a variable resistance sensor1K In this diagram. Note that the Analog Input power supply voltage is not affected by the setting of the Ratiometric property. and the longer the sensor cable. the data rate sets the sampling rate. Actual data rate will depend on network latency.5% stable voltage reference. and it can be measured and calibrated out in software.Sensor cables have some resistance. This feature is useful if you need to log sensor data at less than 8 ms resolution. the maximum voltage returned on the Analog Input should be the +5V nominal power provided by the PhidgetInterfaceKit. We estimate that you can set up to 4 channels to 1ms or you could set all channels to 2ms. By default. the data rate sets both the sampling rate and the transmission rate. When the Data rate is set at a multiple of 8 ms. an analog inputs on resistor) is show to connect various In this to the FSR (force sensitive your Phidget. the error is quite predictable over the life of the sensor. the more pronounced this effect will be. Non-Ratiometric Configuration If Ratiometric is false. You will get an error when you exceed the available bandwidth. but can be easily measured and compensated for. The 5.0V. you set the data rate to 1ms. warning you of lost data samples. For values less than 8 ms.Setting Ratiometric causes the reference to the internal Analog to Digital Converter to be set to the power supply voltage level. the analog input data set is sent to the PC every 8ms. This can be a significant source of error in some applications. 2011 Interfacing to an Note the use of pow su er The RC filter also pre 13 . it is possible to correct for this distortion to some extent in your software application. 4K GROUND GROUND Sensing the position of a potentiometer 1018_2_Product_Manual . There is also a limit as to how many channels can be set at a high sampling rate. 2. The more power consumed by the sensor. You will simply get more sample data. the ADC reference is set to a 5. 1 2 3 Connecting non-Phidget devices to the Analog Inputs Sensing the value of a variable resistance sensor Here are some circuit diagrams that illustrate how Detail of Analog Input non Phidgets devices case.0VDC voltage reference is accurate to 0. an FSR (Force ANALOG INPUT Sensitive Resistor) 1K 1M is shown. Non-Ratiometric Configuration .For many sensors.0V 0. at one point run out of bandwidth. Note that data rate is limited to at most 16ms when opening over the Phidget Webservice. Setting the data rate at 1. you will receive a packet containing 8 miliseconds worth of 1 ms samples every 8ms.Sensors that have a high output impedance will be distorted by the 900K input impedance of the Analog Input. The maximum voltage returned on the Analog Input should be maximum 5. Intrinsic Error In Sensors . since you will. Factors that can affect Accuracy High Output Impedance .5%. If.Voltage Reference error. Power Consumption . or 4ms will not allow you to react to received sensor data any faster than every 8ms. and the power consumption of the sensor will cause the sensor to have a slightly different ground from the Analog Input on the PhidgetInterfaceKit.

FS03 BARO-A-4V Description 2 Manufacturer MSI Sensors Humirel Measurement Specialties Freescale Semiconductor Allegro Allegro Analog Panasonic Honeywell AllSensors-Europe 2 Load cells . The RC filter also prevents VOUT from oscillating on many sensors GROUND ANALOG INPUT 1 2 3 VCC VOUT GND 100nF GROUND D Non Phidgets Sensors In addition to Phidgets sensors.February 11.measure up to 100lbs of force Humidity sensors Pressure sensors . accurate Piezo-resistive load cells Barometric Pressure Sensor . any sensor that returns a signal between 0 and 5 volts can be easily interfaced. 1 Analog Sensors Part Number FC21/FC22 HTM2500VB MSP-300 MPXA/MPXH ACS7 series A1300 series TMP35 TMP36 TMP37 AMN series FS01. Here is a list of interesting sensors that can be used with the PhidgetInterfaceKit 8/8/8.ranges up to 10. Sensing the position of a potentiometer 5V PW R Phidget Analog Input x1 SAMPL ING SWIT CH 5V PW R Phidget Analog Input ANALOG INPUT FSR 5V PW R Phidget Analog Input ANALOG INPUT 1K ANALOG INPUT 1K 1K 1M 20pF Sensing the position of a potentiometer 4K GROUND GROUND GROUND C Sensing the position of a potentiometer Interfacing to an arbitrary sensor Note the use of pow supply decoupling and the RC Filter on the er The RC filter also prevents VOUT from oscillating on many sens 100nF 5V PW R Phidget Analog Input 5V PW R Phidget Analog Input 1K Interfacing to an arbitrary sensor 1K ANALOG Note the use of power supply decoupling and the RC Filter on the INPUT output.Detail of Analog Input B +V Sensing the value of a variable resistance sensor In this case.com 1018_2_Product_Manual .100 mbar 3 Note: Most of the above components can be bought at www.000 PSI Gas Pressure Sensors Current Sensors . Note: these sensors are not “plug & play” like the sensors manufactured by Phidgets.ranges up to 200 Amps Linear Hall Effect Sensors - to detect magnetic fields Temperature Sensor Motion Sensors Small. an FSR (force sensitive resistor) is shown. 2011 14 .600 to 1.digikey.

This makes the digital input much more sensitive to reporting TRUE state.25V. the Digital Input in software will read as TRUE. Phidget USER Actual Voltage Required to sw itch is dependent on VGS required to turn onOSFET M APPLICATION Digital a Digital Input Input USER APPLICATION Phidget Digital Input INPUT R1 1K VS1 1018_2_Product_Manual . and makes it useful to watch for short events. Digital Input Hysteresis The digital input has hysteresis . which will reject noise of higher frequency than 1Khz. INPUT GROUND GROUND 15 . etc) is not pulling the input to ground.that is.75V. unless a large change occurs. The digital input is first RC filtered by a 15K/100nF node. 5Volt Terminal Block For users who need it. the digital input is guaranteed to be reported as true in software. but is a good idea. the digital input must be less than 1. if a digital input was true for greater than 4. and forcing the input to Ground. ith OSFET W iring a sw itch to a Digital Input Drain-Source Current > 270uA causes Digital Input to report TRUE Closing switch causes digital input to report TRUE Drain-Source Current < 67uA guarantees Digital Input to report TRUE The resistor on the Gate is not requiredor it to unction. we provide 5V on the terminal block next to Digital Input 7.Digital Inputs Digital Input Hardware Filter There is built-in filtering on the digital input. 2011 Q1 SW I T C H Wiring a switch to Closing the switch causes the digital input to report TRUE.0ms. During this sampling period.when you have nothing connected. to eliminate false triggering from electrical noise. or your circuitry (switch. The default state is FALSE . and to guarantee TRUE. it will hold it’s current state (false or true).February 11. W iring a sw itch to a Digital Input Closing switch causes digital input to report TRUE USER APPLICATION Phidget Digital Input Detail of Digital Input Functional Block Diagram +5V Phidget Digital Input x1 +5V SW I T C H The digital inputs have a built in 15K pull-upINPUT resistor.5ms are never reported. the digital input must be at least 3. By connecting external circuitry. f f Be sure not to exceed VGS of the mosf et. GROUND 15K INPUT GROUND 15K 100nF Using the Digital Inputs Here are some circuit diagrams that illustrate how to connect various M Detecting an external Voltage w an N-Channel devices to the digital inputs on your Phidget. Digital Input Sampling Characteristics The state of the digital inputs are reported back to the PC periodically. Any Digital Input True events of less than 1. To guarantee FALSE. This filter generally eliminates the need to shield the digital input from inductive and capacitive coupling likely to occur in wiring harnesses.

Actual Voltage RequiredDigital itch is dependent on VGS required t to sw APPLICATION Input K1 Detecting an external Voltage with an N-Channel MOSFET A MOSFET can be used to detect the presence of an external voltage. or if 12V FSR Resistance rising above 75k Ohms causes FSR Digital Input to go FALSE This Current > be used to VS1 Collector-Emitter Current < 67uA guarantees Digital Input to report FALSE This design can be used w any variable resistance sensor . Typical values are 2V-6V. but is a g f Be sureUSER to exceed Phidget the mosf not VGS of et. The external voltage will turn on the MOSFET. When the and relay contact is closed. 2011 R1 Q1 .75k Ohms causes Digital Input to go TRUE INPUT Collector-Emittercircuit can 270uA causes measure if a batteryTRUE Digital Input to report is connected. the Digital Input is guaranteed to on the Gate is MOSFET isf it to unction. but is a good idea.CDS Photocells ith GROUND GROUND 10K Detecting an external Voltage with an NPN Transistor (for example) is on a wire. the Digital Input will report TRUE. the Digital Input will report TRUE. Digital Input to report TRUE 67uA guarantees M r to turn onOSFET not requiredor conducting < 67uA. 15K wired up similarly.W iring a sw itch to a Digital Input switch causes digital input to report TRUE Detail of Digital Input Detail of Digital Input Monitoring the position ofa Relay Relay contact causes Digital Input to report TRUE SW GR USER LICATION +5V Phidget Digital Phidget Digital Input INPUT GROUND +5V +5V Input x1 Monitoring 15K the position of a relay Phidget Digital Input x1 +5V USER APPLICATION K1 Phidget Digital Input INPUT The relay contact can be treated as a switch. Digital Input is guaranteed INPUT USER Isolating a Digital Phidget an Optocoupler Input w ith Digital APPLICATION through LED causes Digital Input to rep Current Drain-Source Current > 270uAInput Digital Input to causes Drain-Source Current < 67uA guarantees Digital Input E ecting OSFET TRUE an external Voltage w is an N-Channel>M If the MOSFETith conducting 270uA. Detecting an external Voltage w an NPN Transistor ith R1 1K VS1 Q1 USER APPLICATION U1 Phidget Digital Input INPUT Collector-Emitter Current > 270uA causes Digital Input to report TRUE Collector-Emitter Current < 67uA guarantees Digital Input to report FALSE Using an FSR as a switch OptoCoupler FSR Resistance f alling below 3. INPUT GROUND GROUND 15K 100nF 100nF SW I T C H NPUT 15K GROUND nput Detecting an external Voltage ith OSFET Monitoring the position ofa Relay w an N-Channel M Relay contact causes Digital Input causes Digital Input to report TRUE Drain-Source Current > 270uA to report TRUE +5V Drain-Source Current < 67uA guarantees Digital Input to report TR The resistor on the Gate is not requiredor GROUND f it to unction.February 11. INPUT Q1 R1 GROUND 1K VS1 R1 1K e Current < to report TRUE. Phidget USER APPLICATION Digital Input R1 Q1 Phidget Digital Input INPUT 16 USER APPLICATION 10K VS1 GROUND INPUT 1018_2_Product_Manual . age Requiredreportitch is dependent on VGS required to turn onOSFET to sw FALSE. causing it to short the Digital Input to Ground. the digital input will report TRUE. f If the t to exceed VGS of the mosf et. the e Current > 270uA causes Digital Input to report TRUE good idea.75k Ohms causes Digita FSR Resistance rising above 75k Ohms causes Digital I This design can be used w any variable resistance se ith GROUND USER APPLICATION Phidget Digital Input INPUT Detecting an external Voltage w an NPN Transistor ith Collector-Emitter Current > 270uA causes Digital Input to report TRU USER Phidget Collector-Emitter Current < 67uA guarantees Digital Input to report F Digital APPLICATION Input INPUT USER APPLICATION R1 Q1 Phidget Digital Input Using an FSR as a switch Detecting an external Voltage w an NPN Transistor ith FSR Resistance f alling below 3. By designing to have Collector-Emitter current > 270uA. The amount of current required will depend on the optocoupler used. and less than 67uA to report FALSE. M USER APPLICATION U1 Phi Dig In IN The voltage level required to turn on the MOSFET depends on the make of of MOSFET you are using. USER APPLICATION Phidget Digital Input INPUT R1 1K VS1 VS1 OptoCoupler Isolating a Digital Input w an Optocoupler ith Current through LED causes Digital Input to report TRUE Drain-Source Current > 270uA causes Digital Input to report TRUE Drain-Source Current < 67uA guarantees Digital Input to report TRUE GROU GROUND Isolating a Digital Input with an Optocoupler When driving current through the LED. Design to sink at least 270uA to cause GROUND the digital input to report TRUE.

GROUND If the resistance rises above 75k Ohms. Similar capacitive orVS1 inductive proximity switches from other manufacturers should work just as well. VS1 GROUND FSR GROUND 1018_2_Product_Manual . We have checked the following switch from Automation Direct 1K to verify that it works with the Digital Inputs.Drain-Source Current < 67uA guarantees Digital Input to report TRUE The resistor on the Gate is not requiredor it to unction.75k Ohms to report Digital Inp Detecting an external Voltage w an NPN Transistor ith AM1 Series FSR Resistance rising above 75k Ohms causes Digital Input This design can be used w any variable resistance sensor ith USER APPLICATION Phidget Digital Input INPUT USER APPLICATION Phidget Digital Input INPUT R1 10K USER APPLICATION Phidget Digital Input INPUT Q1 Using an FSR or other variable resistor as a switch VS1 The digital inputs R1 be easilyQ1 can wired to use many variable resistors as switches.com CT1 Collector-Emitter Direct > 270uA causes Digital Input to report TRUE Series Detecting an external Voltage w an NPN Transistor ith Capacitive Part No Current > 270uAPart No asInput to report Using an Digital a switch Collector-Emitter Inductive causes FSR TRUE FSR Current < f alling below Digital Input causes FALSE Collector-EmitterResistance 67uA guarantees 3. the Digital Input will go FALSE. GROUND R1 Q1 USER APPLICATION 1K +10-30V Proximity Switch VS1 OptoCoupler INPUT GROUND Q1 GROUND Manufacturer Web Page Collector-Emitter Current < 67uA guarantees Digital Input to report FALSE Automation Current www. To properly interface one of these proximity switches to the digital inputs. 10K If the resistance falls below 3. but is a good idea. the Digital Input will go TRUE. as well as an external power supply.February 11. whereas inductive proximity switches APPLICATION Digital Input can detect only the presence of metallic objects. Actual Voltage Required to sw itch is dependent on VGS required to turn onOSFET M APPLICATION Connecting a 3-wire Capacitive or Inductive Proximity Switch Digital Input INPUT Using a Capacitive or Inductive Proximity Switch R1 U1 Phidget Digital Input Capacitive proximity switches can detect the presence of nearby USER Phidget non-metallic objects.75k Ohms. a 3-wire proximity switch is INPUT required.automationdirect. f f Be sure not to exceed VGS of the mosf et. 2011 17 .

This is Q1 D1 USER Using a 3051 Dual R Driving Outputs Can be used Isolating a the Digital Output ith a M w OSFET-Based Analog turn i Driving LED causes output transistors to Input on Can often be usedDigital +5V +5V Phidget to control AC or DC The Load can also Outputitched with the SSR on the be sw x1 Detail of Digital Output intended to protect the device from being damaged if there is a short OUTPUT OUTPUT to ground or if an LED is used. Wire the anode to a digital output labeled 0 to 7 on the Interface Kit.M OSFET so the +5V Controlling a relay w a NPN Transistor. D1 TRUE Phidget Digital Output OUTPUT Phidget Digital USER Output OUTPUT APPLICATION 250 FALSE OUTPUT GROUND GROUND GROUND VS1 OUTPUT L oad GROUND Isolating a Digital Output w a ground with USB ground. and the cathode to a supplied ground. or dangerously high voltage is applied to the input or output terminals. ut Detail of Digital Output Output x1 Using a 3052 SSR Board with a Digital Output +5V +5V Phidget Digital Setting the digital output to true causes the output of the 3052 to turn on. 2011 18 . The output is intended to drive TTL or CMOS inputs. L oad OptoCoupler VS1 U1 Driving an LED w the Digital Output ith GROUND Phidget Digital Output OUTPUT USER APPLICATION Driving an LED with the Digital Output Connecting an LED to a digital output is simple. we provide 5V on the terminal block next to Digital Output 7. Be sure you Maximum current through transistor w depend in part on the transf characteristics of the optocoupler ill er or DC are completely familiarconservative. labeled G. damage to the Phidget or the PC voltage Ground Protection ANALOG INPUT VS1 may result. The load can also be switched with the 3052 on OUTPUT the high side. and refer to the datasheet ofthe optocoupler Be with any circuit you intend to connect to the InterfaceKit before it is connected. Because they are not internally ith Optocoupler Ground terminals on the InterfaceKit share a common SFET-Based SSR Driving LED causes output transistor to sink current to turn on isolated. This can be used to control AC or DC TRUE devices. D1 GROUND Using a 3052 SSR Board with a Digital Output Driving Output causes output of3052 to Turn on Can be used to control AC or DC The Load can also be sw itched with the 3052 on the high side. High side switching is helpful for powering 250 more complicated circuitry that cannot tolerate having FALSE multiple grounds. these terminals will expose the USB ground potential of the PC to which they are connected. GROUND Phidget Digital Output OUTPUT USER APPLICATION RED 3052 L oad VS1 GROUND BLACK 1018_2_Product_Manual . Output Using the Digital Outputs oad VS1 OUTPUT Here are some circuit diagrams that illustrate how to connect various devices to the digital outputs on your Phidget. ith Digital Outputs K1 Driving an LED w the Digital Output ith Functional BlockPhidget Diagram Digital PhidgetAPPLICATION USER K1 Output Digital APPLICATION The 250 ohm resistance is internal to the PhidgetInterfaceKit 8/8/8. it is not designed to provide power to an external circuit. 5Volt Terminal Block Phidget USER Digital APPLICATION For users who need it. Output and limits the current that can flow through the output.February 11. If a reverse SR on the high side.

VS3 MOSFET based SSRs have the advantage that they can be understood as being a simple switch. Output Phidget USER APPLICATION D1 +5V +5 Controlling a relay with a N-Channel MOSFET A inexpensive mosfet and flyback diode can be used to control larger loads . GROUND BLACK Phidget Digital Output USER APPLICATION GROUND VS3 GROUND OUTPUT VS1 L oad VS1 1018_2_Product_Manual . Driving LED causes output transistor to sink current Maximum current through transistor w depend in part on the transf characteristics of t ill er Be conservative.relays for example . 2011 GROUND 19 Isolating a the Digital Output ith a M w OSFET-Based SSR Isolating a Digital Output w a Optocoupler ith Driving LED causes output transistor to sink current . USER APPLICAT OUTPUT Phidget Digital Output USER APPLICATION TRUE 250 FALSE Controlling a relay with a NPN transistor D1 Q1 This circuit GROUND OUTPUT is very similar to the N-channel mosfet .Phidget Digital Output OUTPUT Q1 USER APPLICATION D1 Phidget USER The Load can also be sw itched with the SSR on the high side. The maximum current through GROUND the transistor will depend in part on the characteristics of the optocoupler. Be sure to use a Logic-Level MOSFET so that the +5V Digital Output is able to turn it on. ith Output +5V Phidget USER Digital Controlling a relay w a N-Channel M APPLICATION ith OSFET osf Output Be sure to use a Logic-Level M et .but you D1 K1 OUTPUT OUTPUT RED Phidget USER Isolating a the Digital Output ith a M w OSFET-Based SSR Digital APPLICATION K1 Driving LED causes output transistors to turn on Output Can often be used to control AC or DC GROUND OUTPUT Q1 D1 3052 Max The Load can also be sw itched with the SSR on the high side. K1 Digital Output APPLICATION D1 K1 Phidget OUTPUT Digital Output Q1 Isolating a Digital Output with a MOSFET based SSR GROUND USER APPLICATION It’s possible to wire up your own Solid State Relay to the digital output. and refer to the datasheet ofthe optocoupler GROUND a Digital Output w a Optocoupler Isolating ith In some applications. particularly where there is a lot of electrical noise (automotive).so the osf Digital APPLICATION Digital Output is able to turn it on. higher voltage AC devices that can also be controlled in the same fashion. electrical isolation buys you a huge margin of protection. Phidget Isolating a Digital Output with an USER Digital Optocoupler APPLICATION Output Phidget Digital Output OUTPUT U1 USER APPLICATION VS1 Driving an LED w the Digital Output ith OptoCoupler L oad GROUND Controlling a relay w a N-Channel M ith OSFET Phidget USER Be sure to use a Logic-Level M et . or where OUTPUT you want maximum protection of the circuitry L oad (interactive installations.so the +5V Digital Output is able to turn it on. +5V Digital OUTPUT Output K1 TRUE OUTPUT Q1 Driving an LED w the Digital Output ith Detail of Digital Output D1 Using a 3052 SSR Board Driving Output causes Can be used to co FALSE The Load can also be sw itc GROUND GROUND Phidget Digital Phidget VS3 Output x1 Digital Controlling a relay w a NPN Transistor. There are many other types of SSRs that are more suitable for controlling higher power.February 11. VS1 Driving the LED causes the output transistor to sink current. kiosks). may already have NPN transistors on hand. OUTPUT GROUND VS1 L oad VS1 Isolating a the Digital Output ith a M w OSFET-Based SSR Driving LED causes output transistors to turn on Can often be used to control AC or DC The Load can also be sw itched with the SSR on the high side.directly from the digital output.

GROUND VS3 Phidget USER Phidget Digital Output OUTPUT Q1 USER APPLICATION D1 K1 GROUND VS1 Device Specifications Characteristic Phidget Digital Board Output OUTPUT USER APPLICATION Isolating a the Digital Output ith a M w OSFET-Based SSR Driving LED causes output transistors to turn on Can often be used to control AC or DC The Load can also be sw itched with the SSR on the high side.70°C GROUND GROUND BLACK 20 . An Analog Input can be used to supply power to the relays.26 AWG 0 . ith Using a 3051 Dual Relay Board withKone or two Digital Digital APPLICATION 1 Output Outputs The 3051 Dual Relay Board is D1 designed to be used with the Q1 OUTPUT PhidgetInterfaceKit 8/8/8. The 3051 is a good option if you need a couple relays in your project.Controlling a relay w a N-Channel M ith OSFET Be sure to use a Logic-Level M et .February 11.so the +5V osf Digital Output is able to turn it on.26 AWG 5-6mm strip TRUE Phidget Digital Output x1 Phidget Digital Output OUTPUT Recommended Wire Size Wire Stripping Digital Outputs Series Resistance GROUND Update Rate Recommended Wire Size Operating Temperature 1018_2_Product_Manual . Controlling a relay w a NPN Transistor.75 to 5. Isolating a Digital Output w a Optocoupler ith Driving LED causes output transistor to sink current Maximum current through transistor w depend in part on the transf characteri ill er Be conservative.5 samples/second max over webservice Digital Inputs Driving an Resistance Digital Output Pull-Up LED with the Low Voltage (True) High Voltage (False) Phidget USER Maximum Voltage Digital APPLICATION Output Update Rate 15K ohms Detail of Digital Output 1.25 V Max 500 mA 13 mA 487 mA VS1 USB Voltage Phidget Digital Output OUTPUT U1 USER APPLICATION USB-Power Current Specification Quiescent Current Consumption L oad Available External Current (source) L oad OptoCoupler VS1 Analog Inputs GROUND Impedance 5V Reference Error Update Rate 900K ohms Max 0. and refer to the datasheet ofthe optocoupler Value 4.5% GROUND 1000 samples/second max for 4 channels 500 samples/second max for all 8 channels 62. 2011 OUTPUT OUTPUT 250 RED D1 FALSE 300 ohms ~125 samples/second 16 .75V Min ±15V +5V +5V Using a 3052 S Driving Outpu Can be us The Load can also ~125 samples/second 16 . and one or two digital outputs used to control the relays.25V Max 3.

com 1018_2_Product_Manual . PCB X Dimension increased to 3.February 11.403.Product History Date July 2007 September 2007 May 2008 April 2010 1 2 Board Device Revision Version 824 825 826 900 2.27” Configurable data sampling speed.1. Replace USB connector with Mini-USB connector Support Call the support desk at 1.7335 9:00 AM to 5:00 PM Mountain Time (US & Canada) .20100406 or later Library Version Comment Product Release SPI Overclocking issue fixed Added RC Filtering to Digital Inputs. 2011 21 .GMT-07:00 or E-mail us at: support@phidgets.282.6.

Sign up to vote on this title
UsefulNot useful