A Brief Analysis of the Design and Implementation of Low-Voltage Digital Relays
2026-04-06 08:49:46··#1
Abstract: This paper introduces the model design of an intelligent monitoring system in power monitoring. This monitoring system uses a microcontroller to sample AC power parameters. The system processes power signals from current transformers and voltage transformers in real time. This device is mainly used for relay protection in low-voltage systems, integrating comprehensive measurement and display functions, and can form a fully functional computer power management network system. A detailed design scheme for the low-voltage digital relay and its hardware and software implementation are given. 1 Introduction In low-voltage power systems, basic requirements include measurement, metering, and relay protection. Traditional low-voltage components mostly adopt electromechanical structures. These components have poor performance, large size, high cost, limited functionality, and lack intelligence. Low-voltage digital relays are designed according to my country's requirements for power equipment operation, protection, and computer monitoring. They are suitable for automation in power supply and distribution in industrial and mining enterprises and civil construction projects in my country. Primarily used for relay protection in low-voltage systems (0.4kV), they possess strong comprehensive measurement and display functions, directly displaying electrical parameters such as three-phase current, three-phase voltage, power factor, reactive power, active power, energy consumption, and frequency. They can also indicate the opening, closing, and fault status of circuit breakers. The CT ratio can be adjusted via operation buttons, and the primary current and voltage of the incoming lines can be directly displayed. By adjusting various protection parameters, protection functions such as short-circuit instantaneous trip, overcurrent alarm, overvoltage alarm, and undervoltage alarm can be implemented. Through the RS485 communication interface, a complete and cost-effective computer power management network system can be formed. 2. Principle The primary voltage signal (AC 380V) is directly connected to this device. The voltage signal is rectified by a voltage transformer and sent to the CS5460A acquisition chip. The primary current signal (AC 5A) is connected to this device via a current transformer (CT). The current signal is rectified by a current transformer and also sent to the CS5460A acquisition chip. Then, a microcontroller is used to sample the AC power parameters, reading the current, voltage, and energy from the CS5460A and displaying them. The closing of the output contacts is controlled based on the set and measured values. External status can also be displayed based on external status inputs. 3. Hardware Composition 3.1 Microcontroller-based Hardware Design This device is based on a microcontroller. The functional units consist of a main control board, sampling circuit, display driver circuit, watchdog and power-down protection circuit, RS485 serial communication interface circuit, current and voltage transformer board, relay board, housing, terminals, and power supply. The internal components are layered for good heat dissipation and strong anti-interference capability. The overall structural principle of the device is shown in the figure. [IMG=Overall structural schematic diagram of the device]/uploadpic/THESIS/2007/12/20071228110309849724.jpg[/IMG] 3.2 Data Acquisition In the process of realizing power automation, the most critical link is data acquisition. All electrical quantities measured in this device are obtained through AC sampling by a microcontroller. To reduce costs, current transformers are used to obtain small AC signals for the large-signal three-phase currents, while voltage transformers are used to obtain small AC signals for the large-signal three-phase voltages. To ensure the accuracy of active power, reactive power, and electrical quantities, precision transformers with good consistency and small phase errors should be selected as much as possible. The signal conditioning circuit is essentially a signal transformation and low-pass filtering process. The analog signal is converted by the current transformer and sent to the CS5460A acquisition chip. The CS5460A chip is a monolithic integrated chip for energy measurement manufactured using CMOS technology. It includes one programmable gain amplifier, two delta-Σ analog-to-digital converters, and two high-pass filters. It has system tuning and power calculation functions for accurate measurement and tuning of energy, instantaneous power, RMS voltage, and RMS current. The CS5460A can perform AC system tuning on-chip, making it easy to convert voltage and current values to digital quantities. The microcontroller reads the current current, voltage, and energy parameters from the CS5460A's serial interface. As shown in the figure, AC voltage and current are input signals through the positive terminal Vin+ of the differential voltage and the positive terminal Iin+ of the differential current of the CS5460A chip, respectively. The sampling circuit outputs digitized current, voltage, and energy values through the SDO pin of the CS5460A chip, which are then sent to the controller for display. [IMG=Communication Interface Circuit]/uploadpic/THESIS/2007/12/2007122811031644861N.jpg[/IMG] 3.4 Watchdog and Power-Down Protection: When a program crashes or enters a temporarily constructed infinite loop, the system will be completely paralyzed. The watchdog timer can automatically reset, allowing the CPU to exit the infinite loop and return to the normal program flow. The Xicor X25045 programmable watchdog monitoring E2PROM chip integrates three commonly used functions: watchdog timer, voltage monitoring, and E2PROM, thus greatly reducing costs and saving circuit space. The X25045's 512-bit non-volatile serial ROM is crucial for storing important data in instruments (such as parameter settings), and this data will not be lost even during power loss. The microcontroller reads and writes to the X25045 through the write port SI, read port SO, and clock port CLK, respectively, in a specific timing sequence. 3.5 The ZIG7289A display driver circuit is an intelligent display driver chip with a serial interface, capable of simultaneously driving an 8-digit common-cathode seven-segment display or 64 independent LEDs. It communicates with the microprocessor serially; serial data is fed into the chip from the DIO pin and synchronized by the CLK pin. When the chip select signal CS goes low, the data on the DIO pin is written to the ZIG7289A's buffer register on the rising edge of the CLK pin. 4. Software System Design 4.1 The main program measures and monitors the electrical parameters of the protection device, requiring real-time collection and processing of parameters such as electrical quantity and switch status. The device demands high accuracy in measurement, reliability, speed, and safety in protection actions. Implementing multiple functions on a microcontroller necessitates a carefully prioritized allocation of CPU time for each function, ensuring both functional completeness and real-time performance. The software for this device must perform the following tasks: sampling and converting the three-phase voltage and current every 1.667ms (12 points within one AC sinusoidal signal cycle (20ms)), then calculating the effective values of voltage and current, and other relevant quantities; communication tasks, receiving downlink commands from the host computer, transmitting voltage, current, active power, reactive power, and energy to the host computer in real-time, and executing other control commands issued by the host computer; saving and displaying measurement results; and keyboard detection and response. [IMG=Main Program Flow]/uploadpic/THESIS/2007/12/2007122811032230909S.jpg[/IMG] The program design adopts a modular design method, dividing all functions into main modules and functional modules. In specific implementation, a combination of interrupts and polling is used, employing task scheduling principles. High-priority tasks are implemented through interrupts, while low-priority tasks are implemented through setting and polling flags in various functional modules. As shown in Figure 4, the main program first initializes the system, including the CPU itself, display panel, communication, and switch output initialization, and then enters the main loop. In the main loop, various functional modules are called by polling flags: checking for a keyboard polling flag; if present, the corresponding processing subroutine is called, which has already handled keyboard bounce and interference signals; checking for new A/D sampling results; if present, adjusting the A/D sampling results using channel coefficients stored in E2PROM (downloaded from the host computer); checking for communication processing, which includes checksum calculation and verification, processing of corresponding commands, and sending feedback information. After completing 12-point sampling and adjustment for one cycle, the calculation subroutine is called to complete all calculation tasks, including voltage, current, power, electricity, and frequency; the measurement results are displayed, with the display subroutine showing different measurement results depending on the display status. 4.2 The communication protocol of this device uses Modbus bus-based communication at the data link layer, enabling efficient transmission of information and data between the host computer (master station) and the power monitoring system. Its functions include allowing the master station to access and set all configuration parameters of the connected power monitoring instrument; and allowing access to all measurement data from the power monitoring instrument. Modbus is an open fieldbus protocol widely used in industry, capable of communication via RS232 or RS485. The basic communication method is that only one master station controls communication on a single communication line. The master station issues data request commands, and the slave stations respond to these signals. Only one slave station can respond to the master station's request at any given time. Data transmission uses ASCII code: 8 data bits, no parity, and 1 stop bit. Each Modbus data packet consists of four parts: slave station address, function, data, and error check. The slave station address is 1 byte and must be unique within a single link, with a valid address range of 1 to 247. When all slave stations receive a data packet conforming to the Modbus protocol standard, they first check the slave station address. If it matches, the packet is processed and a result is returned; otherwise, no response is given. The function code is also 1 byte, specifying the operation the instruction requires the slave station to perform (setting parameters, reading data, etc.). The response data packet informs the master station of the completed operation. The data length depends on the instruction function. Generally, data is organized in 16-bit or 32-bit mode. Error checking uses CRC-16 verification. 5 Conclusion The low-voltage digital relay is designed based on the similar products at home and abroad and according to the requirements of China for the operation, protection and computer monitoring of power equipment. It is suitable for the power supply and distribution automation device of China's industrial and mining enterprises and civil construction. It can be widely used in the monitoring of power parameters in the power, textile, light industry, chemical and petroleum industries. This instrument has advantages that previous instruments did not have and has a wide range of application prospects. References: [1] Liu Xiaoduan, et al. Low-cost intelligent power detector based on MSP430F149 [J]. Electronic Technology, 2002 (4). [2] Liu Junfeng, et al. Implementation of AC sampling technology for power monitoring system based on single-chip microcomputer [J]. Single-chip microcomputer and embedded system application, 2001, (6). [3] Sun Guokai, et al. Principle of power system relay protection [M]. Beijing: China Water Resources and Hydropower Press, 2002. [4] Li Renjun, et al. A protection relay for low-voltage network system [J]. Relay, 1994.