Introduction: Animated Christmas LED Snowflake Window Decoration

I make my own Christmas lighting decorations instead of buying ready-made ones.
This year, I made a "Snowflake" pattern using a matrix of 61 white LEDs.
The finished item measures about 38 x 40 cm and is controlled by a PIC microcontroller.

It is programmed entirely in assembler, has about 30 different pattern effects with fading, random speed and pattern selections.

The video shows some of the effects (I have added more effects since then)



The ZIP file contains the current PIC HEX firmware file and templates for making the Snowflake, PCB etc.

The latest firmware can also be found on my website.

I have added the .dwg file for the Snowflake pattern to allow you to customise the size etc.
You will need a CAD program to use it. ( A good free one is A9cad by A9tech).

Step 1: What You Need

A sheet of clear 2mm thick Polycarbonate/Acrylic plastic sheet (The type found in DIY stores).
(You could use a thin sheet of wood or strong cardboard instead if you wish.) about 40x37 cm (16 x 14.5 inches).

Parts list
1 x 100uF capacitor (25v electrolytic)
1 x 10uF capacitor (16 or 25v electrolytic)
2 x 0,1uF capacitor (small decoupling 50v type)
1 x 1N4002 Or 1N4001 diode
1 x 7805CT Standard 5V regulator
1 x CD4028BE Or equiv. (BCD to decimal decoder IC)
1 x ULN2803 Or ULN2803A (Darlington Transistor array IC)
1 x PIC18F1330-I/P Microchip PIC microcontroller
8 x 56 ohm resistors (0.25W carbon)
61 White LEDS (5mm) High brightness.
1 x 18pin IC socket for the microcontroller.
1 x piece of single sided pcb board at least 6.3 x 3.5 cm (2.5 x 1.38 inches)
Plenty of thin hookup wire for connecting the leds.
A 9 volts DC power supply (rated at over 100mA)
4 x m3 nuts & bolts for securing the pcb to the plastic.

The PIC18F1330-I/P is a standard 18 pin DIP version, available from suppliers such as Farnell, Mouser, RS Components etc.

The leds can be the very cheap types typically available in bags of 100 from various suppliers.

The resistors can be a higher value up to 100 ohm types if you don't mind the leds being slightly dimmer.

Tools and stuff
A sturdy workbench
Fine tip soldering iron and solder.
A heavy duty "Stanley" type retractable DIY knife for scoring the plastic sheet.
A metal "straight edge" for guiding the knife when scoring the plastic sheet.
Tape measure or ruler.
Pen for marking cuts and a sharp Bradawl for marking drill holes.
Small pliers and cutters for the wiring work.
General purpose clear glue for fixing any loose leds.
Printer, Paper and clear adhesive tape.
Safety equipment: Eye protection for soldering, trimming wires etc.
Antistatic ESD protection: A Wrist strap and ideally a ESD workbench mat are recommended.
5mm & 3.5mm metalwork drill bits for drilling led and pcb mounting holes.
A general purpose drill (I used a rechargeable type)
Tools and equipment for etching a pcb using the "Toner transfer" or other methods - there are various tutorials elsewhere so I won't go into it here.
A programmer that supports the PIC18F1330. Ideally a Microchip "PICkit 2" or similar clone type.
(Note. Older types of programmer/software (eg JDM) may not support this chip.

Step 2: Cutting the Plastic Sheet

Leave any protective film on the sheet.
Measure and draw cutting marks on the sheet ready for scoring to 40cm wide by x 37 cm high rectangle. (about 16 x 14.5 inches).

Score it with a good quality,heavy duty "Stanley" type retractable DIY knife and metal straight edge.
TAKE GREAT CARE TO NOT CUT YOURSELF WHEN DOING THIS!
Repeat the scoring several times to make sure that the plastic is weakened enough.

When sufficiently scored, it should be possible to snap the sheet cleanly by placing the scored line aligned with the edge of of your workbench.Bend the rest of the sheet down, forcing it to break along the score.
(Or it can be sawn using a jigsaw at very low speed with a fine toothed blade intended for plastic or metal cutting.)

Step 3: Marking the LED Positions

Now print the four snowflake templates in the PDF document. Make sure they print at the correct size by setting the "Adobe Reader" or other PDF software print option for "Page Scaling to None" or "100%".

Trim excess paper at the overlapping sides (still leaving a small overlap) then join sheets with clear tape.
(Hold the sheets to the light to get best alignment of the overlapped edges before finally taping them)
When all four sheets are taped together, trim around the outside then tape it centrally onto the plastic sheet.

Step 4: Drilling the LED Holes

Use a sharp tool such as a Bradawl to mark the plastic sheet at the centre of every LED hole.
Then drill each hole slowly with a 5mm metal drill bit to avoid melting the plastic.
(Test the drill hole size first on some scrap material to ensure the LEDs will be a firm fit in the holes).

You can also now drill two holes in the top corners of the sheet to attach string for hanging it in a window.

Using the PCB paper template or the PCB itself, mark and drill four 3.5 mm mounting holes for it in the space below the centre LED.

Now remove the paper template and any protective film from the plastic.

Wear an ESD antistatic wrist band when handling the leds to avoid damaging them!

Insert all LEDs with the flat side (short lead) towards the top of the sheet.
Carefully push each led in fully into it's hole, if any are a loose fit, apply a drop of general purpose clear adhesive to the side of the led before pushing it into it's hole.

Step 5: Wiring the LEDs

Two diagrams in the PDF document show colour coded guides to wiring the LED anode and cathode connections.
A cathode connection is the shorter lead adjacent to the flat side of each led.

Using thin,single strand insulated wire (You can use stranded wire instead if you like, although it doesn't look as neat ). Make the connections by carefully striping just enough insulation to wrap the wire around each led lead without completely cutting the wire.
(I used two different colour wires for the anodes and cathodes to make it easier to trace any errors)

Solder each connection as you go.

After making the last connection in a row or column, leave enough wire free for connecting to the pcb which is intended to fit in the space under the centre led.

Do not solder the leads closer than about 5mm from each LED and trim the leads after making all of the connections.
(TIP: Hold each LED lead while trimming to prevent it flying off.)

TIP: If you use small pieces of PVC tape or sticky labels to mark each Row/Column wire it will make it easier to identify when connecting to the PCB.

The trimmed LED leads are sharp, you may want to cover them over later using another similar sized plastic sheet or card.

Step 6: Making the PCB and Fitting the Parts.

I made my PCB using the "toner transfer method", using an old iron to transfer the toner onto a piece of PCB board. I won't describe how it is done here as other people have probably made good instructables or web tutorials about it.

The pcb layout is in the PDF document ready to be printed at the right size (no scaling as before).

You could easily build the circuit on "stripboard" instead, it is not too complex.

Fit the parts as shown, making sure that you use a socket for the microcontroller.
The ICs all face in different directions because it made the pcb layout easier.
(I don't usually do that - but I wanted to avoid the need for wire links and keep the board small)
Make sure you fit them with the pin1 marks matching the layout.

Ensure the electrolytic capacitors are fitted with the negative polarity mark matching the layout.
The diode is also fitted with the white band matching the layout marking.

Connect the Rows and Columns wires in the right order.
You can either solder them directly into the pcb holes or use 2.54mm pitch header pins.


Step 7: Program the Microcontroller

You will need a PIC programmer compatible with the PIC18F1330.

I used a Microchip "PICkit2" programmer connected to my home made ZIF socket adapter shown in the photo. (I did not provide any in-circuit programming connections to the pcb.)

The latest .hex file to program the chip with can be found in the attached zip file.

It is possible to use a "JDM" style programmer instead, although I only managed to get it working with DL4YHF's "Winpic" software: http://www.qsl.net/dl4yhf/winpicpr.html

Winpic did not support the 18F1330 by default but has an editable config file: "devices.ini" where new PIC device configurations can be setup.
If you want to try it, rename your existing devices.ini file in your winpic program folder then temporarily replace it with my file (which only has a few device configs in it, including the 18F1330).
Or just cut and paste the config from my file into your Winpic devices.ini file.

Step 8: Testing Everything

After fitting all components to the pcb except the microcontroller, inspect the board to check for solder splashes, dry joints etc. (also use a multimeter to check power supply tracks for shorts if you have one.)

Apply power and check the regulated voltage between TP1 & TP2 (should be 5 volts).
Disconnect the power.

If all checks so far are OK, fit the microcontroller in it's socket and apply power.
All leds should light-up for a few seconds at power-on. If some do not light, turn-off the power and check their connections.

During the display, watch some of the non-random led patterns, looking for any lack of symmetry. Fix any wiring mistakes by tracing the led connections,comparing them to the anodes and cathodes wiring diagrams.

Step 9: Circuit Description

The snowflake is controlled by the PIC18F1330 microcontroller (ic4) using it's internal oscillator.
It multiplexes the 8x8 LED array by sequentially turning on one column at a time then sending 8 bits of data to the 8 LEDs in that column before moving on to the next.
This occurs much too fast for the eye to notice any flicker. (Actually about 15,000 times per second!)
The microcontroller selects the column to turn-on via a logic chip (ic2), a 4028 BCD to Decimal decoder. This is used in this design as this microcontroller does not have enough outputs to address all of the columns directly.
Only 8 outputs of the 4028 are used and these can be controlled using only 3 ports of the microcontroller (although a fourth port is actually used so that all of the columns can all be turned-off if required)
The 4028 drives a ULN2803 8 way transistor array. This chip has outputs easily capable of supplying enough current to light all 8 leds in each row.

The row leds are driven directly by the microcontroller via current limiting resistors as each output will only have to light one led in a column. Each microcontroller port can handle about 25mA max . As the display is multiplexed, it is possible to get-away with higher peak currents by using smaller value resistors although I don't recommend it!

Power is provided via a 5 volt regulator ic1. The power consumption is quite low (just under 100mA).

The circuit includes a serial data connection. This is provided so that the snowflake can be turned-on/off at a pre-set time from a connection to another of my Christmas projects from a few years ago (an LED Christmas Star).
My Star also sends commands which should be able to sync together several Snowflakes, although I can't test it yet as I have only built one Snowflake so far!

Comments

author
schroedc (author)2010-12-03

I like it. But, I might suggest replacing some of the white LEDs with blue ones to define/distinguish the snowflake shape a little better than just a bunch of white LEDs.

author
compukit (author)2009-12-23

hi i post a youtube link  to my movie of my xmis decoratjon whit the snowflake :):P.
hoop ou like it

author
compukit (author)compukit2009-12-23

http://www.youtube.com/watch?v=lJtLA7EfgGQ
oops forgot the clip .

author
compukit (author)2009-11-14
I have a question that you print that image in your zip file that is signed so that the signed parts of the solder the components to come out if the other side of the solder side.
Thanks
author
neilh (author)2009-01-04

Great instructable! I just built one, and it came out really well. Would you consider posting the source code so I can play with my own patterns more easily? I was hoping to have it complete before christmas, but the LEDs took a while to ship (I found them on ebay for a reasonable price). I can supply a pic of my snowflake if you like. Happy New Year to you! Thanks again! --Neil.

author
unusualelectronics (author)neilh2009-01-05

Hello Neil, Sorry, I don't release the source code for my projects. Perhaps next Christmas I could add a user config facility via the serial link? Please do post your snowflake photo here. Thanks, Dave

author
wanderingmoose (author)2008-12-30

Thanks for your work on this project. I built four for xmas gifts this year. They went over great with the family. Thanks

author
danking (author)2008-12-07

What values did you use for the resistors? Did you spec if for full current draw with one LED or eight?

author

I used 56 ohm resistors to ensure no damage to LEDs or the PIC. Each port only has to drive one led at a time and the max allowed current per port is 25mA according to the Microchip datasheet. The voltage drops of the leds (about 3.2 - 3.6V) and the ULN2803 drivers (about 1V) actually limit the current to around 10mA so you could use lower value resistors if you want. Probably the minimum value you could get away with would be 33 - 22 ohm depending on your LEDs spec. I have seen designs that don't use any resistors at all but that may risk damaging the PIC or LEDs if it stopped multiplexing for any reason.

author

Hmmm. Clearly I failed to undetand the design. I thought each port would have to drive an entire row (or column) at a time. Or, I missed a bit of subtlety. Thanks!

author
skylab (author)2008-12-05

Very nice. But don't build it if you are in Boston! The ever paranoid spastic Public Safety folks will arrest you.

author
WingDings (author)skylab2008-12-06

lol

author
jhorton (author)2008-12-04

This is a great project! Any chance you have the snowflake pattern in one piece, say in .SVG or .AI format? Would love to modify it a bit and get a few stars cut out on a laser cutter from places like Ponoko.

author

I made the pattern using a freeware CAD program (A9CAD) and have now uploaded the .dwg file. I have just tried to convert it to .SVG format using another utility (Dwgsee+) but it did not convert it properly. Perhaps you may know of a better way to convert it.

author

Thanks for the .DWG file! I've tried a few utilities, and have had no luck getting a usable .SVG file. I'm going to work on a new vector file from scratch over the weekend using Inkscape and the Ponoko guides. I'll share whatever I come up with!

author
jcencer (author)2008-12-05

This is a very cool design, but it's much easier and cheaper to run to Wal-Mart or Target to buy the same thing. The circuitry is then in a weather-tight enclosure and can stand up to anything Mother Nature dishes out. Nice job on the design.

author
jhorton (author)jcencer2008-12-05

But then you can't modify the patterns or any other aspect of the code :) Just pot the circuit board in some epoxy, hot melt glue the solder connections, easy isn't always better.

author
xboxteen01 (author)2008-12-02

Awesome project. Any tips for drilling the acrylic to avoid cracks from stress? I heard you can use masking tape but it hasnt been effective for me on past projects

author
mickeypop (author)xboxteen012008-12-04

When drilling plastic - use plastic drill --- regular twist drills are beveled at about 13 degrees, plastic drills are at 45 degrees or a 90 degree point. This prevents the jamming that causes the cracking in the first place -- if you have access to a grinder, re-shapening the tip to the new angle works great and will last a long time, much cheaper than buying special bits.

author
ericschmidlin (author)xboxteen012008-12-04

Forget about using tape when drilling through plastic. The only way that works is if you use a drill press that has an adjustable speed. Even then, if you dont drill with very light pressure, the plastic will still crack. The best thing you can use is a "step up" drill bit (about $20 at the usual home centers). This bit looks simillar to a funnel, with several diameter "steps". I do a lot of work with acrylics and I have yet to crack anything with this bit! Just be sure that you go slow and don't apply too much pressure when drilling! Also, drilling in reverse may work on some types of plastic, but here again, more times than not, the plastic can crack from the heat.

author
groudzero (author)xboxteen012008-12-03

A few drilling tips. Use a dull bit. Tape the back side to help stress. Use smaller bits first then move up to the size you need.

author
computer_gui (author)xboxteen012008-12-03

I've found it works well to drill in reverse so as to melt the plastic instead of drilling normally having it catch and then having it break. The holes need to be filed down after but it keeps it from breaking.

author

I didn't have that problem. Perhaps it depends on the type of plastic? I bought mine several years ago and I think they are polycarbonate. I just marked each hole then drilled it not too fast to melt the plastic.

author
alexorson (author)2008-12-04

Thanks for including the video. It really ties the whole project together. Great instructable!

author
amaze1 (author)2008-12-03
  • Very * very * nice !
I like so much the idea and the pattern.
Maybe you could save some parts using charlieplexing, but it could lack in luminosity and all in all final circuit seems not so complicated.
Indeed I think it is better place LEDs this way than make * another * led cube!
author

Thanks! I decided against charlieplexing in this project because previously I tried using it to reduce hardware, causing the LEDs to be much dimmer and it also made a little EMI due to the extra switching.

author
Plasmana (author)2008-12-02

That is some very impressive work you had done! 5 stars!

About This Instructable

43,819views

91favorites

License:

More by unusualelectronics:LED Animated Christmas Tree 2015Animated Christmas LED Snowflake Window Decoration
Add instructable to: