Introduction: Small Triac Switch

Picture of Small Triac Switch

In order to switch some floodlights by my Arduino, the small switch circuits I built around a 39mf22 were just not man enough to handle the current needed, so I decided to build a switch with discrete components around a TRIAC.

Now these circuits are very easy and come a dime a dozen on the internet: just google for TIC206 or MOC3041 and you have lots of choice. The reason I make an instructable for such a simple circuit is to also provide a print design for those people to lazy or unable to make a design themselves :-)

But let me start with a disclaimer/warning:
This circuit is connected to a mains voltage that can kill you. If you do not know what you are doing then do not build this circuit.. Do not touch it when it is connected to the mains. The metal plate of the Triac is connected to it's Terminal 2 and thus to the mains voltage. When in use, do not touch that plate to feel how warm it gets.
Put this circuit in a proper container.


Materials List
Triac TIC206 €1.20
MOC3041 €0.65
DIL 6 IC foot €0.15
LED €0.15
Resistor 220 Ohm 1/4 Watt €0.10
Resistor 470 Ohm 1/4 Watt €0.10
Connector €0.20
Piece of scrap PCB 23x43 mm

That is a total of €2.55
The links are just there to illustrate what I mean and to give a price indication. I have no links to that webshop other than that i use it and am satisfied with it.
It is also possible to use the considerably cheaper BT136-600, that like the TIC206 can deliver 4Amps, but it's gate current is a hefty 35-70mA as compared to the TIC206's 5mA. If a BT136 is used, the 470Ohm resistor may need to be a bit smaller (150 Ohm). The BTA16-600 is also a good choice

additionally you may need:
capacitor 10-100nF 400V
resistor 39-100 Ohm
resistor 330 Ohm

The PCB is here.
and mirorred here.

The circuit
The main components in this circuit are the MOC3041 optocoupler and the TIC206 TRIAC (M or D version). I have chosen for a MOC3041 because it has a zero crossover circuit in the chip, ensuring smooth switching. The TIC 206 is a triac that has a relatively sensitive gate.

The output from an Arduino or other uP is led to the MOC3041 via a 22o Ohm resistor and an LED. This way one can see for sure if there is current flowing through the optocoupler.
The gate of the thyristor is fed from a 470 Ohm resistor that connects through the MOC3041 optocoupler
On the printed circuit board there is room for a 330 Ohm resistor (labelled with a '*'). If one uses the TIC206 TRiac this resistor is not necessary. Some other thyristors however may need that resistor in order to start.

Triacs are not really suitable for inductive loads. As I am switching a lamp, I have no use for a snubber circuit (formed by the 100R resistor and C1). However, if you switch inductive loads you will need one. The values of the resistor and capacitor may vary depending on your situation but a proper way to start would be a 100 Ohm resistor and a 100nF capacitor. The PCB offers holes at various distances, suitable for different sizes of capacitors.

The PCB
Download the PCB design(s) above and use your favorite method to etch your PCB. With regard to the design: the pcb picture in this ibble is seen from the component side: The copper traces thus are actually seen as if you are looking through the board. That is why the writing is in reverse. This design is suitable for a direct toner transfer

If you use the mirrorred design, the writing is in fact not mirrorred.

I have used the non mirrorred design for a direct toner transfer (printing it on glossy paper and ironing it on a copperplate) and that works well. Etching in Hydrochloric acid and Hydroyperoxide.

Connecting
There is only a two pole connector on this PCB that can be thought of as a switch, interrupting the 'Live' line of a connection, just like a regular switch. The figure shows the proper way to connect it according to EU codes: Blue is neutral, brown is live black is switched and yellow green is earth. Outside the EU there are different colour codes.

Comments

TJMehta (author)2017-01-31

Hi,

I want to operate simple LED Lights of maximum 20W which are not dimmable.

Can I use the same circuit for switching purpose of LED Lamps or any lighting appliances?

diy_bloke (author)TJMehta2017-02-02

Yes, this is basically just a switch so i see no reason why and LED lamp couldnt be switched by it

TJMehta (author)diy_bloke2017-02-02

Sorry, but I am getting flicker for LED Light if I am using it in '0' Logic also. It works fine for Logic '1'.

I want to specify one thing that I am using SMPS based LED Driver for that appliance. What should I do for proper operation? Should I modify the circuit? If yes, Plz suggest...

diy_bloke (author)TJMehta2017-02-03

Well Triacs are very suitable for a pure ohm resistance, they do not do very well if electronic circuits are behind it.

A conventional SMPS provides an output that is regulated to give a constant voltage.

That explains why it works in the on position. In the OFFposition, meaning with no voltage on the gate, a Triac switches off at the next zerocrossing. Sometimes that doesn't work well if the load is too small,which one would expect with LEDs.

I am afraid that 'modifying' the circuit in this case would mean a completely different circuit, SMPS driven LED's are usually regulated by resistors

TJMehta (author)diy_bloke2017-02-03

I want to ask one question...can you explain the significance of 100R Resistance and 100nF Capacitor?

Because, if I remove those components, the same circuit works very well for lower load resistance like LED lamps. So if those two components are used for protection purpose then my circuit may damage... otherwise it is working fine.. and we can say it as so called 'Modified' circuit.

diy_bloke (author)TJMehta2017-02-06

Those 2 are there mainly for suppression of noise on the mains line and they are especially important if you switch an inductive load.
But yes you are right, sometimes, with a lower load they can keep the TRIAC open. So in your case, justremove them, no harm done

TJMehta (author)diy_bloke2017-04-18

One more difficulty I am facing that if I am using output of Arduino Promini which is operating on 3.3V, then I am not able to get switching of Appliance connected at Load side. Please suggest me suitable changes for the same.

I think initial resistance of 220 ohm and indicator LED is consuming most of the output voltages so if I remove both these components, will MOC 3043/3063 (I am using in my case) work properly or because of absence of current limiting resistor it might get burnt?

diy_bloke (author)TJMehta2017-04-20

The switch was built in the 5 Volt era with a red LED in mind. With 3 Volt, the LED will already consume much of the voltage.
The Forward Voltage of the MOC is about 1.25-1.5 Volt. An LED can be between 1.8 and 2.5 Volt forward voltage, so obviously there is not much room to move. Depending on the LED you use, you could do 2 things
1 remove the Resistor out of the equation and feed your 3.3 Volt directly to the LED in series with the MOC3041. Again, depending on the LED (say we take a red one), that will have a combined forward voltage of 3.2 Volt, so shld be OK.
2 a safer option is to remove the LED out of the equation and just use the series resistor. Suppose you want to feed the MOC 10 mA, you shld have a resistor of (3.3-1.8)/10= 1.5/10=0.15kOhm=150 ohm

Jameeluddin (author)diy_bloke2017-07-16

Can we connect 230V AC to power the infrared LED inside the Opto coupler with suitable resistant in series. Or we have to convert AC to DC then feed the the optocoupler LED. Then the value of resistance in serier (230-1.8) /10 = 23 K resisitant.

TJMehta (author)diy_bloke2017-04-20

Yaa.. I also used same red LED.. That's why I also think to bypass the LED and using a 150 ohm resistor. Thank you for your response...

diy_bloke (author)TJMehta2017-04-21

My pleasure

TJMehta (author)diy_bloke2017-02-07

Thank you very much...

JurajP1 (author)2017-01-09

Hi, please, is it possible to use esp8266 + MOC3021 + BTA16 for switching 230v/16A ?

diy_bloke (author)JurajP12017-01-10

sure, but it is pushing the bta 16 to its limits. need some serious heatsinking

AamalD (author)2016-06-26

THANKS A LOT

diy_bloke (author)AamalD2016-06-27

my pleasure

iced2 (author)2016-03-31

Hello,

I have tried this circuit with very bad results. I put in the snubber circuit just in case and connected a small 50w halogen lamp transformer and 30W halogen lamp, the 470ohm resistor next to the triac smoked away when the triac turned on.

Even when the triac was off I could still hear the transformator being on so it is never actually turns a device off.

I have tried it with low power devices, the switching doesnt work as it should either this cannot replace a relay.

diy_bloke (author)iced22016-04-01

I am sorry to hear about your problems. But I think your conclusions as that it doesnt work is wrong. It is working for me for 3.5 years already and as you can see from the various reactions here it works for a lot of other people.
If the 470 Ohm burnd away, then perhaps you made a faulty wiring.
Triacs are not very suitable for inductive loads because the Voltage and current can get out of phase due to an inductor.
Nevertheless, as a result of your comment I tried it with a 25 W Halogen lamp and I have no problems

