Zero-Crossing Control

Last Updated on : 2024-06-25 10:02:23download

This topic describes what zero-crossing control is and how it works.

Background

Zero crossing control is used to close or open the contacts of the relay at the zero-crossing point. This is useful to protect relays from spikes for better service life.

Overview

The device detects when the input signal crosses zero in either the rising or falling direction and controls the relay at the zero-crossing point.

Principle

The device detects the zero-crossing point to open or close the contacts of the relay at this point. Then, it will start detecting the next crossing event. There are two detection methods:

  • Single-edge detection

    This is a common method. The active edge can be either the rising edge or the falling edge.

  • Dual-edge detection

    This is not a common method. Generally, both the rising edge and falling edge should be the active ones.

Implementation

  1. Set a time delay t for relay operation on the Tuya Developer Platform.
  2. Use the waveform of hardware signals to calculate the cycle T of the AC supply. Then, subtract the time delay t to get the time delay of the hardware timer. The formula is T − t.
  3. Once the device detects the zero-crossing point, it starts the timer that fires after T − t time has elapsed. After the timer fires, the software controls the relay switch so that the device will come on or off at the next zero point.