I am trying to implement a dimmer circuit with AT89C2051 controller. I am using a Transformerless Capacitive Power Supply. I need a Zero Cross Detector circuit directly from 230V mains to make the dimmer work.
Previously I had successfully implemented the dimmer using a linear power supply with a 12-0V transformer and a comparator for implementing the ZCD.
Please share if anyone has any idea regarding Zero Cross Detector circuit directly from 230V mains, whose output can be fed to the controller which I am using.
Does the AT89C2051 have clamping diodes on the inputs? I can't remember. If so, zero detection is trivially easy since you don't need galvanic isolation:
I always advise to use external clamping diodes and not rely solely on the internal ones.
The reasons are simple, external diodes are inexpensive, and secondly they can handle far larger overloads than the internal ones.
This last feature is necessary whenever inductive transients (and believe me, there are plenty of them) appear on the powerline.