A project with which I've been involved is an interactive portrait gallery, with seventy mains LED lamps, turned on and off using VO2223A optocoupler/phototriacs, driven by a microcontroller. The lamps draw only 20mA each, which was one of the reasons they were chosen (negligible heat generation in the display).
All works fine, except that the clients would like the lamps to turn on and off slowly (over a half second, say) rather than simply jolting on and off, as the optocouplers switch the mains.
Below is a small schematic of the lamp circuit, showing the arrangement described above, and (on the right) what I'd like to be able to do. (Note that I've left out lots of components (such as the current-limiting resistors on the PIC outputs), to keep the diagram simple.) lamp circuit http://www.scifun.ed.ac.uk/downloads/atiyah/LED-lamp-switching.gif
Is there a circuit or component that could be installed inline with the mains supply to all of the lamps (via the optocouplers) as shown, such that there would be graceful rises and falls in current, rather than step changes?
As you can imagine, I'd rather that I didn't have to consider some individual circuitry on every lamp input, seeing as how there are seventy of them...