Share this

Design of a multi-functional single-phase household electricity meter based on MAXQ3120

2026-04-06 03:15:22 · · #1
Abstract: This paper details the design of a multi-functional household electricity meter based on the MAXQ3120, realizing the functions of recording useful power, automatic data transmission, and time-of-use payment. The paper specifically introduces the system design, details some circuits, provides a block diagram of the system software and the data communication protocol, and finally proposes improvements based on practical results. Keywords: Multi-functional electricity meter; MAXQ3120; DS3231 clock module; Communication protocol I. Introduction Currently, the commonly used mechanical electricity meter is a mechanical kilowatt-hour meter based on a rotating metal disc. It does not consider input voltage or power factor, but only tracks and records the actual electricity consumption. This is mainly manifested in two aspects: First, mechanical meters cannot record time; they can only record the number of rotations of the Ferrus sign, and cannot record the corresponding fast and slow rotation times. Second, they can only record theoretical real-time active power, while the actual electricity consumption of users depends not only on the input current and input voltage, but also on the power factor. Traditional mechanical meters cannot monitor the power factor, but instead default to the current and voltage being in phase. This means that some reactive power is also included in the calculation, resulting in the actual usable power being less than the product of the input voltage and current. Moreover, electricity billing now needs to consider time periods, peak electricity consumption, and power factor, which mechanical meters simply cannot achieve. This paper proposes a design scheme based on the Maxq3120 microcontroller to solve the above problems. II. Scheme Design Differences from previous meters, the main functions of the household multi-functional meter are as follows: 1) Record only the usable power actually used by the user; 2) Implement automatic segmented payment; 3) Automatically report meter data; Technical specifications of the household meter: Rated voltage: 220V; Rated frequency: 50Hz; Basic current: 10 (40)A; Clock accuracy (daily error): ≤0.5s. This system is mainly designed using the Maxq3120 microcontroller. The MAXQ3120 is based on the MAXQ20 core, operating at 8MHz, and contains 32KB of flash memory and 512KB of RAM. It includes two 16-bit analog-to-digital converters (ADCs) for precise measurement of instantaneous voltage and current amplitude and phase. These two ADC channels complete a new conversion every 48µs, resulting in a conversion rate of 20667 samples/second. The MAXQ3120 integrates a 16 x 16-bit multiplier with a 40-bit accumulator. This multiplier performs one operation in a single clock cycle and is highly efficient due to its tight integration with the CPU core. The MAXQ3120 integrates an LCD controller capable of driving up to 112 segments. It provides two UARTs, one with special logic for easy infrared data transmission and the other for RS485 serial transmission. The MAXQ3120 includes a battery-backed clock module with sub-second counter and alarm functions. This clock features digital fine-tuning and boasts extremely high accuracy. The system can be primarily divided into the following parts: A/D conversion data processing, clock and time management, serial communication management, LCD display and power management, Jatg debugging, and software. 1) A/D Conversion Section: This section mainly utilizes two internal A/D conversion channels of the MAXQ3120 to acquire voltage and current signals. The voltage input is AC 220V, while the MAXQ3120's analog signal input is ±1V, necessitating voltage division. The current signal is acquired by generating a voltage signal through a current shunt; the maximum current parameter of the meter depends on this current shunt. This meter is designed for a standard 10A operation and a maximum of 40A. If the current shunt is 0.5mΩ, the maximum full-scale bias voltage is 20mV. However, according to Ohm's law, the power consumption of the current shunt is 0.8W, so a current shunt greater than 0.5mΩ should not be used. The accuracy of this meter is 1%, and the measurement range is from 1A to 40A. Therefore, the minimum current that can be distinguished is 10mA, and the maximum current that can be distinguished is 40A, which is 4000 times 10mA, to avoid A/D saturation. Therefore, the accuracy of the A/D must reach 12 bits (1/4096) or higher. The MAXQ3120's A/D conversion is 16 bits, which meets the design requirements, so a 0.5mΩ current shunt is used. The voltage divider circuit is shown in Figure 1. Figure 1 Voltage divider circuit 2) Clock and time management section The clock circuit of the MAXQ3120 has two cases: one is to use the clock chip DS3231. This clock contains a calendar clock, a pre-selected and finely tuned crystal, and a temperature sensor. The clock automatically compensates for temperature, achieving a timing accuracy better than ±3.5ppm/°C across the entire temperature range of -40°C to +85°C. The DS3231 can be directly connected to the microcontroller via the industry-standard I2C bus. Alternatively, the clock can be used internally in the MAXQ3120. The MAXQ3120's built-in calendar clock uses a standard tuning fork crystal as its time base. The operating frequency of a tuning fork crystal is significantly affected by temperature; the clock frequency will change with temperature variations. The MAXQ3120 also includes a fine-tuning register for fine-tuning. Temperature is obtained via an external temperature sensor, and software is used to adjust the fine-tuning register based on the temperature. The accuracy after fine-tuning is better than 4ppm. The first approach is preferred. Timing charges are calculated based on different time periods. The rate is written into the register, and charges are applied based on the time periods read from the DS3231. The system supports a maximum of four time periods. The DS3231 interface circuit is shown in Figure 2. Figure 2 DS3231 Interface Circuit 3) Serial Communication Management Section The MAXQ3120 integrates two serial port controllers, one of which can be connected to an infrared transceiver, and the other can be used as a regular serial port. This system does not have an infrared communication section, only RS485 communication, using the SP3490 chip, and its circuit diagram is shown in Figure 3. Figure 3 RS485 Working Circuit 4) LCD Display Section and Power Management Section The MAXQ3120 integrates an LCD controller, which can drive up to 112 segments. Therefore, this system directly connects the MAXQ3120 to the LCD display. The power supply uses the SPX1117 chip, which can convert 5V voltage to the working voltage. It should be noted that the first pin of the SPX1117 chip is GND, which is different from the pin of the 7805 chip. 5) Jatg Debugging Section and Software Section The Jatg debugging section uses the Jatg debugging circuit provided by the MAXQ3120 kit. The software mainly consists of several modules: initialization module, A/D sampling module, register management module, data calculation and billing management module, and data encapsulation module. The system software flowchart is shown in Figure 4: Figure 4 Software Flowchart. The data communication protocol format is shown in Table 1: Table 1 Communication Protocol Format. Data Header and Data Trailer: Each is 2 bytes, used to distinguish data integrity. The main consideration is transparent data transmission; that is, if data appears in the data header and is identical to the data trailer, it will fail the verification. Target Machine Address: 6 bytes, used to distinguish the data sending target. Command: 1 byte, used to instruct the target machine on the specific action. Data Length and Data: Data length refers to the length of the data; data is the parameter required by the command. This system uses an RS485 interface network, and data transmission uses a polling method. Although the real-time performance is not high, it avoids data conflicts and can fully realize automatic data transmission. III. Conclusion The author's innovation in this paper is the design of a home electricity meter that can accurately record the user's useful work, charge at multiple rates, and automatically transmit data using the highly integrated MAXQ3120 chip, while maintaining excellent stability under good cost control. The system has been tested and meets the original design requirements, but some aspects need improvement. For example, the serial communication part only has a 485 interface and an infrared communication interface needs to be added; the meter also needs to have anti-creep logic design; the voltage circuit should be charged with 115% of the rated voltage; and the meter should not generate more than one pulse output when there is no current in the current circuit. In addition, to save costs, the use of an on-chip crystal oscillator should be considered. References 1. Hu Shengyao, Chang Chun, Zhang Donglai, Qiang Wenyi. Design of Remote Environmental Monitoring and Management Information System Based on Wireless Communication. Microcomputer Information, 2004, 20(3): 55-56 2. MAXQ3120 Datasheet. Maxim Integrated Product. Inc. 3. Xie Xiren. Computer Networks. Dalian University of Technology Press. 2004.9 4. Customization Guide for the MAXQ3120 Electricity Meter Reference Design. Maxim Integrated Product. Inc. 2006.3
Read next

CATDOLL 108CM Coco

Height: 108cm Weight: 14.5kg Shoulder Width: 26cm Bust/Waist/Hip: 51/47/59cm Oral Depth: 3-5cm Vaginal Depth: 3-13cm An...

Articles 2026-02-22
CATDOLL 136CM Seina

CATDOLL 136CM Seina

Articles
2026-02-22
CATDOLL 135CM Laura

CATDOLL 135CM Laura

Articles
2026-02-22