Current-limiting resistors necessary on opto-isolators and relays?

I am using a couple of solid-state relays with integrated opto-isolators on my project, as well as a couple of plain old opto-isolators. I realized today that I might have to use current-limiting resistors on the control circuits. I had already installed two of the relays in my project, and haven't burned out any of my Arduino's data pins yet, but just to be sure, I measured current through one of the relays and found it to be 4 mA. So, presumably the internal resistance of the relay is keeping current below the 40 mA that the Uno's pins are capable of supplying. I haven't tested one of the non-relay opto-isolators yet.

That got me thinking, though: presumably, the relay will reliably operate with much less than 4 mA of current. My project will likely operate on mains power, so keeping current draw to the absolute minimum for battery life is not a priority.

Would it be better to minimize current draw, just as a matter of good design practice?

Is it standard practice to install current-limiting resistors on the control lines of relays and opto-isolators?

Which SSR (Solid State Relay) ? Which optocoupler ?

Most SSR turn on at 3V to 12V (or more). They have already a current limit.

Most optocouplers are a led (plus phototransistor). So you must use a resistor for the led. You should check the datasheet for the normal current for the led. I think 10mA is the most used current for older types of optocouplers.

Erdin: Which SSR (Solid State Relay) ? Which optocoupler ?

CPC1218 relay. LTV-816 opto-isolator.

Most optocouplers are a led (plus phototransistor). So you must use a resistor for the led.

I never would have thought of it that way, but of course: it's an LED, so it needs a current-limiting resistor in there somewhere. I suppose this may be one advantage of the relay over the otpocoupler: the relay is an entirely self-contained device, while the optocoupler requires some supporting hardware.

You should check the datasheet for the normal current for the led. I think 10mA is the most used current for older types of optocouplers.

I've perused the data sheet, and I'm not sure which specification would apply. I see a max. input forward current rating of 50 mA. Presumably that specification would be limited by the LED's current-carrying capacity, so is that it?

Most SSR turn on at 3V to 12V (or more). They have already a current limit.

I am having some trouble understanding this statement. If a passive device has no resistance, and a voltage is applied to it, then voltage on either side of it is the same and current through it is infinite. If the device has any resistance at all, then the voltage across it depends on the supply voltage: Vcc on one side, 0v on the other side. But the voltage difference doesn't depend at all on the resistance of the device, only the current flow. So I don't understand how the need for a potential difference across the relay leads to the conclusion that it must also have an internal current limit.

Unless... well, I suppose you could say that, if there is any potential difference, then resistance must be > 0, but that isn't saying much. a 1-Ohm resistor has resistance > 0, and will produce a 3v or 12v difference in potential--at least until it burns up from overheating!

Maybe can you expand on your statement so I can have a better understanding?

joshuabardwell:

Most SSR turn on at 3V to 12V (or more). They have already a current limit.

I am having some trouble understanding this statement. If a passive device has no resistance, and a voltage is applied to it, then voltage on either side of it is the same and current through it is infinite. If the device has any resistance at all, then the voltage across it depends on the supply voltage: Vcc on one side, 0v on the other side. But the voltage difference doesn't depend at all on the resistance of the device, only the current flow. So I don't understand how the need for a potential difference across the relay leads to the conclusion that it must also have an internal current limit.

Unless... well, I suppose you could say that, if there is any potential difference, then resistance must be > 0, but that isn't saying much. a 1-Ohm resistor has resistance > 0, and will produce a 3v or 12v difference in potential--at least until it burns up from overheating!

Maybe can you expand on your statement so I can have a better understanding?

I had a look at this datasheet https://www.google.com/url?q=http://www.ixysic.com/home/pdfs.nsf/www/CPC1218.pdf/%24file/CPC1218.pdf&sa=U&ei=k7tAUtysKOTj4QTS_oHgBw&ved=0CAcQFjAA&client=internal-uds-cse&usg=AFQjCNFLKjCspCLxAoqN0L85S136HquVcQ

which says "input resistor : min 900 - typ. 1000 - max.1100 Ohms " The input is an LED+resistor ;)

Would it be better to minimize current draw, just as a matter of good design practice?

No minimising the current is not good engineering practice. The low the current the less noise immunity the circuit has. Like most things a good design is a compromise.

joshuabardwell: I've perused the data sheet, and I'm not sure which specification would apply. I see a max. input forward current rating of 50 mA. Presumably that specification would be limited by the LED's current-carrying capacity, so is that it?

