Microchip logo
  • All
  • Products
  • Documents
  • Applications Notes
×

8-Bit MCUs

Zero Cross Detect (ZCD)

What Is Zero Cross Detect (ZCD)?

Zero Cross Detect (ZCD) detects when an Alternative Current (AC) signal crosses through the ground potential. The ZCD module is useful when monitoring an AC waveform for purposes such as TRIAC dimming, AC period measurement and minimizing EMI caused by switching transients.

How Can Your Design Benefit From an On-Chip ZCD?

If the microcontroller (MCU) you have selected doesn’t have an on-chip ZCD, you will need to build an external circuit with passive components. This will not only lead to higher power consumption and BOM costs, but it will also result in a current injection into the substrate, which may damage the MCU.

The on-chip ZCD peripheral in PIC® and AVR® MCUs can take the signal directly from the AC main with only a resistor or a capacitor in series. This saves BOM costs and reduces energy loss while also preventing substrate current injection.

The ZCD peripheral can be easily configured with MPLAB® Code Configurator (MCC) for PIC MCUs and Atmel START for AVR MCUs. 

zero cross detect diagram

How Is ZCD Used?

ZCD Operating Circuit

To safely interface with the AC input signal, a current-limiting resistor (and/or capacitor in some cases) is needed in series with the input. The value of that resistor/capacitor is calculated based on the AC input voltage and the current specs of the ZCD peripheral. An optional pull-up or pull-down resistor can also be added to balance zero-crossing voltage offset.

ZCD Configuration and Output

The ZCD peripheral is very easy to configure. The ZCD output signal is a simple digital level that toggles from active low to high when the signal crosses from negative to positive or vice versa. The output signal can be used to trigger other peripherals internally, or output to a GPIO pin externally. You can also configure the peripheral to trigger an interrupt when the signal crosses positively, negatively, or both.