Software Support > Automated Projects
Noob question about resistors for LEDs, but for opto-isolator.
(1/2) > >>
BadMouth:
I'm still a noob at this stuff, in fact I think I've regressed since not playing with it for a few months.

At 5v, what's the lowest value resistor I can use on the IR LED side of this opto-isolator without having to worry about it burning up in a month?
http://media.digikey.com/pdf/Data%20Sheets/Lite-On%20PDFs/LTV-817_827_847(M,S,S_TA1).pdf
If I'm doing things correctly, an online calculator is telling me 82ohm, but that seems low to me.

I was under the impression that opto-isolators were like switches, but after building my circuit on the breadboard, I see it's more like a transistor where the input affects the output.  I'm making a circuit that switches between two resistances when an optoisolator is tripped and didn't account for the optoisolator itself adding resistance.  I got down to a 220 ohm resistor on the anode before getting a low enough resistance on the collector/emitter side.  But I would like to go even lower for the sake of being able to adjust it with a pot elsewhere in the circuit.

What I'm up to = this will reduce the brightness of the IR LEDs in the optical switches of my joysticks, making them less sensitive to the point of skipping the corners in 4-way games. It will be controlled by joychoose of course.  ;)
DaOld Man:
According to the specs you linked to, the forward voltage at 20 MA is 1.2
So, using supply voltage of 5 minus the forward voltage of 1.2, divided by 20 ma:

E =Es-Ef  (5-1.2=3.8 volts)
R= E/I
R=3.8/.020 (20 ma)
R= 190 ohms. (200 should be ok that will give the led 19 MA)

If you are experiencing the output of this opto isolator "floating" (not turning completely off), you may need to bias it with a resistor on the transistor side (output) of the opto isolator.
If the transistor is switching the ground going to the joystick, add a 5 K resistor to the wire going to the joystick and the positive supply for the joystick. If it is switching the positive, then the 5k resistor needs to go to the ground.
This will either pull down the opto isolator output when it is turned off (if it is switching the positive) or pull up the output if it is switching the ground.
(Its actually pulling up or down the input to the joystick, to make sure it is completely off)
The 5 K resistor is just a wild guess, it may need to be higher or lower. To err on safety, maybe use a 10 K, if it don't work, try the 5 K.
See diagram below, this is assuming that the opto isolator is NPN.
DaOld Man:
Ok I just re-read your post and I think I misunderstood.
If you are trying to adjust the brightness of your internal joystick leds, may need a different approach.
The circuit I recommended is completely off or completely on, based on optoisolator output.
Adjusting the brightness of LEDs are not as simple as one may think, however you can try to put a pot (adjustable resistor) in between the optoisolator and the joystick, then adjust the pot to vary the brightness of the joystick leds. (This is not efficient, because at some point the led will drop off fast to dark.)
The best way to vary the brightness of an led is adjust the current (caution! very easy to fry the led), or pulse the current off and on at different rates. I don't know if this is possible with your joysticks or not.
BadMouth:

--- Quote from: DaOld Man on August 17, 2013, 12:17:20 pm ---Ok I just re-read your post and I think I misunderstood.
If you are trying to adjust the brightness of your internal joystick leds, may need a different approach.
The circuit I recommended is completely off or completely on, based on optoisolator output.
Adjusting the brightness of LEDs are not as simple as one may think, however you can try to put a pot (adjustable resistor) in between the optoisolator and the joystick, then adjust the pot to vary the brightness of the joystick leds. (This is not efficient, because at some point the led will drop off fast to dark.)
The best way to vary the brightness of an led is adjust the current (caution! very easy to fry the led), or pulse the current off and on at different rates. I don't know if this is possible with your joysticks or not.

--- End quote ---

Yeah, I want to switch between two different levels of resistance.  One when the opto-isolator is off, another when it is on.  The simplest way I thought of to accomplish this was adding another resistor in parallel with the first one when the opto-isolator is on.  (I'm using pots so they're adjustable, but for the sake of keeping it simple, we'll just say I'm using resistors).

The joystick PCB already has a pot to adjust the sensitivity.  I've removed that pot and replaced it with some pins and a cable that will go to this circuit. 

At the higher resistance, the IR LEDs are dimmer and the joystick less sensitive so it doesn't register in the corners. (4-way mode)
At the lower resistance, the IR LEDs are brighter and work normally for 8-way games.\
This is with a round gate on the joystick and it doesn't feel as odd for 4-way games as I thought it might.
 

I messed around with it today with the joystick hooked up instead of just measuring resistance.  After a fair amount of fiddling, I got it working the way I want and moved onto building the actual boards, but I'm using a 100ohm resistor.  :scared
(I was mistaken when I mentioned a 220ohm resistor yesterday, it was a 120).

It didn't behave exactly as expected, so a 200ohm resistor might work, but I'd have to remove them from my proto-board to test.  :-\
I have a half dozen more opt-isolators.  Hmmm...


EDIT: ugh, ended up tearing the proto-boards halfway apart before I realized that the pads on the edges aren't linked to the other side like the holes.
This after I tested to make sure that the individual holes weren't linked in any way.   ....and one of the optoisolators is blown.   :embarassed:  It's a shame, as it was working exactly how I wanted on the breadboard for around a half hour of fiddling with it.  Not sure how long out of that the opto-isolator was powered.  Back to the breadboard I suppose.

Is there something other than an optoisolator that would be better to use here?
DaOld Man:
How are you switching the opto isolators? If you are using the printer port, you could use NPN transistors.
But opto isolators are neat because they keep the currents on the joystick and the PC currents separated.
You can also use DIP sockets, so you can just unplug the opto isolators.
So you are wanting to switch the resistance to the joystick LEDS, based on an output on or off from the PC?
Navigation
Message Index
Next page

Go to full version