Sunday, December 15, 2013

Arduino Xmas tree Shield based on WS2812

Arduino Xmas tree Shield with WS2812

Christmas comes, and nothing more typical than riding a Christmas tree to give a bit of atmosphere. They come in many types, but this is intended for the most geeks, based on state of de art RGB LEDs and thought to 'planting' directly on an Arduino.





The scheme can not be more simple: an Arduino, 20 addressable LEDs WS2812b, few 100nF and a piezoelectric buzzer.

Arduino Xmas tree Shield with WS2812


The WS2812b are cascaded through a single wire, so that communication with Arduino is extremely simple, only one pin, the data are passed from one circuit to the next, and this enables each LED can be controlled independently. This creates strips or arrays of RGB LEDs easier than ever.
The WS2812b think without exaggeration that is a real gem. Internally includes three LEDs (R, G, B) and an integrated circuit WS2811, which is responsible for handling the data put a single pin, and send the next control each led with 256 levels of intensity.
Here you have a couple of photos I could do the above:


Arduino Xmas tree Shield with WS2812

Arduino Xmas tree Shield with WS2812



Warning! There is another version of the WS2812 equal to 6 pin WS2812b but in the power of the LEDs and the circuit are separate.
Given the boom have had, it is easy to find on ebay  in adhesive strips where only the input pin and the supply must be connected or loose as in this case.

For operation of the LEDs, I use a great library: Adafruit neopixel, can easily handle this type of LEDs.

The code

As I already mentioned, I use the Adafruit library to control the LEDs. Basically is the example 'strandtest' of the library, to which I added a first half in which the tune of 'Jingle Bells' is played using the tone function, and some more effect.
In case you do not want to constantly hear the melody, you need to make a bridge between pins 2 and 7 to ring.

This is the PCB design I've done:

PCB of Arduino Xmas tree Shield with WS2812

Although theoretically requires a bypass capacitor of 100 nF for each LED, I've put a few scattered around the circuit (if any LED gets lost in a given time and not think it will be very serious), so far I have not seen no failure.

The code
Descargar

You can download the code, the PCB and the schematic here: 

Project Photos HERE

Merry Christmas!


If you liked it, remember to share it on your favorite social network. Thanks

5 comments:

  1. Well done. PCB-tree : what a great idea.

    Were the capcitors necessary or did you just put them by safety ?

    ReplyDelete
  2. @BarbudorAccording to the documentation, this makes sure there's steady current available to the LED control logic amidst the small surges and dips that can occur as the LED brightness changes.
    In minor projects like this, do not need them all, but in a major project may not work properly if the capacitors are not, especially if the number of LEDs is high.

    ReplyDelete
  3. beautiful project! congratulations for your work! and thanks for sharing the source code

    ReplyDelete
  4. What is the program that you use to design PBC???

    ReplyDelete
  5. @phill chanapai
    Because the shape was a bit 'special', I used Adobe Illustrator, not a program for PCB

    ReplyDelete

Note: Only a member of this blog may post a comment.

Arduino Chromatic Clock, with Steampunk style

Arduino Chromatic Clock, with Steampunk  style Need a unique gift for Christmas? ... This watch unlike normal, uses colors instead of...