Arduino LED Christmas tree in one evening
This mess of wires and LEDs is actually a distant relative of the New Year tree. True, the Christmas trees are not yet aware of this, but we will not ask them.
The pursued goal is to quickly collect something New Year's-glowing from the minimum of improvised materials that everyone has.
Digging through the drawers of the table, I came across a handful of multi-colored LEDs that were “unclear why” (part of my wife’s slang) bought on eBay.
It was evening, fluffy snow fell outside the window, the fireplace comfortably warmed the fifth point ... That is, everything was arranged in order to take a soldering iron and
As a result, I managed to catch the idea of making an LED Christmas tree on Arduino by the tail.
The idea, although it was a bit tipsy, but offered me the following simple concept: to combine several LEDs in the form of a matrix and to build something a bit like a Christmas tree on a frame from a 24 AWG single-wire wire.
LEDs are connected in four groups. Each group consists of three LEDs with a common
The circuit is something like this (add resistors to your taste):
The rows go to the Arduino digital outputs, I connected the groups to the analog outputs (in theory you can also use the digital outputs, but I didn’t have the appropriate current-limiting resistors and I just decided to quickly limit the brightness to the PWM )
That is, when the row at the output 0, then you can control the LEDs in the group. When row 1 is on, the LEDs are patiently silent and wait for their turn.
PS: Only I couldn’t figure out how to carefully hang one LED (white?) In the form of a star on top. Is that just a separate hang, but the design will not be very stable. I will leave this as homework for a curious reader. Suggestions in the comments are welcome.
We will need
- The desire and time to do this nonsense
- A handful of LEDs (I used 5 mm LEDs in different colors - 3 red, 3 yellow, 3 blue and 3 green)
- Arduino or any other suitable board with a microcontroller (I use Arduino Fio since it is convenient to power it from a Lipo battery)
- Single core wire for frame
- Soldering tools
To begin with, I decided to process the LEDs with sandpaper, because I would like them to scatter the light a bit:
Fotik is old, his hands are shaking, the horizon is littered - unfortunately, this was reflected in all the photos. But I hope that the process has been transferred.
I began the assembly itself with the formation and soldering of individual rows.
The bottom row has a side of about 60mm, the middle row is about 50mm, and the top is about 30mm.
Separately assembled three rows look like this:
We solder the first chain of LEDs and there, thereby forming our "Christmas tree type":
Further it is easier. Here the second chain of LEDs has already been soldered (photo with a distant relative):
Thus, we solder the remaining LED chains to the frame.
Verification and code
I checked on the Arduino Mega2560, since it is the only Arduino board, which has agreed to this dangerous experiment (the rest somewhere in hiding when they heard that I decided to stir up):
The code can be downloaded from Github'e: github.com/nochkin/ardutree
Himself the code, of course, does not claim to be genius, but I tried to simplify it as I could, so that it would be easier for others to modify it.
There you can set your own programs and sequences.
After debugging and checking, I transferred all this disgrace to the Arduino Fio with Lipo battery in order to give some kind of completeness and mobility of the design:
Happy Patients Happy New Year!