about the LTV-816 : the max input current is 50mA, there is only a LED (no resistor) in the device, so it's up to you to limit the imput current. If you want to source it from an arduino output, 10 to 15mA will be OK, VceSat will be low enough - And remember Ic must stay below 50mA too ! (absolute maximum rating)

Is it standard practice to install current-limiting resistors on the control lines of relays and opto-isolators?

There is no general practice, each specific device has a datasheet that tells what the current/voltage input requirements are, go by that.

Lefty

alnath: which says "input resistor : min 900 - typ. 1000 - max.1100 Ohms " The input is an LED+resistor ;)

Oh. Durrr. I thought you were saying you could infer that it must have current resistance. You were actually saying that you looked up the specs and they said it had a resistor built in. I get it. Here I thought you had unearthed some nuance of Ohm's Law that I was unaware of.

Most, if not all, Solid State Relay’s have built in resistors and will say things like “3 to 24 volts” in the control side, giving a clear indication that the on board LED also has an on board current limiting resistor.

alnath: the max input current is 50mA, there is only a LED (no resistor) in the device, so it's up to you to limit the imput current.

With you so far.

If you want to source it from an arduino output, 10 to 15mA will be OK, VceSat will be low enough

Sorry. You lost me. Are you saying that I should calculate the value of a resistor so as to limit current to 10-15 mA. Or are you saying that the saturation voltage of the optoisolator will, itself, provide enough current-limiting so as to prevent the Arduino pin from exceeding 10-15 mA, and that a current-limiting resistor would only be necessary with a higher-voltage source?

EDIT: well, it's not the second one. I tested it (with a momentary switch, so I could just pulse it very briefly), and it triggered the over-current alarm on my meter. So, more than 200 mA.

And remember Ic must stay below 50mA too ! (absolute maximum rating)

Not a problem. My load circuit measures 4 mA dead-short.

I chose to use a 220 Ohm resistor, since I have a zillion of them for use with LEDs. This should give a current of 23 mA. I get an actually measured current of about 17 mA, which corresponds to a resistance of 294 Ohms, or 74 Ohms more than I expected. If this was the internal resistance of the opto-isolator, I would expect to measure a current, without limiting resistor, of 67 mA, but when I actually performed this test, I got over my meter's max of 200 mA.

Not that it matters, but just out of curiosity, any idea where the extra 74 Ohms is coming from?

any idea where the extra 74 Ohms is coming from?

Your misunderstanding of the situation.

You are thinking of everything in terms of resistance. LEDs don't work like that, they require a certain voltage to turn them on. Once on they conduct a lot of current, so what you think of as 74R is actually the 1.9V or so needed to turn the LED on. See:-

http://www.thebox.myzen.co.uk/Tutorial/LEDs.html

Grumpy_Mike:

any idea where the extra 74 Ohms is coming from?

Your misunderstanding of the situation.

Usually. Regarding your example, if I understand correctly, the math to apply is 5v - 1.8v = 3.2v / 220 Ohms = 16 mA, which is juuust about right, and the variation is probably explained away by the 1.8v being a nominal value.

5v - 1.8v = 3.2v / 220 Ohms = 16 mA,

Yes the 1.8 should be replaced by the actual forward voltage drop of the actual LED that is used. This depends on the colour and generally the higher up the spectrum the bigger it is. In the case of an opto isolator, they normally use IR LEDs and so the forward voltage drop will be low. Check the data sheet to see exactly what forward voltage drop you have.

joshuabardwell: Sorry. You lost me. Are you saying that I should calculate the value of a resistor so as to limit current to 10-15 mA. Or are you saying that the saturation voltage of the optoisolator will, itself, provide enough current-limiting so as to prevent the Arduino pin from exceeding 10-15 mA, and that a current-limiting resistor would only be necessary with a higher-voltage source?

EDIT: well, it's not the second one. I tested it (with a momentary switch, so I could just pulse it very briefly), and it triggered the over-current alarm on my meter. So, more than 200 mA.

Sorry for the late answer, but yes, it is the first one : doing that, you make sure that the arduino output will not be overloaded, and, according to the datasheet, the opto will work in good conditions. And, as Grumpy_Mike says, if you look at the datasheet, you see that the forward voltage is between 1,2V (typical) and 1,4V(max). Now, your 17mA are OK : (5-1,2)/220 = 0,017 :)

joshuabardwell:
… without limiting resistor, of 67 mA, but when I actually performed this test, I got over my meter’s max of 200 mA.

Throw that one away, and use a new one.
The 50mA is the absolute maximum, that means the internal led is damaged at 51mA.