Nikki SamridhiM (author)2015-07-03

Hi,

I tried this circuit with moc 3061 and BTA16-600 BW, with 470 and 330 ohms resistors. It works perfectly switching on and off. But when Direct AC driven LED is connected, i can see light flickering after 2 second. Can you please suggest me any changes that needs to be done to the circuit for LED load?

Thanks,

Sham.

AC LED's work completely different and many are not compatible with a circuit like this. For starters you would need an

lED that is labelled as suitable for dimmers

Yes true, the one i have does not support dimmer. Let me buy one with dimmer and try. Thanks diy_bloke.

if you buy one with dimmer then ofcourse you do not need this circuit anymore. I meant onr suitabl for a dimmer

ManojM1 (author)2015-01-29

hi,

i think the T2 label in your diagram should be T1, as its on the side of the Gate.

As per http://www.bristolwatch.com/ele/triacs.htm and other references, Gate should be triggered from T2.

i was trying out a circuit with bta136 and 3061. for safety, i was testing it with an AC-AC adapter that output 18V AC, with a 1uF/300V capacitor in series, so as to limit the current, so that i could it it with a load of LEDs.( one can also design an LEDs light from mains this way). initially had the problem with the circuit always remaining on, as well as the leakage issue. i replaced bta136 with bta16, as per comments here, but no change. researched the internet for some triac basics, one of the tips was to make sure to connect "Mt2 to Gate". Checked the pinout of bta16, and made the connections again, keeping t2-gate in mind. Now i tried to make the circuit work first with 3061 alone, then with the bta16 alone, and finally using both, and had success all times. It also worked with the bta136. Note that the resistor to the input of 3061 may have to be reduced, in order to provide sufficient current. the snubber causing leakage seems unavoidable, as it provides a parallel path to the triac. I=V/R = V/(1/wC) = VwC = 240*50*10^-8 is around .12 mA, probably not significant when a proper load is connected. some circuits suggest a value of higher 100nF, so would not reduce it. i was also thinking of using a non-zero-detect photo-triac, so that i could send pulses instead of providing a continuous input current.( zero-crossing detection can help protect the load by providing a gradual voltage, and may be a must for some loads ) am attaching a pic of my test circuit. the black box at the start is a fuse-holder.

diy_bloke (author)ManojM12015-05-08

ManoJM,
oddly, my earlier reply to you has not been posted. There was a time that apparently I had to click the button 'Make Comment' twice. and as I didnt always do that, comments disappeared when i left the page.
Anyway, Thanks for your contribution. There indeed can be some confusion about those pins.
As my earlier reply got lost, I am not sure if I indeed had changed the picture then, but as far as i can see it is now correct.
You can use a non zero crossing detect photo triac to which you can send pulses, but as there will be no defined relation then to the point in the cycle when u send the pulse, the effect will be unpredictable. for that you may want to check mu ibble on the triac dimmer.

thanks for your picture. i always appreciate to see what othes do.

ManojM1 (author)diy_bloke2015-05-08

thats odd, i had read your earlier reply and seen the corrected diagram posted around 3 mths ago. i can still see your comment on my home page, maybe its just lost here. thanks for responding.

diy_bloke (author)ManojM12015-05-09

that is odd indeed, but thanks for letting me know

JeffW13 (author)2015-05-08

@diy_bloke Will this work with 120V? what values change? Also the other circuit with the triac the dimming one can it be used with 120V as it is shown?

diy_bloke (author)JeffW132015-05-08

yes it will. no need to change any values.
With regard to the dimmer, the changes are described in the article. If you are running 120 Volts, most likely you will also have 60Hz and then it involves changing a value in the software as well as changing 2 resistors.. as described in the article:-)

diy_bloke (author)2015-01-29

ManojM1
You are right about the naming of T1 and T2. If I look at the fact that the T1 label is put also in a somewhat awkward position, I guess something strange happened that induced this mistake. The print design is correct however.
There are people claiming that switching of T1 and T2 doesnt make a difference, but I am not so sure about that. I always keep an eye on using the proper one and I never had any problems with triacs.
In the text I do mention that on using the BT136 the gate resistor may need to be reduced.
Snubbernetworks indeed can cause problems due to leakage. As I usually only switch pure resistive loads rather than inductive loads, I can get away with no snubber network.
Thanks for your remarks. I will correct the picture

