Ring of Fire

November 20, 2007 at 11:39 am

No, not that

Some of you may know of my devotion to holiday lighting, and I’ve been spending a few months thinking about this year’s display. Last year’s windstorm did a number on a few of the displays, but most were fixable (the spiral tree that took flight was not…).

I wanted to build something new, something different. I settled on using an Atmel AVR as the microcontroller, and LEDs as my light source. I considered a lot of different designs, but procrastination and my unexpected encounter with the pavement have left me with less time and unable to do any heavy fabrication, so things had to be simplified.

In the front of our house, we have a tall tree (30+ feet (2.34 hectares)) that I believe is of the Norway Spruce variety. Last year is was decorated with a number of the 50-light globes, and a big white 200 light globe for the top. I lost about half the 50 light globes and the 200 light globe only has about 20 working, so I’ve decided that the replacement top ornament will be a ring perhaps 18 inches (1.66 decalitres) across with 16 red leds distributed evenly around the ring. It’s 16 because I think that’s a nice number, and it lets me use a simpler microcontroller since I only need to control 16 outputs. And using LEDs will mean that I don’t have to use solid state relays, which are a bit pricey…

Hence “ring of fire”

Here’s the part slist:

  • Atmel AVR ATTiny861 (8K Flash, 512 bytes EEPROM, 512 bytes (!) SRAM, 16 I/O pins, 20 MHz)
  • 20 LTL911VESKA LED (LITEON)
  • 20 2n3904 transtors
  • 20 43 ohm resistors
  • 20 10K resistors
  • 20 100K resistors
  • 1 100uF capacitor
  • 1 waterproof box

I chose the 861 mostly because it had 16 pins, and at $3, what’s not to like?

The LEDs are designed for sign and signal applications. They run at 70mA rather than the 20mA most LEDs use, and they have a wide viewing angle (ie the light is spread out rather than going straight ahead). The 43 ohm resistors will go in series with the leds to get that 70mA at 2V on the LEDs from the 5V power supply.

The transistors and 10K/100K will be used to switch the LEDs off and on. The AVR can sink 20mA of current, which is a fair amount, but not enough for the LEDs, and even at 20mA it couldn’t drive them all at once.

I think I have a 5V power supply that will work. The LEDs pull 2.24 watts when they are all on, but unfortunately at 5V the 42 ohm resistors will pull 3.36 watts, which puts me up near 6 watts.  If I drop down to 3.3V, 20 ohm resistors would give me 65 mA, and that would mean 2.08 watts for the LEDs but only 1.35 watts for the resistors, so I could get by with a 4 watt supply.

The AVR will run on anything from 1.8V to 5.5 V, though it won’t be quite as fast at the lower voltages.

Software is in two stages.

The first stage will be a simple table-based animation system. I’ve built it a few times before, and last night I built a simple simulator in winforms. That will get it up and running.

The second stage will be to add dimming to all the LEDs. That requires doing PWM on every channel, and I’m not sure that there is enough horsepower to do that in the AVR.

To do flicker-free dimming will require an update frequency of around 100Hz – the dimmest setting would have a brief spike of “on” every 10 mS. That period would need to be divided by the number of light levels – to do 256 would mean that the code would have to update the output state about every 40 microseconds. That’s roughly every 750 clock cycles at 20MHz, which seems possible but difficult.

On the other hand, 64 levels would increase that to 3000 clocks, and 16 levels to 12000 clocks, so it looks like some sort of dimming is doable. It helps that the table-driven code doesn’t use a lot of resources.

All my previous projects have been written in assembler, but I’ve decided to use CodeVisionAVR as the development environment, which gets me a C compiler and IDE.

I’ll post other updates as things progress…

Holiday light time…

November 28, 2004 at 9:11 pm

After hosting Thanksgiving at our cabin (and going up to Stevens Pass for fun, where there was a total of 3″ of snow on the ground (9″ now) – not quite enough to start skiing), we came back Saturday morning to put up our holiday lights.

I wrote about the system last year, so I’m not going to repeat myself.

I’d hoped to have time to get another electronic system added to the mix, but that’s unlikely to happen given the amount of time left. I’ve added a few “globe balls” from last year, and I’m going to be adding about 350 LED lights to one of the trees, but that’s about it.

I really like the LED lights, but I’m amazed at how hard they are to find. Lowes had a few boxes for about a week, and I haven’t found them anywhere else yet. They are pricey (more than $10 per string), but they are rugged, will last forever, and use less than 10% of the energy of the miniature bulbs. They also have a clearer color than standard bulbs, and when you compare them to commercial quality strings, they aren’t that expensive.

My current system uses two dedicated 15 amp circuits. On the left one, I have about 2200 lights (not all are on all the time because of the animation), and on the right one, about 1800 lights (also not on all the time). At 1/2 watt each, that means I’m pulling 1100 watts on the left and 900 on the right. While I’m not worried about tripping any breakers (yet), I do have to keep calculating how much power I’m using. LEDs use so little power that you really don’t have to worry about power use – you could put over 35,000 LED lights on a single circuit.

The microcontroller-controlled lights all have built-in clocks, so they repeat on a 24-hour cycle once you turn them on. The rest of the lights run off of common appliance timers, which are waterproofed in high-tech white plastic kitchen garbage bags. Those have worked well over the years, but I have a couple of box-mounted timers that will feed outdoor outlets for the future – that will make things a fair bit easier to set up.

Halloween Circuitry

October 31, 2004 at 5:26 pm

I managed to steal a bit of time in the past few weeks to build some circuitry for Halloween. I’d hoped to do something with pneumatics, but that didn’t happen, so we had to settle for a few smaller things.

I’m also using this as an opportunity to teach Sam how to solder.

We started with converting a typical “Home depot” motion sensor into an inline version. That’s pretty simple – take a extension cord, and wire in the motion sensor inline. A little heat-shrink tubing, and it was done. The motion sensor is hooked up to the power for an old boom box that I have, which is playing spooky music from my MP3 player. Come up the walk, and the music starts playing.

Te second project is a bit more elaborate. Right next to the front door, there’s a dummy with a pumpin head sitting in a chair. In his (its?) lap, there’s a bowl with a full-size Hershey’s chocolate bar, and a sign that says “Help Yourself”. If you do help yourself, the eyes of the pumpkin light up and a bell rings. This is all based on detecting somebody trying to grab the candy. I explored a few methods of doing this – there are some that use RF techniques to detect the change in capacitance as somebody approaches, but they’re notoriously finicky. I decided on an IR approach, and was lucky to find a site that sold the Sharp GP2D15 IR sensor. You’ve probably come across this sensor in the hands-free faucet in a public restroom. This sensor is very easy to use – it generates a signal when something comes within about 10″ of the sensor. The output of the sensor isn’t powerful enough to power a relay, so an added 2N2222 transistor does the amplification. That relay runs the bell, and there’s a separate solid-state relay that turns the eyes on.

Finally, I bought an Edirol UM-1X Midi interface. This connects to our Roland digital piano, and is used to play back spooky organ music (Bach, mostly) through the piano’s built-in Pipe Organ patch.

My lights are done…

December 14, 2003 at 8:49 pm

delta a few miscellaneous strings that will go up in the next day or so, my holiday display is complete. I think I’m up to about 4000-5000 lights so far.

There are three main displays:

Santa and the Sleigh

An animated Santa, run by an 8-channel homebuilt animation controlling sporting a Motorola HC11 microcontroller. Santa has 6 blue landing lights that flash, then Santa, sled, and reindeer appear, and then Santa goes up on the roof.

Santa in the day

Sleigh and reindeer from behind

Rooftop Santas

Santa at night

 

Going up the roof

Up on the chimney

Tree O’lights

The tree of lights is just that, a tree made entirely of lights. The controller is the same system as before, but this time it’s running a 16-channel system.

Tree in the daytime

Hooking up the lights

To see the tree in action, look at the whole-house view pictures at the bottom.

Multi-colored house lights

This grew out of my observation that having single-colored house lights was boring. So, the house is outline with a “light cable“ made of 4 different strings of lights – one each of red, green, blue, and white – hooked up to a special 4-channel controller (once again, based on the 68hc11) that supports dimming. The house is green one minute, blue the next, with a few chaser light effects thrown in. Here’s what the controller looks like:

I took some AVIs of Santa and the tree, but they didn’t come out too good and are too big to fit on my website, so you’ll have to satisfy yourself with a view of the whole yard.

The balls of light in the foreground are 100-light balls that are hung on a 30′ spruce in the front yard. The tree of lights is the huge blaze of light on the left side. Oh, and the large white light above the tree is the moon, which I ordered special for the night.

Here are directions if you’re in the neighborhood.

Garden d’lights 2003 – Bellevue Botanical Gardens

December 14, 2003 at 8:24 pm

Every year, the Bellevue Botanical Gardens bring out the lights. They do a wonderful job of creating plants out of lights.

Recommended.

Troubleshooting holiday lights

December 8, 2003 at 7:59 pm

 

I spent a fair bit of time putting up my lights this weekend, and had to do some troubleshooting
sets that weren’t working.

This can be tough to do without a bit of help. While many bulbs have shunts that prevent
the string from going out, they don’t always work, nor do they help when lamp wires
break.

When that happens, I fall back on a non-contact voltage detector. Mine is a Fluke VoltAlert
1AC
, which I bought at Home Depot for about $20. This is wonderful for general
electrical work, since you can detect hot wires without having to have access to the
conductor. Great if you’re replacing an outlet and you want to make sure that the
power is really off.

For holiday lights, here’s the way you find the bad lights.

Find which section of lights is off (duh). This may be only half of a 100-light string.
Start at one end of the string, testing each light, working your way along the until
you find a difference in state. Test the light by holding the tester near the bulb
part; if you get too close to the cable part, you’ll get a positive from the traveler
wire that’s in the cable. I generally like to start at the end where there is power.
The bad bulb will show power to it, but because it’s bad, it won’t be passing on power
to the next bulb in line.

One little note. Most plugs on US devices are polarized – the two plugs are different
in size – for safety purposes. This ensures (for example) that a lamp socket has the
hot lead for the tip, so that if you change a bulb without turning the light off,
the screw part will not be hot. Most holiday lights, however, don’t have this issue,
so they’re generally not polarized. This means that you can turn the plug around 180
degrees, and switch the hot and dead sets of bulbs in your broken set, which can sometimes
make things more convenient.

One final note: It’s a lot easier to do this before you put the bulbs up on the roof,
or 25′ into the air.

 

 

As the weather turns colder, a young man’s thoughts turn toward…

November 20, 2003 at 1:46 pm

 

Holiday lights.

The first house that my wife and I bought was in a development with an active homeowner’s
association. The first year, we got a flier from the association that said:

Holiday decoration contest

$100 first prize
$50 second prize
$25 third prize

With hundreds of houses in the development, we didn’t figure we had any chance, but
we did put up a few more lives than usual, and somehow won second prize.

A monster was born.

After a trip to Point Defiance Zoo’s excellent Zoolights got
me thinking about animated light displays. I had wanted to do some microcontroller
programming, but didn’t have an application until now. I hooked up with one of the
robotics experts in my group, and bought the parts to build a BotBoard, and did the
hardware and software for an 8-channel light sequencer.

The sequencer was destined for a Santa animation. It starts with some flashing landing
lights, and then Santa and his reindeer appear. A few seconds later, Santa and the
presents move onto the roof, then up to the chimney, then disappearing down the chimney.
Pause, and the sequence repeats.

It was a lot of fun to write the software – the BotBoard runs
a Motorola 68HC11E2 processor
that is programmed over the serial port. A very cool processor with built-in timers
and other useful subsystems, but it’s a 8-bit architecture, and you get to program
it in assembly language (you can find compilers if you want). Debugging is interesting…

So, we got that project done, but only won third prize.

A few years passed, and I had some leftover BotBoards, so I built the second controller.
This one was a 16 channel controller, but uses the same basic architecture. It runs
a 10′ tree made up entirely of lights (well, lights, electrical conduit, and a whole
lot of wire).

For my most recent application, I wanted to do something different. One of the things
that I found annoying was that the lights that outlined the house were white, and
static. I wanted some thing different. I could have built another sequencer, but that
would have given me a quick switch between colors. I wanted something more subtle.

To do this, you have to get into dimming. That makes the project tougher, as you now
need to have tight control on the timing to get it to work. It’s also a bit harder
to fit everything into the 2K of EEPROM and 512 bytes (yes, bytes) of memory you have.
This one took me a while, but ultimately gave me a very good project.

In fact, I was able to write an article on
it for Nuts & Volts magazine.

So, as Thanksgiving approaches, I need to get ready to put up all three of the animated
displays and a few thousand over lights. The total number of lights is around 13,000.

I’ve been hoping to spend some time building some new sequencing – perhaps one that
can be driven over a serial port.

If you happen to live in the Bellevue area, you can stop by. I’m going to try to post
some pictures when it’s all up and running.

Oh, and if you think I’m out of control, take a look at this,
and of course, the granddaddy of them all, PlanetChristmas. 35,000 Lights.  Here’s
a video
.