Xmas LED Wreath

For the last 2 years I've been getting in to making LED displays using Arduino. I get how to use the outputs as on/offs and literally have to write thousands (lots of copy/paste) of lines of code to do the sequences i want as i have been unable to understand how to multiplex or write more complex (and probably a lot shorter) code to do what i want. As an example, i have attached some pictures, and the code i used to make an Xmas tree last year. The strings of 'garland' LEDs on the tree turn on/off in order, at such a rate that it creates the marquee/moving light effect. there are some other patterns too, where like one string of green turns on, then the next and next, then same with the red and the white, then they will all stay on for a minute, turn off, and start all over. I would attach a video, but it doesn't appear i can.

The problems i'm running in to are, of course, qty of outputs and the code. For the xmas tree i used both a standard Arduino and an arduino Nano, the nano controls the star. Each row of lights on the tree are 3 circuits, one for red, one green, one white. 15 total circuits for the tree. the star is split in to 19 circuits. There have been times i wanted to be able to do other sequences, but run out of outputs, even using a Mega. Also, for running so many LEDs i have created 'switch boards' using 2n2222 transistors, to act as switches to draw power from a separate power supply. I included a picture of one that i just recently designed and had made by JLCPCB. The one in the tree is hand made.

My current project is to make a wreath with 1/8" plywood, which has green LEDs bordering the outside of the wreath and the inner hole, then have strings of LEDs acting as garland wrapping the wreath, similar to the garland look on the tree, and a big bow on top, i've also included pictures of the bow so far. In between the strings of garland LEDs i then plan on having some ornaments, which too have a series of LEDs, turning on/off in some sequences, each controlled by individual Nano's, as i would need upwards of 150 outputs to control everything with one controller and writing the simple on/off code that i know how to do would take forever trying to sequence so many different things at once.

Sorry this is such a long post. Does it make sense? does anyone have any suggestions as a better way to do what i want? it doesn't seem like anyone makes displays like these, so of all the searching I've done i can't find any example projects and/or codes to attempt to modify to work for me.

Do you need any more information?

Thank you all.

Example.ino (36.7 KB)

Have you considered using strings of WS2812B LEDs, smart RGB LEDs that you control with just 1 signal line?
You can have several strings controlled by 1 processor. I'm working a project now that uses 9 strings of 32 and 33 LEDs each.

Just a couple thoughts. You could create channels of light that correspond to certain colors. So one signal can turn on and off a whole array of lights. Break it up into meaningful sections. 3 light patterns can be coded to imply motion. I like your project.






I'm wondering if an ATtiny could run a string of leds as a 1-wire device. A LOT of those could be run by an Uno much less a Mega.

CrossRoads: I have looked in to the 2812's a little, my biggest hurdle is writing the code, i simply can't understand it to be able to write it to do all the different patterns i want to do. My 36yr old brain just can't figure it out and i don't have anyone close that can sit down and go through it line by line with me. I can wire them up and use an example code to get them to work, same with multiplexing, but the code just looks like spanish to me, so editing it has been impossible so far.

Woldramore: That is kind of what i have done on the xmas tree. One string of garland consists of a red LED, then green, then white. All the greens in that row are connected together, then all the reds, and all the whites. so i can turn on each color independently, or as you mentioned having the 3 channels, i can turn them on/off to imply motion.

I will try to get a video of the tree up this evening.

Here is a video of a pumpkin i made for Halloween, showing more of the sequencing i'm looking to do on the wreath. This pumpkin uses 28 channels, 3 per element, and a couple single channel elements, like the eye pupils.

The more i think about it, until the day i can actually figure out how to understand and write more complex code, i think i'm stuck having to adapt my projects to the # of outputs on an Arduino and writing long HIGH/LOW code sequences.

Jarod,

That's pretty cool... stuff i've wanted to do but too lazy to try.... lol. My wife would love it.

I recommend reading: http://publications.gbdirect.co.uk/c_book/thecbook.pdf

I've recently started it and between naps I get aha! moments.

Also - I have limited Arduino coding access at work but looking at your codes, I would try to organize it into subroutines using functions. Then instead of just sequentially writing on off. You can trigger patterns based on whatever you want...

Multiple Arduinos is almost always a design mistake, often made by beginners.

I would suggest you look into the following chips to allow a single, small Arduino to control as many LEDs as you could wish.

Max7219. This can drive up to 64 LEDs which must be wired in an 8x8 matrix. That does not mean the LEDs must be physically arranged as a matrix, they can be however you want. You can wire as many of the chips as you like to the same 3 Arduino pins, each chip controlling up to 64 LEDs. Only one resistor is needed, plus a couple of caps, per chip.

Tpic6b595. These can drive only 8 channels per chip, but each channel can drive multiple LEDs, in parallel or in series (if you have enough voltage for that). Again, multiple chips can be connected to the same 3 Arduino pins, but you will need series resistors for each group of LEDs connected in series.

As for coding, there is an approach you could try which would allow you to code up the sequences you want in a very simple way. This method is a little like the paper rolls or chained punch-cards which were used to drive player pianos, fairground organs or jacquard looms.

Wolframore: thank you :slight_smile: I will check out that book/PDF and look up subroutines. it would be nice not to have to copy/paste so much and possibly make organizing my sequences easier?

PaulRB: I have looked in to the 7219 and 595 chips, i can wire them up no problem, it's the code that, as i mentioned, looks like Spanish to me, i just can't understand it.

You mentioned there is a simple code approach i could try, but you didn't mention what that approach is....or did i just not understand?

Thank you!

Well, I described the technique in terms of the historical machines that have used a similar control mechanism. You, as the programmer, must lay out a table of ones and zeroes, in columns, which control each channel over time. It's quite easy to control up to 64 channels like this.