I have made a simlpe zero crossing circuit to control the speef of a single phase AC fan through conduction angle control with a Triac. The circuit looks like this with the use of 4n25, an optocoupler:
L and N represent live and neutral out of the mains supply.
So ideally i thought while the mains sine wave is above or below zero, you would get 0V beneath the 10k pullup resistor since there is condcution on the infrared diode and thus, conduction through the transistor. and when the sine wave passes through 0, it would make a pulse with 5V at its peak. But when i put this to test, I see a sqaure wave of 50% duty cycle and 50Hz frequency, meaning the conduction through the transistor basically changes state when the mains sine wave goes from negative values to positive values. I am struggling to see the reason why and could really use some help.