Go Down

Topic: 48 Individually controlled LEDs to create a blinking starry background (Read 1 time) previous topic - next topic

pfulda

Hello Community,  first I am very new to arduino and have a task to create a starry background for a marching band prop.  I need a way to control a bunch of LEDs (48 or more) individually.  Some LEDs will have different blinking rates, while others will be just on with various brightness.  I was thinking of using an Arduino Mega controller to do this since it has a lot of digital outputs.  I am not an electronics expert at all so need help in how I would design this from power to all components (resistors, transistors, etc).  These are the LED lights I was thinking about using

https://www.ledsupply.com/leds/5mm-led-warm-white-50-degree-viewing-angle

Any and all help would be greatly appreciated as well as any other ideas that might be better to create this effect.

Thanks,
Paul

Something like a MAX7219 could do it easily together with a Arduino Nano. It can handle a array of 8x8 leds without any extra resistors or transistors, the Arduino then uploads a 8 byte bitmask to turn the individual leds on. You can upload a new bitmask many times each second to make blinking leds.
It do not have individual brightness control only a global one, with a optimized transfer you might be able to do a few brightness levels with PWM (A single MAX7219 can be updated in less than 0.001second or 1ms).

pfulda

Thanks HKJ-lygte!  So can you point me to how I would wire this up?

The idea is to make a matrix, this could also be done directly from a Arduino, but the MAX7219 can deliver much more current, i.e. ma the leds brighter:



You can also get kits, the are designed for 8x8 led modules, but with a kit you do not have to mount it, but can instead connect wires to your own leds:



It needs a 3 wire connection to the Arduino, in addition to GND and power.

Paul__B

OK, start by getting - I suggest two or three - of these module kits:

I would be suggesting you assemble one with the matrix provided so you can test your "star" coding.

Then you assemble (wire) your LEDs in a matrix so they correspond to the module.

So you can use another module kit - not soldering in the header sockets for the matrix itself but soldering the wires from your own array instead.

Note that for 48 LEDs, you use only the first six "column" (cathode) drive lines and set the Scan-Limit in the MAX7219 to 5.

Using the MAX7219 means that at each step of your "twinkle" you just code to set five bytes with the pattern you want to show on the LEDs, and write those five bytes to the MAX7219.

(You can use the kit HKJ-lygte cites, but it is somewhat obsolete, this one is actually cheaper!)


pfulda

Paul__B,HKJ-lygte
After looking at this one important part I forgot to say is the lights will be placed on a 16 feet by 6 feet board.  It would be a lot of work to wire this matrix up.  Is there a way to use the leds, resistors, and transistors to achieve less wiring.  I would still have 48 "+" wires and 48 ground wires. 

I am not sure you will get less wiring do it any other way, but another solution is a IO expander (PCF8574).
Each device can handle 8 leds and you can chain 8 devices. Again 64 leds, but this time with 8 chips.
The PCF8574 works best pulling low, i.e. the LEDs is connected to 5V and a series resistor to a PCF8574 output pin.

Another chip is the PCA9685, it can handle 16 channels with PWM, i.e. variable brightness and 16 leds. It also is best at pulling low.

pfulda

HKJ-lygte, ok, let me look into this.  Might have more questions for you.

noiasca

It would be a lot of work to wire this matrix up.  Is there a way to use the leds, resistors, and transistors to achieve less wiring.
google for WS2811, WS2812 LED Strips. They come in different LED's per meter. Each LED adressable. Yes they come with RGB, but you can use just one color also ;-)

http://s.click.aliexpress.com/e/nip7ILni
DE: Wie man Fragen postet:
1. was hat man (Sketch und Hardware)
2. was SOLL es machen
3. was macht es: IST (Fehlverhalten, Fehlermeldungen, Serial.Output ...)
4. Eine Frage stellen bzw. erklären was man erwartet


They are very useful, but you have to be careful with the distance between each and you also need a decoupling capacitor for each LED. A RGB led is not white when you turn all leds on, but it do probably not matter here.
If they work at the distances required here (Distance is between each led, not the total), they may be the easiest solution.
You can get small circuit boards with one led a decoupling capacitor and solder pads. You can also get them in round versions (Search PL9823, APA106), but some Ebay sellers will just ship ordinary RGB leds instead!

david_2018

Some other considerations when using the WS2811/WS2812b/etc LEDs is that to get a white color, you will actually be using three LEDs (red/green/blue), so the current requirements will be higher than for a single LED.  At maximum brightness, with 20mA per LED, that will be 2.88 amps at 5 volts.  Typically power and ground need to be fed into the LED wiring at multiple points to prevent voltage drops.

You can get an RGBW version, which has an additional white LED, but that is probably a bit too much for this project.

The LED strips would be fairly easy to use, they include the decoupling capacitor for each pixel, and are made so they can be cut apart between LEDs, with copper pads at the joint to solder wires to.

You mentioned having some of the lights blinking at different rates - what would the fastest rate of blinking be?

DrAzzy

What about a string of WS2811 LEDs, the kind that look like bulky christmas lights, with the wire chopped and spliced where needed (so if some of the "stars" are close together, you wouldn't need to cut/splice)?

Making a wall-sized piece of electronic art is almost by definition going to include a lot of wiring >.>
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Paul__B

After looking at this one important part I forgot to say is the lights will be placed on a 16 feet by 6 feet board.  It would be a lot of work to wire this matrix up.  Is there a way to use the LEDs, resistors, and transistors to achieve less wiring.  I would still have 48 "+" wires and 48 ground wires.  
And that is exactly why you want to wire it up as a matrix.  For a 6 by 8 matrix, no more than 14 wires need to go to any part of the matrix and for example, seven wires to a group or area of twelve.  Much less wire involved.

Using "NeoPixels" (WS2812) would be a lot more difficult due to the need to "chain" the data wire - always along with the 5 V and ground wire as they cannot be separated - from one LED to the next.  You encounter the "shortest path" problem.   As well as the need to ensure you do not lose too much voltage along the wiring to ensure colour consistency and purity.  The only advantage would be the ability to control individual brightness,

Go Up