ManojM1 (author)diy_bloke2015-01-29

ok. thanks.

mashiurmmr (author)2014-08-09

Hi,

I am making another switch to control water valve of over head tank and using this circuit. I am facing problem that when I supply current to pin 1 of MOC3410 pin 4 & 6 get connection but even after cutting the current supply to pin 1 the connections of pin 4 & 6 remains. I want some thing which cuts off connection when the signal is off. Can you suggest any solution.

Mashiur

diy_bloke (author)mashiurmmr2014-08-10

Mahiurmmr
It seems like you have exactly the same problem as before:
The MOC3041 should shut off once you remove power. if it doesn’t, you might have a faulty one or yr circuit is not correct.
If it is just to switch a control valve and you are having so much trouble with teh MOC, how about a transistor with a relay?

mashiurmmr (author)2014-07-05

Hi,

Thanks for the circuit I made it, used a mobile for input signal ( ringtone) and 12 volt for operation of a relay had to use a triac 547 to enhance the signal the relay is switch on but it remains switched on even after cutting the input signal. I have used all registers and the PF(100n) only R330 register excluded and I used Tric225 instead of 206.

I am using it with timer and magnetic contract to drive a pump, I solved the problem of shutting the relay of by using the magnetic contracts connection to cut the power (12v) when the time is on.

I thought the load (relay) will switch off when input signal is stops. Can you advice me what to change in the circuit.

diy_bloke (author)mashiurmmr2014-07-05

yes the Triac should switch off so something is keeping it on.
But first I need some clarification of your sentence: "I solved the problem of shutting the relay of by using the magnetic
contracts connection to cut the power (12v) when the time is on."
What exactly are you cutting the power off from??
Also, I am not really sure what it is that is not switching off? is it your relay or the TRIAC?
The 547 btw is a transistor and not a triac.
Could you perhaps send me a drawing of yr circuit?
If you are using a relay, you may as well use that to switch yr load

mashiurmmr (author)diy_bloke2014-07-07

Hi,

Yes 547 is a transistor, actually I am a hobbyist. Trying to make home automation.

I use a timer and a magnetic contact to drive overhead water pump. I made the connections such a way that when I apply power through a push button switch to timer, timer starts the magnetic contact which starts the pump and also provides power to timer. When the time is up timer shuts the magnetic contact, the pump and timer both stops.

I used this circuit to activate the connection of push button switch. As mobile ringer signal is low used the transistor. But the triac keeps supplying current even after input signal is stopped.

As I had ideal connections in the magnetic contact which is connected when the contact is off, I used that connection to supply power(12v) to circuit. So as soon as the timer starts, the magnetic contact is activated and power to the circuit is cut off. When the time is up the power to the circuit get restored.

I think I did it manually, but I plan to use a flip flop circuit in future. Give me some tips on that but now I need to know why the triac keeps the connection on. Thanks for reading.

Mashiur

diy_bloke (author)mashiurmmr2014-07-08

Mashiur
I admire your energy and drive, but i get the impression your circuit is needlessly complicated. Why not just use 1 transistor and one relay to switch your contact, no need for the Triac circuit

rmatkar made it! (author)2014-04-25

Hi

It had a lot of fun doing this. Got a PCB printed and have the ability to control 7 switches using this. I have added a xbee module to make it wireless.

Cheers!!!

Rituparna

diegolangamer (author)rmatkar2014-06-14

Hello Rituparna,

Congratulations for your work. I'm in a similar project and I have faced some problems. I sent you a message about this project. If you can help me, thank you very much!

rmatkar (author)diegolangamer2014-06-14

what have u sent the msg on? i don't have anything in my inbox...rituparna89@gmail

diy_bloke (author)rmatkar2014-04-26

looks great. Thanks for posting it. Always good do see what people do with ibbles. Impressibe PCB :-)

rmatkar (author)diy_bloke2014-04-26

thanks

egrabhishek (author)rmatkar2014-04-25

Nice Work. Looks awesome.

Regards,

