Animated Led Star

by Daneasch in Circuits > LEDs

5450 Views, 57 Favorites, 0 Comments

Animated Led Star

Pacifica _1.jpg
Fire.jpg
Pacifica.jpg

Hello Again,

For this instructable I got the idea during a conversation with my brother, Hans and brother in law, Wil. Hans was playing with a Led strip, one meter long wooden strip with 144 WS2812B programmable leds on it, and Wil just really wanted to have one. So, I thought, "Time for a new project", let’s make him one.

To make this project a bit more interesting I decided to build a star shape. 8 legs, 4 long with 20 leds and 4 shorter legs for 16 leds. Powered by a wall plug of 5V 3A. and driven by an Arduino Nano, hidden away in the center of the star. O, and for the record, the cow isn't real, no cows have been hurt for this project.

Supplies

Tools:

  • Saw
  • Sandpaper
  • Drill with 5 and 2 mm bits
  • Hot glue gun
  • Solder iron
  • Pc with Arduino software

Material:

  • Led strip WS2812B 1 meter 144 led/m IP65
  • 8 Resistors , one per leg, 470 ohm.

  • Arduino Nano

  • Adapter 5V 3A with a barrel plug

  • Barrel plug female round 5,5 by 1,2mm

  • Some enamel copper wire

  • Heat shrink tube

  • Solder

  • Wood glue

  • 8 Screws 3x16mm

  • Transparent paint

  • 4 pieces of plywood 8 x 8 x 0.5 cm

  • 8 sticks of wood about 30x1,5x1,5 cm

All electronics found on Ebay or Ali, and can be bought for a total of about € 20,--

The Star

Sticks.jpg
the cross.jpg

The 8 wooden sticks were sawn at a bevel of 45 degree so the all have a point at one end. Four of about 18 cm, and four of 16cm. The first the four long ones are glued together, to make a cross and than the four short sticks are glued in the corners of the first cross so we have a double cross. On leg one I drilled a 5 mm hole halfway through, so I only need a nail to hang it on the wall.

At the back an 8 by 8 cm piece of plywood is glued and screwed, with at the rear side 2 more layers of plywood with the inside removed, to make a box. Then I cut out a cavity for the barrel plug, and made a lid of the same plywood to screw on the back. And voila, we have a box for the Arduino to live in.

The wood was all sanded down to a smooth finish and painted with transparent paint from a spray can. 3 layers, because this thing is going for outdoor use.

Electronics

ledstrips.jpg
Inside the box.jpg

Then it’s time to put on the led strips. I chose the IP65 version, with the silicone layer over the leds. because it looks much better than the one in the tube ( IP 68 ). And when cut they can easily be made waterproof. I cut the strips in 8 pieces, 4 with 20 leds, and 4 with 16 leds. All the strips begin at the same distance from the middle and about 3 cm from the center, this because I wanted all the wiring out of sight.

Right in front of the strips I drilled three holes of 2mm, 3 per strip, so a total of 24 holes, all ending inside the Nano box. 32 pieces of copper enamel wire are led through the holes and soldered to the strips. The strips have three connections, 5V+ , 0V- and data wire. All eight 5V+ are connected together and to the barrel plug center pin, and the minus from the leds all go to the barrel plug outside pin.

We also need to make to leads from the barrel plug to power the Nano board. Here I used header connectors, to be able to disconnect the power from the Nano. This because while programming, the board gets power from the USB, and power from two sides is not a very good idea, and will fry the Nano. For testing and while programming, you can connect the header turned so that only the ground pin is connected, otherwise the leds won’t lit up.

Now all there is to do is connect all the led strips middle wires through a resistor to the ports of the Nano and all the electronics is ready. I used pins 2 to 9 because these are nice in a row, and connected them to legs 1 to 8, with a piece of heat shrink around the resistor for insulation.

Below is the schematics, I just drew four of the leds per strip, so just imagine there are 16 more folowing.

The Code

Then the fun begins. Programming these strips was much fun to do. I mostly used the build in examples from the FastLed library. But because these use different setups here and there, there were some things to change. Some scripts use one array to put all the leds in and some multiple arrays. In some scripts it’s easier to control the leds within a single array, and in other it goes nicer with multiple arrays. But you can’t change the array when the program is running without using a lot of memory, and the Nano doesn’t have to much of this, so a choice had to be made. I decided to make 8 arrays, 1 per leg, which gave me the benefit it was faster, because the all the leds are close to the Nano. And it was easier to wire up. For those who would like the schematics I added a PDF below

I set myself the goal to fill up the entire memory of the Arduino, but realized that wasn’t too hard to do, it turned out I had to try hard to shrink all the code because the Arduino's memory was to small. At the end I re-flashed the bootloader to gain some extra memory space. This also has the extra benefit it makes the Arduino start instantly, and not with the normal 2 second boot delay. I won’t go in to the re flashing since it came straight from the NET. For those who are interested all can be found here:

https://github.com/Optiboot/optiboot

The program is made out of 7 segments, witch run one after the other, and to make it even more interesting the next loop has different settings for various things as brightness or color.

To get this to work the FastLed library is needed. Can be found here:

http://fastled.io/

The code is made in three files, Just make a folder in your sketches folder named "Ledstar_V2.8" and put all three files in it and you're good to go. you just have to upload "Ledstar_V2.8" and the others will follow automatically.

The Scripts:

Circle to Cylon

I managed to squeeze in 7 scripts and the variable memory was so full, the Nano became unstable. Ill discus them in the order they are played in the star.

Pacifica

Pacifica one

First sketch is Pacifica, originally made by Mark Kriegsman and Mary Corey March, which I’m sad to say, are better programmers than I will ever be. This one is in the official FastLed example library. Beautiful Ocean waves going up and down. This was for me one of the easiest scripts to insert. All I had to do is get one leg running, and write a sub to copy the output to the other legs. A way of working that proved to work good in other sketches as well.

Twinkle Fox

Twinkling fox-one

This was the last sketch I took in the program, and it took a lot of memory. Even so much I had to trim it down to be able to get it all in, so I’m afraid it’s badly mutilated. I had to strip out some of the color pallets and even had to scale down the number of leds it’s working with, but I think the result is rather nice, although I’m quite sure it doesn’t look at all like the original from Mark Kriegsman anymore, but it’s fun to watch.

Fire

Fire 2.jpg
Fire 3.jpg
Fire one

Another one of Mark, and also from the FastLed example library. It resembles burning flames flashing out of the center. I changed this one so I starts as a little fire, ever growing bigger, to a wild inferno, to at last fade away back to nothing. Like Pacifica much more beautiful coming from eight legs at once. And like Pacifica the most beautiful sketches I have.

Circle

circle-.jpg

One totally my own. A led circling up from the middle of the star, rotating faster every turn to become firework. I really liked the way this one starts. All the leds are lit by the former sketch, and turned of one by one by this one.

Cylon

Circle to Cylon
Cylon.jpg
Cylon-.jpg

This one was based on the robots from the TV show, Battlestar Galactica. The base comes from the Example set with no name. One of the most fun to take in. Here I could play with the settings of direction, color and to fade or not, and to which leg the light would go next. Really pleased with this one.

Pride

Pride 2.jpg
Pride 3.jpg
Pride 4.jpg
Pride1.jpg

A sequence of ever-changing colors traveling over the legs. And for some strange reason, I totally forgot to make pictures of this one?? Ill go by Wil's house, and make some. With the whole country in lockdown with the covid thing this was a bit of a problem, but in the end I found a gap in time.

Windmill

Windmill.jpg
Windmill

A color changing windmill which is trying to keep up with a hurricane. If it was a real one the wings would fly off.

Closing Up

dark show

When the programming was finished and everything was working as I wanted, I connected the Arduino power leads back to the barrel plug and closed the box with two screws. I secured both ends of the led strips with some hot glue, to make sure they stay fixed, and to insulate the copper wires.

I enjoyed this project so much I’m already thinking of repeating it, with a 16 leg 288 leds version, but this will need something faster than a Nano.