Pages: [1]   Go Down
Author Topic: 100 RGB-LEDs controlled with arduino and MAX/MSP  (Read 3300 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey all!

I'm currently doing an university project, which incorporates 100 RGB-LEDS, audio output, arduino and MAX/MSP to control. I don't have much experience with using RGB-LEDs, so in fear of messing things up I've come to this forum.

The basic idea is to make box like this one:

which is basically 5 of these infinity mirrors put together: http://www.instructables.com/id/cool-DIY-infinite-LED-tunnel/

My question is: how do I make something similar but with RGB-LEDs that I can control through the arduino + MAX/MSP combo? I've got one RGB-LED to run without any problems (I can even control the color fra MAX/MSP without any problems), but how would I go about making a setup that handles 100 RGB-LEDs? I probably need another power supply from the Arduino, but can I get enough juice out of normal batteries?

Any schematics would be awesome smiley
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

what are you studying in uni
surely you can calculate current draw?
it should say on the data sheet you just have to do some adding
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 635
Posts: 34574
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You need a driver like a TLC5940. To save money multiplex it like in this project:-
http://www.thebox.myzen.co.uk/Hardware/Mini_Monome.html
By chaining three together you can get 64 LEDs controlled, so double it up to six for your 128 LEDs.

Quote
surely you can calculate current draw?
He is not asking about current draw but how to drive it.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I study digital design at Aarhus Uni. I don't know much about volt, amps, ohms, voltage drop transistors etc..

As I've said I can easily control one LED and it's colors through the PWM ports. But I don't really know how to set up a parallel array of this many RGB LEDs :/ These are the LEDs that I'm working with: http://translate.google.com/translate?js=n&prev=_t&hl=da&ie=UTF-8&layout=2&eotf=1&sl=da&tl=en&u=http%3A%2F%2Felektronik-lavpris.dk%2Fproduct_info.php%3Fproducts_id%3D94654

It doesn't say anything about the amp of the LEDs (does it matter?) but after some researching I've come to the conclusion that they're probably 20mA :/ I'm basically looking for some really basic help here - I would like to think that this project wouldn't be that hard if I had the right experience with basic electronics.

I'll check out the link, thanks!

Grumpy_Mike: the setup seems to be a bit too complex :/ Can't it be done any simpler? The Mini Monome setup seems to require that the user can control each LED individually?
« Last Edit: May 10, 2011, 05:48:28 am by decon89 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh and by the way, I don't need to be able to control each and every RGB LED individually. It would be alright just to able to control the color of the whole setup.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 635
Posts: 34574
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

In which case simply attach a transistor to a PWM output and drive all the LEDs of one colour in parallel. Each LED needs it's own current limiting resistor.

See the schematics here:- http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1288991886

Do this three times one for each colour. Make sure the transistor can handle the current from all the LEDs.
Note not all pins are capable of PWM output, see the data sheet for your arduino.
« Last Edit: May 10, 2011, 07:55:46 am by Grumpy_Mike » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've got two of these power supplies:
http://i.imgur.com/0TUAO.jpg

According to the thread that you link to, then I only need one resistor right after the power supply? And if that's true, then I would need a 10 ohms resistor if I set the Supply Voltage to 12V/4 Amp (I've used this calc http://www.hebeiltd.com.cn/?p=zz.led.resistor.calculator with the desired LED current set to 20, and the "leds connected" to 60).

Am I missing something? Also is it possible to power all the 100 LEDS through just one power supply or do I need to split it up?

Edit: I've got 3 IRF520 MOSFET transistors
« Last Edit: May 11, 2011, 04:07:59 pm by decon89 » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 635
Posts: 34574
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
According to the thread that you link to, then I only need one resistor right after the power supply?
No what makes you think that?
you set the supply voltage then you work out the current you do not set the output current, that is determined by the load you put on it.
If LEDs are in series you need only one resistor, but at 12v there is a limit to the number you can have because each one of them drops about 2v. So six in series is the maximum. BUT as you have RGB LEDs you can't connect them in series so it has to be parallel.
You can supply anything with one supply providing it has enough current capacity.
With 4 amps and 20mA per LED then you can power 4 / 0.02 = 200 LEDs
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Aaah I'm sorry. I got confused since Richard Crowley also got the parallel/serial thing wrong.

I've also found this guide (http://www.ladyada.net/products/rgbledstrip/), which uses RGB LED strips instead of just RGB LEDs. I figure it's pretty much the same thing? One segment of the strip is equal to one of my RGB LED diodes?

Also, does this mean that with the transistor that I've got (datasheet: http://www.datasheetcatalog.org/datasheet/fairchild/IRF520.pdf 9,2A, 100V), I don't need resistors for every LED? (I base this on the ladyada guide).

I've tried to do some Mspaint modding, does this look anywhere near correct? I find it quite hard to get my head around the "no-grund issue" with RGB leds.
http://i.imgur.com/TNtqi.png

Thanks for your patience and help smiley If I could I would buy you a beer! I'm quite tired, if I seem slow in figuring this out.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 635
Posts: 34574
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The RGB strips already have the resistors in line with each series of LEDs so there is no need to add any more to limit the LED current.

However, you do need a resistor of 100 ohms or so in line with the gate of the FET to protect the arduino's output.

The TNtqi.png drawing shows just an RGB LED and these DO need a series resistor in each cathode of the LED. Driving just the one LED from 12V is a bit of a waste, you might as well drop this to to 5V. You can't connect common anode RGB LEDs in series to make use of the 12V. On the RGB strip each colour of LED is a separate with access to both anode and cathode, allowing them to connect in series and have one resistor for every three LEDs.   
Logged

Offline Offline
Edison Member
*
Karma: 19
Posts: 1041
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First of all, think of the LEDs as three completely separate LEDs that are only joined in physical characteristics, and have their grounds tied together for you.

So now you want to find out what kind of power supply you need. Every diode has a certain "voltage drop" which is pretty much constant for each diode, unlike a resistor which has its voltage drop vary with the amount of current (E=IR). You can find the voltage drop on the datasheet for the LEDs. It may be different for each different color. While you're there, find the recommended current that you can put through the LED. Let's say the voltage drop is 3V and the maximum current draw is 20mA. If you have a large, 12V power supply, that means you need to lose 9V with a resistor in line (you may want to consider something like a 5V power supply at this point, so that you don't use so much power). So, since each LED is in a series circuit with the resistor, the current is constant. That means you want to have 20mA go through your resistor as well. So now we have a voltage (9V) and a current (20mA) so we can apply ohms law to get resistance.

9V = .02A * R means that R = 450 ohms. That's the value of the resistor you want to put in series with each different LED.

The way you wire up the LEDs is simple. You take your power supply and wire three wires to it. Those three wires go to three different MOSFETs or other transistors (make sure they're rated for 12V and .02*300 = 6A). The base is connected to an arduino PWM pin with a 1k ohm resistor. The other side goes to all of the blue, red, or green legs of the LEDs in parallel, with a resistor in series with each (so 300 resistors). The other leg goes to ground. (this is assuming you have a common anode LED).

I know that's probably more than you need, but I hope that some of that will help you.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 635
Posts: 34574
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but I hope that some of that will help you
It would help if. You posted correct information.
You described a common cathode LED which while they exist are not at all that common. The LED you come across most of the time is a common anode type.
Next you describe the wiring up of a FET incorrectly. You don't put the load in the source it should be in the drain, a FET has not got a base it has a gate, the gate resistor should not be 1K but 100R.
Have you ever come across a FET that is not rated to take 12 volts?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

With your help and a little trail and error, we've built our first LED frame (got 20 RGB LEDs). We're able to control the color through some MAX/MSP that we've written. Our problem is getting to fully understand how many/much resistance we need in our system.

http://i.imgur.com/BCxu3.png
http://i.imgur.com/KDkOx.jpg
http://i.imgur.com/jtF15.jpg

As I posted earlier, we'll be using 2 x 12v/4 amp Power Supply. When we try to figure out the resistance for each LED using this calculator http://www.hebeiltd.com.cn/?p=zz.led.resistor.calculator but we're not sure if we're doing it right.

Supply Voltage
12 VOLTS
Voltage Drop Across LED
0.3 VOLTS (randomly chosen value, I don't know the exact wire properties)
Desired LED Current
0.60  MILLIAMPS (when the led outputs white)
How many leds connected
50

The calculator gives the result of 4.7 ohm, but according to our own tests (which again is just trial and error).

At each RGB LED we have been testing out 47 ohm and 100 ohm. We don't have any real calculations on why exactly we use 47 and 100 ohm, we've just tried it through trial and error. The 47 ohm resistance does get extremely hot though, whereas the 100 ohm just gets warm. The light output is as good with 100 ohm as it is with 47 ohm, though the 100 ohm setup does seem to give us more stability.

How do we calculate the correct resistance? What are we missing?
Does the total watt of the system influence which resistors we should choose?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 635
Posts: 34574
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
0.3 VOLTS (randomly chosen value, I don't know the exact wire properties)

You need to see the LED data sheet but it is approximately 1.9V for a RED, 2.4V to 3.3V for green or blue and 4.1V for a white LED. So with RGB LEDs each colour will require a different value to get the same current. Then you need to see what light output each current gives and scale the currents so the light output is the same.

Quote
The light output is as good with 100 ohm as it is with 47 ohm
So use the 100R as that uses less current in the LEDs, for as you say not much different light output.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
You need to see the LED data sheet but it is approximately 1.9V for a RED, 2.4V to 3.3V for green or blue and 4.1V for a white LED. So with RGB LEDs each colour will require a different value to get the same current. Then you need to see what light output each current gives and scale the currents so the light output is the same.
So we need a resistor for each color :S? If you look at the pictures in my last post, then we only use a resistor for the anode (cathode?). It works without any resistor for the colors so far. I don't have any datasheet on the LEDs (which is a huge problem)

Quote
The light output is as good with 100 ohm as it is with 47 ohm
So use the 100R as that uses less current in the LEDs, for as you say not much different light output.[/quote]
Okay great, but couldn't we get a more precise ohm number by using some math?

Sorry if there's something I'm missing. We're pretty much on the lowest level of knowledge when it comes to el the theory of electronics.
Logged

Pages: [1]   Go Up
Jump to: