Could an opto-isolator serve as a led driver?

Example, LTV-816/826/846 series which don't cost much...

You put power in one side, your pin(s) through resistor(s). And you put power on the other side but it doesn't have to be the same voltage.

So could a 70-cent (priced somewhere today) 4-channel opto-isolator drive 4 leds (likely using external power) without much load on the Arduino? My feeling is it should.

Question remains if using transistors would be better/cheaper/easier.

transistors would be better/cheaper/easier.


Also I doubt an opto could carry enough current for a LED.


Transistors would be better/cheaper/easier. Unless you need to isolate your LED's from the Arduino for some reason (doubt it). Even easier: drive the LED's directly from Arduino pins using series resistors. Unless you are using special high-power LED's (>20mA), in which case an optoisolator is not the answer either.

-- The Ruggeduino: compatible with Arduino UNO, 24V operation, all I/O's fused and protected

It was looking to me like 1 pin could run a few leds this way, but oh well!

Why I should be able to read datasheets better.

These Lite-On's are NPN on the receiving side and I read collector current (Rating is max?) as 50 mA and collector-emitter voltage Rating at 80V. Does that mean you have to run 80V to get 50 mA while if the V is small you get proportionally less mA?

And another one bites the dust.

Not just means you shouldn't try to conduct more than 50mA on the transistor side, nor should you apply more than 80V as you will then damage the device.

-- The Flexible MIDI Shield: MIDI IN/OUT, stacking headers, your choice of I/O pins

If that opto is good for 50mA it will probably work, but the bottom line is "why bother", a transistor will do the same job or even as RC says the Arduino chip itself depending on the LED.

Does that mean you have to run 80V to get 50 mA while if the V is small you get proportionally less mA?

No, the voltage doesn't matter much, those are maximum ratings.


Only reason I can think of is 4 channels on a dip for 70 cents. But maybe 10 cent transistors could do better anyway.

I can see I need to spend time on and off learning more about transistors than the very simple theory. Much more...

RuggedCircuits: I know I can pull 20 or 40 mA off one pin. And 200 mA off the 328 if I have that right. The same 328 that has... is it 20 usable pins?

It probably would work, I don't see why not, and for you it may be a plausible option. Just check the datasheet of the optoisolator and stay under the maximum power output.

If you want more than just a few LEDs (ie power leds) then check out "high side drivers" theres a bunch of different ones with different channels, current/voltage maximums etc.Their great to use, its pretty much just power, ground and a certain number of inputs with the same number of outputs. Just look around and you should be able to find something suitable.

If you want REALLY high power check out one of these, I want to get my hands on one so bad.

Its pretty much a really high power shift register, with a max of 1.2a, 45v per channel, you could easily drive 8 40 watt LEDs with one of them, thats just hectic, that isolation system looks a little bit slow though but that would only be a problem with a lot of them and bit bang PWM i think...

You would need 2 resistors: one to drive the opto's LED and another to limit the current on the external LED.

Moreover, power consumption would be big. Using a normal transistor, you just need to provide it a small base current (in the uA range), and it's gain, typically 100+, will "amplify it" to the LED current (20mA typical). The "amplification factor" on the optos, the CTR (Current Transfer Ratio) is very small; it's given as a percentage, the percentage of current out (opto transistor) from current in (opto's LED), and is usually small - 50% to 600% in the case of the optos you mentioned, that is, 0.5 to 6 (compare that with the 100+ of a stand alone transistor). This means that, to make sure your external LED get 20mA, you would have to provide 40mA from the Arduino, because the CTR can be 50% (0.5 amplification).

And you can also find single transistors much cheaper (like 3 or 4c or less) than "equivalent" optos.

So optos are better for when you need to really isolate 2 systems.

I wasn’t trying to push so much out the leds would need resistors. I want to draw low current from the MCU and get led power from the other side. And I do like chip packaging.

I saw Paul Bergsman at a mid-90’s Trenton Fest, heard all about one certain power-chip and a few other neat tricks and bought his book. That was way back when you could use the parallel port even with Windoze.

What about the ULN-2803, a Darlington array with built-in back-EMF protection, as the book says. That’s 8 lines able to take up to 50V 500mA for about $1. And I’d need bigger resistors on both sides, but I could use the same chip to run a stepper.

I’m sure there’s actual perfectly-suited led-drivers already mentioned and explained on the site and forum.

I wasn’t trying to push so much out the leds would need resistors.

You would need the resistor. Unless you care to characterize each part you use individually and… nevermind. Resistor.

I remember seeing simple single LED driver chips, I can’t remember manufacturer nor part numbers, but a search on farnel should get you there.

As for the ULN… that’s a bit like shooting a fly with a bazooka. You would need the LED resistor anyways. Built-in backEMF protection is totally irrelevant to light LEDs. Not sure if there’s something else to take into consideration, I would have to open the datasheet.