Fibreoptic Christmas Tree Upgrade

10,421

14

19

Introduction: Fibreoptic Christmas Tree Upgrade

We've had one of those fibre optic Christmas trees for some years. The base contains a 12V halogen reflector bulb, and a coloured disk driven by a motor is placed between the bulb and the base of the tree. The bulb and the motor are powered by a 12V AC "wall cube" type mains adapter. But the colours are rather washed out and repeat every 10 seconds or so, and some people with similar trees find the motor a bit noisy. It struck me we could do much better in this day and age!

Having replaced the bulb by a 7-pixel Neopixel ring driven by an Arduino Pro Mini, it now no longer needs the coloured disk or the motor driving it, and gives much more intense colours using less electricity. The video doesn't really do justice to the colours - the high contrast of LEDs against any background makes them very difficult to photograph effectively

The Arduino sketch I've written embodies 2 programs which alternate every 5 - 10 minutes. In one, all the Neopixels follow the same random sequence of colours, but each is slightly delayed from the previous, giving an effect of colours sweeping across the tree. In the other, all 21 coloured LEDs (one red, one green and one blue in each Neopixel) are faded in and out at random, giving a very pleasing show of intense and continually changing colours.

Since your tree is unlikely to be the same as mine and you may not wish to power it in the same way I can't give detailed instructions for a complete beginner, but hopefully you will learn something in adapting them to your tree.

You will need:

  • Adafruit Jewel Neopixel ring, or Far Eastern equivalent.
  • Arduino Pro Mini or Nano (it needs to be a 5V part)
  • If you use the Pro Mini, an FTDI USB to serial adapter
  • Stripboard, pin strip, soldering iron, solder, connecting wire etc.

You can use one of the ATTiny85 boards (Trinket, Lily Tiny, Gemma) instead of the Pro Mini or Nano but it may not have room for the full sketch with both programs - see Step 5.

If you reuse an exiting 12V AC adapter, you will need:

  • 1N4004 rectifier diodes - 4 off
  • 1000uF 35V electrolytic capacitor
  • 5V step-down switching regulator module (one based on the LM2596 chip should do), or cannibalise an old car satnav or USB charger delivering 5V as I did.

Otherwise:

  • Reuse a old 5V USB charger, such as an Apple or Blackberry charger, or get a new one.

Step 1: Disassemble Your Tree

As you will see from the pictures, my tree has a circular base containing the works, with a hole in the top which takes the tree itself.

It shouldn't be hard to disassemble the base. Mine simply has 3 screws in the bottom. Remove these and the cover comes straight off. Check it works the same as mine, with a halogen reflector bulb, a motor and a coloured disk.

Remove the bulb (2 screws hold a retaining ring) and the coloured disk (secured with a single nut in the top of the spindle).

Follow through the wiring to see how it works. The conversion is easiest if you can assemble the new electronics as a module to directly replace the bulb, fitting into and taking power from its socket. You will probably want to disconnect the motor and maybe remove it altogether.

Step 2: Assembling the Electronics

The photo shows the end result, before replacing the cover.

The electronics comprise up to 3 parts:

  • The Arduino and Neopixel ring

and if you are using an existing 12V AC mains adapter:

  • 1N4004 rectifier diodes and smoothing capacitor
  • DC-DC step-down regulator.

I will describe each in turn, but first, consider how you are going to mount them in order to fit in place of the bulb.

I soldered a 3-pin-wide piece of pin strip with the middle pin removed to the bottom of a piece of stripboard. This fits into the bulb socket.

I ensured that the stripboard was the same height as the bulb, and that the top of the stripboard was the same width as the bulb diameter. That way the stripboard could directly replace the bulb, retained at the top with the ring that used to retain the bulb.

Step 3: The Arduino and Neopixel Ring

If your Arduino comes without the pin strips ready soldered you can mount it directly onto the stripboard, by running short lengths of bare wire through the pins on the Arduino and through the stripboard, soldered on both sides. The Arduino Pro Mini needs a 6-way pin strip soldered to the serial port pads for programming.

You only need connect the +5V, GND and D8 pins on the Arduino, but cut the tracks on the stripboard between the two row of pins anyway, for safety. That will allow you to solder one or two more pins to secure it without creating any short circuits.

I used 3 pieces of thick copper wire to both support the Neopixel ring and to connect it to the stripboard.

The Neopixel ring has 4 connections: Vcc, Gnd, D-In and D-Out. We only use the first 3 of these.

Having mounted the Neopixel ring as shown, use short lengths of connecting wire to connect Vcc to the Arduino +5V pin, Gnd to the Arduino Gnd pin, and D-In to the Arduino pin D8, or D1 if you are using one of the ATTiny85 boards.

Check to ensure the stripboard conductors you soldered the Neopixel ring to don't make unwanted connections with the Arduino, and cut them if necessary to break any such connections.

