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.
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
- Popular Resources
- Popular amplifiers
- MSP430 series single chip microcomputer system engineering design and practice
- oled multi-chip calling program
- Microcontroller Principles and Applications Tutorial (2nd Edition) (Zhang Yuanliang)
- Getting Started and Improving MSP430 Microcontrollers - National Undergraduate Electronic Design Competition Training Course
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- The problem of not being able to sample the AD value using the official ADC routine based on the BlueNRG-LP chip
- [RVB2601 Creative Application Development] Environmental Monitoring Terminal 06-Synchronize Data to Alibaba Cloud
- One question per week, relax and broaden your mind
- Crowdfunding 3,000 yuan to buy batteries for needle penetration tests, BYD VS CATL technology game
- [Evaluation of EC-01F-Kit, the NB-IoT development board of Anxinke] + Alibaba Cloud connection to upload light illumination data
- Operate the lmx2582 registers through stm32, the project file is in the attachment
- 【ESP32-S2-Kaluga-1 Review】2. Update the firmware
- Speed sensor
- How to use Labview to perform secondary development on Ginkgo 2
- What is iPhone USB PD fast charging?