Okay guys, I've been tasked with making a light-dimming control system for a 240V heat lamp dissipating around 250W. I need to adjust the heat output on the lamp by control from a microprocessor.

I'm developing on an 8051-based SoC with RF circuitry and some sensors and actuators. Basically it's a node in a wireless sensor network. I've left all other components out.

I'm mostly a software guy, so I might need some help here. Pardon my lingo and if I raise fundamental questions, I don't have a lot of experience with this.

I am thinking of a design like this for the dimmer circuit:

enter image description here

.. and I have some questions :) I've marked red boxes with numbers matching the questions:


  • Is this a sensible way to drive a triac ? The resistor on pin 6 should have a higher power rating. Like 5W or something I would guess.
  • The GPIO leg can supply up to 500mA, so it should be plenty to drive the gate for the transistor right?
  • And mostly any transistor will do I take it.


I don't know how inductive the heat lamp is, or how its resistance changes with temperature. I want to do an estimate of how the triac should be spec'd.

  • 240VAC(rms) would be ~340VAC(peak2peak), so 400V max isolation voltage should suffice, no?
  • A max surge-current rating of 4A would leave some overhead I would assume, but I'm not sure how much I need. I am assuming a switch-on from cold could draw a lot of current - should I instrument to be sure? I don't have any data on the heat lamp other than its rated for 250W max.


  • Am I understanding correctly that this is the snubber?

I've found a couple of topics that helped me, but I'd appreciate a comment. I read these:

TL;DR: Am I way off with the schematic? Some help on guestimating the rating of the components would be nice as well :)

  • 1
    \$\begingroup\$ What is unique about your situation that prevents the use of a standard off-the-shelf timer switch? \$\endgroup\$
    – Dave Tweed
    Oct 19, 2012 at 14:42
  • 1
    \$\begingroup\$ @DaveTweed: It is as m.Alin suggests. This is part of a larger design and not just a dimmer :) The design will be made in volumes of a couple thousands, so unit price has some priority. Though if you know of a dimmer I can use, please post a link :) \$\endgroup\$ Oct 19, 2012 at 16:58
  • 1
    \$\begingroup\$ It all boils down to how the dimmer is to be controlled, and you're not giving us the context we need to determine that. Are you trying to regulate the temperature of something? You say that you're handling the zero crossing detection yourself, but you haven't shown us that. As far as the AC side of the circuit, what question do you have that isn't answered in the thousands of data sheets and application notes for triacs and optoisolators out there? \$\endgroup\$
    – Dave Tweed
    Oct 19, 2012 at 17:33
  • 1
    \$\begingroup\$ @MortenJensen , just never mind it too much. What I told you is if you double check for safety , then there's nothing more to check. If you new to AC power electronics, find somebody who is experienced to guide you. \$\endgroup\$ Oct 21, 2012 at 16:04
  • 1
    \$\begingroup\$ Without the FULL schematic you are asking us to just guess. What you have shown right now is just the output stage; there is no way the SOC will be detecting a zero cross without additional circuitry. \$\endgroup\$
    – akohlsmith
    Oct 24, 2012 at 15:39

4 Answers 4


First off if you are controlling a heating element you don't need a snubber.

Second, safe is a relative term. If by safe you are asking if it will explode and catch fire then build it an find out. If by safe you mean can I or anyone here tell you that you have built a safe circuit, meaning that you won't hurt someone.... well good luck getting a commitment there. 240 VAC is generally considered unsafe voltages to mess around with, so its not wise for anyone to give you the go ahead.

Here is a link to AN-3003 from OnSemi that shows an application note that will help you design the circuit.

Safety advice:

One more comment, remember that you need to handle the peak voltage when specifying a part, and handling surges and overvoltage situations that can arise from the power company. So 240 VAC is the RMS value (average), and the peak is times the sqrt of 2, or 340 volts. So make sure you use a triac that can handle 600V for a 240VAC circuit.

  • 2
    \$\begingroup\$ Peak is times sqrt(2), unless you want to add some overhead to it for safety or such. \$\endgroup\$
    – exscape
    Oct 24, 2012 at 17:20
  • \$\begingroup\$ Brian, thanks for the answer :) I'll update my question with a better schematic. @exscape, yeah I thought so - I should be safe with 400V isolation voltage parts though, right? \$\endgroup\$ Oct 24, 2012 at 19:21
  • \$\begingroup\$ @Brian I've updated my question (a lot). \$\endgroup\$ Oct 24, 2012 at 20:55

I'll add a few more things:

  • 500 milliamps is a lot of current, and should be more than enough to drive the opto-isolator directly unless the uC runs at a different voltage. Even then, you can probably use it as a sink.

  • If you still keep the transistor, you need a resistor between the GPIO and the base. B->E on a transistor operates like a diode, so it'll pull as much current as you let it, while only needing a few milliamps to do its job. Check the datasheets, but something like 1k should be plenty to do all the work you need to while not drawing excessive current.

  • Remember the operating behavior of a TRIAC when deciding to use it in this manner. It won't turn off until the AC voltage swings to the opposite polarity and crosses zero. This means you can't use PWM in the traditional sense as provided by the uC (since that's generally dozens of kilohertz), and will have to watch the zerocross yourself and count internally to trigger the triac. You may have simplified the diagram, but I didn't see anything to indicate that you are feeding the zero-cross signal into your uC.


Regarding safe voltages, it's good question. I see that the voltage swings in the mains are up to 260 VAC RMS; that's about 364 VAC peak. A 400 V TRIAC could just meet that requirements. However, it would be wise to use a 600 V TRIAC, but these are more costly.


i have started working with AC dimming of LED AC light bulbs and made this circuit which uses a 555 timer for the zero detection.

555 zero cross ac dimmerhttps://www.dropbox.com/s/l1mweybxcspuqwr/555.png?dl=0

i did not see the need for a snubber circuit until now. i started testing with longer (25m) cable between bulb and dimmer and saw a flicker.

not sure how important flicker is for your heating lamp.

you might have solved the problem already. would be great to hear who it went.

good luck.


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.