How to drive 6 individual 12v LED via arduino

Hi all,

I have an existing circuit that I'd like to drive using my teensy arduino. There are 6 leds which required ~12v to light, and they have a common ground so I must drive them from the high side.

I tried using a transistor array but I can't find one that will do supply side drive, so I think I will have to revert to transistors - what's the best way of doing this? There are so many options, NPNs and FETs and I don't know where to start..??

How much current?

Literally one 3mm led per transistor so a couple of ma

You could use an 8 channel low side driver like ULN2803 to pull down the base of a PNP transistor like 2N3906, IF the 3.3V output from the Teensy is enough to trigger it.
https://www.digikey.com/product-detail/en/stmicroelectronics/ULN2803A/497-2356-5-ND/599591
http://www.st.com/content/ccc/resource/technical/document/datasheet/e4/fa/1c/16/4e/39/49/04/CD00000179.pdf/files/CD00000179.pdf/jcr:content/translations/en.CD00000179.pdf

That seems like more components than necessary... Is there not a way to use just a transistor and a resistor per led?

Well you need a PNP or P-channel MOSFET for high side switching, but you can't high side switch 12V with a 3.3V input. You could do it with 6 NPNs and 6 PNPs and 18 resistors but...

Bloody hell, surely there must be an easier way..?

Well, hang around a few hours 'til the big guns come online, maybe one of them will have an idea, good luck.

Thanks, I was trying to use a UDN2981 but it's now obsolete so I cant get hold of it. Replacing with loads of transistors and resistors isn't going to fit on my board without some major mods sadly

Thats what I was saying, with an array like ULN2003 (7channel), you would need only one current limit resistor for each LED transistor base . And I think it comes in a tiny SOT package.

That's still quite a lot of components. My pcb manufacturer couldnt source UDN2981 but it looks like I can get some on Ebay or similar. Maybe it's easier just to buy some loose and send to the pcb company? This way I only need one chip as I can drive it directly from the arduino and then directly power an led right??

Right, but wait for @Cross Roads or @MarkT to come on, I believe they are still actively building (I'm not) and probably know of more modern parts.

MIC2981 is equivalent to UDN2981. Maybe your PCB fab can get that.

An HV5812 would probably work and is obtainable from mouser. It is actually a vacuum fluorescent display driver chip, but with 20 output channels is probably overkill in this application. I used this chip in a nixie clock which I published recently: Six Digit Nixie Clock - Exhibition / Gallery - Arduino Forum

Edit

I’ve just seen that you need 3.3 volt logic so this is not an option (unless you are prepared to add a level shifter such as the SN74HCT14N as used in that published circuit)

Edit2

If for this (UDN2981) , you were intending to use the PDIP version, you could just get a socket installed and source the devices yourself from ebay, and add them later. That is assuming you are not expecting the manufacturer to do a full functional unit test.

Hi,
This is a basic generic circuit for high side switching.

I hope you will be prototyping your project before committing to a PCB.

Tom... :slight_smile:

I may be missing something, but surely one PNP is all that is required?

A PNP transistor switches when its base is negative with respect to its emitter. Invert the logic on the processor so that it is active low and it will just work (unless I am in pillock mode again?).

Actually the pullup should be on the 3V3 rail and the emitter should be on the 12V rail.

1 Like

AJLElectronics:
Actually the pullup should be on the 3V3 rail and the emitter should be on the 12V rail.

Which means the base will be negative with respect to the emitter ALL the time.
+3V3 base is LOWER than +12V emitter with respect to gnd.
Tom... :slight_smile:

TomGeorge:
Which means the base will be negative with respect to the emitter ALL the time.
+3V3 base is LOWER than +12V emitter with respect to gnd.
Tom... :slight_smile:

Yes of course it will! I need to rethink that. :slight_smile:

Another alternative could be three 2-channel opto-couplers , 6 series resistors for the opto-coupler leds and 6 series resistors for the target leds (if these are not already on the board).

e.g. https://www.onsemi.com/pub/Collateral/MOCD223M-D.PDF

OC.JPG

OC.JPG

PaulRB:
MIC2981 is equivalent to UDN2981. Maybe your PCB fab can get that.

Hero! This looks like the thing I've been looking for... Can I please clarify a couple of things that don't seem immediately obvious in the datasheet?

  1. If I'm looking for 12v at the output channels, I put 12v to vs and ground to GND?

  2. Will 3.3v logic from the Arduino be enough to switch the input?

Thank you all for your help - I really appreciate it. I will try and get one of these to test...