Integrated Circuit logo
UnusualElectronics logo

Animated Christmas Star project

(Project added 2nd November 2006)

Christmas Star

Introduction

The star is about 35cm across and designed to be displayed indoors in a window.

I originally created the star three years ago using a 16F872 controller. The original version worked ok - but had no spare memory for adding more features.

This new version uses a 18F2620 because I now prefer the 18F series and decided it would be a good general purpose 28 pin chip to use. It has more than enough memory (64K) so I can add as many features as I want now.

Since, I made the first version, brighter LEDs are now available and cost is much lower - this project currently uses a total of 60 comprising of 25 Blue, 15 Green and 20 Red.

Watch a video clip of it working (Windows Media 3Mb)

Features

  • An ever changing animated display, Patterns and speed chosen at random.
  • It can fade from one pattern to the next
  • Low power consumption
  • Currently 32 different patterns have been coded - and plenty of space available for more.

Features currently being developed

  • A centre colour changing feature using three leds (RGB) under PWM control- DONE (02/12/06)
  • Enabling the pushbuttons and creating a basic timer function to switch-off the display when not needed. - DONE (02/12/06)
  • Using the serial data ports to synchronize several stars either by wire or wireless modules - DONE (14/12/07)

Circuit Diagram

Star controller Circuit Diagram
Click image to enlarge.

Circuit Description

The circuit has been kept as simple as possible. The microcontroller uses portB to control the matrix columns through a cheap ULN2803 octal darlington transistor array.
This has the advantage of being compact,designed to work with logic levels without extra components and each output can carry 500mA, easily enough for this project.

The matrix rows are driven by portA directly and series resistors are used to limit the current supplied to each LED. Each port pin can only supply 25mA, with the multiplexing the effective current is even lower - but still bright enough.

PortC is eventually going to be used for a serial data link to control other stars, enabling the pushbuttons to make configuration changes etc. and three pins will control a colour changing effect to go in the centre of the star.

The microcontroller is clocked at 32Mhz using it's internal oscillator to save port pins - a timer function has been added, it is not very precise,but it can be adjusted to be good enough for use over the Christmas period though.

Operation

On power-up, it lights all of the leds for several seconds as a diagnostic feature. Then it chooses patterns at random, also choosing a random speed for animating each pattern plus a random number of repeats for some patterns. Some patterns are enhanced by fading the leds - others are more appealing with no fade.

Settings options

The star works ok without any settings, although some features can now be set-up using the two pushbuttons.

Configuring the centre RGB led.

If you have used an RGB led with a common cathode (negative) lead, then it will work ok.

If you want to use an RGB led instead with a common ANODE (positive) lead, then you must connect the anode lead to +5V instead of 0V and enable it by holding the UP button pressed while applying power (this setting will then be retained in eeprom memory).

Enabling the timer function

(All settings are best made by viewing the star from behind)

This allows the star to turn-off at a chosen time. First, set the current time by pressing the SET button. The hours (12 hour time) are shown in a line of 12 leds across the star and the led at the top point lights for PM.

Press the UP button to step up the hours. Then press the SET button again to show Tens of minutes on the five blue leds in the middle of the star and Ones of minutes on the nine leds at the base of the star.

Press the UP button to count-up the minutes.

Press the SET button again when you have finished setting the time.

Setting the ON time

Hold the SET button pressed for several seconds until the centre RGB led lights RED.

Now set the ON time (just like setting the time as before) When done, press the set button and the centre RGB led will light GREEN for setting the OFF time.

Set the OFF time as before.

Press the set button again and the RGB led will light BLUE for adjusting the clock timing.

The clock speed is at default to begin with (shown by a single led at the middle-base of the star.

Pressing the UP button lights leds to the right to increase the speed and then to the left to decrease the speed.

The clock oscillator is factory preset to an accuracy of about 1 or 2% and this option allows it to be adjusted up or down in steps of 0.4%.

Press the set button again to end all settings.

The on/off times and speed adjustments are now stored in eeprom memory.

Resetting back to defaults

If you ever need to reset the chip back to defaults (removing saved timer and rgb led settings) it can be done by holding both SET and UP buttons pressed while applying power.

Toggling the display on/off

Press the UP button to to toggle the display off/on without using the timer function.

!NEW! (December 2007) - Now allows several Stars to sync together.

To sync two or more stars together you just need a pair of wires.

You choose one star to be the Master and connect a wire from it's TX terminal to the RX terminal of one or more other stars. Then also link the Ground wires (0V)

For the possibility of longer distance links, I have used a slow speed serial data (2400bps) "Manchester" encoded protocol.

This may make it possible to link stars using short range RF data modules (Although I have not tested it because I don't have any!)

When using the serial link, the option to turn on/off the star's leds at preset times is controlled by the master star. (no need to configure it on any other Stars)

Here is a YouTube video of my two stars showing how they randomly sync patterns (I have improved the firmware slightly since making the video)

Files/Firmware

You will need a PIC programmer compatible with the PIC18F2620 microcontroller.

If you don't have one - there are various articles on the web for constructing a simple serial port "JDM" type programmer. Good Freeware programmer software is easily available - such as "IC-Prog" or "WinPic800".

I shall update the file version here as features are added/bugs fixed etc.


The Latest version of the program HEX file (v0.4) (16/12/2007) (right-click then "Save As")

The previous version of the program HEX file (v0.3) (08/12/2006) (right-click then "Save As")
(Note. This is a beta software - still being developed)

PCB Layout

The circuit is simple enough to construct on stripboard, Or use the single sided pcb layout design provided.

The microcontroller should be fitted in a socket. Connections to the pcb can be made either directly or use rows of connector pins. Power can be provided by a 9V DC wall-wart adapter rated at 300mA or better.

Star construction

Drawing a five pointed star accurately can be time consuming - so I have made some templates to print-out and transfer to plastic sheet.

Making the star and wiring-up all the LEDs does take the most time, you need to be patient, it is very easy to make mistakes when doing the wiring.

Detailed instructions, templates diagrams etc. are all in the manual below -
Star construction manual (PDF file)

Project Updates

v0.4 (14th December 2007) (added serial link functionality - allows several stars to be randomly synced to a master star)

v0.3 (8th December 2006) (added 12 more display patterns and a few improvements)

v0.2 (2nd December 2006) (added RGB LED and timer + slightly improved the displays)

v0.1 (2nd November 2006) (first release)

Please check-back for updates.

To Do List

Add some more patterns.

Add some refinements to the serial link sync facility.


An old Christmas project

Several years ago, I created an LED Christmas tree window display with a couple of PIC16F84s and some hardboard.
I am not documenting it here as it evolved onto two separate pcbs and took ages to construct.
Perhaps one day I will update the design?

Anyway, here is the link to my YouTube video showing it in action.

Disclaimer

This project (including software) is provided on an "AS-IS" basis for NON-COMMERCIAL, personal use only and WITHOUT WARRANTY of any kind, either express or implied.
I shall NOT BE LIABLE in any way to you or to any other person, firm or corporation whatsoever for any loss, liability, damage (whether direct or consequential), personal injury or expense of any nature whatsoever arising from inaccuracies, errors in, or the use or inability to use the hardware and/or software here.


This project page was last updated Sunday 16th of December 2007
Copyright © 2006,2007 D. Thorpe (www.unusualelectronics.co.uk)
Home   Contact   Case Photos   Projects   Links   Terms & Conditions