Showing results for 
Search instead for 
Did you mean: 
Reply

Turn on LED using the USB Port without a DAQ card

Turn on LED using the USB Port without a DAQ card

Hello NI:

I would like to use LabView 8.2 to turn on an LED light which is mounted externally to my computer. I do not have a DAQ card and would preferably just use the USB port for getting the power for this purpose. Please let me know what kind of hardware I need for this purpose and how I should proceed.

Thanks
0 Kudos
Message 1 of 18 (2,649 Views)
Reply
0 Kudos

Re: Turn on LED using the USB Port without a DAQ card

I don't know about using the USB port, but you can trick your serial port in to giving you one digital output.  I forgot the pin out, but if you use the configure serial port and close serial port VI you can turn at least on Pin on and off. 
0 Kudos
Message 2 of 18 (2,630 Views)
Reply
0 Kudos

Re: Turn on LED using the USB Port without a DAQ card

Thanks for your advice! Do I actually need some kind of hardware besides the LED itself? How would I connect the LED to the serial port?
0 Kudos
Message 3 of 18 (2,590 Views)
Reply
0 Kudos

Re: Turn on LED using the USB Port without a DAQ card

You may need to build up a circuit to translate voltage levels and supply drive current to the LED.
A low cost USB based DAQ card would be the most direct route.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 4 of 18 (2,586 Views)
Reply
0 Kudos

Re: Turn on LED using the USB Port without a DAQ card

USB devices are required to identify themselves to the host when they connect. Anything which does not have this communication capability may cause problems for the USB network and the host.

Lynn
0 Kudos
Message 5 of 18 (2,580 Views)
Reply
0 Kudos

Re: Turn on LED using the USB Port without a DAQ card

I know it would be possible to do this by using a USB DAQ. However, I would like to do this without purchasing such a card. Does anyone have a idea of how the LED could be wired to the ports (either USB or the serial port)?
0 Kudos
Message 6 of 18 (2,578 Views)
Reply
0 Kudos

Re: Turn on LED using the USB Port without a DAQ card

Off the shelf serial port monitor

http://www.blackbox.com/Catalog/Detail.aspx?cid=151,156,181&mid=1761

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 7 of 18 (2,572 Views)
Reply
0 Kudos

Re: Turn on LED using the USB Port without a DAQ card

[ Edited ]

Here is the poor man's way to light an LED with the serial port:

 

You may have to play with the resistor value dependent on the type of LED you are using.  The serial port normally puts out 12v on the DTR line when activated.  With a 510 ohm resistor, this would give about 23 mA to the LED.  Make sure the LED ratings can handle 23 mA.  If not, you may have to make the resistor value larger.  If the LED can handle more, you make it brighter by lowering the resistor value.

To assert DTR, look up a Labview example on serial communications.  You can set a property node for DTR I believe.  True/False to turn it on or off.

Message Edited by tbob on 03-08-2007 12:21 PM

- tbob

Inventor of the WORM Global
Message 8 of 18 (2,566 Views)

Re: Turn on LED using the USB Port without a DAQ card

Hi tbob:
 
I was under the impression that serial port drivers were only good for a few mA (depends on the chip used). Typical LED's use ~10-20mA. Also, some PC's only drive to +/- 5V levels.
 
It's worth a shot though. Could also drive a transistor with a reverse blocking diode on the base. May need and external power source to fully drive the LED.
 
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 9 of 18 (2,555 Views)
Reply
0 Kudos

Re: Turn on LED using the USB Port without a DAQ card

Thanks tbob for giving him the pin out and circuit.

The code to turn on you circuit is attached.

Also wanted to let him know that the a USB DIO module  (NI USB-6501) is only $100.

Message 10 of 18 (2,551 Views)