Pages: 1 [2]   Go Down
Author Topic: New here - Planning a 5x5x5  (Read 2010 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 438
Posts: 23718
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"Otherwise, I might have to figure out some kind of delay circuit with a capacitor and a transistor"
Messy.
Use higher brightness LEDs, 4000-10000+ mCd are available.
Get a uC with more IO pins, and reduce the multiplexing instead.
Or use parts like TLC5940.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

SydneyAust.
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That looks like a cool chip:
" It can control 16 LEDs per IC, and also be cascaded to control more and more, with the display data arriving via a serial line in the same manner as a 74HC595 shift register. Furthermore, another benefit of this IC is that you don't need matching current-limiting resistors for your LEDs, as this IC is a current sink, in that the current flows from the 5V rail, through the LED, then into the IC. However, it can control the brightness of the LEDs using pulse-width modulation over 4096 steps via software, or using a single resistor."
http://blog.littlebirdelectronics.com/review-texas-instruments-tlc5940-16-channel-l-1

But I'm thinking it will be OK with a basic 5x5 multiplex because at PWM(10/255) there is sufficient brightness.  And yes, there are plenty of options to create the proverbial cat-skin.  Anyway, I'm just learning at the moment and appreciate all the fabulous input.  +1 the Forum.
Logged

SydneyAust.
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When I had the 4-LED test going - running each off a PWM pin, and they were nice and bright.

Now I have made up a 5x5 LED grid which cycles through 5 digital pins switching a transistor to ground each group of [5 LEDs working off a PWM-pin each].  The brightness is pretty low even with the PWM on max (255), but you can see the software generated LED-patterns easily.  But I think going to a 5x5 multiplex cycle will be too faint and flickery.

What I am thinking of doing is a bit of destructive LED-testing.  I'm not sure of the LED specs, but if I reduce the resistor value (now 110ohm) of the PWM pins, the LED would be brighter and since it is only operating for one or two miliseconds per cycle, it might tolerate more input voltage. 

I'm sure this would only damage the LED and not the Arduino.   (yes?)
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 438
Posts: 23718
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"I'm sure this would only damage the LED and not the Arduino.   (yes?)"

Taking your chances:

"Stresses beyond those listed under “Absolute
Maximum Ratings”  [40mA per IO pin]
may cause permanent damage
to the device.  This is a stress rating only and
functional operation of the device at these or
other conditions beyond those indicated in the
operational sections of this specification is not
implied. Exposure to absolute maximum rating
conditions for extended periods may affect
device reliability."
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

SydneyAust.
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for that.

I ran the circuit with no resistor for a few seconds - it made absolutely no difference to the brightness.  So I put the 110ohm back.

What I did was look at the code.  I realised I was turning off the anodes then doing some calculations and setting the cathodes before turning the anodes back on.  I optimised the code to now do all the calculations, then change all the outputs consecutively.  It is a lot better.

Only thing is now, the top row (cathode row-0) shows when row-4 is lit.  I will have to check the code-loops again in detail to check that the anodes clear in that for-loop.

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 438
Posts: 23718
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There you go - fixing the code to leave the LEDs on as long as possible before turning off & turning the next one on.
Simple concept, yet many do not grasp the consequences or how to implement it.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

SydneyAust.
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Fixed that glitch now.  It was to do with setting LOW to the previous row at the restart of the for-loop.   I just made a new loop to clear them all each row-cycle immediately prior the update.

The pattern is working nicely on the 5x5 square.  Now I'm thinking of connecting the IR 2D120X to adjust some parameters - just to learn how that works.

The eventual cube will be bright enough to see because presently the brightness is sufficient with PWM(50/255).  Not 'bright' but plenty to see the pattern moving around. 

Logged

SydneyAust.
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Forum,
Just an update ..

Got some thin MDF (wood) to mount the project.  Got that all drilled ready to put the 25 leads through and have the controller and arduino on the back.  I'll have little rubber feet to create some space under it.  The controller-board and wiring and electronics will still visible when it is turned over.  I got some ribbon cable and mini connector plugs.

I got a bread-board with holes and coppered rows on the back and made up a transistor controller-board grid.  I had all the transistors soldered in with some resistors ready to connect up.

Then I realised I needed to break some of the copper rows to get the correct circuit.

So after doing about 100 perfect NASA-quality solders, I had to drill the copper - so I used my power drill as carefully as I could.  But unfortunately, the components on the other side didn't think it was careful enough because several transistor-legs got a bit mangled.

Note to self: drill first, solder second.

Anyway, I got a new board and some more 2N2222A's and will have another go.  But first I will plan the thing fully and get the board fully ready before soldering.  I will be using ribbon cables and some mini-plugs to connect the cube because I will be making a better cube with bright blue LEDs later.  My yellow-LED cube looks pretty cool all soldered up, ready for mounting... after realigning the LEDs a little.

I will need to connect 30 outputs from the controller-board to the 25 grid-points and the 5 planes on the LED-cube.  Then connect the 15 outputs from the arduino to the controller board (5 planes, 5 x-points, 5 y-points).  Hmm 45 connections.. this is going to be interesting.

I only had a little bit of time this weekend, apparently Mothers Day takes priority.

More later.

Logged

SydneyAust.
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

All building is done now.

I have made up a controller board to manage the multiplexing.  The circuit is as per CrossRoad's design of 25 transistors with 5 more running the power to ground.  This has connector-plugs to the LED cube and to the Arduino using ribbon cable.

But now I need help with addressing the output pins A1 to A5.

What I have so far:  (Nothing lights up)
Code:

int xPin[] = {
  3,5,6,10,11  };

int zPin[] = {
  2,4,7,8,12  };   

int x;
int z;

void setup()
{
pinMode(A1, OUTPUT);
pinMode(A2, OUTPUT);
pinMode(A3, OUTPUT);
pinMode(A4, OUTPUT);
pinMode(A5, OUTPUT);
}

void loop()
{
 
digitalWrite(A1, HIGH);

analogWrite(xPin[1], 255);

digitalWrite(zPin[1], HIGH);  // Turn LED ON

delay(500);

digitalWrite(A1, LOW);

analogWrite(xPin[1], 0);

digitalWrite(zPin[1], LOW);  // Turn LED OFF

delay(500);

}
Logged

SydneyAust.
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have got some lights working now, but not as expected. 

I'll go over the wiring with a multimeter tomorrow and do some troubleshooting.

But I'm still not sure if I'm addressing the A1 to A5 pin outputs correctly.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 438
Posts: 23718
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A0-A5 are digital pins D14 thru D19.
Use them that way, makes the coding easier.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

SydneyAust.
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, that D14-19 will help a lot.

Trouble is, with the code below, I get incomplete vertical planes of LEDs coming on sequentially instead of individual lights, and the last plane never lights up.  In the first cycle, horisontal-plane 1 is OFF, in the next cycle horisontal-plane two is OFF etc.  So I'm wondering if the code is wrong - or maybe I have a fundamental wiring error.

There are so many sources of error it's hard to figure.  I'll have to look at my soldering for bridging.  Also check the board drill holes for any errant residual copper.  The solders appear to have good flow and minimal excess, but this is making me think I need better glasses.  I had to mount the transistors on adjacent rails to fit it all on the ~30x34 hole board.

Also, the LED grid itself might have some bad solders.. there were some dry joints that failed while I was setting the LED framework into the support-base which I re-soldered, but there could even be some LED leg shorts too. 

Code:

int xPin[] = {
  3,5,6,10,11  };  //PWM Pins to bases (multiplex grid)
                  //(Should have PWM running to anode planes - will change later)

int yPin[] = {
  2,4,7,8,12  };   // Bases of grounding transistors (multiplex grid)

int zPin[] = {
  15,16,17,18,19  };  //+5V to LED anode planes via R150

int x;
int y;
int z;

void setup()
{
  for (y=0; y<5; y++){
    pinMode(yPin[y], OUTPUT);
  }
  for (z=0; z<5; z++){
    pinMode(zPin[z], OUTPUT);
  }
}

void loop()
{
  for ( int z = 0; z < 5; z++){
   for ( int y = 0; y < 5; y++){
    for ( int x = 0; x < 5; x++){
      analogWrite(xPin[x], 0);   //Initialisation Loop everything is OFF
      digitalWrite(yPin[y], LOW);
      digitalWrite(zPin[z], LOW);
    }
   }
  }
 
  for ( int z = 0; z < 5; z++){
   for ( int y = 0; y < 5; y++){
    for ( int x = 0; x < 5; x++){ //Loop through each LED in sequence

      analogWrite(xPin[x], 255);
      digitalWrite(yPin[y], HIGH);
      digitalWrite(zPin[z], HIGH);  // Turn LED ON
      delay(200);

      analogWrite(xPin[x], 0);
      digitalWrite(yPin[y], LOW);
      digitalWrite(zPin[z], LOW);  // Turn LED OFF
      delay(500);

    }
  }
}
}


Logged

SydneyAust.
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had a good look at the board under a microscope at work, and the solders are great.  I removed some residual copper from the drill-holes that may have been shorting.  Also two of the HM3410 header plugs had a loose wire.  But the embarrassing bit is, I left out the wiring to bridge the emitters in the transistor grid   smiley-red
I might have to solder that on the back of the board - 20 jumpers.

So I have no idea how the LEDs were getting any power at all.

More later...
Logged

SydneyAust.
Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Added the jumpers to join the emitters in the multiplex grid, fixed the plug leads, swapped the PWM pins onto the anode planes.  Now nothing works.  

Could I have cooked the transistors by over-soldering?  They look OK and have about 5mm of leg-length.

This is becoming quite a mystery.
Logged

Pages: 1 [2]   Go Up
Jump to: