Sunday, December 13, 2015

Christmas Lights and Their Control Signals

Merry Christmas.  I recently bought a set of LED Christmas lights for a display at work.  They were nothing special, just a cheap set of 4 colour lights that can flash and dim the lights in different patterns.  One thing that stood out was that the plug that connected the string of lights to the power supply only had two contacts.  So how is the controller able to control 4 different colours with only 2 contacts?

LED Party Lights
The first thing that came to mind was that there must be some sort of communication bus operating over the power rails controlling something like a WS2812 LED (I always come up with the most complicated solution first).  After watching the lights operate it became obvious what was happening.  The blue and green ones operate at the same time, and the orange and red ones are on at the same time as well.  So instead of controlling four different strands of lights the controller only needs to control two, red and orange, blue and green.  This can be easily done by connecting the red/orange and the blue/green LEDs with opposite polarity.  As the lights are LEDs and only conduct when voltage is applied with the correct polarity, applying a positive voltage to the connector, will light up half the lights, and applying a negative voltage will light up the other half.

I didn't have the time to test the set I bought for work, so I bought another smaller set of 100 lights from Bunnings for $10.

Lytworx LED Lights from Bunnings

Light String
The power supply is a small light isolated plug-pack that weighs only 51 grams.  I didn't want to open it as the case seems to be ultrasonically welded together and doing so would destroy it.  Given the weight, I'm almost certain that it's a switch-mode supply.  When a scope probe is placed near the case a 12.5 kHz switching signal can be detected with a 250 kHz ringing component.  The observed waveform and frequencies involved are commonly associated with switch-mode supplies.

Plug Pack
Power Supply
The supply has a button on the top that cycles the lights through different display modes.

Plug Pack
Button to change between modes is shown
Something to note that will become important later is that the output voltage of the supply is 31 volts.  How do you power 50 (half at a time of 100) LEDs from 31 volts?  The only other bit of interesting information here is the maximum power of 4 Watts.  That's similar to a USB charger.  Although you could power the lights from a 5 Volt 1 Amp source, without a boost converter the size of the cabling would have to increase to reduce losses.  I do however wonder what will happen if the USB power delivery specification becomes ubiquitous.  It can supply 20 Volts at up to 5 Amps.  Will Christmas lights of the future come with a power supply?  You might just get a string of LEDs with a small in-line button to switch between modes and a USB connector.  What's more likely is a string of lights with a USB connector and bluetooth connectivity (it's trending towards free) to control something like a string of WS2812 lights.  This means that the manufacturer doesn't have to worry about providing a power supply.

Power Supply Specs
There are 8 different light patterns.  Combination, In Waves, Sequential, Slo Glo, Chasing/Flash, Slow Fade, Twinkle/Flash, and Steady On.  For patterns that require all the lights to be on at once, the voltage alternates between positive and negative at a rate of about 140 Hz.  This means the lights aren't on all the time but the changes are too fast for the eye to notice.  To dim the lights you just need to reduce the fraction of the time that they're on.  If you're unsure of how this works read up on pulse width modulation to catch up.

Light Programs
Different Light Patterns
The string of lights is connected to the power supply via a simple barrel jack.

2 Pin connector
To see if the lights you have use pulse width modulation, wave the lights around quickly.  You should see a dashed line of lights similar to the pattern below.  By comparing the length of the blue streaks to the spaces in between them you can see that the light is on for about 40% of the time.

Longish exposure showing PWM of LED lights
To see how the 31 Volt supply was connected to the lights I sat down and traced out the wiring.  It turns out that there are 10 strands of lights connected in series.  Each strand contains 10 lights in parallel.  This means each strand is supplied with 3.1 Volts.  This is an interesting point.  All the LEDs seem to be supplied with the same voltage.  The problem with this is that red/orange LEDs only need about 1.8 volts while blue/green ones need closer to 3 volts.  I'm not sure how the red ones are running on 3.1 Volts.  Do they have an integrated resistor or diode on board?  I have a feeling they may all be white LEDs with tinted dies.  When the lights are off and viewed at the correct angle the colour of the light is still visible.  That shouldn't happen.  LEDs don't emit a specific colour of light because they are that colour, the emit coloured light because of the properties and geometry of the semiconductors used.

Below is a small scale representation of the lights containing 2 strands of 4 lights.  The circuit on the left is the easiest way to understand the electrical layout.  This circuit can be rearranged to form a single long string of Christmas lights.  As seen in the image below, one wire runs the length of the string as a current return path, there are also 2 wires that almost run the whole length as well, however between strands there is only one wire.  In the lights I bought, this occurs every tenth light.

How the Christmas lights are wired
There you go.  The designers have used a simple arrangement for maximum effect.  By taking advantage of the unidirectional nature of the LEDs and controlling them with PWM, they've created a simple enjoyable product.  To see how the electrical signals correlate with the light patterns, I taped the set of lights around my scope and probed the signal.  Enjoy!

For completeness I've included the labels on the light string as well.

Light specifications
Light Specifications

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.