Christmas Lights

We've converted our outdoor holiday lighting to use GE G35 computer controlled RGB LED lamps. I've devised new programs every couple of days. github

Furnace

My first scheme sampled my furnace hot-air plenum temperature and then set a random lamp according to this schedule: cold => blue, warm => green, hot => red.

In the morning they would be all red as the house warmed.

In the afternoon they were mostly green but with red speckles as the furnace cycled.

In the middle of the night they would be solid blue.

Requests

I resorted to writing much simpler programs by request. 10 ro 20 lines of code would put on a show that recognizably met the requests.

Often I would chose colors at random.

Often I would chose a bulb to change at random.

Often I would chase patterns around the lights.

I began expressing patterns as strings of characters where each letter corresponded to a color or some related function.

Remote

I wrote cgi scripts that would set or clear filesystem flags that would be interpreted by my scripts at their convenience.

My son Patrick wrote a php/bootstrap application that offered more sophisticated controls like a color picker. We made that cycle about ten times a second for nicely animated effects.

Resolution

I use to scale rgb to the 4-bit range available in the hardware. I would then set the brigtness to full on.

red = red/16 green = green/16 blue = blue/16 bright = 255

I now set the brightness to the brightest component. I then scale each rgb by the inverse of the brightness.

bright = max(red,green,blue) red = 255/bright * red/16 green = 255/bright * green/16 blue = 255/bright * blue/16

This means that at least one of the 4-bit rgb registers will be set to full on and the others set proportionally.

This preserves the best color fidelity even for dim colors. The difference is startling. You can take any color and dim it down to black without it changing hue near black.

I tested this by using the color picker to set every other bulb by each of the two methods. For brighter colors there was no difference. But for dim colors they would no longer shift hue toward primary colors as they got close to black.

Resources

We control our Christmas lights with scripts that take parameters from a web application. The scripts talk Txtzyme to a Teensy microcontroller that replaces the stock controller that came with the GE G35 LED lamps.

What is Christmas without lights? Incandescent mini-lights on the tree and GE G35 LED lights on the house.