Design of electricity management system for student apartments based on PL3000 single chip microcomputer

Publisher:码上奇迹Latest update time:2011-11-12 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction
In recent years, the scale of higher education in China has expanded rapidly, and the number of students has doubled, while the development of logistics has lagged behind. The problem of difficult electricity management in college student dormitories is particularly prominent. First, the electricity billing of a large number of student dormitories still remains at the stage of old-fashioned electricity meter measurement, with low measurement accuracy, low efficiency and error-prone manual meter reading, and it is difficult to effectively manage users in arrears. Second, it is impossible to automatically identify the use of prohibited electrical appliances by students, which poses a great safety hazard. Therefore, it is of great significance to design an intelligent power control system with functions such as accurate measurement, intelligent control, malicious load identification, and time-limited power transmission. This paper gives a control system design scheme with the above functions using the Fuxing Xiaocheng PL3000 microcontroller. This product has entered the promotion stage locally.

1 Hardware Circuit Design
1.1 Overall Control System Scheme
Each user end is equipped with a multifunctional electric meter to complete electricity metering, billing and management. The upper computer transmits the relevant electricity control parameters to the user terminal. The terminal system monitors the electricity consumption in real time according to the parameters set by the management center, reports metering data, malicious load identification and other functions to the management center computer, and executes the power-off and power-on instructions sent by the management center. Thus, a flexible intelligent management system for the entire power supply site is formed. Its overall scheme is shown in Figure 1.

a.JPG
1.2 Multifunctional Electric Meter Structure
This scheme adopts the multifunctional electric meter dedicated processor PL3000 developed by Beijing Fuxing Xiaocheng Company. The chip has the following features and functions:
(1) Embedded enhanced 8051 compatible processor, equipped with 8/16-bit ALU, 256+768 bytes SRAM and 8kbytes E2PROM, three 8/16-bit timers/counters, a watchdog timer and three external interrupts. (
2) Super instruction pipeline structure, 8 times faster than the standard 8051 microprocessor under the same main frequency.
(3) Built-in high-precision digital multifunctional energy metering unit, with a metering accuracy better than 0.1%;
(4) Built-in programmable gain amplifier (PGA) in the current channel
(5) Built-in dual-channel current sampling, positive/negative power indication digital logic circuit, with anti-theft function.
(6) Provides instantaneous output of active power and reactive power.
(7) Peripheral modules include LCD driver, in-system programming, power supply voltage monitoring circuit, dual-channel IS07816 interface, and real-time clock. [page]

The chip integrates a rich set of functional modules, and only a small number of auxiliary components are needed to complete all functions, meeting the requirements of low cost and high reliability of the whole machine. The block diagram of the meter design is shown in Figure 2.
b.JPG

1.3 Current and voltage transformer sampling circuit
The working principle is: first, the current and voltage are sampled through the current transformer CT and the voltage transformer PT, and the sampling circuit is shown in Figure 3; after sampling, it is directly sent to the IC pin, amplified by the internal amplifier circuit, and converted into a digital signal through the A/D converter; then it is processed by digital filtering, phase shifting, etc.; finally, effective electric energy metering data is obtained. Thus, the measurement and calculation of active/reactive power, instantaneous current and voltage effective values, and current AC frequency values ​​are completed.

c.JPG
The metering circuit can be controlled by software to sample one of the two current signals. The voltage sampling result is multiplied inside the metering module to calculate the active power and reactive power. The metering module and 8051 communicate in parallel, and are controlled by registers and interrupts. The embedded microprocessor 8051 inside the PL3200 can
directly access the registers inside the metering module through the special function registers (SFR, including four categories: control register, identification register, calibration register and data register).
1.4 Active power measurement
Electric energy can be regarded as the energy flow from the power supply to the load in physics. Mathematically, it is equal to the product of the instantaneous voltage value and the instantaneous current value at that moment. The product of all instantaneous consumption is integrated over time (see the following formula):
d.JPG
Where U and I are the effective values ​​of the AC voltage and current signals respectively, and cosφ is the power factor. However, formula (2) is only applicable when the voltage and current are both standard sinusoidal signals. If this premise is not met, formula (2) cannot be used for power measurement of the power grid. In actual power grids, voltage and current signals are basically not sinusoidal signals containing only 50Hz frequency components, but contain many
harmonic signals such as 100Hz, 150Hz, 200Hz... etc. Therefore, modern power metering still uses formula (1) to calculate power and energy.
The PL3000 chip uses an IIR high-pass filter to remove DC signals from voltage and current signals. One disadvantage of the IIR filter is that it has a frequency response characteristic with nonlinear phase. However, since the PL3000 chip uses the same IIR filter for voltage and current signals, the same phase delay will be generated for the same frequency components in the voltage and current signals, and their phase angle difference has not changed, so it will not affect the voltage and current product integral value of the same frequency. In this respect, the PL3000 chip is different from other similar power metering chips. The high-pass filter will not have an adverse effect on electric energy metering due to the nonlinear phase effect.

