Can you please clarify ?You only need zcd and opto-coupler when using a microcontroller..
'In order to fire the triac at zero or some delay after zero, you need to have a Zero crossing detector circuit, so your micro knows when its zero mains voltage, then it can fire the triac at any delay to create a dimmer.
Are you using an Arduino or Pic...?


I am doing this circuit to control water temperature. I looking for controlling the voltage along the whole period not just the half of the power. Is triac suitable for that or it just controls the half of the power as you mentioned ?If you use a zero crossing detector you will only be able to control the temperature by dropping half cycles. The other approach using thyristors is to make the phase of the firing pulses relative to the powerline voltage continuously variable. Is dropping half cycles the method you want or would you like the phase to be continuously variable.
What is it that you are planning to control the temperature of, and will the control circuitry be floating on the AC line or earthed?
I am using an Arduino , But if possible can you please let me know why this type of ZCD would work with triac while the compactor technique will not ?In order to fire the triac at zero or some delay after zero, you need to have a Zero crossing detector circuit, so your micro knows when its zero mains voltage, then it can fire the triac at any delay to create a dimmer.
View attachment 193298
Are you using an Arduino or Pic...?


Using an Opto-coupler is better to detect Zero crossing not an op amp..remember that half the Voltage across the Heater is a Quarter of the Wattage!!I am using an Arduino , But if possible can you please let me know why this type of ZCD would work with triac while the compactor technique will not ?
An opamp has a kind of metastable state when two voltages are identical on their input pins. Your slow moving AC voltage and the zero volt signal are identical for quite a while, causing this instability.I used the this technique and the pulses get crazy around the zeros , have you got any idea of why that happens ?