Help figuring out appropriate transistor for LED Cube

Discussion in 'General Electronics Chat' started by jerseyguy1996, Jan 15, 2012.

  1. jerseyguy1996

    Thread Starter Active Member

    Feb 2, 2008
    206
    9
    I am trying to design my first LED Cube using STP16CPC26 LED drivers and an ATTINY85 microcontroller. I am using the TINY85 mostly because I have them and want to use them on something fun but I know it is not typical to use an 8 pin microcontroller in this type of application. My plan is that the first 5 bits sent from the microcontroller will specify the row of the cube to be turned on and the next 25 bits will specify the columns. If I am understanding the datasheet for the LED driver correctly it appears that they will sink current but not source current which (in my very limited understanding of electronics) suggests that I would need to drive PNP transistors with the LED Driver to light specific rows. I have included what I have so far in the attached schematic and Q1 through Q5 are the transistors in question.

    The LEDs are driven at 20 mA based on a 1K resistor on R-EXT of the LED drivers which I think would mean that if all LED's in a row are lit that the transistor will have to supply 500 mA. I am horrible at reading transistor data sheets but it seems that all of the ones that I read show them sourcing closer to 10 mA at saturation so I am not sure how to get 500 mA. Can someone help me understand what I should be looking for to select an appropriate transistor for this application?
     
  2. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    The way I did mine was to only light one LED at a time per port.

    My vertical layers were "Z", X was left to right, Y was front to back. Only one Z was enabled at any given moment, then I enabled the out x and y ports for that layer. Left them on while I went to next layer, once buffer was ready, disabled previous layer, put out new bits, enabled new layer. I did the output on an interrupt at about 1kHz, the entire array was mirrored in a RAM framebuffer which was manipulated using draw functions that were defined. When the interrupt happens, the framebuffer was put out to the LED cube. There wasn't any problems with the interrupt happening in the middle of drawing a line or lighting up a plane, as it was only 1/1000th of a second, so the function would finish and the result would look perfectly smooth. The entire cube was refreshed 200 times per second.

    I used a PIC with more pins to direct drive the X/Y, but should be able to use shift registers for the high driver, since you only need a single 20mA port to drive one (x,y) LED (that flickers at 1kHz with high duty cycle to appear brightly lit), and the IC driver to sink all of the LEDs on that Z layer (few hundred mA max).

    I structured mine like:

    Code ( (Unknown Language)):
    1.  
    2. [FONT=Lucida Console]zmax
    3. |  / ymax
    4. | /
    5. |/_____xmax
    6. [/FONT]


     
    Last edited: Jan 15, 2012
  3. nickelflipper

    Active Member

    Jun 2, 2010
    280
    35
    Using the STP16CPC26 as a pfet high side driver should work fine for the 5 levels of the cube. Driving the gate low with a cmos output will turn on a logic level pfet, if the total gate charge (Qg) is low enough (say less than 25 nC?, the lower the better). For instance, I have used a 74hc138 to drive the gate to an irf7304. which had a led load up to 500ma. There should be many pfets with similar characteristics.
     
  4. jerseyguy1996

    Thread Starter Active Member

    Feb 2, 2008
    206
    9
    Is pfet synonymous with p-channel mosfet?
     
  5. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Yes. It's just abbreviated, used to switch high side voltage/source current rather than switch/sink current for n-fet/N-Channel MOSFET, although you can switch current with an N-MOSFET if you use a high side driver, which makes things complicated, high side drivers and N-Fet are pretty much only used when driving large loads such as motors in an H-Bridge.
     
  6. jerseyguy1996

    Thread Starter Active Member

    Feb 2, 2008
    206
    9
    So I revised my schematic to use the p-fet. Does the attached schematic look correct? Would I need weak pullups on the fet gates to insure cutoff or will the LED driver provide a high enough logic level to shut the fet off?
     
  7. jerseyguy1996

    Thread Starter Active Member

    Feb 2, 2008
    206
    9
    I have actually set mine up like that with each pin of the LED driver only sinking current from one LED at a time but my horizontal layers are also being driven by the LED Driver so I need to drive a transistor on the high side to source enough current to drive potentially 25 LED's all at once.
     
  8. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    You could switch it around, use 74HC595 Shift Registers for X and Y on the high side (4 outputs from uC), which would supply your individual layer, and then sink that entire layer using the driver, which would enable all the features of the driver, such as PWM on some layers for fade effects, etc.
     
Loading...