[page]

1.5 Communication interface design
Serial data communication only needs a pair of data transmission lines to transmit information, and the transmission cost is low. It is particularly suitable for distributed control systems and long-distance communications. Therefore, this design chooses serial data communication. RS-232C and RS-485 interface circuits are the most commonly used interfaces. The disadvantage of RS-232C is that it can only be used for short-distance data communication, usually within 50m, while RS
-485 can reach thousands of meters. The RS-485 interface allows up to 128 transceivers to be connected on the bus. It has the advantages of good noise resistance, long transmission distance and multi-station capability. Here we choose RS-485 interface as the communication interface between the user end and the management center. RS-485 uses balanced transmission and differential reception, so it has the ability to suppress common-mode interference. In addition, the bus transceiver
has high sensitivity and can detect voltages as low as 200mV, so the transmission signal can be restored thousands of meters away. RS-485 uses half-duplex working mode, and only one point can be in the sending state at any time. Therefore, the sending circuit must be controlled by the enable signal. RS-485 is very convenient for multi-point interconnection, which can save many signal lines. RS-485 can be used to form a distributed system, which allows up to 32 drivers and 32 receivers to be connected in parallel. Figure 4 shows the RS-485 communication interface circuit composed of SN75176.
e.JPG


2 Software Programming
2.1 Software Design Ideas
The software of the power control terminal is mainly used to realize the collection and processing of power data, and to realize data exchange with the dormitory management center system software through the RS485 interface. PL3000 is a single-chip microcomputer with high integration, rich functions, and low power consumption. It uses 51 as the core, so it is very convenient to use assembly or C language to complete the program design. In the software design of the system, a modular design method is adopted. In order to make the program structure clear and facilitate the further expansion of the system functions in the future, the software of the dormitory center computer is developed by the development tool Visual Basic language and Access database. The basic functions include setting power, query, statistics, printing, meter parameter setting and alarm, etc. If a card reader is configured, the prepayment and balance refund functions can be added.
2.2 User electricity metering program design
The main program block diagram of the multi-function meter is shown in Figure 5. The function of the communication module is to achieve reliable communication with the dormitory management center computer according to the communication protocol. The central computer system reads the user's electricity data and sets the time period, rate, vicious load and power limit and other meter parameters. The function of the display module is to display the user's peak, flat, valley, total electricity and time, last month's electricity and other information. The metering module and 8051 are parallel communication. The MCU can directly access the register inside the metering module through a special register address to read the metering result. Then use the circuit constant to correct the corresponding meter parameters to obtain the real measurement value. Combined with the current time period and rate, the actual electricity consumption of the user in the peak, flat and valley periods is accumulated. The electricity can be directly stored in the Flash memory or in the computer center.


2.3 Malicious load identification design
In collective electricity use places such as college student dormitories, vicious loads usually refer to high-power pure resistive electrical appliances such as hot pots and rice cookers. The use of these appliances brings great safety hazards to dormitories. The use of vicious loads causes the active power of the line to surge in an instant and continue to use the same power. When using loads such as computers, the power of the line increases instantly, but as the host and display enter the working state, the total power of the line will drop immediately. Moreover, the power factor of loads such as computers is usually around 0.9. Therefore, PL3000 can fuzzily identify whether there is a malicious load based on the changes in the voltage and current of the load line sampled. The software design flow chart is shown in Figure 6. When it is found that the user is using a malicious load, the meter will short-term power outage for the user, and then try to supply power after a certain interval. If the malicious load has been removed, normal power supply will be restored. If there is still a malicious load, the power will be cut off again. If there is still a malicious load, it will be reported to the computing center after repeated several times, and long-term power outage will be performed. In addition, this system can also supply power according to time periods, such as supplying power with a very small load at night. This can be divided according to the work and rest schedule, and different power parameters can be set for each time period.

3 Conclusion
As an intelligent power management system, the intelligent power control system is very suitable for centralized power management in college dormitories, for example. With appropriate communication protocols, it can easily interface with the computer of the management center to form a monitoring and management network. This design adopts low-power devices, low cost, easy integration, and high reliability. After testing, the technical indicators of the electric energy meter designed in this paper have reached the national technical standards for electric energy meters, and it has certain promotion value and good market prospects.

Reference address:Design of electricity management system for student apartments based on PL3000 single chip microcomputer

Previous article:Grayscale Design and Implementation of LED Display Screen Based on AVR
Next article:A solution for an AVR single-chip intelligent multi-interface full hardware audio system

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号