Step 4: The Power Supply

If you're using a 5V power supply all you need do is connect the positive connection to Vcc/+5V and the negative to Gnd on the Arduino and the Neopixel ring, and you can skip forward to Programming.

The 12V AC supply first has to be rectified with 4 diodes (turning into DC), then smoothed with an electrolytic capacitor.

I mounted the diodes and capacitor on the same piece of stripboard as the Arduino. In the photos, the copper strips run vertically.

Mount the 4 diodes as shown, alternate ways round. The positive end of each diode is marked with a white band. Cut each of the 4 copper strips between the two ends of each diode.

The 12V AC comes in through the white wires from the pins which plug into the bulb socket. At the AC end, the diodes are connected in adjacent pairs as shown by the white lines, each AC input wire going to one positive end and one negative end of a diode.

At the other end the diodes are connected with positive ends together (red lines) and negative ends together (blue lines).

Solder the capacitor to the strips marked red and blue. I soldered it further up the board then bent the leads to allow the capacitor to sit neatly over the diodes.

Very important: one side of the capacitor is marked negative (with minus signs). You must connect that to the strip marked blue!

Now you can connect the red and blue to the positive and negative inputs respectively of the DC-DC step-down converter.

If you're using a step-down converter with adjustable output, be sure to measure the output voltage with a multimeter and adjust it to 5V before going any further or you may damage your Arduino and Neopixel ring.

Finally, connect the positive and negative outputs of the converter to the Vcc or 5V and the Gnd on the Arduino and Neopixel ring.

You may be able to mount a small DC-DC converter on the stripboard with the other components, but mine was too big, so I had to connect it with flying leads and tie it to a couple of convenient posts.

Step 5: Programming

If you don't already have it, you need to download and install the Arduino IDE. It's free. Make sure you have the latest version (1.6.13 or later - some earlier versions contain bugs which wasted a lot of my time).

In your Arduino folder (by default under Windows this is in My Documents) create a folder called Neopix_colours3. Copy the file Neopix_colurs3.ino into this folder.

Now launch the Arduino IDE and locate the sketch Neopix_colours3 in your sketchbook.

If you are using an ATTiny85 board there may not be room for the full sketch. Comment out the definition of FUNCTION_1 or FUNCTION_2 near the start of the sketch. Alternatively you may be able to squeeze the whole sketch in if you sacrifice the bootloader and program it using another Arduino.

