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.

  • 1
    \$\begingroup\$ In theory, no problem. \$\endgroup\$
    – Andy aka
    Jun 4, 2013 at 8:09
  • \$\begingroup\$ There are optoisolators with a triac output. For example, MOC3020 \$\endgroup\$
    – Phil Frost
    Jun 4, 2013 at 13:19

1 Answer 1


The basic triac driver circuit sinks current into the gate (trigger) input, to ground. If you can connect the grounds of all involved triacs together, you an use one microcontroller to drive all triacs (via a suitable drivers, of course). I hope you realise that this makes your microcontroller circuit 'life' (= connected to the mains), so unless you have an isolated programmer it will make your debugging process tedious.

I have my doubts that this approach will save you much, because optoisolated triac drivers are small and cheap. The snubber R + C are likely to be your largest components (unless you need to cool the triac). Maybe you can combine the snubbers into one filter for all channels.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.