Abhishek.

XenonHK (author)2014-06-01

Hi all,

I have using MOC3043 and BT136-600 (without using snubber circuit due to system will automatically triggered). When the circuit is connected to the fan or digital clock, it works fine. I can control it on or off without any problem. However, when i connect the circuit with CFL, light is flashing. How to solve the problem?

My circuit is follow MOC3043 datasheet Figure 13. Hot-Line Switching Application Circuit ( http://www.fairchildsemi.com/ds/MO/MOC3043M.pdf)

diy_bloke (author)XenonHK2014-06-01

XenonHK
You are touching on a frequently asked question. The fact is that just a regular CFL isn't really suitable to be dimmed by a traditional TRIAC dimmer as it is not merely a resistive load, but a piece of electronic equipment. An incandescant lamp and a CFL are as comparable as a bread toaster and a TV set: both use electricity and that's about it.
There are specific dimmers for CFL lamps and dimmable CFL lamps: They usually function by feeding a variable voltage (1-10V) to the CFL controller.
That means that if you have such a lamp, you could make an analog out circuit coming from your arduino, that you feed to the dimmable CFL lamp.

This may help you a bit:

https://www.google.nl/search?client=ubuntu&channel...

Also this article describes exactly what you are experiencing:

http://www.nxp.com/documents/application_note/AN10803.pdf

XenonHK (author)diy_bloke2014-06-01

Hi diy_bloke,

Thanks a lot for your quick reply and your information. I will study it. I would like to ask one quick question on my circuit. Can the my circuit able to handling CFL on/off control, without flickering (no dimming function is needed)? Thanks a lot

Best regards

Xenon

egrabhishek (author)2014-05-14

Thanks for all your help guys.

I completed the required circuit and it works great. I tested it with a pedestal fan for 4-5 hours and no heating and things like that.

I switched to BTA16 - due to its high dv/dt values I was able to remove the issue created due to the transients on the power lines.

Also I discovered that snubber circuit tend to leak a very minimal amount of current which will not turn the load on but could give a nasty shock. But still its OK and sort of necessary to use them in inductive circuits, along with Safety Fuse and safety warning mentioned appropriately.

diy_bloke (author)egrabhishek2014-05-14

good to hear that. Thanks for the feedback. I always appreciate hearing if people got their problems solved :-)
The TIC206 is kinda my TRIAC of preference and I haven't had any problems with it.
I guess you found out about the charge in the snubber circuit the hard way? :-)
We have all been there, but it underlines again the care one should take working with high voltages. One would not really expect to have a capacitor charge on AC :-) . Probably has something to do with phase shifting or whatever, I am no AC crack

x0900 (author)2014-05-13

Thank you for this nice tutorial. I used BTA16-600C and it worked but for a few minutes. I tried putting heat sink but problem return after few minutes. Do you get same problem ? Do you have some tips for me ? Please :)

diy_bloke (author)x09002014-05-13

Usually problems like this are a faulty soldering connection, a faulty optocoupler or a faulty triac.
Are you using it with a microcontroller?
Please do the following:
Unplug everything
check yr connections
Dont use yr microcontroller but put a 5 Volt tension on the entrance and connect to the mains again.
Let me know what happens

egrabhishek (author)2014-04-23

Thanks for this easy to implement tutorial. I have implemented the same stuff using MOC3041 and BT136 TRIAC. I am using 470 and 330 ohms resistance and the things work pretty well.

However I am facing a strange issue with the snubber circuit, which I had incorporated to get rid of the transients in the line. The transients auto-triggers my TRIAC for a moment which I want to remove. Removing the snubber makes my circuit work well. With the snubber my switch is always ON.

I removed the MOC3041 from the circuit and no input signals as well but still it is ON always when snubber is present in parallel to TRIAC. Seems like it provides a parallel path to the external load turning it ON.

Any help would be highly appreciated.

Thanks,

Abhishek.

About This Instructable

48,697views

73favorites

License:

Bio: I am a physician by trade. After a career in the pharmeceutical world I decided to take it a bit slower and do things I ... More »
More by diy_bloke:Working With the Funduino W5100 Ethernet Module.Uploading Data to ThingSpeak With MQTTAdding an MCP23017 I/O Extender to Arduino or ESP8266
Add instructable to: