Go Down

Topic: powering a high power led matrix with arduino (Read 5546 times) previous topic - next topic

josh97531

I am going to make the led matrix circuit on the Arduino playground here http://arduino.cc/playground/Main/DirectDriveLEDMatrix
I am going to make it in to a 8x8 led matrix table with high power led's if I did this would I need transistors if so how would I arrange them. the led's I am going to use have a forward current of 35ma and a forward voltage of 3.4v 

focalist

#1
Feb 06, 2012, 07:04 pm Last Edit: Feb 06, 2012, 07:10 pm by focalist Reason: 1
I am a huge fan of ULN2003.  It's a chip with seven Darlington pairs per 16 pin chip, and each pair can switch 30v@500ma.

They can be bought for pennies, and even have the base resistor built in, so you just directly connect the input of the ULN2003 to a digital output and you are good to go.  They even have a surge supress diode built in, so you can use them with inductive loads like motors... I use them for almost everything, from LED's to steppers..

It's NPN, so you will be sinking the current, perfect for what you want.  Seven pairs per chip, so you would need ten ULN2003 for the 8x8 (64 outputs).  I happened to buy ten just the other day, think it totalled like four or five dollars for the lot of them.  If you order from overseas, you can get them for half that.

They are easy, cheap, and versatile... several manufacturers make them.  Just order the ones for TTL logic, they are "ULN2003A", the other letters are for working with CMOS and other voltage levels.  For our purposes, 5v logic TTL levels are perfect.


Grumpy_Mike

Quote
I am going to make the led matrix circuit on the Arduino playground here http://arduino.cc/playground/Main/DirectDriveLEDMatrix

Very bad circuit, it has no current limiting resistors, it will damage your arduino.

Quote
I am going to make it in to a 8x8 led matrix table with high power led's

OK how high powered?

Quote
going to use have a forward current of 35ma

Ah not so high powered then, these are considered low powered LEDs.

The ULN2003 is a good chip but while this is strictly true
Quote
each pair can switch 30v@500ma.

You can't switch then all at that current at the same time. The total switched on at any one time is about 650mA.

However in addition to this chip you would also need current limiting resistors, in line with each output.
For an example of what you need for a matrix see:-
http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html

CrossRoads

What you can do is have 8 outputs going thru current limit resistors to the 8 anode pins (the columns),
and then 8 more outputs going to ULN2803 (8 drivers, ULN2003 only has 7) to drive each row pin.
To work the display, you drive the anodes with a row of data, drive the cathode low by writing a 1 to the ULN2803 pin for that row. Then 0 to turn it off.
Write the next row of anodes, turn on the next cathode driver, and back off.  Repeat 6 more times.

The arduino is thus outputting current to only drive 1 LED, while the ULN2803 sinks the current for up to 8 LEDs (280mA) one row at a time.

Or you could drive 1 anode and sink its cathode, drive the next anode and sink its cathode, skip the ULN2803. Requires a lot more cycles to go thru all 64 positions that way, vs going thru 8 rows.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

josh97531


What you can do is have 8 outputs going thru current limit resistors to the 8 anode pins (the columns),
and then 8 more outputs going to ULN2803 (8 drivers, ULN2003 only has 7) to drive each row pin.
To work the display, you drive the anodes with a row of data, drive the cathode low by writing a 1 to the ULN2803 pin for that row. Then 0 to turn it off.
Write the next row of anodes, turn on the next cathode driver, and back off.  Repeat 6 more times.


could i still use the same code that is on the website http://arduino.cc/playground/Main/DirectDriveLEDMatrix

CrossRoads

No, you'd have to change this part from driving 1 anode at a time, to driving all 8, if I understand what is going on, and I may not:
Code: [Select]

// Interrupt routine
void display() {
  digitalWrite(cols[col], LOW);  // Turn whole previous column off
  col++;
  if (col == 8) {
    col = 0;
  }
  for (int row = 0; row < 8; row++) {
    if (leds[col][7 - row] == 1) {
      digitalWrite(rows[row], LOW);  // Turn on this led
    }
    else {
      digitalWrite(rows[row], HIGH); // Turn off this led
    }
  }
  digitalWrite(cols[col], HIGH); // Turn whole column on at once (for equal lighting times)
}
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

josh97531

is it passible to use transistors without changing the code as i am not very good at code

Grumpy_Mike

No, the whole point about a micro controller is that it is defined by the code.
Quote
i am not very good at code

You will get no better by trying to ignore it, code will not go away, start to learn.


Grumpy_Mike

Quote
but is it possible

What part of that reply:-
Quote
No, .....

Did you not understand?

Go Up