Turning LEDs on/off

I have an LED wired to the digital side car power and ground pins. I want to be able to turn it on/off programatically, but it always stays on. I am using Labview to open a digital output sand setting it to false, but the LED is always staying on.

I have the jumper on the DSC’s port.

What am I ding wrong? Should the LED be wired to the ground and signal pins?

Wiring to the signal pin sounds like it would work.

The power stays on. Only the signal turns on/off. Whether or not the LED will illuminate when you connect it between signal and ground depends on how much current the LED requires to illuminate, and how much current the signal can source. What’s the part number of the LED?

I think you are right when you say that you should wire to signal and ground, just don’t mix up positive and negative on the LED, they make a nice pop sometimes, you can also run LEDs on spike relays if they are 12 volt

Edit: Also the signal may not carry enough current to power LEDs in which case you should use a spike

LEDs from SuperBrightLED

Qty | Product / Options | Price/ea |

12 | RL5-G7532: 5mm Green LED | $ 0.54 |
RL5-G7532: Green LED

Resistors from www.MOUSER.com

299-82-RC
299-82-RC
82ohms

Assuming the flat side of the LED is the negative side.

Going to try the ground/signal setup now… thanks

Why did you select 82 ohm?

For anyone who reads this thread in the future:

Reversing polarity on a LED will not damage the LED (or the Digital Sidecar, for that matter) – it will simply not night. LEDs are diodes. Feeding them too much power, however, can make them pop.

Only reason I said that is because I actually did make one pop when I wired it backwards.

And like flameout said it won’t hurt the sidecar or the LED at that voltage. An LED is a diode so it only lets current through in one direction and also happens to light up.

Caution: the above is true only if driving the LED with a source whose open-circuit voltage is less than the reverse voltage which would damage the LED.

A high voltage high impedance source might work fine in the forward direction but damage the LED if polarity is reversed.

I used the calculator linked below to determine the resistor. Forward current was 20mA, source voltage was 5v and the forward voltage was taken from the LED specs.

http://led.linear1.org/1led.wiz

When I switched to the signal tonight, there was no light when I set the DIO to true or false. When the LED is on power and ground, it comes on

Sounds to me like the output impedance of the DIO signal line is too high to provide enough current to light the LED (as mentioned in my earlier post).

Disconnect your LED circuit and put a voltmeter (a cheap $10 one will do) between signal and ground at the DIO output. Flip the DIO true/false and confirm that you are getting 5 volts and zero volts.

Now connect your LED circuit (leaving the voltmeter connected between signal and ground). My guess is that you will no longer see 5 volts. The load from the LED acting on the impedance of the signal source will drop the voltage below that necessary to provide the current to light the LED.

I’ll check as soon as the show is over (the robot is part of the play Something’s Afoot). If that is the case, what is the solution?

If I use a spike to control it, I assume I will need a different resistor to handle a 12v input? Or I run 5v throught the spike?

Instead of using the signal as a power source to drive the LED, you could use the signal to control a transistor which switches the DIO power line.

I’ll draw a sketch and post it here in a few minutes.

Very cool thanks Ether.

Something like this.

edit: corrected resistor value

*





When I buy the FET, is there anything specific I need to look for? Probably going to Radio Shack to find one tomorrow. If not available then will probably go to mouser.

Your application is really light load and low voltage, so most FETs will work fine. Here are the general things you look for:

Type: Your options are “N” or “P” channel. Either can be made to work, but Ether drew the schematic with an N channel. N is generally preferred because they have better electron mobility.

Vds: Maximum voltage from Drain to Source, or how much voltage you can block. You need at least 5V, but I’ve never seen a normal discrete FET with a Vds rating less than 5V.

Vgs: Maximum voltage from Gate to Source, or how much signal voltage you can apply. Again, most FETs can handle 5V just fine.

Vgs_thresh: Minimum voltage from Gate to Source to guarantee turning on the FET. Most FETs will be in the 1 to 3 V range, so you’ll be fine.

Rds: Resistance from Drain to Source while on. Subtract this from the 82 ohm series resistor you calculated. It’ll be relatively small, you can likely ignore it.

Ids: Maximum current from Drain to Source while on. It needs to be more than 20mA. Just about any FET that is big enough to be in its own package can handle this.

OK, just got back from Radio Shack trying to get the right components. The transistors were hard to match up, so I got a couple.

One is a MOSFET N-channel transistor and the other is a bag of NPN-Type transistors. I’ve included pictures below. My guess is the MOSFET is the closest match and where I am starting to build the circuit.

Am I correct in assuming the following:

Source - The +5V/82ohm/LED side of Ether’s diagram
Drain - The ground side of the diagram
Gate - The DIO Signal/100Kohm side of the diagram

Here are the components I purchased, 100K-ohm resistors, MOSFET transistor, and NPN transistors

http://www.rsisk.com/electronics1s.jpg

And the back of the MOSFET transistor and NPN transistor bag

http://www.rsisk.com/mosfets.jpghttp://www.rsisk.com/npn.jpg

No. For an N-channel MOSFET, the source is connected to ground, and the drain is connected to the load, which is connected to the power.

The gate is connected to the signal, as you said.

So in the sketch I posted earlier, the source is on the bottom of the FET, and the drain is at the top. See annotated sketch attached.

*





Thanks for that timely information, just starting to put this thing together.