I'm trying to switch multiple 12V LED's with my arduino, based on the input of a (serial-in parallel-out) shift-register.

The 12V comes from a separate battery, so I can use 8 mosfets to get my 12V, and I might even put a parallel-in serial-out shift register in between.

But I'm hoping that there is a cleaner way of doing this. Is there some kind of component that combines a shift register and a mosfet?

Any ideas on the best way to solve this?

  • What kind of amperage do these leds use? – Gerben Oct 23 '15 at 14:53
  • The manual that came with my LED lights mentions 90mA per LED. – Nico Kaag Oct 23 '15 at 19:45
  • How about using optocoupler pc817? – Aircraft Oct 24 '15 at 8:33
  • ULN2803 FTW, 50v 500mA max, 8 channels, available everywhere, including as boards to plug onto an Arduino – Neil_UK Oct 26 '15 at 19:53

I would recommend using something like the STP08DP05. ST Microelectronics makes 16 and 24 bit versions as well. You can also find TI and NXP parts that will do basically the same thing.

With these parts you can hardwire your max current value with a resistor to make sure you don't overdrive the LED. Just because you can drive the LED at 90mA, doesn't mean you should... it will probably be way to bright. The IC's can also be daisy-chained to your shift register and you can drive very large strings of LEDs... or use them for RGB LEDs.

Hope that helps!

EDIT - Based on Comments

There are a couple of options. Note the Vdd represents the voltage supply to the IC itself and the nominal operating voltage is 3.0V up to 5.5V (I'm honestly not sure why they even added 7V as a max value when they specify 5.5V on the next page).

So, Vdd is not necessarily the voltage that your LED's are driven at. You can drive the LEDs at 12V (if you need to) and add a series resistor to the OUT pins of the IC's to dissipate the extra heat.

You would probably be fine with 200 ohms per pin. If you set your current at 20mA, and assuming a 2.2V drop through the LED, that would give you approximately 5.8V at the OUT pins and the IC wouldn't have to dissipate much heat in terms of power.

However, if you don't need to drive them at 12V then I wouldn't bother. Usually the forward voltage of an LED is 1.8 to 3.3V and you don't need 12V. However, if you are driving a lot of them then it may be easier to use the 12V. There are always trade-offs.

| improve this answer | |
  • That one indeed looks like what I want. I only do no fully understand the schematics. When the max Vdd is 7V. How can I get a Vo of 12V. Or do I have to hookup the OUT pins to the LED cathodes? – Nico Kaag Oct 24 '15 at 10:04
  • 1
    I agree with Embedded_Guy. Here's a link to an instructional YouTube video I made for this. It includes a schematic and Arduino code. youtu.be/x20uNWz1Res – linhartr22 Oct 29 '15 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.