Thursday, February 17, 2011

TwinklePIC, part 4

Parts 1, 2, and 3

So, I had a circuit that worked and a program that made the LEDs twinkle nicely. But that is only part of the story: I also needed to dress it all up into a pleasing display. In truth, the soldering and programming were fun little exercises; industrial design is not something I would claim to have any talent with.

The Cosmic Nightlight that was the original inspiration for this project embedded its LEDs in a clear epoxy resin, into which was mixed streaks of color and children's glitter. The LEDs were arranged into the constellation Leo.

The results were very nice, and originally I planned to do the same. But in the end I decided to take a different approach. The epoxy was more labor-intensive than I wanted - and permanent! The author's nightlight was 3" x 6", dictated by the mold he used. I wanted something larger. In the end I decided on the following construction: I would embed the LEDs into a piece of 8" x 10" black acrylic, and set that into an ordinary picture frame. Much easier to just drill some holes!

I pondered what constellation, if any, to base the work on. I decided to make the Pleiades cluster:


It's beautiful, it's visible to the naked eye, it's a little off the beaten path, it has tons of history and legend associated with it, and it's the inspiration for the Subaru logo. Plus, I was using white LEDs for this project, many of which tend to have a slightly bluish tint to them, so a constellation filled with blue giants seemed appropriate.

Since my presentation was going to be pretty spare - no glitter or extraneous coloring - I at least wanted to go for fidelity. I could perhaps have found measurements of where each star is located in the sky, then transferred that to my 8 x 10 acrylic. I could have done it freehand. Instead, I went a much easier route, and made an 8 x 10 printout that I could tape to the acrylic, using the star locations as my drill locations. I found it much easier to first invert the image and print it black and white. It is well known that humans are better at picking out black spots on a white background than the other way 'round. This saved a lot of ink, too.


This then was the pattern I used to drill holes in the acrylic. I plugged the holes with the LEDs on wires that I showed in the previous post.

One thing I soon realized, however, was that these particular LEDs shone their light in a relatively narrow beam. In the dark, they were dazzling when viewed head-on, but didn't throw much light off-angle. There are things I could have done to combat this, including just getting different LEDs. But laziness won out, and I have just decided to live with it for now.

One thing I did to ameliorate the narrow-beam effect: I replaced the picture frame's original piece of clear plate glass with a piece of frosted glass. It doesn't do much for illuminating an entire room, but it does produce a nicer look from the side.

You'll notice that the stars in the cluster are not all the same brightness. I could have adjusted the program so that some of the stars were always brighter than their fellows. A better way would be to adjust it in hardware: each LED has a resistor in series with it. The resistor value has the effect of setting the maximum brightness: a greater resistance would result in a dimmer LED. The apparent magnitude of all the stars are well known. It would have been trivial to figure out what resistor values to use to get the relative brightnesses of the LEDs to match. Again, laziness won out, and I haven't gone to that length yet.

My intention originally had been to power this device from batteries. Based on testing I did with my prototype circuit, a fresh pair of AA alkalines would nicely light Brynna's room each night for just over a week. In that case, I planned on routing out a groove in the wood of the picture frame, and installing metal contacts at either end, so that I could indeed have the batteries as part of the frame. But then I got to thinking about all the batteries I'd be using over the years: it's unconscionable. Rechargeables were an option, but with shorter runtime. Plus, as the batteries drained, the LEDs would get dimmer.

Instead, I decided that the best long-term solution would be to power it from a high-efficiency AC/DC converter. A USB power adapter would do the trick nicely: they're easy to find, relatively inexpensive, can be really tiny, and can be extremely efficient. I'm presently using the adapter from the current generation of iPhone: it's >90% efficient, zero vampire current, and less than one inch cubed. The USB cord, and required proximity to an outlet, are a livable compromise.

You may recall that I also installed a mode-selecting switch, which would toggle the LEDs from twinkling to solid to off to twinkling again. This I planned to install on one corner of the picture frame. If I installed it on the front it would be easy to find, but a bit of an eyesore. Instead, I planned to install it on the back side of the frame, so that to activate the switch all one need do is push that corner of the frame as it hangs on the wall.

How does it look? You'll have to wait for the 6th and final installment. Before that, we'll revisit the electrical circuit, and how I transformed it into a printed circuit board.

No comments: