NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Project Help and Ideas » Music reactive grid of multicolor LEDs

March 21, 2010
by arcadefreaque
arcadefreaque's Avatar

I am looking for some good examples of code/hardware to create a 4x4, 8x8, or 16x16 grid of multicolor GB LEDs that create patterns that react to the beat of music.

I have a 4ft x 4ft section of wall opaque glass on a wall between some stereo speakers that I would like to make patterns of light that reacts to the beat of music. I would eventually like to figure out how to make the section touch sensitive so that sections touched would get brighter, but one step at a time ;) Any project help would be greatly appreciated.m

March 22, 2010
by hevans
(NerdKits Staff)

hevans's Avatar

Hi arcadefreaque,

It sounds like you have yourself a great project in mind. If you take a look at our sound meter tutorial you will see an example of using the piezzo buzzer included in your NerdKit in reverse as a sound detecting device. It should get you started in sensing the beat of the music.

Controlling RGB LEDs is not very difficult once you know what you are dealing with. They are essentially just three LEDs inside one package. You will see 4 pins, one of them is a common node (either anode or cathode) and the other 3 you turn on individually to turn on the Red green or Blue. You can control the average current through each color using PWM to make virtually any color combination.

If you do explore with RGB LEDs make sure you post your findings, I'm sure other folks would be interested.

Humberto

March 22, 2010
by Phrank916
Phrank916's Avatar

Question: Humberto, your explanation of the RGB LED got me thinking. If the LED was common anode, can you run PWM on the cathodes of the RGB to modulate them independently? How would that work? Common cathode makes sense to me, but what's the point of common anode?

Ted

March 22, 2010
by Phrank916
Phrank916's Avatar

BTW arcadefreaque,

Your project does sound awesome! It made me remember a purchasable item I saw on a website a few months ago. I tracked it down again, check this out:

motion sensitive LED grid

I honestly don't like the way this one works because you can see the delineation lines between the panels. They could easily work up the code a bit more, so that they are flashing in unison and fading in unison, to minimize that effect. Although, I don't think they are connected in any digital way. They seem to be all independent cells, just mechanically fastened together.

Ted

March 23, 2010
by hevans
(NerdKits Staff)

hevans's Avatar

Phrank916,

A common anode set of LEDs can be useful when you don't want to run the LEDs directly off the MCU. You could put the LED in series with a current limiting resistor and an n channel mosfet. You could then use the MCU to pull the cathodes low individually via the mosfet. This would be especially useful if you wanted to push more current through the LEDs than the MCU can source, of if you wanted to run the LEDs off a bigger power supply. It is just a matter of which way you would like to build your circuit.

Humberto

March 23, 2010
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Does this fit? instuctable

March 25, 2010
by arcadefreaque
arcadefreaque's Avatar

Thanks guys. Looks like I have a starting point now :)

June 23, 2011
by uml_12
uml_12's Avatar

I'm working on a similar project .. not so much controlling a grid but more so basic control of RGB leds using the two 8bit PWM timers. Pretty cool stuff. but now for the question:

I want to have access to all 256 colors but I dont want it to be random .. well eventually yes .. but I want to know the actual duty cycle values for the combination of Red, Blue and Green without having to test all the possibilities myself. Does anyone know of a table of values that could be useful ? someone that had the patience to do so themselves ?

Btw, I've been using this guide and found it to be extremely helpful for learning PWM.

http://www.ermicro.com/blog/?p=1971

Post a Reply

Please log in to post a reply.

Did you know that microcontrollers have two different kinds of memory, program space (flash) and SRAM? Learn more...