ATMega16 allows sink up to 20mA at pin output, but maximum operational current recommended for MOC3052 is 10mA.
Perhaps a small 100R resistor on microcontroller output could be a good parctice.
Surely that´s not the reason for failing, but can affect opto-coupler life cicle.
+++
well, idk what's wrong, in virtual [proteus] when i add 180 Ohm res after PB4, the pulse won't reach the opto, but i already add 180 Ohm in the real schematic...
or is 180 is just too big, should i use 100 Ohm as u just said?
and i really can't understand this, if i use 50V & 110V as AC source, it'll be functional, but not with 220V AC, here's the pic :
schematic :
**broken link removed**
50 V :
**broken link removed**
110 V :
**broken link removed**
220 V :
**broken link removed**
and sorry, i did some experiment using moc 3052, but the one i'm about to use is moc3021
oh yes, and the triac, i'll use bta12 << is this usable for this??
Start with usual resistive load, e.g. 60 W lamp. The load should allow at least the maximum specified trigger and hold current to flow. Otherwise the circuit has serious problems.
I should add, that I don't know the parameters assumed for the triac model. The observed simulation behaviour is not necessarily identical to a typical real triac.
If you really intend to operate the circuit with a low power load, you should probably change to a sensitive triac.
yepp, i know that, virtual is not always the same with the real thing, but, i can't get 220v working with this circuit, but it'll work with 110v or 50v...
so, i can't do [for now] what u just said [yet]...