Multifunctional multi-rate three-phase energy meter based on MSP430 single chip microcomputer

Publisher:SereneJourneyLatest update time:2011-10-06 Keywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Introduction

With the development of the national economy, the electricity consumption of enterprises and individuals has increased significantly. Now the electricity consumption time of users is relatively concentrated, so that the load curve of the power system varies greatly. In order to adjust the load curve and make full use of the capacity of power generation and supply equipment, it is necessary to realize time-of-use billing of electricity prices. The multi-rate energy meter records the electricity consumption according to the peak and valley time respectively, so as to charge electricity fees at different prices, and encourage users to take measures to avoid peak and fill valley, which is beneficial to both power supply and power consumption. At the same time, the multi-function meter with GPRS remote meter reading, microcomputer centralized meter reading, power failure meter reading, anti-theft electricity, metering active and reactive energy and demand measurement can replace the functions of several meters, which not only saves money and reduces the area occupied by equipment, but also reduces the cost of meter reading. This paper gives a solution for a multi-function multi-rate three-phase energy meter based on TI's MSP430F449 high-performance single-chip microcomputer.

2 System overall structure and function description

The whole system is divided into two modules, energy metering module, energy data processing and communication module. The electric energy metering module collects data such as active and reactive electric energy, three-phase voltage and current values, frequency and power factor through the electric energy metering dedicated chip. Then, the collected data is transmitted to the electric energy data processing module through a dedicated data bus. The electric energy data processing module processes the electric energy data and stores it in the flash chip, and can display the electric energy data in real time on the LCD. When meter reading is required, this system provides three communication methods: infrared, RS485 and GPRS; thus, three methods can be used for meter reading: handheld meter reading, microcomputer centralized meter reading and GPRS remote meter reading. The system structure diagram is shown in the figure below:


3 System hardware circuit design

3.1 Introduction

to the single-chip microcomputer MSP430F449 This system uses TI's 16-bit ultra-low power high-performance single-chip microcomputer MSP430F449, which has 64K Flash, 2048Byte RAM, 8-channel 12-bit high-speed A/D, two UART communication ports, and its internal integrated 160-segment LCD liquid crystal controller, which greatly simplifies the LCD hardware circuit. The MSP430F449 consumes only 0.8μA in standby mode, as low as 0.1μA in RAM retention mode, and 225μA/MIPS in operation. It only takes 1μS clock to start. The supply voltage of MSP430F449 is 1.8V ~ 3.6V, so only one lithium battery is needed for normal operation.

3.2 Design of electric energy metering circuit

The core of the electric energy metering circuit adopts the ATT7022 electric energy metering chip of Shenzhen Actions. It is a high-precision three-phase electric energy metering chip suitable for three-phase three-wire and three-phase four-wire applications. It can measure the active power, reactive power, apparent power, active energy and reactive energy of each phase and the combined phase, and can also measure the current, voltage effective value, power factor, frequency and other parameters of each phase, fully meeting the needs of three-phase multi-rate multi-function electric energy meter. ATT7022 provides an SPI interface to facilitate the transmission of electric energy data and calibration parameters between the external MCU. Moreover, as a domestic chip, the price is relatively low, which can greatly reduce the production cost of the product while meeting the design requirements.

The energy metering circuit is shown in the figure below:


The above figure introduces the connection circuit of phase A, and the circuits of phase B and phase C are the same as the circuit of phase A. In order to ensure that ATT7022 has a stable voltage reference source, TL431 is used as its external voltage reference. Since the power supply voltage of ATT7022 is 5V, and the power supply voltage of the microcontroller system is 3V, the communication between the two modules requires level conversion to exchange data normally. Therefore, a simple resistor voltage divider circuit is used in the design to achieve the purpose of level conversion. After testing, it is found that the data transmission is very stable and no data loss occurs.

3.3 Clock circuit design

In order to meet the requirements of accurately calculating demand and rates in different time periods, a precise and reliable real-time clock is required in the multi-rate meter. However, the internal RTC clock of MSP430F449 is not accurate enough, so we use the clock chip DS3231 of MAXIM in the system. DS3231 is a low-cost, high-precision I2C real-time clock with a temperature-compensated crystal oscillator and crystal. The chip contains a battery input terminal, which can maintain accurate timing when the main power is disconnected. The integrated crystal oscillator improves the long-term accuracy of the chip and reduces the number of components on the production line. Its accuracy can reach ±3.5ppm within the industrial temperature range.

The INT port of DS3231 can provide an interrupt signal with a period of 1s to the microcontroller. The microcontroller system will read the specific time and date data through the I2C communication interface based on the signal, so as to calculate the demand and the rate of each period in real time. In addition, the 32KHZ port of DS3231 can provide an accurate 32KHZ pulse signal, which can be used to accept relevant experimental tests of the power department. When the power is off, the backup battery of the clock circuit will ensure that the clock chip can continue to accurately time until the power is restored.

3.4 Communication module design

This design mainly uses three communication methods to realize the meter reading function, namely: RS-485, infrared transmission and GPRS.

Considering that the energy meter will be installed outdoors, it is necessary to add lightning protection measures to the RS-485 bus interface. The RS-485 interface chip we use is TI's SN65LBC184 chip, which is isolated by the optocoupler NEC2501 and the microcontroller system to prevent damage to the entire system when it is struck by lightning.

If the data is directly transmitted through the infrared transmitting tube during infrared communication, it will be seriously interfered by the external environment. The common anti-interference method is to modulate the data to be transmitted to a 30KHz~40KHz carrier and then send it.

The pin P1.5/ACLK of the MSP430F449 microcontroller can be used as the system's low-frequency auxiliary clock output port, which can be directly driven by a universal 32.768KHz clock crystal oscillator without the need for additional external components. P1.5 is used to drive the transistor to generate a carrier with a frequency of 32.768KHz. The TXD pin of the UART port of the microcontroller drives another series-connected transistor to transmit binary data signals "0" and "1", thereby achieving the function of infrared data transmission. In the infrared receiving part, the infrared integrated receiving module TSOP1838 is used to demodulate the high-frequency infrared signal. When TSOP1838 receives a high-frequency infrared signal, the receiving tube outputs a low level; when TSOP1838 does not receive a high-frequency signal, the receiving tube will output a high level. The data after infrared demodulation by the receiving tube is input into the microcontroller through the RXD pin of the UART port for corresponding processing.



Another way to read the meter is to read the meter remotely through the GPRS module. The GPRS module used in this design is the GR47 module of SonyEricsson. GR47 is an advanced wireless module with a full set of GSM/GPRS voice and data functions, with the characteristics of small size and comprehensive functions. It has an embedded TCP/IP protocol stack, which can shorten the R&D cycle of GPRS products to the greatest extent. GR47 provides 3 UART ports for communication with MCU, so the GR47 module can be controlled through another UART port of MSP430F449, and its control command is a standard AT command. Through GPRS meter reading, the data in each electric energy meter can be easily obtained, and the electric energy meter can also be broadcast and calibrated. It should be pointed out that the peak current consumption of GR47 is 2A, so it is necessary to add an electrolytic capacitor of about 1000uF to the power supply end of GR47, and the power chip should also meet the corresponding requirements. In this design, the LM1084 voltage regulator chip is used, which can provide an output current of up to 5A

.

The power module in this system is a switching power supply, so when one or two phases of AC power are disconnected, the switching power supply can still supply power to the system. However, if all three phases of AC power are disconnected, the power supply of the system will be interrupted, so it is necessary to consider whether the meter can be read after the power outage, and at the same time, the time of the power outage must be recorded. In order to ensure that the core part of the system can still operate normally during a power outage, we use a 3.6V lithium battery with a low-power voltage regulator chip RH5RL30AA as the backup power supply of the system. In addition, when the power is off, the microcontroller is in a dormant state, and the power of other chips is turned off by transistors to reduce power consumption. After testing, the entire system consumes less than 10uA in the dormant state. When the power is off, the system can be awakened by a key interrupt, and the data will be displayed on the LCD for meter reading.

The battery is used as the power supply during a power outage, and the switching power supply is used as the power supply during normal power supply. How to switch between battery power supply and switching power supply is a problem that needs to be considered. Here is a simple method to solve this problem. The switching power supply circuit is stabilized to about 3.3V by the voltage regulator chip, while the battery power supply circuit is stabilized to about 3V by the voltage regulator chip. Schottky diode 5819 is added to the output of both circuits. In this way, when the power is normally supplied, the output of the switching power supply circuit is 0.3V higher than that of the battery power supply circuit, and the battery power supply circuit will be cut off due to the reverse non-conduction of 5819; and when the power is off, the output of the switching power supply circuit is 0, and the battery power supply circuit will supply power to the system after 5819 is forward-conducted. The power switching circuit is shown in the figure below:



When the power is normally supplied, the voltage of the lithium battery can be obtained by sampling the 12-bit A/D inside the MSP430F449. In this way, when the battery voltage is lower than 3.3V, it can be charged by the battery charging circuit until the battery voltage rises to the lithium battery charging limit voltage of 4.2V and then stops charging. The battery charging circuit can be realized by controlling the transistor to cut off the output of the voltage regulator chip through the IO port of the microcontroller.

4 System software design

The following introduces the software implementation of system functions:

1) Initialization: self-check the LCD and memory, and initialize the data. If the system is powered on for the first time, all data will be initialized to 0, otherwise the corresponding value will be read from the memory to initialize the data.

2) Time module: time measurement is performed according to the time pulse provided by DS3231, providing time measurement for the system data processing module and providing the current time display for the user.

3) Data processing module: This module is the core of the software design. Its main function is to process the active and reactive power, three-phase voltage and current values, frequency and power factor data provided by the metering chip, and combine the current time period and rate to obtain the actual power consumption and maximum demand of the user at each rate and time period, and save the data to the memory at a specified time (settable). This meter can save data for multiple months and can provide any current or saved data to the meter reading system through RS485, infrared interface and GPRS module. This module also has the function of recording phase failure time and current failure time.

4) Meter calibration module: In order to match various peripherals, ATT7022 provides a meter calibration function. This module is used to set the internal calibration registers of ATT7022 to match the peripherals to increase the measurement accuracy.

5) Display module: LCD displays time, four-quadrant active and reactive energy, three-phase voltage and current values, frequency, power factor, power consumption at each rate in each period, and maximum demand, etc. The display interface can be operated by buttons.

6) Power outage processing module: When a power outage occurs, the system does not access the data processing module, and the entire system will enter a dormant state, so that the system is in an ultra-low power consumption mode, and the system can be awakened by a key interrupt.

7) Communication module: The communication module is divided into infrared, RS485 and GPRS communication.

8) Interrupt processing module: The system has three main interrupt processing modules, namely timing, communication and power outage interrupt.

5 Conclusion

The multifunctional multi-rate three-phase energy meter based on MSP430F449 microcontroller integrates multiple functions. With the cooperation of energy metering chip ATT7022 and clock chip DS3231, the energy metering can achieve high accuracy. Since the system power consumption is reduced by multiple methods, after testing, the power consumption of the entire system is extremely low during power outages, thus ensuring the realization of the power outage meter reading function. The production cost of the entire system is low, and all technical indicators have reached the domestic technical standards for three-phase multi-rate energy meters, so it has good market prospects and application value.

The author's innovation points: the ATT7022 metering chip and high-precision clock chip DS3231 are used to improve measurement accuracy and reduce costs, the power outage meter reading function is added to enable timely and reliable meter reading after power outages, and two remote meter reading methods, GPRS and infrared, are added. The meter reading methods are flexible and diverse, and the system power consumption is minimized by comprehensive consideration of hardware and software.
Keywords:MSP430 Reference address:Multifunctional multi-rate three-phase energy meter based on MSP430 single chip microcomputer

Previous article:The role of the body control module microcontroller and local interconnection network
Next article:A simple way to learn microcontrollers

Recommended ReadingLatest update time:2024-11-16 19:42

Based on MSP430F149 microcontroller serial port program, interrupt query method
Based on MSP430F149 microcontroller serial port program, interrupt query method #include msp430x14x.h #define uint unsigned int #define uchar unsigned char #define RXF BIT7//p2 #define TXF BIT6 #define Read BIT4//p3 #define Write BIT5//p3 uchar static usb_flag=0; void int_clk() {     uchar i;     BCSCTL1
[Microcontroller]
【MSP430】Capture mode to measure signal duty cycle
The code comes from the 2016 Beidou Cup, which is used to measure air pm2.5. The sensor estimates the particle concentration by measuring the duty cycle of the signal. (1) TimerB settings, working in capture mode: void TimerB_Init(){   TBCCTL0&=~(CCIS1+CCIS0); // Capture source is P4.0, which is CCI0A (also CCI0B)
[Microcontroller]
Design of steering gear control system based on MSP430
0 Introduction   UAV is the abbreviation of a powered, unmanned, reusable aircraft. In the UAV system, the servo controlled by PWM wave signal is an important actuator, which is the power source of the UAV control action. In order to facilitate system expansion and upgrade , a distributed strategy is often adopted in
[Microcontroller]
Design of steering gear control system based on MSP430
Design of data forwarder based on MSP430F149
Overview The current large number of manual meter reading methods are far from meeting the needs of modern management, and the resulting increase in line loss rate will inevitably affect the development of the power industry. One of the main reasons for the high line loss rate is the backwardness of meter
[Microcontroller]
MSP430: A picture to understand the low power mode of msp430f4371
430 has 6 working modes, which I will not repeat here. In C program, the statement to make 430 microcontroller enter low power consumption is very simple, just one sentence LPM0/LPM1/LPM2/LPM3/LPM4 can make it enter low power consumption state. After a day of looking at the system clock module and low power consumption
[Microcontroller]
MSP430: A picture to understand the low power mode of msp430f4371
Design of wireless access control system based on MSP430
    introduction   As people's living standards continue to improve, the issue of home anti-theft has become particularly prominent. Traditional mechanical locks have been gradually eliminated due to their simple structure and poor safety. Electromagnetic locks have gradually entered thousands of households due to th
[Security Electronics]
Design of wireless access control system based on MSP430
Design of reversing radar based on TI MSP430
  With the increasing requirements for the intelligence of automobile assisted driving systems and the networking development of automobile electronic systems, new reversing radars should be able to continuously measure and display the distance to obstacles, and have communication functions to send data to the vehicle
[Microcontroller]
Design of reversing radar based on TI MSP430
MSP430G2253 generates PWM with adjustable duty cycle
I recently made a code to drive a white LED with 430. It used the common peripherals such as ADC and PWA that I used before. I found that my understanding of the chip is still too basic. Now I will review it so that I can have a reference when I use it in the future. Today I will only learn the most basic functions to
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号