opto-isolator help

JediKnight0

Limp Gawd
Joined
Jul 2, 2002
Messages
168
OK, I feel like I'm losing my mind here. I've been working on the same problem for 3+ days now, so I may have the order screwed up here a bit, but here goes:

I want to use 4 ultra-bright LEDs (2.0-2.3 volts, 30mA each) as hard drive activity lights. So I build a circuit that uses a 4N27 chip, takes the hard drive pins as input on pins 1 & 2, takes 12V input on pin 5, and pin6 goes to a resistor (150ohm) which goes to one pin of a 2-pin header i soldered on. The other pin of this new header goes to ground. Attached to this 2-pin header is the 4 LEDs wired in series.

This works fine on my test rig. I attached it to my real mod (a mini-itx) and then LEDs seem dim (but work). Taking it back to the test rig, it's also dim. Figuring that I somehow reversed the voltage during testing and blown the 4n27, I replace the chip with a 4n25 I had. Same idea - fine on test, dim on real, dim on test.

Long story short - I've replaced the opto-isolator half a dozen times with various results but not what I want.

Can someone definitively design the circuit for me? I can use 12v (easiest) or 5v or 7v - whatever works.

HELP PLEASE! :(
 
We need a link to the place you bought the LEDs or complete specs on their voltage and current requirements to be able to tell if you're burning them or the opto-isolator. I think those kind of chips usually use 5V too, but this one might not. maybe it's higher powered since it has to have lower propogation delays or whatever. But anyway, give us more detais on your components, and a drawing of what you're trying to do would be good.
 
I wonder if you need to put a resister on the IR led side of the opto. I used a couple of those to allow me to do a 3 color led for power/HD activity, and I limited the input on the isolator. Maybe what's happening is that the production machine is putting out a higher voltage or current that is buring out the led in the isolator, causing the photo transistor to not pass as much current...

My guess, at least...
 
Thanks for the help.

The LEDs are the 5000mcd red ones from lsdiodes, link here .

As for the circuit itself, I'm using the design from linear1.org , except that the LED portion is 4 LEDs in series. The article claims that I can use 12v instead of 5v as well, and the specs on 4n27 (or 4n25 or 4n33 or ntp3040 [I've used them all]) say the collector voltage can go upto 70v.

The resistor on the HDD header is an interesting idea...
 
Ok, i'd say first, get a voltmeter and measure the voltage of the output from your mobo to the 2 HDD LED pins. it may be like 5v or 2v or some weird number. From looking at the datasheet for the 4N27, the emitter input can only take up to 1.5v, so you very well may be burning the emitter with the input from the mobo. if that's the case, you just need to put a resistor between the HDD LED pins and the emitter... which is exactly what xtant3150 said. Get back to us when you figure out what the voltage is, it will be interesting to see if that's the problem.

It looks like your circuit for the 4 LEDs in series is just fine, other than that you need to use a 120 ohm resistor for a 12V source and 4 - 2.1V LEDs.
 
I measured the voltage on the HDD header. Without anything attached, it was below 1v. Reading through the page here though, it states that this value means nothing without some load on the header.

So I found another opto-isolator (a 3040 from NTE - they claim it's the same as a 4n27) and put that into my circuit but also put a 220ohm resistor in between one leg of the hdd header and the chip. Same problem - still too dim. Measuring the voltage on the 1v, plus or minus .2v (although I saw one spike to 2v I think - my meter is not very fast).

I've tested my red LEDs individually with an LED tester, they seem fine.

HELP. This project is on a deadline for a couple of reasons, and I've spent 20+ hours this weekend on nothing but this and one other problem. I'm getting very nervous that I can't finish in time and I'm already exhausted.
 
JediKnight0 said:
I measured the voltage on the HDD header. Without anything attached, it was below 1v. Reading through the page here though, it states that this value means nothing without some load on the header.

So I found another opto-isolator (a 3040 from NTE - they claim it's the same as a 4n27) and put that into my circuit but also put a 220ohm resistor in between one leg of the hdd header and the chip. Same problem - still too dim. Measuring the voltage on the 1v, plus or minus .2v (although I saw one spike to 2v I think - my meter is not very fast).

I've tested my red LEDs individually with an LED tester, they seem fine.

HELP. This project is on a deadline for a couple of reasons, and I've spent 20+ hours this weekend on nothing but this and one other problem. I'm getting very nervous that I can't finish in time and I'm already exhausted.

The HDD signal is active LOW.

What does active LOW mean? Most people appreciate that digital signals have two values, 1 and 0. And most people could tell you that 1 means ON and 0 means OFF. But in active LOW logic, the 0 (LOW voltage) means ON. This is precisely how the HDD signal works.

If you look at the header pins on your motherboard, you'll see one labeled +. You would tend to assume that this is the HDD signal,and the other pin is ground. The real deal is that the pin marked + is really stuck at +5V with respect to ground all the time. This doesn’t change. It’s the other pin that’s connected to the HDD signal. So when the other pin goes LOW, the LED lights.

AH HA!! it IS 5V! so that 7n27 just may be getting overpowered. But then...

So the thing to do if you want to change the LED is to just drop the new one in. The circuit on the drive limits the current to the LED. You don’t need to add resistors to do this mod.

apparently, the output of the header depends on the load. you can't really say what resistor to put on it, because it doesn't matter. So most likely, your isolators are fine.

I don't know as much as I should about opto-isolators, so I really can't tell you exactly what to do about that at this point. If it were me, I'd stick a diode in there to make sure we didn't get any current the wrong way, and be happy with that.

Good luck, maybe someone else here knows more about this?
 
Thanks for the help.

I looked at your circuit, but I don't understand a few things. First, the wires going to the flashing LED... you mean two flashing LEDs in series, right? Also, what does the extra transistor do? Why do you have anything attached to pin 4 of the 4n25?

Can you describe the function of your circuit a little? Thanks again.
 
OK here goes.

The transistor inside the opto is not very powerful so I'm using the bigger 547 to do the hard work. Just about any NPN will do, try using an MJE3055 and replacing the led with a car headlamp if you like! The two LEDs are in series as are the second two which are always on.

The hard drive LED is replaced with the led inside the opto.

When light falls on a photo-transistor it starts to conduct. Essentially the light the light energy provides the base current. This causes pin4 to rise to ~12V allowing current to flow through the 2k2 resistor, turning the 547 on. It conducts, pulling the 390r to ground and the leds light. The 100k is to makes sure the 547 turns off by allowing any leakage current from the opto to go to ground. The 500k lowers the sensitivity of the opto and in most cases can be left off.
 
OK, I built the circuit chopsuwe described, except I changed a few values.

Because of the 4 LEDs I'm using, I used a 150ohm resistor connected to the LEDs. I also used a 2200ohm resistor instead of the 2002 ohm resistor (it's all I had) and I used an MPS2222A transistor (still NPN). I also left off the 500k ohm resistor and the always-on LEDs.

The end result: it works, but the LEDs are dim.

chopsuwe, can you tell me how you arrived at your resistor calculations?
 
JediKnight0 said:
chopsuwe, can you tell me how you arrived at your resistor calculations?

V=IR, where V=voltage, I=current, R=resistance. from that equation, you can derive that R=V/I. That R is the size resistor you need if you figure out the amount of voltage you need to drop, and how much current is going through the line.
 
Going on his circuit, I wonder if you could adjust the 2.2k resistor to something a little smaller (like 2k or 1.8k) to see if you could get a little more voltage at that node, possibly brightening the leds.

dunno if that would work or not, but I think it'd be worth a shot.
 
nevermind... I looked at that again... it doesn't work that way... changing the 2.2k would not effect the voltage or current through the leds...
 
xtant3150 said:
nevermind... I looked at that again... it doesn't work that way... changing the 2.2k would not effect the voltage or current through the leds...

So how would I change the voltage/current through the LEDs? Changing the resistor in series with the LEDs doesn't seem to work - besides, I know I'm calculating it properly.
 
ok... let's see how much of my EcET classes I remember...

To satisfy Kirchhoff's voltage law, the resistor has to drop 11.3V as there is nothing between the emitter and ground, and there is only a .7V drop between the base and the emitter... No matter what resistance you put in place of the 2k2, the resistor drops the same voltage. the only thing that changes is the current through that resistor. because the leds are on the collector side, the current through the BE loop doesn't effect the current (or voltage) through the leds and the 390. The transistor just acts like a switch to turn the leds off and on...
Man... it's been a while since I had to analyze a circuit... ;)

The only thing I can think of is to lower the 390 some, but be careful that you don't fry your leds.

Something else you may want to try is to put some standard leds in place of yours. Just to see if it's the leds or the circuit. Are normal leds dim when compaired to being directly connected to the HD header?
 
I've already lowered the 390ohm to 150ohm, which is correct for using 4x2.0 volts 30mA LEDs in series with a 12v source (I think).

I put a single ultra-bright LED on the HDD header of the motherboard and it functioned just fine and was bright.
 
The led resistors are:
R=V/I
R=(Vsupply - Vled) / I
R=(12V - 4 * 2V) / 0.03Amps
R=130ohm

As for the other resistors... well... er... there are calculations. xtant3150 got it pretty much right. The base emitter junction forms a diode. Diodes have a 0.7V drop across them. So without the 2k2 we have 12V at the supply, we lose a little going through the opto's transistor which leaves us with about 12V across the b-e junction.... which trys to maintain 0.7V by basically shorting the 12V supply. You can guess what happens then.

ps. I'm in the process of updating that page.
 
don't know if it will make much of a difference, but if you go on the source voltage of 11.3V (and a current of 30 mA) your limiting resistor should be more like 110 ohms... I don't think that's a common value, but mabe you could do a 100 ohm and 10 ohm in series... or 2 220's in parallel...

duh...

The CE loop doesn't drop any voltage beyond the leds and resistor. that's more like 130 ohms, so go with that instead 2 270's in parallel...
 
1) what current is going through your optoisolator?
2) are you sure your LEDs need to be in series?
 
Back
Top