Help with transistor switch

Discussion in 'The Projects Forum' started by Thorsten, May 3, 2008.

  1. Thorsten

    Thread Starter New Member

    Oct 21, 2007
    4
    0
    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.
     
  2. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    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
     
  3. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    The NPN version should work. Can you tell us what values of resistors you are using?

    hgmjr
     
  4. Caveman

    Active Member

    Apr 15, 2008
    471
    0
    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.
     
  5. Thorsten

    Thread Starter New Member

    Oct 21, 2007
    4
    0
    103 ohm for R3 (red LED), and 80 ohm for R2 and R4 (blue and green LED).
    R5-R7 has 10K ohm.
     
  6. Caveman

    Active Member

    Apr 15, 2008
    471
    0
    103 Ohms would give about 80mA! Don't go that low!
     
  7. Thorsten

    Thread Starter New Member

    Oct 21, 2007
    4
    0
    Well, the LEDs have a forward current of 75 mA
     
  8. Thorsten

    Thread Starter New Member

    Oct 21, 2007
    4
    0
    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.
     
  9. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    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.
     
Loading...