Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How to light an LED????

i have PCI-DIO-96 hardware w/ data cable.

i have an LED and connected with PIN 49(+5V) and PIN 50(Ground).

i have my own driver. and it works fine. that is i can read/write to registers.

all i cant do is to light that LED.

what do i need to do?
a journey of a thousand miles is started by taking the first step.
- chinese proverb
0 Kudos
Message 1 of 14
(5,385 Views)
Hello,

Some observations about what you mentioned in your thread.

1. When working with LEDs, one usually uses resistors to limit the current passing through the LED. Make sure you are applying the correct amount of current to light up but not burn your LED. Also remember that polarity on LEDs do matter!

2. It's awesome you developed your own drivers, but we also have ours that you can download for free from our website. Go to http://www.ni.com/support/daq/versions to find the driver that you need.

3. If you want to turn on/off your LED, you might want to use the DO lines instead of just using 5V. With a connection to just 5V and using the appropiate resistors, you should be seeing your LED ON all the time. On the other hand, if you use one of the digital ouput lines you can write 1s and 0s to it and therefore turn on/off your LED.

Hope this helps!

LA

P.S: I liked the Chinese proberb.
0 Kudos
Message 2 of 14
(5,353 Views)
Hello,

As LA appropriately mentioned, you MUST use a resistor to limit the current that flows through the LED and that you are drawing from the board!

Remember that an LED is a special kind of diode, which means that it will have a very very small resistance when you apply a voltage with the right polarity.

So, if you are applying 5V through a very small resistance, the result is that you get a very big current, most likely big enough to burn the LED, and perhaps able to damage the board or computer themselves.

Take a look at the board's manual to see what is the limit of current that you can draw from each line to determine the size of the resistor you need to use. For example, if the manual says you can draw up to 1mA of current from the digital line, and you are working with 5V, you use the simple equation of Ohm's law: V = R*I -> 5V = R*0.001A -> R = 5kOhm.

Since you say that you connected your LED to +5V and it is not lighting up, it probably means that it was instantly burned by the high current.

Also, you mentioned you were connecting the LED between pins 49 and 50, which are PERMANENTLY at 5V, and which you cannot control with any driver. That means that the LED would always be ON (if you use a resistor to limit the current). If you want to be able to control if the LED is on or off, you should use one of the DIO lines of the board.

Alejandro
0 Kudos
Message 3 of 14
(5,343 Views)
I am doing the reverse. I intend to light up a photodiode remotely and sent the signal into a 6025E DAQ board. The idea is to find the frequency of the incoming signal. Can it be done? What precautions shall I take? I have the file attached.
0 Kudos
Message 4 of 14
(5,274 Views)
First, your sketch mentions a 'photodiode resistor'. There are photo resistors and photo diode, but no component that does both jobs... Photo resistors (AKA CdS resistors, as used in lightmeters and cameras) are rather slow guys and I don't assume you are using such a device.

So obviously you want to use a photodiode. A photodiode can be operated in photovoltaic mode, it will generate a (small amount of) current when light shines upon it. However, in most cases, photodiodes are biased and operate in 'reverse bias mode'. The bias current is applied in the reverse direction (i.e., + connected to the cathode and - to the anode). A certain amount of current will flow through the diode in reverse direction when light shines upon it. However, you will need an amplifier circuit to generate voltage levels that can be detected by a digital i/o line. In most cases today phototransistors are used for this purpose today. They have an inherent amplification of approx. 100x, and in many cases you don't need an amplifier to drive a digital line. It is recommend to use some trigger circuitry to generate proper signal rise and fall times.

Another thing is the light source you want to use. Most photodiodes and phototransistors have their sensitivity maximum in the (near) infrared range (at around 1000nm). Fortunately light bulbs emit a lot of radiation in this range, so the torch in your sketch might be suitable, but in most cases infrared LEDs (matched to the phototransistor sensitivity curve) are used for this purpose. You can also buy readily-assembled slotted optical switches which have an infrared LED, phototransistor (and sometimes circuitry to generate proper signals). Omrom, Sharp and some others make such devices for pcb and panel mounting.
0 Kudos
Message 5 of 14
(5,268 Views)
I agree that the LED probably was burned in the very instant the system was switched on.

However, your equation for calculating the series resistor is not correct. You have to take into account that a LED needs 1.8V to 2.3V (depending on color and make) and 2mA to 20mA to light up.

In most cases you can assume that almost all LEDs will work properly with around 2V across them, and low-current LEDs will need approx. 2mA. A quick and dirty calculation shows that you need the following resistors:

1kOhm @ 5V
4.7kOhm @ 12V
10kOhm @ 24V

In most cases LEDs are connected to digital outputs in the current sink mode, i.e. the LED anode plus series resistor are connected to the supply voltage and the cathode to the output. Most commercial digital i/o boards can handle up to 24mA sink current. In this mode, the LED is switched ON when the output is driven (physically) LOW.
0 Kudos
Message 6 of 14
(5,269 Views)
From your post I gather the equipment I assembled can work with some modifications. Can you give me a simple VI that can measure the frequency? I am new to LV and cannot seem to locate. However I have come across some complicated VI regarding frequency. I am using a 6025E DAQ card. How do I connect the PINS?
0 Kudos
Message 7 of 14
(5,239 Views)
Hello labview1958,

1) If you want to measure the frequency of a digital signal, than you can use the counter on your 6025E. There are several examples of this located here:
"C:\Program Files\National Instruments\LabVIEW 7.1\examples\DAQmx\Counter\Measure Digital Frequency.llb"

2) If you want to measure the frequency of an analog signal AND it is periodic AND your board support analog triggering, there are several examples in our Developer Zone that show how to do this. I've posted one example below:
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B123AE0CBAD0111EE034080020E74861&p_node=DZ52308&p_source=External

3) If 1) and 2) are not suitable for your application, you will have to write your own software algorithm that determines the frequency of the signal after you have acquired it.

Take care,
E.Lee
Eric
DE For Life!
0 Kudos
Message 8 of 14
(5,223 Views)
Hello labiew1958,

In regards to 3) that I posted above, there is a VI that might help you out. It is called "Pulse Measurments.vi" and can be located in the Analyze>>Waveform Measurements palette.

Take care,
E.Lee
Eric
DE For Life!
0 Kudos
Message 9 of 14
(5,220 Views)
"If you want to measure the frequency of an analog signal AND it is periodic AND your board support analog triggering"

I have attached a file regarding my proposed measurement of the frequency together with 50-PIN 6025E DAQ board.

Q1: Does my setup measures analog or digital signals?
Q2: If it is analog does my 6025E DAQ support analog triggering?
Q3: Will the incoming signal be in pulses and periodic?
0 Kudos
Message 10 of 14
(5,202 Views)