Pages: 1 ... 4 5 [6] 7 8   Go Down
Author Topic: RGB SMT LED Cube, resistors, drivers, and shift registers.  (Read 17863 times)
0 Members and 1 Guest are viewing this topic.
Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've been reading up on the transistors...
For the cascaded transistor cube, it looks like i could use 20 2n2222 transistors. Since my needs are 240ma, 3904s wont be suitable. It seems like I could also do it with ULN chips and 4 transistors. Is there any reason an n-channel mosfet wouldnt work well?

I still havnt figured out what mosfets to use for the other cubes, but maybe I will find one to use with the transistor cube.

Logged


Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have been trying to figure out what decoupling cap I need for the TLC 5940, Ive read that I should put a 47uf electrolytic cap on them. I've looked over the datasheet, and not found anything that suggest what cap to use, the tutorial doesnt have any decoupling cap, and calculating what cap seems to be some kind of magic that nobody really understands.

I've dug through all my spare/scrap parts, and cant find any 47uf caps, i have many caps in various sizes, but that that size. What about voltage rating, what caps do i need? how do I know what size is right?

Im also curious about ordering parts from the big houses like digikey mouser, ... How long does it take to get parts within the US? does it take weeks, or within a week? I've never ordered anything from any of those places, so any tips would be helpful.
Logged


Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ive found lots of fets that will probalby be suitable, trying to pick one is hard.

Ive found this one DMN2112SN
its 100mOhm, 1/2watt 1.2a
My needs are:
16x3x20=960ma=.96a
THis is my dissipation calculations.
.96x.96 =0.9216 x .1= .09216, or 96mw, or about 1/10th watt, so well within 1/2 watt.

this is from the digikey website:

FET Type   MOSFET N-Channel, Metal Oxide
FET Feature   Logic Level Gate
Drain to Source Voltage (Vdss)   20V
Current - Continuous Drain (Id) @ 25° C   1.2A
Rds On (Max) @ Id, Vgs   100 mOhm @ 500mA, 4.5V
Vgs(th) (Max) @ Id   1.2V @ 1mA
Gate Charge (Qg) @ Vgs   -
Input Capacitance (Ciss) @ Vds   220pF @ 10V
Power - Max   500mW
Full datasheet.
http://www.diodes.com/datasheets/ds30830.pdf

Does that seem like a good part for what im doing? I dont want to buy any more parts that are not what i need.
Logged


Kansas
Offline Offline
Newbie
*
Karma: 0
Posts: 1
If it sparks, rethink it, If it smokes, Time to Hang it up!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I love to see these things in action, Can you maybe think about making a video for us so we can see  smiley-grin
Logged

When Working with Arduino and Breadboards on an all nighter, Better buy some more Code Red Mt Dew... Know what I mean... X-)

Offline Offline
Sr. Member
****
Karma: 7
Posts: 266
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For decoupling you usually need one larger cap, for example 47uH, and smaller caps for each chip involved with usual values ranging from 0.1uF to 0.01uF. The latter ones are for the high frequelncy noise and should be located as close as practically possible to the ICs.

Here's an excellent tutorial on it:
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

I order most of my components from places like Mouser, Digikey and Newark and they ship rapidly. Of course it depends on ones particular location but my things usually arrive within 3-4 days.
« Last Edit: January 27, 2013, 08:41:46 am by Headroom » Logged


Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

CybrE3_Mad_Coder, heres a link to my youtube videos, the last several videos are examples of LEDs and circuits that ive been working on. I have some TLC5940 stuff, 74hc595/shiftout stuff, and some charlieplexed stuff.
https://www.youtube.com/user/hippynurd?feature=mhee

Headroom, Thanks for the tips, It sounds like those place dont take any longer than ebay or any other place, thats good to know.

I looked over mikes decoupling page, and things are still rather complicated and hard to understand everything, but its good to have that as a reference. As I understand it, if the caps arent quite right, there can be a lot of RF noise, and I guess its common for folks to just throw some caps at it, and be unaware of the noise issue. I dont like solving problems by making other problems, which is what im trying to avoid, while learning...

I have 104 ceramic caps on my shift registrers, and my tlc chip, but I think my tlc chips may also need 47uH because mike had posted that on another thread about that chip.

There are no capacitors in the TLC tutorial, and the 595 tutorial has them in the wrong place, it would really be nice if things were consistent around here. its kinda confusing.
Logged


Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I ordered some parts from digikey yesterday, and in just over an hour, I was notified that my order was ready for shipping, it appears to be on its way, and should be here by the end of the week, and shipping cost was minimal.

1   25   DMN2112SNDICT-ND   MOSFET N-CH 20V 1.2A SC59-3      25
2   25   785-1085-1-ND   MOSFET P-CH -30V -1.2A SC70-3              25
3   100   CF18JT51R0CT-ND   RES 51 OHM 1/8W 5% CF AXIAL      100
4   100   MMBT2222AFSCT-ND   TRANSISTOR GP NPN AMP SOT-23   100
5   10   399-6098-ND   CAP ALUM 47UF 35V 20% RADIAL      10
6   100   CF18JT75R0CT-ND   RES 75 OHM 1/8W 5% CF AXIAL      100

Hopefully, the fets are the best fets for my purposes. I think I have some parts that will be very efficient, but Im hoping they are fast enough.
The other parts are for other cubes, including the new transistor shifter cube.

I hope to have some inexpensive charliecube kits soon if anyone wants to build one.
Logged


Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I ordered parts monday around noon, and the parts arrived by thursday. It seems they can ship stuff just as quickly, and inexpensively as any ebay provider within the US.

They did kind of use a lot of packaging, but they did use about 1/2 recyclable packing material.

I forgot to calculate the resistors for the 2n2222 transistors. I need 240mA for the transistor cube, The transistors I got seem to be limited to 350ma, that should be enough for my needs. I have been trying to figure out HFE, and what resistors to use with them, to limit the current to safe levels. Nearest i can tell, about 330 seems to be about right, to keep me under 350ma, but enough to drive the transistor well into saturation.

It seems that while reading about mosfets, one of the nice things is that I wont be needing a current limiting resistor, like I would on a BJT, but that I could use a resistor to help reduce the chance of the fet self destructing or going into a feedback loop or something. can anyone explain that ?

The transistor cube is coming along nicely. I have 16 spires built, and I have 20 transistors soldered and circuit wired up for them. im still trying to figure out the best way to assemble the spires onto the PCB. Im thinking that making 4 spires into 1 plane, then fit each plane onto the PCB. I'll get some pics up today.
Logged


Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset



Heres one image of the spires being assembled. I havnt soldered them together yet, but I think this is how I will do it.



This is an ugly picture of the transistors. I grouped them badly. It was to make it fit in a small space. After soldering them in like this, I realized I could use a little more space, put 4 transistors inline, and the wiring would have been a lot neater and tidier.

Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

man, you're doing a great job!! I'm anxiously awaiting your next posts! thank you for sharing this with us!

rick
Logged

Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You are welcome rick, thanks for the support. smiley-grin

If things go well today, I think I will solder the LEDs to the board, and finish the circuitry. Then the scary part, testing.
Logged


Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset



I havnt posted anything in a while, I have been testing transistors for the new cube, and for the other unfinished cubes.
The above picture was after finishing the new cube design. I chose to build this one using just the LEDs leads, instead of using wire. I wanted this cube to fit on a smallish PCB, the LEDs are just under 1" apart, and that meant that the LED leads were just long enough to work without additional wire.
I did have to add 2 support wires, to help make the cube sturdy, but I may take them off, as they are kinda ugly.
Logged


Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ive finally gotten the transistor cube working. Heres a quick video


This circuit uses:
64 Common Cathode RGB LEDS
20 NPN transistors (2n2222, I used tiny sot23 package parts, but any 2222 should work)
20 Resistors (eight 270 ohm 2n2222 base resistors, 12 anode resistors (eight 100 ohm, four 150 ohm)
The cube layout uses lines instead of planes. Typical 4x4x4 cube construction uses 4 planes of 16 LEDs, this uses 16 lines of 4 LEDs, which brings the duty cycle down to 6.67% (from 25%), but it requires few parts, and doesnt require off-board power, since it only lights up a maximum of 12 LEDs(4 RGB LEDs) at a given time.

This specific cube was made using the LED leads and no additional stiff wire, It is also sized to fit a slightly smaller circuit board (this board is only 3" wide, so the LEDs are about 7/8" in apart, unlike the other cubes that are 1" spacing.

I think it looks horrible in the daylight, compared to the cubes with nice stiff wires, but when its dark, you dont notice so much.

This cube use 20 pins on the microcontroller, and on most arduinos, that doesnt leave any pins left for additional features, and assuming you are using 20ma LEDs you could draw upto 240ma at one time, which may be too much for 28 pin dip arduinos.

Edit: removed old ugly program, see next post for better program.
« Last Edit: February 23, 2013, 05:31:01 pm by Hippynerd » Logged


Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is a better test program, I've cleaned things up, and added some more programs.
Code:
// TransistorCube  -- Test Program
#include <avr/pgmspace.h> // allows use of PROGMEM to store patterns in flash

#define CUBESIZE 4
#define PLANESIZE CUBESIZE*CUBESIZE
#define PLANETIME 3333 // time each plane is displayed in us -> 100 Hz refresh
#define TIMECONST 5 // multiplies DisplayTime to get ms - why not =100?

/*
** Defining pins in array makes it easier to rearrange how cube is wired
** This cube uses 2 plane pins and one led pin to light up any single LED.
** Pins 2-13 are used to control the 12 RG and B anodes (the rear to forward 4 LED)
** 5 banks of 4 transistors that are controlled by 8 arduino pins sink the cathodes.
** Pins (14,15,16,17) control 4 transistors that select the row(wide), and on each row.
** Pins (18,19,0,1)4 control 1 of 4 sets of 4 transistors that select the level(height).
** First you have to turn on a row, then turn on a level to sink the LED.
**
** This cube uses NPN transistors. We send HIGH to sink a row or level,
** and we send HIGH to turn on a anode color/forward/back LED. send LOW turns LEDs off.
*/

int RGBColumnPin[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
int RowPin[] = {14, 15, 16, 17};
int LevelPin[] = {18, 19, 0, 1};
int RowLevelCount  = 4;
int RGBColumnPinCount = 12;
// initialization
void setup()
{
  int pin; // loop counter
  // set up LED pins as output (active HIGH)
  for (pin=0; pin<(RGBColumnPinCount); pin++) {
    pinMode( RGBColumnPin[pin], OUTPUT );
  }
  // set up plane pin1 as outputs (active HIGH)
  for (pin=0; pin<CUBESIZE; pin++) {
    pinMode( RowPin[pin], OUTPUT );
  }
  // set up plane pin2 as outputs (active HIGH)
  for (pin=0; pin<CUBESIZE; pin++) {
    pinMode( LevelPin[pin], OUTPUT );
  }
}

void loop(){
// comment out lines below to run just the specific test you want
// to run. comment all but one routine at a time for best results.
// You can also change values inside the programs for different testing.

  loopFor();
  loopRand();
  loopRedWall();
  loopFullOn();

}

// This bit of programming uses 3 loops to sequence all 192 LEDs
// one loop controls 1 LEDs anode pin, the 2 other loops control the cathode pin.
// You turn a pin HIGH, to light the LED (turn the anode HIGH, and turn 2
// transistors HIGH to sink one cathode line (4 RGB LEDs)
// Turning all pins LOW, turns all LEDs off.
void loopFor()
{

   for(int thisRowPin = 0; thisRowPin < RowLevelCount; thisRowPin++){
     for(int thisLevelPin = 0; thisLevelPin < RowLevelCount; thisLevelPin++){
        for(int thisPin = 0; thisPin < RGBColumnPinCount; thisPin++){
       
        planesOff();
        digitalWrite(RGBColumnPin[thisPin],HIGH);
        digitalWrite(RowPin[thisRowPin],HIGH);
        digitalWrite(LevelPin[thisLevelPin],HIGH);
       
       
        delay(100); // increase value to slow down
       
        digitalWrite(RGBColumnPin[thisPin],LOW);
        digitalWrite(RowPin[thisRowPin],LOW);
        digitalWrite(LevelPin[thisLevelPin],LOW);
     //   delay(100); // if you want an off delay       
      }
    }
  }
}

void loopRand()
{
    int randPin = random(12);
    int randPlane1 = random(4);
    int randPlane2 = random(4);
   
    planesOff();
   
    digitalWrite(RGBColumnPin[randPin],HIGH);
    digitalWrite(RowPin[randPlane1],HIGH);
    digitalWrite(LevelPin[randPlane2],HIGH);
       
    delay(50);
           
     
    digitalWrite(RGBColumnPin[randPin],LOW);
    digitalWrite(RowPin[randPlane1],LOW);
    digitalWrite(LevelPin[randPlane2],LOW);
     
     
}

void planesOff(){
    for(int thisRowPin = 0; thisRowPin < RowLevelCount; thisRowPin++){
        digitalWrite(RowPin[thisRowPin],LOW);
    }
    for(int thisLevelPin = 0; thisLevelPin < RowLevelCount; thisLevelPin++){
        digitalWrite(LevelPin[thisLevelPin],LOW);
    }
}


void loopRedWall()
{

   for(int thisRowPin = 0; thisRowPin < RowLevelCount; thisRowPin++){
        for(int thisPin = 0; thisPin < 4; thisPin++){
 
     for(int thisLevelPin = 0; thisLevelPin < RowLevelCount; thisLevelPin++){
         
        planesOff();
        digitalWrite(RGBColumnPin[0],LOW);
        digitalWrite(RGBColumnPin[1],HIGH);
        digitalWrite(RGBColumnPin[2],LOW);
        digitalWrite(RGBColumnPin[3],LOW);
        digitalWrite(RGBColumnPin[4],HIGH);
        digitalWrite(RGBColumnPin[5],LOW);
        digitalWrite(RGBColumnPin[6],LOW);
        digitalWrite(RGBColumnPin[7],HIGH);
        digitalWrite(RGBColumnPin[8],LOW);
        digitalWrite(RGBColumnPin[9],LOW);
        digitalWrite(RGBColumnPin[10],HIGH);
        digitalWrite(RGBColumnPin[11],LOW);
        digitalWrite(RowPin[thisRowPin],HIGH);
        digitalWrite(LevelPin[thisLevelPin],HIGH);
       
       
        delay(5); // increase to slow down
       
        digitalWrite(RGBColumnPin[0],LOW);
        digitalWrite(RGBColumnPin[1],LOW);
        digitalWrite(RGBColumnPin[2],LOW);
        digitalWrite(RGBColumnPin[3],LOW);
        digitalWrite(RGBColumnPin[4],LOW);
        digitalWrite(RGBColumnPin[5],LOW);
        digitalWrite(RGBColumnPin[6],LOW);
        digitalWrite(RGBColumnPin[7],LOW);
        digitalWrite(RGBColumnPin[8],LOW);
        digitalWrite(RGBColumnPin[9],LOW);
        digitalWrite(RGBColumnPin[10],LOW);
        digitalWrite(RGBColumnPin[11],LOW);
        digitalWrite(RowPin[thisRowPin],LOW);
        digitalWrite(LevelPin[thisLevelPin],LOW);
     //   delay(100);       
      }
    }
  }
}
void loopFullOn()
// This program lights 12 LEDs ina line, and cycles through the row/levels
{
   for(int thisRowPin = 0; thisRowPin < RowLevelCount; thisRowPin++){
 //       for(int thisPin = 0; thisPin < 4; thisPin++){
 
     for(int thisLevelPin = 0; thisLevelPin < RowLevelCount; thisLevelPin++){
         
        planesOff();
        digitalWrite(RGBColumnPin[0],HIGH);
        digitalWrite(RGBColumnPin[1],HIGH);
        digitalWrite(RGBColumnPin[2],HIGH);
        digitalWrite(RGBColumnPin[3],HIGH);
        digitalWrite(RGBColumnPin[4],HIGH);
        digitalWrite(RGBColumnPin[5],HIGH);
        digitalWrite(RGBColumnPin[6],HIGH);
        digitalWrite(RGBColumnPin[7],HIGH);
        digitalWrite(RGBColumnPin[8],HIGH);
        digitalWrite(RGBColumnPin[9],HIGH);
        digitalWrite(RGBColumnPin[10],HIGH);
        digitalWrite(RGBColumnPin[11],HIGH);
        digitalWrite(RowPin[thisRowPin],HIGH);
        digitalWrite(LevelPin[thisLevelPin],HIGH);
       
       
        delay(100); //This controls speed, bigger is slower.
       
/*        digitalWrite(RGBColumnPin[0],LOW);
        digitalWrite(RGBColumnPin[1],LOW);
        digitalWrite(RGBColumnPin[2],LOW);
        digitalWrite(RGBColumnPin[3],LOW);
        digitalWrite(RGBColumnPin[4],LOW);
        digitalWrite(RGBColumnPin[5],LOW);
        digitalWrite(RGBColumnPin[6],LOW);
        digitalWrite(RGBColumnPin[7],LOW);
        digitalWrite(RGBColumnPin[8],LOW);
        digitalWrite(RGBColumnPin[9],LOW);
        digitalWrite(RGBColumnPin[10],LOW);
        digitalWrite(RGBColumnPin[11],LOW);
*/       
        digitalWrite(RowPin[thisRowPin],LOW);
        digitalWrite(LevelPin[thisLevelPin],LOW);
     //   delay(100);       
   //   }
    }
  }
}
Logged


Greenville, IL
Offline Offline
Edison Member
*
Karma: 11
Posts: 1310
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 I like your progress! I hope you continue to post more videos as you get better at using the cube.

 I need to build a RGB cube bad!
Logged


Pages: 1 ... 4 5 [6] 7 8   Go Up
Jump to: