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..??
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...
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??
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.
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.
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...
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).