I want to control (dim) multiple mains lights using triacs and a microcontroller. (One triac per light). I want to keep both the costs and component count as low as possible.
Is it necessary to have multiple optoisolators? (One per triac?) Under normal operation, could the triac gates be at significantly different potentials, for example when some lights are on and some or off, or perhaps during non-zero switching due to transient spikes due to the inductance of the lights? I would probably use a transistor (PNP) between the uC and triac, which would saturate to trigger it. The gate-side anode would be connected to neutral, as would the uC's ground.
I understand that the live part of the system should be isolated from interfaces such as programmers, as per this question. Such isolating would be less costly than one optoisolator per triac, so I'd prefer to isolate this way rather than one opto-isolator per triac.