Show Posts
Pages: 1 2 3 [4]
46  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: February 04, 2013, 04:12:34 pm
I have a question about the current draw from the arduino 5v pin. Is it true that i can pull around 450mA from that pin(Usb powered, arduino uno itself use around 50mA or something close to that, so that leaves me 450mA IF all the digital pins are turned low).

Thanks in advance smiley!
47  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: February 03, 2013, 04:51:42 am
No problem, I just thought it was weird because I was sure I made the post  smiley-mr-green. Anyway, my next project will be 5x5x5. I already ordered some shift register to experiment with and learn the basics of them smiley, I probably going to use shift registers on my 3x3x3 cube first to make sure I understand the programming and the way the shift registers work.
48  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: February 02, 2013, 12:04:09 pm
Don't know how, but Arduino001 should be me (WonderTiger),  Weird..... Thanks anyway for your positive reply smiley-grin! (and thanks ofcourse for sharing your code as well smiley-wink)
49  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: January 30, 2013, 06:17:15 pm
Another video smiley, multiplexed so only 1 layer is lit on any given time(im using array's and for loops to turn on the LEDs, easier to program/the code is shorter):


edit:
this code has even less lines as the one that I showed 2 posts back smiley.
50  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: January 26, 2013, 06:32:38 am
Got my LED cube build today smiley-grin! This code I made as a test:

I used for() loops as delay between the columns as well for making the led columns run at their full brightness.

Code:
int layer1 = 11;
int layer2 = 12;
int layer3 = 13;
int led1   = 10;
int led2   = 9;
int led3   = 8;
int led4   = 7;
int led5   = 6;
int led6   = 5;
int led7   = 4;
int led8   = 3;
int led9   = 2;
int r      = 1;




void setup()
{
  pinMode(layer1, OUTPUT);
  pinMode(layer2, OUTPUT);   
  pinMode(layer3, OUTPUT); 
  pinMode(led1,   OUTPUT);
  pinMode(led2,   OUTPUT); 
  pinMode(led3,   OUTPUT); 
  pinMode(led4,   OUTPUT); 
  pinMode(led5,   OUTPUT); 
  pinMode(led6,   OUTPUT); 
  pinMode(led7,   OUTPUT); 
  pinMode(led8,   OUTPUT); 
  pinMode(led9,   OUTPUT); 
 

}

void loop()
{
while(r<=5){
  digitalWrite (layer1, LOW);
  digitalWrite (layer2, LOW);
  digitalWrite (layer3, LOW);
  digitalWrite (led5, HIGH);
 
 for(int i = 0; i <= 15;i++){
  digitalWrite (layer1, HIGH);
  digitalWrite (led1, HIGH);
  delay(1);
  digitalWrite (layer1, LOW);
  digitalWrite (layer2, HIGH);
  delay(1);
  digitalWrite (layer2, LOW);
  digitalWrite (layer3, HIGH);
  delay(1);
  digitalWrite (layer3, LOW);
  digitalWrite (led1, LOW);
 }
 
 for(int i = 0; i <= 15;i++){
  digitalWrite (layer1, HIGH);
  digitalWrite (led2, HIGH);
  delay(1);
  digitalWrite (layer1, LOW);
  digitalWrite (layer2, HIGH);
  delay(1);
  digitalWrite (layer2, LOW);
  digitalWrite (layer3, HIGH);
  delay(1);
  digitalWrite (layer3, LOW);
  digitalWrite (led2, LOW);
 }
 
for(int i = 0; i <= 15;i++){
  digitalWrite (layer1, HIGH);
  digitalWrite (led3, HIGH);
  delay(1);
  digitalWrite (layer1, LOW);
  digitalWrite (layer2, HIGH);
  delay(1);
  digitalWrite (layer2, LOW);
  digitalWrite (layer3, HIGH);
  delay(1);
  digitalWrite (layer3, LOW);
  digitalWrite (led3, LOW);
 }
 
 for(int i = 0; i <= 15;i++){
  digitalWrite (layer1, HIGH);
  digitalWrite (led6, HIGH);
  delay(1);
  digitalWrite (layer1, LOW);
  digitalWrite (layer2, HIGH);
  delay(1);
  digitalWrite (layer2, LOW);
  digitalWrite (layer3, HIGH);
  delay(1);
  digitalWrite (layer3, LOW);
  digitalWrite (led6, LOW);
 }
 
 for(int i = 0; i <= 15;i++){
  digitalWrite (layer1, HIGH);
  digitalWrite (led9, HIGH);
  delay(1);
  digitalWrite (layer1, LOW);
  digitalWrite (layer2, HIGH);
  delay(1);
  digitalWrite (layer2, LOW);
  digitalWrite (layer3, HIGH);
  delay(1);
  digitalWrite (layer3, LOW);
  digitalWrite (led9, LOW);
 }
 
 for(int i = 0; i <= 15;i++){
  digitalWrite (layer1, HIGH);
  digitalWrite (led8, HIGH);
  delay(1);
  digitalWrite (layer1, LOW);
  digitalWrite (layer2, HIGH);
  delay(1);
  digitalWrite (layer2, LOW);
  digitalWrite (layer3, HIGH);
  delay(1);
  digitalWrite (layer3, LOW);
  digitalWrite (led8, LOW);
 }
 
 for(int i = 0; i <= 15;i++){
  digitalWrite (layer1,  HIGH);
  digitalWrite (led7,    HIGH);
  delay(1);
  digitalWrite (layer1, LOW);
  digitalWrite (layer2, HIGH);
  delay(1);
  digitalWrite (layer2, LOW);
  digitalWrite (layer3, HIGH);
  delay(1);
  digitalWrite (layer3, LOW);
  digitalWrite (led7, LOW);
 }
 for(int i = 0; i <= 15;i++){
  digitalWrite (layer1, HIGH);
  digitalWrite (led4, HIGH);
  delay(1);
  digitalWrite (layer1, LOW);
  digitalWrite (layer2, HIGH);
  delay(1);
  digitalWrite (layer2, LOW);
  digitalWrite (layer3, HIGH);
  delay(1);
  digitalWrite (layer3, LOW);
  digitalWrite (led4, LOW);
 }
 digitalWrite (led5, LOW);
 digitalWrite (layer1, LOW);
 digitalWrite (layer2, LOW);
 digitalWrite (layer3, LOW); // RESET all layers to OFF
 r = r++;                     
}
r = 1;                       
while (r<=10){
  digitalWrite (layer1, HIGH);
  digitalWrite (led1, HIGH);
  digitalWrite (led3, HIGH);
  digitalWrite (led7, HIGH);
  digitalWrite (led9, HIGH);
  delay(75);
  digitalWrite (layer1, LOW);
  digitalWrite (layer2, HIGH);
  delay(75);
  digitalWrite (layer2, LOW);
  digitalWrite (layer3, HIGH);
  delay(75);
  digitalWrite (led1, LOW);
  digitalWrite (led3, LOW);
  digitalWrite (led7, LOW);
  digitalWrite (led9, LOW);
  delay(75);
  digitalWrite (led2, HIGH);
  digitalWrite (led4, HIGH);
  digitalWrite (led6, HIGH);
  digitalWrite (led8, HIGH);
  delay(75);
  digitalWrite (layer3, LOW);
  digitalWrite (layer2, HIGH);
  delay(75);
  digitalWrite (layer2, LOW);
  digitalWrite (layer1, HIGH);
  delay(75);
  digitalWrite (led2, LOW);
  digitalWrite (led4, LOW);
  digitalWrite (led6, LOW);
  digitalWrite (led8, LOW);
  r = r++;
}
r=1;
}

Here a video smiley:
If anyone has some tips what I could do better on my code, feel free to let me know smiley.
51  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: January 24, 2013, 03:36:00 pm
All the components are send today! Soon I will start building the cube smiley-mr-green.

A little programming question. What will happen when I don't use a delay between switching on and off the LED. I would guess it wouldnt turn on the LED because it's been turned on and off too fast. Will I do damage on any components if I don't use delay.

And it's true the arduino pin can take up to 200mA? So I will be able to put on 9 LEDs on 1 plane ( 9 * ~15mA= 135mA). Thanks for the help again smiley-roll-blue.
52  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: January 23, 2013, 06:53:20 pm
Thanks for the explanations, now I understand why I needed it.

I got another question about the 13th pin from arduino. According to arduino pin 13th has an built in resistor so I can directly put a LED to pin 13 and ground. When I connect a column on pin 13 does the LEDs shine less bright because there is an extra resistor built in on pin 13(my 220ohm resistor + arduino uno pin 13th resistor?)
53  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: January 22, 2013, 04:33:32 pm
Is it possible for somebody to explain me why I need to use a resistor on the base from the transistor? I did alot of reading about why a resistor is needed on the base from the transistor (as NPN switch), but I keep seeing different answer on different forums this makes me understand it less and less. So if someone briefly can explain why a resistor is needed on the base (and how you calculate it) I would be very happy with it smiley!

sorry for the newbie questions, still in the learning process  smiley
54  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: January 21, 2013, 07:03:03 pm
No problem, you helped me out alot on other stuff though. Thanks again!!!

I'll guess somebody else can take a look at it smiley.
55  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: January 21, 2013, 05:55:43 pm
Ok thanks! Then If you can confirm the 22kOhm will be sufficient for the 2N3904 transistor: http://www.produktinfo.conrad.com/datenblaetter/150000-174999/163350-da-01-en-Transistor_2N3904.pdf. Then I will be ready to place my order smiley-wink.
56  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: January 21, 2013, 04:22:25 pm
Ye I did forget the delay smiley-neutral.

Though for me its more like this, right?:
Starting with all pins low.
Turn plane 1 pin high
Turn column pin(s) high
  Wait some amount of time(1ms or more)
Turn column pins low
Turn plane pin low

I use npn transistors that will switch to ground when current is provided to the base pin from the transistor, this is why I need to set plane 1 to a value HIGH instead of low, right?
57  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: January 21, 2013, 03:21:07 pm
Ok thanks I will keep it in mind until I got everything soldered up!

Maybe someone want to check this for the last time, to be sure I buy the right stuff:

-Transistor+22kOhms resistor should be fine right? Datasheet transistor: http://www.produktinfo.conrad.com/datenblaetter/150000-174999/163350-da-01-en-Transistor_2N3904.pdf
-LED+220 ohms @15mA GREEN. Datasheet LED: http://www.produktinfo.conrad.com/datenblaetter/175000-199999/184705-da-01-en-WU_8_56_GD_LED_5mm_gruen.pdf

Thanks  smiley-mr-green
58  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: January 21, 2013, 02:57:53 pm
Thanks to you all! Then I will get resistor aimed @15mA. As well with the programming I will only lit up 1 layer at the time smiley!

Control question:
If I want to lit up the whole cube, I need to do the following:
-Select layer 1 (turn off layer 2/3)
-Turn on all LED columns
-Turn off all LED columns
-Select layer 2 (turn off layer 1/3)
-Turn on all LED columns
-Turn off all LED columns
-Select layer 3 (turn off layer 1/2)
-Turn on all LED columns
-Turn off all LED columns

Or is this possible as well? (I'm newbie in programming as well smiley-wink):
-Select layer 1 (turn off layer 2/3)
-Turn on all LED
-Turn off layer 1
-Select layer 2
-Turn off layer 2
-Select layer 3
-Turn off layer 3

I will post some pics of building this cube!
59  Using Arduino / LEDs and Multiplexing / Re: 3x3x3 LED cube, newbie questions on: January 21, 2013, 02:04:10 pm
Ok then I will lower the value from the resistor  to around 180 ohm (to be in the middle of safe and bright smiley-wink). So you are saying I can switch on all the grounds from each level (3 grounds in total) and then turn on 1 column so I get a vertical line that is lit. So I also can make a wall of LEDs just by turning on all the grounds and turning on 3 columns?

And I don't get your last sentence  smiley-roll-blue "I think Its possible to do all the other things you list, but you probably wont want to do them." Are you reffering to an easier way to make a 3x3x3 LED?
60  Using Arduino / LEDs and Multiplexing / My 3x3x3 and 5x5x5 LED cube on: January 21, 2013, 12:34:01 pm
Hello,

My name is Mike and I'am currently living in the Netherlands. This year I started my first study: electrical engineering smiley.
So I went through some things what I could do to help me with my study and came out by the 3x3x3 LED cube.

Now I do understand almost everything and I should order my parts soon. This is my parts list:
-3 2N3904 NPN to use as ground switch (40V/200mA)
-3 22kOhms resistor for the NPN transistors.
-27 green LED's (2.2V/20mA)
-I calculated with this program: http://led.linear1.org/1led.wiz , that I needed 9*150ohms resistors. Though on the internet
 I found that most people uses ~220Ohms resistors. I'm not sure why they do that, so if anyone can tell me I would be thankful smiley!
-Perfboard, wires, etc
-Arduino Uno rev1.

Each transistor is connected to 1 of the 3 cathode levels. Then all the 3 transistors are soldered to 1 gnd wire (which then need to plugged in, into a GND port from the arduino).
Each transistor's base is connected to a digital pin from the arduino. When the cube is complete, it does look something like this: http://www.instructables.com/id/LED-Cube-and-Arduino-Lib/step3/Build-the-Circuit/

But I got a couple questions about what I can lit and what I can't:
-How many LED's can I lit up at the same time?
-Is it possible to lit LEDs on two different levels by grounding 2 or 3 levels at the same time and then let a current flow through a column? (So you can get a corner of 3 LEDs lit up the same time, without switching on high frequencies)
-Is it possible to turn on all 9 LEDS at the same time on 1 level?

Thanks in advance for helping a newbie smiley-wink.

Pages: 1 2 3 [4]