Having recently come into posession of a number of high brightness LEDs (thanks to a generous donor), I had to do something with them. I decided to use most of them as ambient lighting, light strings perhaps. Kind of festive besides, being that it is December!
Lighting LEDs is fun and all, but if I'm going to the trouble of stringing up the bastards, I might as well control them, too. The most basic way to light LED strings is a series resistor and optional diode (half wave rectified). The 60Hz pulsing light is awful, and there is no control (although a lamp dimmer would work). Full wave rectification might be more tolerable. Full wave with a filter capacitor, however, is just so easy and gives perfectly constant light. As for control, a linear regulator could be used, but the power dissipation would be awful. PWM comes to mind, not needing any heatsink on the switching transistor. If the strings are operated off line, the controller will need to be isolated, so an optoisolator is required (since a gate drive transformer doesn't work very well for PWM at 0 or 100%). So, a PWM frequency needs to be chosen and the PWM controller chosen (or designed). Given that anything over about 100Hz will smear into constant light due to persistence of vision, a moderate frequency, around 5kHz let's say, will give ample time for the transistor to switch, allowing it to be driven rather lightly (with a few miliamperes) from a rather slow optoisolator. Finally, being fond of LM393s as I am, I went with a hysteresis comparator. Since I'm going to the trouble of PWM and all, I want an analog input too, with peak detector.
Putting all that together, I got something like this. This circuit is a strange combination of over-the-top design and bean-counter-esque economy. Certainly, much of it could be combined into one chip (for that matter, the whole thing sans capacitors could be), but I don't know of any one chip that does most or all of these functions, so I built it discrete as I like to. It's not very big anyway, the controller fit on a bit of leftover perf board (see below). Standing resistors save a lot of space!
Placed inside a (grounded!) chassis, the front panel controls are Power, Bias, Level and Input. On the rear, the power cord, fuse holder and LED strings.
Inside, the controller is mounted to the front panel, while the power supply (which includes the current limiting resistors) is mounted to one side.
So how does it look? Pictures don't really really do it justice, but video is nice: