I had a look to other posts about Triac and I am pretty sure my problem was not in there.

The goal of my system is to realized a controlled switch for home appliance. Then I designed a power supply system (non isolated) that supply energy to my microcontroler (STM32F030C8T6). It is all working fine.

I would like to controlled a triac (NXP BTA316-800E) with one of the logical output of the STM, then I realized this circuit: enter image description here

NOTE: The earth symbol is a mistake, it is a 0V point of the circuit.

As I would like to control every types of appliance I add a snubber circuit for inductive load.

To turn on the applicance I set the STM32 output (logic 1 : 3.3V), and I clear this output to turn off the appliance (logic 0; 0V). This ouptput is a push pull type.

My problem is : The appliance is always ON. I can see that logic levels are well applied (at the output of the STM32), however, here is what I get at the Triac gate, when output is 0: enter image description here

I guess the short 1.8V spikes keep the triac on, but I don't know why these spikes are present.

Anyway, I tried to remove R2 and tied T1 gate to ground in order to be sure that no current is flowing through but the appliance is still on.

Do you have any idea?

Thank you very much.

IMPORTANT: This circuit is dangerous (deadly) as you deal directly with main power. All care has to be taken to experiment.

  • \$\begingroup\$ Just saying: instead of wiring your MCU directly to the triac's gate, I suggest using an optocoupler instead. That will make the circuit less deadly. :) \$\endgroup\$
    – Venemo
    Mar 20, 2016 at 21:12

3 Answers 3


Test whether the triac is OK by leaving its gate floating. It shouldn't conduct.

You can put the control signal to high impedance state, this should kill the triac at the end of the period.

OT: be very careful if you really must have the power supply referenced to the line (as is on the picture).

Edit: the schematic is not wrong as others claim - it is possible to use line as reference, but one has to keep in mind that the moment the GND connects to neutral you got a short circuit. And it is all too easy to happen in this setup. For example, if you connect to grounded lab instrument (oscilloscope) you get a short. I've been using similar setup in a project that measured noise on the power lines. There you need it if you have non-isolated supply. I knew the risks, but I still managed to burn the prototype, the programmer and my computer. Also, don't let me start on the fireworks it caused..


How about if you add Photo-Diac the output; MOC3021/3022 and trigger the triac with a diac. The Photo Diac method never ceases to amaze me. Works like a charm.

Technical explanation :Triac works with AC and gate give voltage pulses to the controller. Hence using Photo-Diac takes out every chance of blowing your controller apart, and i guess Gate voltage required to trigger the Triac is more than 3.3V(Unsure about this one). 3.3/220 = 4.5mA ; so technically the gate current is sufficient.

Before trying the photo diac method; try using a lower-value resistance. like 100ohm


I don't know if you have messed the schematics, but is completely wrong. Line is earthed, the power supply comes just from neutral - impossible to work. Probably the MCU output pin is already dead.
Keep in mind that triac has to be sensitive gate who works in 4 quadrants. Read this app note carefuly: http://www.w-r-e.de/info/st_an392.pdf

  • \$\begingroup\$ Thank you for the app note. It is very interesting and confirm that the cicruit looks ok, as it is quite the same as the figure 3. Of course I messed the "GND" symbol, which is a "0V" reference point and definitely not "Earth". The MCU pin is fine (tested) and once again: the problem is not that the Triac doesn't turn ON, but it doesn't turn OFF \$\endgroup\$
    – yipyop31
    Jan 18, 2016 at 11:41
  • \$\begingroup\$ Post your schematics, it shall be clear that +Vdd is connected to line and gnd has always the vultage Vgnd= Vlive-3.3V \$\endgroup\$ Jan 18, 2016 at 13:27

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.