Help with transistor switch

Thread Starter

Thorsten

Joined Oct 21, 2007
4
Hello guys

For the past few weeks I've been working on a little ambilight-like project (in vein of http://divxstation.com/article.asp?aId=151, but with a different microcontroller setup, and some other minor changes), and so far, everything software-wise have been going pretty smoothly.
My only real problem lies with the transistores turning on and off the RGB-leds, which I can't seem to get working -I've tried calculating the needed resistor sizes through some measurements, but it still didn't give enough amperes for the LEDs.

I'm working with two kinds of RGB LEDs (http://www.dotlight.de/shop/product_info.php/cPath/263_264/products_id/744 and http://www.dotlight.de/shop/product_info.php/cPath/263_264/products_id/340), one having one anode and three cathodes, and the other having one cathode and three anodes, and therefore two different transistors - BC557NPN and BC547PNP.
If I could get some help getting just one of the posted schematics working I would be very grateful - it's the sizes of R2 to R7 I need help with.

Datasheets can be found at:

http://www.dotlight.de/datasheets/LL-U48RGB3C-001.pdf
http://www.dotlight.de/datasheets/SRGB7130.pdf

http://www.datasheetcatalog.org/datasheet/mcc/BC556B.pdf
http://www.datasheetcatalog.org/datasheet/mcc/548B.pdf


Edit: I only have those two transistors available, so recommending another transistor will not be helpful, unless there's no chance of getting them to work.
 

Attachments

hgmjr

Joined Jan 28, 2005
9,027
You will need to avoid using the PNP version you have posted as that will stress your PIC since it may pull your PIC outputs above your +5v supply.

hgmjr
 

Caveman

Joined Apr 15, 2008
471
R5-R7 should be somewhere in the 1k to 10k range. You need to calculate R2-R4. They are all the same value (assuming that you are using 3 of the same type of LED).

Basically, you need to pick the current you want to go through your LEDs. Let's say 10mA. Then you need to look at the voltage across the resistors. You have 12V at the top, then you drop about 0.3V across the transistor. That's just a rule of thumb for saturated bjts. Then you need to know the voltage across the LED. Look at the datasheet. Depending on the color and current, it will be slightly different. A typical red LED is from 1.8V to 2.2V.

So, the voltage on the resistor = 12 - 0.3V - 2.2V = 9.5V. If you want 10mA, then
R = V/I = 9.5V/10mA= 0.95k = 950 ohms, which is about a 1k.

And don't forget, you can play with it. If you want it brighter, just turn down the resistors a bit. Maybe 910 ohms or 820. If you want to pull less current, 1.1k or 2.2k.
 

Thread Starter

Thorsten

Joined Oct 21, 2007
4
I have already made a test PCB consisting of the following schematic, which didn't work.
I know it's the PNP transistor, but since the base is connected to a 5 V power supply indstead of a PIC-chip, it sholdn't be any problem.
 

Attachments

Audioguru

Joined Dec 20, 2007
11,248
Your switch disconnects the base of the PNP transistor to turn it off. The output of a PIC does not disconnect. It is either 0V and the transistor and LED are turned on, or it is +5V and the transistor and LED are still turned on.

The base current of the transistor goes into the output of the PIC backwards which might destroy the PIC.

An LED won't light if its pins are backwards.
a transistor doesn't work properly when its pins are backwards.
Look at the pics of the pins in their datasheets.
 
Top