element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs Arduino-powered 3-D Christmas tree
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fustini
  • Date Created: 22 Dec 2011 10:18 PM Date Created
  • Views 823 views
  • Likes 0 likes
  • Comments 0 comments
  • radioshack
  • avr
  • diy
  • xmas
  • led
  • velleman
  • christmas
  • microcontroller
  • arduino
  • kits
Related
Recommended

Arduino-powered 3-D Christmas tree

fustini
fustini
22 Dec 2011

Howdy,

 

I've assembled several Velleman (http://www.vellemanusa.com) holiday kits over the last few years to give as gifts:

http://www.vellemanusa.com/images/products/0/xmas2005.gif

I'm glad they make such kits, and the prices are reasonable.  However, in the age of cheap microcontrollers, the fixed blinking LED patterns are a bit of let down after soldering a gob of LEDs.  In almost all the kits, transistors switch on and off strings of LEDs based on the RC time constant of the components.  Thus, I got the idea to hook up one of the kits to a microcontroller to add more pleasing variations.

 

I decided to give this a try with the Velleman 3-D Christmas tree:

 

http://www.vellemanusa.com/products/view/?id=351133

http://www.vellemanusa.com/images/products/0/small/mk130.jpg

Thanks to RadioShack's recent DIY blitz, this kit is stocked in all 3 RadioShacks I've visited in Chicago recently.  This mod could have been done with any number of popular microcontrollers, but I thought I'd shoot for an Arduino-compatible setup given many folks are familiar with it (and I was bit tired of fiddling with registers after a recent pure AVR project).  I had an unused Breaduino kit (http://www.appliedplatonics.com/breaduino/) which is a breadboard-able ATMega328 Arduino clone I'd bought at Noisebridge (San Fransico's hackerspace).  I decided to use this as my goal is to solder all the components on a small protoboard to mount under the tree.  For now I've just setup the circuit on a breadboard with jumpers connected to the 3-D tree PCB:

image

The Arduino fades the LED segments in and out at different randomly-selected rates using PWM via the easy analogWrite() functions.  I found it quite pleasing to watch, especially in dim light.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Here's the schematic of the 3-D tree kit from the instructions:

 

http://www.vellemanusa.com/downloads/0/minikits/manuals/manual_mk130.pdf

image

I cut the positive lead on each capacitor and then connected a jumper to the "capacitor-side" of the 82k or 100k resistor for each of the 4 segments (for one segment I clamped on the negative lead of the capacitor as corresponding the resistor lead was too tight of a fit for the mini-hook jumper):

image

 

Those jumpers then are connected to pins on the AVR via 1K resistors.  Finally the 9V battery connector springs on the PCB are connected to the 9V rails on my breadboard (where a 9V battery is strapped on).  I will make a proper schematic when I get ready to solder components onto a protoboard, but, for now, here's my messy breadboard:

image

The 2nd breadboard really isn't needed, but I started off by breadboarding all the components which are now soldered onto the 3-D tree PCBs.  The Breaduino doesn't have a USB interface like an official Arduino board, so I used a FTDI USB-to-serial cable to program it.

 

Here is the sketch I wrote which is based on the PWM LED Fade example which is included with the Arduino installation:

 

// Arduino-mod for the Velleman 3-D Christmas tree kit
// This code is in the public domain (based on the Arduino.cc Fade example).

int fadeAmount = 0;
int fadeMax = 0;
int fadeMin = 0;
int fadeDelay = 0;

void setup()  { 
  //serial output isn't required, but useful when experiementing
  Serial.begin(9600);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  randomSeed(analogRead(0));
} 

void loop()  { 

  // generate random setting to keep patterns interesting
  // bounds were determined by experiementation, so you
  // you may want to tweak to your own liking
  fadeMin = random(1,100);
  fadeMax = 255;
  fadeAmount = random(1,10);  
  fadeDelay = random(5,15);    

  // this loop controls the duration for each random pattern
  // note, the faster the fading, the sooner the pattern will end
  // maybe this could be improved by refactoring the program to be 
  // driven by a timer interrupt so each patttern gets equal duration
  for(int i=0; i<20; i++) {

    Serial.print(i);
    Serial.print("\t");       
    Serial.print(fadeMin);
    Serial.print("\t");       
    Serial.print(fadeMax);
    Serial.print("\t");       
    Serial.print(fadeAmount);
    Serial.print("\t");        
    Serial.println(fadeDelay);  

    // fade from minium to maximum brightness
    for(int fadeValue = fadeMin ; fadeValue <= fadeMax; fadeValue += fadeAmount) { 
      analogWrite(11, fadeValue);
      //invert the current brightness so that LED segments visually "oppose" each other
      analogWrite(10, fadeMax-fadeValue);
      delay(fadeDelay);   
    } 

    // fade from maximum to minimum brightness
    for(int fadeValue = fadeMax ; fadeValue >= fadeMin; fadeValue -= fadeAmount) { 
      analogWrite(11, fadeValue);          
      analogWrite(10, fadeMax-fadeValue);              
      delay(fadeDelay);                            
    } 

  }

}

 

Now that I have a working prototype, I look forward to permanently placing the components on a board attached to the base of the tree to make an attractive holiday decoration.

 

I'd love to hear about what other holiday-themed electronics projects folks have been working.  Please post in the comments if you've got anything to share.

 

 

Happy Holidays!

Drew

http://twitter.com/pdp7

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube