NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
NI_User_77
Posts: 16
0 Kudos

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
Member
Hopeless
Posts: 8
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. 
Member
NI_User_77
Posts: 16
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?
Trusted Enthusiast
AnalogKid2DigitalMan
Posts: 3,165
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.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Proven Zealot
johnsold
Posts: 9,976
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
Member
NI_User_77
Posts: 16
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)?
Trusted Enthusiast
AnalogKid2DigitalMan
Posts: 3,165
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.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Trusted Enthusiast
tbob
Posts: 4,089

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
Trusted Enthusiast
AnalogKid2DigitalMan
Posts: 3,165
0 Kudos

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.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Member
Hopeless
Posts: 8

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.