Controlling mains light with microcontroller is fairly easy. A simple mechanical relay can do the job. For more advanced approach, there can be Solid State Relays (SSR) used. But what about controlling 32-lamps. Jaanus decided to build programmable 32-channel light dimmer that could be controlled from computer. He used Arduino which controls an array of solid state arrays to switch lights.
SSR’s already have zero crossing detectors and optical isolation. So they are safe to be controlled directly with microcontrollers. Light dimmer accepts simple commands from USB virtual serial port, where each channel can be turned on or off. So it can be programmed to do some fancy patterns or simply can be integrated in home automation. Project details are available on GitHub.