Desktop Arduino Christmas Tree

This is a simple christmas tree i made for my desk at office just to create some christmas mood in the office

Supplies:

The item required as below

1 X Arduino/Arduino Compatible boards

12 x WS2812 LED (quantity up to individuals)

1 X USB Cable (any scrap USB cable will do)

Cardboard/foam board

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Step 1 - Get Started..

Print out a template from the web or draw a tree on a cardboard following the size of your preference.

for my tree, i have download the above image and printed/expanded as the dimension i have preferred .

Cut out the outline of the picture/drawing, and determine where are you going to assign the lights in the end.

Step 2: Step 2 - Cut Out the Holes for the Light

Cut the light holes, in this case 5mm x 5mm square to accommodate the WS2812 LED.

Once the holes have been cut, you need to paint it as per the color of your preference.

you also can add any details you want at this time.

Step 3: Step 3 - Add Your LED's

you can add your led's at this point, remember to mark down the orientation of the LED's

Super Glue or Hot Glue Gun to stick the LED to the cardboard

Step 4: Step 4 - the Wiring

this is the tricky part.

Remember on the previous step the orientation of the LED was important?

At this point, you can choose the path of the LED flow (eg, which is light 1, light 2 , light 3 etc)

VCC to be looped

GND to be looped

DIN from the 1st light to arduino Pin 6 (in my case)

Dout to the next LED and continue.

Step 5: Step 5 - Closing the Back

Before you are closing out the back with another cardboard, just trace the outline in a new cardboard, and remove the middle part so that you will have a skeleton of the cardboard protruding and able to cover with a flat cardboard when you are placing on top.

this is for support as you can just sandwich 2 cardboards as there are wiring and led which will obstruct a clean closing.

at this moment also, you can decide how you want to make your tree stand, for mine, i have cut a triangle and attached it with hot glue so that it can stand on its own, as the final product is very light, i have added some nuts to make it heavier so that it wont fall off easily.

Step 6: Step 6- Connection to Arduino

Attached a schematic example from Google

you can use the pin of your choice (digital Pin) i have used D6.

you can choose as a DC Jack for the power supply or directly connect the USB to Vin/GND as per the image

Step 7: Step 7 - Code

I have used the example code provided in Arduino IDE examples and mix it with some glitter

#include

FASTLED_USING_NAMESPACE

// FastLED "100-lines-of-code" demo reel, showing just a few

// of the kinds of animation patterns you can quickly and easily

// compose using FastLED.

// This example also shows one easy way to define multiple // animations patterns and have them automatically rotate.

// -Mark Kriegsman, December 2014

#if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000)

#warning "Requires FastLED 3.1 or later; check github for latest code."

#endif

#define DATA_PIN 6

#define LED_TYPE WS2811

#define COLOR_ORDER GRB

#define NUM_LEDS 12

CRGB leds[NUM_LEDS];

#define BRIGHTNESS 150 / brightness of the LED.

#define FRAMES_PER_SECOND 120

void setup() {

delay(3000); // 3 second delay for recovery

FastLED.addLeds(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);

FastLED.setBrightness(BRIGHTNESS); }

typedef void (*SimplePatternList[])(); SimplePatternList gPatterns = {rainbowWithGlitter };

uint8_t gCurrentPatternNumber = 0;

uint8_t gHue = 0;

void loop() {

gPatterns[gCurrentPatternNumber]();

FastLED.show();

FastLED.delay(1000/FRAMES_PER_SECOND);

EVERY_N_MILLISECONDS( 20 ) { gHue++; }

EVERY_N_SECONDS( 10 ) { nextPattern(); }

}

#define ARRAY_SIZE(A) (sizeof(A) / sizeof((A)[0]))

void nextPattern() {

gCurrentPatternNumber = (gCurrentPatternNumber + 1) % ARRAY_SIZE( gPatterns); }

void rainbowWithGlitter() {

fill_rainbow( leds, NUM_LEDS, gHue, 7);

addGlitter(40); } //this to change the frequency of the blink

void addGlitter( fract8 chanceOfGlitter)

{ if( random8() < chanceOfGlitter) { leds[ random16(NUM_LEDS) ] += CRGB::White;

}

}

Step 8: Final Working - Good Luck

If you worked on this project, please do post some pictures.

and if you have suggestion for improvements, please share as well.

thanks.

Merry Christmas

Be the First to Share

    Recommendations

    • Instrument Contest

      Instrument Contest
    • Make it Glow Contest

      Make it Glow Contest
    • STEM Contest

      STEM Contest

    3 Discussions

    0
    None
    audreyobscura

    2 days ago

    This came out great! Thanks for the share! Did you mean to enter this project into a contest?

    2 replies
    0
    None
    Kogelaramaudreyobscura

    Reply 1 day ago

    hi, thank you very much.
    i did not plan on any contest, is there any contest ongoing?
    maybe ill give it a try.