Friday, 2 December 2016

Electronic Christmas Decoration

And now for something completely different…

While perusing the Christmas tat in Poundland /Poundworld recently, I found some cheap battery powered Christmas lights and thought I could hack these.  

I chose some LED Christmas trees, stars lights and multi-coloured lights. These take 3v in the form of 2 x AA batteries, but you can snip the battery holder of and connect them to your Raspberry Pi or micro:bit.

The first thing I did was to snip the battery holders off and connect them to my Raspberry Pi, I used some driver transistors to protect the Raspberry Pi’s GPIO ports. I wrote a simple Python script using the excellent GPIO Zero library to flash the lights on and off.  This worked well but I had seen a simple Christmas decoration project in an old book called Digital Electronic Projects for beginners by Owen Bishop. 

Lights connected to my Raspberry Pi

I thought I would build the circuit to see how well it worked.   The project uses a 555 timer and CD4040BE 12-stage binary ripple counter to make a set of 5 LED’s light up according to the binary sequence with some additional add-on extension ideas.  I modified the circuit and replaced the CD4040BE with a CD4042BE 7-stage binary ripple counter as I didn’t need all of those stages.  I added a UM66T-01L which is a melody generator IC and plays ‘Jingle Bells, ‘Santa Claus is coming to town’ and ‘We wish you a Merry Christmas’.  Finally I added driver transistors to drive the LED strings as the CD4024BE can’t supply a lot of current via the outputs. 

Prototyping the circuit

Prototyping the circuit

I was happy with the circuit so I transferred it from the breadboard onto some stripboard. Overall I'm very pleased with how it worked out and there's not a single microprocessor in sight.

Final circuit built on stripboard

Final circuit schematic