4x4x4 led cube one column is dimmer than others

I've just assembled a led cube, and when I try to turn on all LEDs, the column connected to d0/rx pin is dimmer.
I'm using an andruino nano.
Is it possible to do something about it or do I need to live with it?

Edit:I've added the code

code.ino (14.9 KB)

Did you try swapping the pins? Does this dimness stay with D0/rx pin or does it stay with your LEDs? Maybe something is wired wrong?

I did try to swap the d0 and d2 pins but still the column that is connected to d0 is still dimmer.
Also when only the d0 column is on it lights normally.

using pin 0 & 1 for anything is a bad plan. pins 0 & 1 are the serial port, where programs are uploaded and the Serial monitor outputs from Arduino to monitor

Read "How To Use This Forum"

This is what happens when you do not

Where's your code & schematics & the other info as listed in the sticky?

Or do you really think the provided info is enough to diagnose your problem?

Indeed pins 0 and 1 are best left unused, unless you know what you're doing. Definitely don't try to set up a Serial connection if you want to use them.

65741607_469467093872023_2350981036730482688_n.jpg
A pretty picture, but tells us nothing.

Most certainly, do not use 0 or 1 pins.

For a 4 by 4 by 4 single colour cube, the most sensible way is to use a MAX7219 to drive it. :grinning:

Ok sorry, I've added the code, as for the build I'm connecting four layers of the cube by 4 330R resistors to pins A0, A1, A2, A3 (But I'm thinking to remove these resistors and add a 100R resistor for each column). As for the columns, they are connected to pins 13,12,11,10,9,8,7,6,5,4,3,2,1,0,A5,A4.
I'm suppling the arduino with 5V

Looking at that image again I see two columns that are a bit dimmer.

I also notice you use a Nano, which has a USB/TTL chip on board, and connected to the Serial pins.

As you obviously have ran out of pins, you can't use other pins for those two columns.

Possible solution: use a Pro Mini instead, as that does not have anything connected to the Tx and Rx pins when you don't have the FTDI cable connected.

kapicytryna:
Ok sorry, I've added the code, as for the build I'm connecting four layers of the cube by 4 330R resistors to pins A0, A1, A2, A3 (But I'm thinking to remove these resistors and add a 100R resistor for each column). As for the columns, they are connected to pins 13,12,11,10,9,8,7,6,5,4,3,2,1,0,A5,A4.
I'm suppling the arduino with 5V

Did you read the posts telling you why it is not advised to use pins D0 and D1?
We need to see your code.
Can you please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html . Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Thanks.. Tom... :slight_smile:

TomGeorge:
We need to see your code.

14k of code has since been attached to the OP...

...so it's there but hidden from those that have been reading this thread before! (I just happened to notice it - at least no Serial calls in there).

TomGeorge:
Did you read the posts telling you why it is not advised to use pins D0 and D1?
We need to see your code.
Can you please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html . Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Thanks.. Tom... :slight_smile:

Hmm i've added the code but i'm gonna paste it here if you can't see it

code

Ok so after some tinkering I resolved the issue by connecting pins 0/1 to the base of transistors that i'm using as a switch for both columns, now every column has the same brightness :slight_smile:

That links to an "empty folder".

What you really should do is create a minimal sketch that still shows the problem.

That first of all makes it small enough to post, small enough to actually be able to read for us, small enough so we know where to look for the problem (a messy 14k sketch is too much), and actually in the process of writing it there's a good chance you can find the problem yourself already as you're pinpointing where in the code the problem actually is.

wvmarle:
What you really should do is create a minimal sketch that still shows the problem.

Here you are

int layer[4]={A3,A2,A1,A0};
int column[16]={13,12,11,10,9,8,7,6,5,4,3,2,1,0,A5,A4};
int time = 250;

void setup()
{
  for(int i = 0; i<16; i++)   
  {
    pinMode(column[i], OUTPUT);
  }
  
  for(int i = 0; i<4; i++)
  {
    pinMode(layer[i], OUTPUT);
  }
}

void loop()
{
  turnEverythingOff();
  turnEverythingOn();
  delay(time);
  //after this are some other patterns
}

void turnEverythingOff()
{
   for(int i = 0; i<16; i++)
   {
     digitalWrite(column[i], 1);
   }
   for(int i = 0; i<4; i++)
   {
     digitalWrite(layer[i], 0);
   }
}

void turnEverythingOn()
{
  for(int i = 0; i<16; i++)
  {
    digitalWrite(column[i], 0);
  }
  for(int i = 0; i<4; i++)
  {
    digitalWrite(layer[i], 1);
  }
}

wvmarle:
That links to an "empty folder".

Also that is strange, I did try to open it without logging in, and I still can download the file.

Hi,
If you are going to add files etc as requested, please don't go and add them to your preceeding posts.

Please add them in a new post, this will keep the readability of the thread consistent and easy to follow.

Thanks.. Tom.. :slight_smile:

So no matter which columns you connect to pins 0 and 1, they're dimmer, right? This code definitely proves it's not the code as all pins are treated exactly the same.

Try running it on a Pro Mini, as on both the Nano and Uno pins 0 and 1 are permanently connected to a USB/TTL converter.

And in future, specifically for a 4 by 4 by 4 single colour cube, just use a MAX7219 to drive it. :grinning:

(Much) simpler code, better performance. :roll_eyes: