What kind of LED must I buy??
I found a lot but several seem to have a blinking circuit (I don't need that,I'll control it with max/msp probably... via serial or other way)
Well, im quite the noob myself, but i plan to control 4 TLC5940 LED Drivers thru max/msp, and that way have 64 LED:s under my command. All thru serial programming, i still havent really figure out how to access the different drivers etc. though.. But thats a tip for you anyway, the TLC5940 can have 16 induvidual channels for LED:s.
are my 50 RGB Led's = 50*3 Leds ??
Any advice to control RGB Leds? I mean, I found a lot of different RGB Leds. Have you pre-requisites in order to make me controlling all R, G & B channel? I only want to have around 4 or 5 colors... no more.
The MAX7219 is a popular choice for driving up to 64 LEDs.
Assuming your RGB LEDs are actually 3-LEDs-in-one, with 4 legs, then 3 x MAX7219 would do the trick
(one 7219 for Red, one for Green, one for Blue).
150 LEDs switched on simultaneously is going to use a lot of current though. In the worst case (all directly connected to the supply) 150 of them @20mA is 3 Amps! The 7219 time-multiplexes them very quickly though, so you don't see them flicker, but even then with all 64 LEDs on the datasheet says it draws 330mA. So you should supply at least 1A to your circuit overall.
Code and tutorial here Arduino Playground - Max7219 plus plenty of others around the web. You need to make sure you initialise all the registers properly in your code before you do anything else. I also recommend putting a 10k pull-down resistor on each of the 3 inputs to the chip.
Some further reading (based on basic stamp but the principles are transferrable):
Alternatively if you feel like spending US$650 (or can negotiate bulk discount) you could use 50 BlinkM's communicating via two-wire interface. This would be super-easy to wire up: just an arduino, the BlinkMs and some wire. Sparkfun have them BlinkM - I2C Controlled RGB LED - COM-08579 - SparkFun Electronics
I need to know if I'm right:
with this tip, I can drive 64 monochrome LED with one max7219.
For 64 RGB LEDs, I need 3 max7219.
Conceptually, if I want to make one led of the matrix :
blinking in red or b or g
change from red to blue
etc
will it be possible??
I guess I'll have to code a function that "convert" data from max/msp in data understandable by the Arduino (or wiring) board.
The maxduino (a really good patch imo) seems to do most of the basics, but im not sure how i will have to edit it for work with registers, perhaps a combo of the "three_595s patch" and the maxduino would work.
It has 4 legs, one is common and the other 3 are for red, green and blue. So it's effectively 3 LEDs in one package. If you want red, you turn on the red and turn off green & blue. Same for G or B. Magenta is R+B, Cyan is G+B, white is R+G+B, and so on.
With the MAX7219 you can turn individual LEDs on or off. Or you can vary the brightness of all of them at the same time. You wouldn't be able to vary the brightness of individual LEDs (unless you went for the the expensive BlinkM option).
Changing from red to blue just means turning off the red LED and turning on the blue one - which is controlled by a separate 7219. So you would have to send commands to each chip.
Blinking LEDs would be done by turning them off and on in the arduino's software, using its timing functions.
I guess I'll have to code a function that "convert" data from max/msp in data understandable by the Arduino (or wiring) board.
You haven't said what configuration your LEDs will be in, but since there are 50 I'm assuming it's not a matrix. (the 7219 often drives an 8x8 matrix.)
Nevertheless you might find it helpful to represent the LEDs in each display as binary numbers, where a 0 in the number means off and 1 means on. This is known as a bitmap. You could have 3 x 50-bit binary numbers to represent your whole display. Since 50 bits takes up 4 bytes anyway, in practice you would have 3 x 64-bit numbers, which you can send from Max/MSP to the arduino through Max's serial object. Then read in the numbers on the arduino using Serial.read() and send the relevant commands to the 7219.
It has 4 legs, one is common and the other 3 are for red, green and blue. So it's effectively 3 LEDs in one package. If you want red, you turn on the red and turn off green & blue. Same for G or B. Magenta is R+B, Cyan is G+B, white is R+G+B, and so on.
yes, I understand.
additive color building.
With the MAX7219 you can turn individual LEDs on or off. Or you can vary the brightness of all of them at the same time. You wouldn't be able to vary the brightness of individual LEDs (unless you went for the the expensive BlinkM option).
Changing from red to blue just means turning off the red LED and turning on the blue one - which is controlled by a separate 7219. So you would have to send commands to each chip.
Blinking LEDs would be done by turning them off and on in the arduino's software, using its timing functions.
ok
If I understand correctly, I have to "build" functions in Wiring AND in Max/MSP in order to make a "protocol"
I mean "own protocol"= I send 001000 from max, The board understand led1off..... ledn On etc
You haven't said what configuration your LEDs will be in, but since there are 50 I'm assuming it's not a matrix. (the 7219 often drives an 8x8 matrix.)
Nevertheless you might find it helpful to represent the LEDs in each display as binary numbers, where a 0 in the number means off and 1 means on. This is known as a bitmap. You could have 3 x 50-bit binary numbers to represent your whole display. Since 50 bits takes up 4 bytes anyway, in practice you would have 3 x 64-bit numbers, which you can send from Max/MSP to the arduino through Max's serial object. Then read in the numbers on the arduino using Serial.read() and send the relevant commands to the 7219.
ok.
I understand these concepts.
The project can be that:
I could remove the last line. not sure.
btw, there is a matrix of 8x6 (or 8x5 as I wrote above)
the other leds should receive other kind of information.
But I guess they may be involved in the same matrix for easiest process.
the source of led information will be make in Max/MSP. (I guess... ?!)
Hope this is starting to make sense!
it definitively starts to make sense!
I have to thank you very much.
But......... as usual in this kind of question, I have other questions ....
How could I chain my 3 (or more) MAX7219 ???
I'll buy very soon all the parts (+ 3 or 4 breadboard to prototype that...)
julienb,
As we're on a similar path here (im assuming ure heading for a clip matrix for Live right?)
then you might get inspired and helped by this guy's amazing work: http://www.upwardnotnorthward.com/
Im trying to follow his line of work, just waiting for him to reveal the schematics etc.
I got my TLC5940's yesterday, and im gonna start experimenting with'em today. Those chips seem to be made for this job, just hope i can figure out how to code them right.