Hi, I connect my circuit as in the image I attached it, I disconnected all terminals of Triac with MOC3021, but still the problem is appearing.
the problem is the lamp is flickering one time as soon as I put the plug in the power socket.
is there problem in the triac BT138? if no, what is the problem?
Hi Tom,
Thank you for your help, the circuit is attached, I connected pin 1 of MOC3021 with pin 4 of arduinoMega and pin 2 with ground of arduinoMega, the circuit works correctly when i set pin 4 of arduinoMega on/off.
but either I connect terminals of Triac or I disconnect its terminals with MOC3021,the problem is still appearing that when I put the plug in the power socket, immediately the lamp is flickering one time.
I'm begginer in electrical & electronic subjects,so I didn't understand when you say "you have to have synch wih the AC mains.".
I get the circuit from the internet, and I don't know if there is practical solution or there is problem with Triac.
I'm begginer in electrical & electronic subjects,so I didn't understand when you say "you have to have synch wih the AC mains.".
That's ONLY required for dimming. If you are not dimming, don't worry about that.
If you can't turn the light on/off with 5V, you may have fried the opto-coupler because you didn't have a resistor. It's also possible that you fried your Arduino, so just check the opto-coupler/TRIAC with 5V first (no Arduino). When that works, try it with the Arduino.
I'm begginer in electrical & electronic subjects
Since you're (apparently) not dimming, a MUCH SIMPLER alternative is a [u]Solid State Relay[/u]. (You are building a solid-state relay with the opto-coupler and TRIAC.... But your's isn't working... )