Show Posts
Pages: 1 2 [3] 4
31  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions (5x5x5 comming soon) on: February 18, 2013, 01:47:23 pm
The digital pins from the arduino can only sink(/source) up, up to 40mA. If I turn on 25 LEDs on one layer the total current that need to be sinked by the digital pin would be 25*13mA = 325mA, this is far too much for a digitalpin. Instead I use NPN transistors, the collector from the transistor is connected to each layer of the cube. The emitter is connected to ground from the arduino (Ground from the arduino can sink up to around 450 mA on USB) and the base is connected to a digital pin on the arduino (in my case to the shift register). Now I am able to turn on 25 LEDs on one layer without frying something. The other advantage from transistors is the way how the ground is turned on/off, I send a HIGH signal to the base from the transistor so it switches the selected layer to ground. Because I can use HIGH instead of LOW (what you mentioned) it makes it easier to program.
32  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions (5x5x5 comming soon) on: February 18, 2013, 12:57:18 pm
Yes there quite a few parts in this one, here a list of all things I used:

-125 LEDs
-Copper wire to give the layers more thoughness
-5 NPN 800mA (2n2222) transistors
-5 x 150 ohm resistor for the transistors
-2 experiment boards to solder the components on
-14 male, 5pin connectors
-13 female, 5 pin connectors
-1 male, 3 pin connector
-2 meter 10wires ribbon cable
-6 meter white wire
-2 meter black wire
-2 meter red wire
-1 meter blue wire
-2 meter green wire
-2 meter yellow wire
-6 shift registers and 6 ic-sockets
-6 100nF ceramic capacitors
-25x 220 ohm resistors
-1x 10K resistor

This is all I used. I use 5 shift registers to control 5 LEDs per shift register, the 6th shift registers is for controlling the layers via the NPN transistors.
33  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions (5x5x5 comming soon) on: February 18, 2013, 10:15:03 am
Here are some pics smiley:















Next time I'm gonna design a PCB and etch it at school.
34  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions (5x5x5 comming soon) on: February 17, 2013, 04:14:19 pm
Sorry for the delay but I have been on vacation lately. Tommorow I will post some pics of it. I still have some struggling with the code but I almost figured out. So the videos will be posted within a week smiley.

I figured out the brightness issue though. Its because the duty cycle is around 1/5 if I multiplex 5 layers. To fix it I should pulse my leds with much more current then I do right now. I dont really mind about the brightness loss so I keep it in its original state:).
35  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions (5x5x5 comming soon) on: February 11, 2013, 03:49:47 pm
So after 3 days I finished my 5x5x5 LED cube. Now everything is working fine, however if I multiplex more then three layers my LEDs goes less bright then when I'm only multiplexing 3 layers. It's not a big deal but if someone has an explanation for it it would be great!

pics comming soon!
36  Using Arduino / General Electronics / Re: Help needed with shift registers on: February 08, 2013, 02:24:38 pm
Then I will use your sequence, after all it looks like the best sequence out of the three i can choose. Thanks again!
37  Using Arduino / General Electronics / Re: Help needed with shift registers on: February 08, 2013, 01:05:32 pm
Did some testing with 2 different codes today(changed the code in something easier for the forum):

1:
Code:
void loop(){
shiftOut(dataPin, clockPin, MSBFIRST, B00001);
digitalWrite(latchPin, HIGH);
delay(500);
digitalWrite(latchPin, LOW);
}

2:
Code:
void loop(){
shiftOut(dataPin, clockPin, MSBFIRST, B00001);
digitalWrite(latchPin, HIGH);
digitalWrite(latchPin, LOW);
delay(500);
}

As you can see the difference is the place of the delay(). I uploaded both codes, and both looks exactly the same, so i can assume it does not care where i place the delay?

]
38  Using Arduino / General Electronics / Re: Help needed with shift registers on: February 07, 2013, 03:31:32 pm
Ok thank you very much smiley! Then i put around a 10k resistor between the latch and gnd on my 5x5x5 cube.
39  Using Arduino / General Electronics / Re: Help needed with shift registers on: February 07, 2013, 03:18:06 pm
No you was right! The latch pin should be low so no data will be send to the outputs. If i put the resistor on 5v and the latch then the latch will be high, if i tie it to GND then it is low(atleast it's working if i put the resistor between latch and ground). However i'm not sure if I need to place a resistor on every latch pin or only 1 resistor from  latch to ground will be good enough (notice that all the latches from the 6 registers are tied together).
40  Using Arduino / General Electronics / Re: Help needed with shift registers on: February 07, 2013, 02:39:45 pm
Thanks for the tip! Now the LEDs won't light up when i connect the USB to my laptop!

Btw: Does every latch pin from each shift register need a resistor to ground? *I tie all the latches from each shift register (6 in total) together*

I don't think every latch need a resistor though
41  Using Arduino / General Electronics / Re: Help needed with shift registers on: February 07, 2013, 12:38:41 pm
I still have a small 'problem'. The shift registers are hooked up to the arduino (3 digital pins, GND and 5V), when I put my USB cable in my laptop all the LEDS light up for a second and then just run the code I what was uploaded to the arduino. Is there any way to let the LEDs not light up whenever I connect my arduino to my laptop?
Vid:

 
42  Using Arduino / General Electronics / Re: Help needed with shift registers on: February 06, 2013, 03:51:51 pm
Yes I agree with you, failures are there to learn from as we say in Holland smiley.

Luckily the chip still works fine, I just keep it for experimenting and use new shift registers for my cube;).
43  Using Arduino / General Electronics / Re: Help needed with shift registers on: February 05, 2013, 06:45:44 pm
Yes I discovered I made a bad mistake what mark mentioned. Instead of pulling out the ground from the arduino I should have pulled out the ground from the LED(so stupid). Mark, thanks for the info by the way now I know even more about shift register(I am still very new with electronics so it is a kind of learning experience for me), thanks smiley!
44  Using Arduino / General Electronics / Help needed with shift registers on: February 05, 2013, 05:37:21 pm
Hello,

After finishing my 3x3x3 LED cube I decided to go a little bigger (5x5x5). Now the arduino doesn't have enough pins to control the LEDs, so I decided to use (5)shift registers to expand my number of outputs. So I was searching on the internet and found this tutorial(http://arduino.cc/en/Tutorial/ShiftOut). So I ordered a few LEDs and the 74hc595N shift register (datasheet:http://www.nxp.com/documents/data_sheet/74HC_HCT595.pdf). After wired everything (only 2 LEDs hooked up) up as the tutorial shows, everything worked perfectly fine smiley. Because i'm gonna use 5 transistors to control the LED's  layers, I pulled out the ground (pin 8 on the shift register). I expected to see the LEDs go off though they didn't. So now I pulled out the 5v aswell and still the LEDs are on (less bright though).

Now I think the shift register is provided by current through the I/O pins 8, 11, 12. Now I don't why this happening so if someone can explain it to me (why and how??) it would be very helpful!

this code i'm using:
Code:
//Pin connected to ST_CP of 74HC595
int latchPin = 8;
//Pin connected to SH_CP of 74HC595
int clockPin = 12;
////Pin connected to DS of 74HC595
int dataPin = 11;



void setup() {
  //set pins to output so you can control the shift register
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
  // count from 0 to 4 and display the number
  // on the LEDs
  for (int numberToDisplay = 0; numberToDisplay < 4; numberToDisplay++) {
    // take the latchPin low so
    // the LEDs don't change while you're sending in bits:
    digitalWrite(latchPin, LOW);
    // shift out the bits:
    shiftOut(dataPin, clockPin, MSBFIRST, numberToDisplay);  
    //take the latch pin high so the LEDs will light up:
    digitalWrite(latchPin, HIGH);
    // pause before next value:
    delay(500);
  }
}

this is what is happening:


45  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: February 05, 2013, 05:07:42 am
Ok thanks:D! I only will use around 325 mA at the most so arduino will provide enough when connected to USB, thanks again!
Pages: 1 2 [3] 4