Under Tools, select the board you are using (Pro Mini or Nano, or whatever). If you are using the Pro Mini, connect the FTDI adapter to the Arduino (make sure it's the right way round) and plug it into a USB port on your computer. In the case of the Nano you simply connect it to your computer with a USB cable.

On your computer, go into Device Manager - ports (COM & LPT) and check which COM port has been assigned to the Arduino. Set this under Tools - Port.

You can now upload the sketch and check that it works. The Neopixels are very bright so it's a good idea to place a sheet of paper over them to protect your eyes, or to temporarily change the definition of BRILL in the sketch from 255 to 50.

The sketch as I've uploaded it starts with program 1 and then switches between the two programs randomly every 5 - 10 minutes. If you prefer one or the other, find the line

function = 1;

at the end of the setup() function. Replace the 1 by -1 or -2 to lock it into program 1 or program 2. You can change the minimum and maximum times (in milliseconds) each program runs for by finding and altering the definitions of MINCHGTIME and MAXCHGTIME.

When you're happy, put everything together again, sit back and enjoy!

Make it Glow Contest 2016

Participated in the
Make it Glow Contest 2016

Arduino Contest 2016

Participated in the
Arduino Contest 2016

4 People Made This Project!

Recommendations

  • Tinkercad to Fusion 360 Challenge

    Tinkercad to Fusion 360 Challenge
  • Digital Fabrication Student Design Challenge

    Digital Fabrication Student Design Challenge
  • Pets Challenge

    Pets Challenge

19 Comments

0
vmrdmeng
vmrdmeng

Question 5 months ago on Step 2

I have a question: bought a fibre optic Christmas tree but I d like to put more light ex. Tiny LED string. Is this safe to do? Thank you.

0
p_leriche
p_leriche

Answer 5 months ago

First of all, you need to take it apart and see what sort of bulb it has. These days it should be a LED type rather than a halogen reflector like mine was, and most of the people who've made this. If so, you may be able to simply substitute one of the same size and voltage by higher lumens rating. I'm not sure how you could fit a LED string in place of a bulb.

0
vmrdmeng
vmrdmeng

Reply 5 months ago

Hi, thank you for your response. I don’t want to replace what’s in there but only want to hang another string of lights and plug it to a separate outlet. Is it safe to do this.. some warm bulbs might touch the fibre optic branches, might destroy the branches or worst, will cause fire?

0
Kc2ecd
Kc2ecd

Question 6 months ago

Does your sketch loop back to the start of 1 after the 2nd is done? It seems like after a while it stops at one color and I have to turn it off and back on to start the sequence again.

0
p_leriche
p_leriche

Answer 6 months ago

It certainly should cycle between the two functions. If it sticks at one colour combination and stops changing at all, it sound like the Arduino has locked up. Is your power supply adequate? As an experiment, find the line in the sketch "#define BRILL 255" and change 255 to something less, e.g. 100 or 50 and see if it's more reliable, running less brightly. Or does it always stop after the same length of time? That would seem to suggest a problem with the sketch. Try re-downloading it. Maybe you accidentally changed something.
You can also try enabling debug. Delete the "//" from the line "//#define DEBUG". With the FTDI still attasched, click on the serial Monitor (top RH corner of the Arduino IDE) and make sure it's set to 38400 baud. It should report progress. Does to do dumb as the changing stops?
Also, take a look at this Adafruit Neopixel Best practice: https://learn.adafruit.com/adafruit-neopixel-uberguide/best-practices - in particular the first 2 bullet points. I've generally got away with ignoring those, but maybe that's your problem.

Thanks for sharing your pic!

0
Kc2ecd
Kc2ecd

Question 6 months ago

When I try to upload your sketch I get an error message saying "Adafruit_NeoPuxel.h: no such file or directory. Everything look good otherwise. I gave the data in pin of the pixel ring connected to pin 8 and the board is powered on. Help!

0
p_leriche
p_leriche

Answer 6 months ago

First, check that your sketch contains the #include line in the attached screenshot below, correctly spelled. (I guess most likely "NeoPuxel" is a typo in your question.)

Assuming that's right, click Tools... Manage Libraries, and search for neopixel as in the screenshot. If Adafruit NeoPixel is not shown as Installed, install it.

Capture.PNG
0
Kc2ecd
Kc2ecd

Reply 6 months ago

That was it! Had to add the library. Thanks so much for your help! Now the family doesn't have to endure that incessant motor noise.

0
Kc2ecd
Kc2ecd

Reply 6 months ago

I added the reflector from the original lamp. The pixel ring was too small and some of the fibers of the tree were not being lit. Now it looks fabulous!

20211211_084921.jpg
0
Kc2ecd
Kc2ecd

Question 6 months ago

When you say FTDI usb to serial adapter do you mean TTL OR RS-232? I'm new to all of this. Thanks.

0
p_leriche
p_leriche

Answer 6 months ago

This is what you need.
https://www.ebay.co.uk/itm/393474366118?hash=item5b9ce65aa6:g:kn8AAOSwW6NhBFjW (If you're not in the UK you'll find plenty of ads for the same in your region.)
On one end is a mini USB socket and when you plug it into Windows it appears to be a COM port. On the other end are 6 pins which are a TTL level serial interface. Alternatively you can use an Arduino Nano which has this functionality built in for a slightly higher price, and connects drectly to yor computer via a miniUSB socket.

0
gcountryside
gcountryside

Question 1 year ago

The motor and mounting assembly

0
p_leriche
p_leriche

Answer 1 year ago

You mean the unmodified tree with motor and coloured disk? Just search online for small fibre optic christmas tree.

0
gcountryside
gcountryside

Question 1 year ago

Where could I buy this

0
Jayna MarieA
Jayna MarieA

2 years ago on Introduction

I don't know how to do this nor do I have tools needed, but just wanted to let u know this is awesome. The stand thay holds the tree broke, so thought maybe I could find something. Merry Christmas to u n urs

0
p_leriche
p_leriche

3 years ago

Two years later, I get this tree out of the loft and find that the Neopixel ring has failed - only the first pixel works. That was a cheap Far Eastern one. Since Christmas is fast approaching I had to order a genuine Adafruit replacement and I'm now back in business.

From a bit of research on the web it seems that the quality of Neopixels is very variable - it may be a false economy to go for the cheap ones. But even the genuine ones don't have an untarnished record.

0
UncleEd
UncleEd

5 years ago

Thank you for the instructable. I'm disappointed I just put all the Christmas stuff away so can't check out the little tree, but now I can have several months to perfect my color system. I like that you included the small controllers as possibilties.

0
p_leriche
p_leriche

Reply 5 years ago

You don't want to be doing it in a rush before next Christmas! There are various parameters in the sketch you can play with to change the speed or the program, or you could devise your own completely new one. I especially liked the way I got it to change seamlessly from one program to the other.

0
rafununu
rafununu

5 years ago

Nice upgrade and very good idea.

On the original model the motor is really noisy, I had to mount it on silent blocks, the power supply is of very poor quality, it heats a lot (50°C), and the color effect is repetitive. I'll test with a neopixel ring to see if colors are brilliant enough. Thx.