SOLVED: Two Power Supplies and a Transistor

Hello,

So I am driving 16 strips of LEDs using 2 595 shift registers. (right now only 4 strips are connected for testing) The strips require 18V so I am using transistors rated at 50V 500mA max. I have the 18V+ connected to the collector, Q0 (LED pin on the 595) to the base and 18V- to the other side of the LEDs.

Now I have heard that you have to 'link' the power supplies (5V Arduino and 18V primary) so I attached the 18V- to the GND on the Arduino. Doesn't work. :(

Interestingly though when I connect a single LED to the emitter of one of the transistors (with appropriate resistor of course) and connect it to Arduino GND, and at the same time break off the connection between 18V- and GND, the remaining 3 LED strips mimic the single LED (on 595pin 3). So if I send the 595 '00000100' all the strips light up. I am very confused and feel I don't understand how to properly use 2 power supplies and a switching transistor together. Any help would be great. (I hope I move one wire and everything is great!) :)

Are these NPN or PNP transistors? If NPN, you should be wired up like I have Q1 & Q2 here:

Your 18V+ goes where I show 12V. You 18V- goes to the arduino ground.

And your 595 outputs go to base of the transistors thru a current limitig resistor so you don't burn up the 595s.

Yes they are NPN TO-92. I have 920ohm resistor between the bases and 595 pins.

Also, my LED strips are common cathode. Total I will have 16 individually controlled strips.

[u]So I can't use USB power and a separate 18V source?/u :-?

USB can power the arduino, that is fine. Just connect 18V- to arduino gnd.
Can you draw a picture of how the LEDs are connected?
With 18V, I am thinking they must be connected in series somewhere - 16 LEDs wired in parallel would not need 18V to turn them on.

16 LEDs wired in parallel would not need 18V to turn them on.

Correct. I have 6 White LEDs/strip. the actual measured voltage is 19.5V and I drop the extra 1-2V with a 100ohm 1/4 watt resistor per strip.

I have done what you are saying.

so I attached the 18V- to the GND on the Arduino. Doesn't work.

I will be home later and I can draw up a schematic. Any tools I can use online or for linux for creating a schematic?

I use expresspcb.com on a PC, I don't what it does with Linux.

So you're talking a setup like this. Connect the Arduino to USB, connect 5V from Arduiono to shift registers, connect the shift registers to dataout line, shift clock line, strobe/data latch whatever, output enable. The 595 outputs then turn a transistor on/off to turn the LEDs on/off. If you use a tpic6b595 open drain shift register, it has outputs rated for 50V & 150mA, that may let you skip the transistors.

I only have 74hc595's at my disposal. I did exactly what you said and it still does not work. I think it has something to do with the power supply. Any ideas?

Got a meter? Take some measurements, see if the transistors are getting a high on on the base and actually turning on.

With pin HIGH I get a potential of 5V between pin and (now common) ground. Also, I get a 5.6V potential between collector and emitter. When LOW I get 0V between the pin and ground. and I get a 9.6V difference between collector and emitter. I CONSISTENTLY get 19.5V potential between the collector and ground.

I noticed that there is no voltage drop across the resistor that connects the pins to the base.

The emitter should be tied to ground - so how can you see 5.6V C-E when the base is high, and 9.6V C-E when the base is 0 - and then 19.5 consistently between C-E? What is the base doing - is not switching high & low?

I have the transistor at the positive end of the strip so the emitter it is not tied to ground. The collector to ground voltage is 19.5V as it always should be. I was hoping you or someone could interpret these readings because I am not sure. I have D33D30 transistors; maybe there is a fault in my wiring, but looking at the data sheet it shows B-C-E configuration (unconventional as far as I know).

The NPN won't work like that. It needs to be wired per the schematic I posted if you want it to turn on. If you want to switch the +18V side of the diodes you need a PNP transistor. Put the NPN at the bottom of the string with the emitter to ground.

Put the NPN at the bottom of the string with the emitter to ground.

It worked! That was it! My limited experience with transistors led me to believe that transistors work exactly like a switch (which they do, but not exactly). Now I see my my error and it seems quite obvious now...the 5V+ coming from the pin on the 595 has to go right to ground through the base to the emitter, before it had to travel through the LEDs (if that makes sense...and I realize a voltage doesn't travel). Anyway thanks a lot CrossRoads! Your problems solving skills are quite remarkable, without the ability to be hands-on. ;D

Your description of the voltages was the clue.

This isn't quite the correct description: "the 5V+ coming from the pin on the 595 has to go right to ground through the base to the emitter, before it had to travel through the LEDs"

With NPN/PNP transistors, the 5v from the shift register creates current (limited by the base resistor) into the base lets the transistor turn on and control current flow from the collector to the emitter. The collector to emitter voltage drop can be 0.3 to 0.7V. And it can get warm. Power dissipated = IV, so 0.02A * 0.7V = 14mW. Put an amp thru there, and now its 700mW.

If you had a MOSFET transistor, such as IRF3070Z, then voltage alone (basically, takes a miniscule amount of current) into the Gate of the MOSFET lets the transistor turn on and control the Drain to Source flow. The Drain to Source resistance can be quite low (0.012 ohm for instance) so the voltage drop across the MOSFET is small - V=IR, so with 0.02A (20mA) and 0.012 ohm, thats 0.00024V, or 0.2mV. Power dissipated is very small - P=IV, or doing some equation substituting P=I*I*R, .02*.02*.012 = .0000048W. Put amp thru, 1*1*0.012 = 0.012, 12mW, not even warm.