Share this

Design of a smart meter reading system for electricity meters based on LonWorks

2026-04-06 08:48:42 · · #1
Abstract: LonWorks bus technology has become one of the most popular fieldbus technologies due to its short development cycle, relatively low investment, and high communication efficiency and reliability. This paper introduces the design methods of various functional circuits in an energy meter reading system based on LonWorks technology, and provides specific hardware implementations; it also introduces the Neuron C application software for the acquisition module, the design of the microcontroller program, and the design of low-level hardware drivers. Keywords: Remote meter reading; Power meter; LonWorks Abstract: LonWorks fieldbus technology is becoming one of the most popular fieldbus technologies due to its short timeframe, low cost, high communication efficiency, and high reliability. This paper details the design method of a power meter intelligent reading system based on LonWorks for every functional circuit. It also presents a detailed hardware design project for a collection device, and explains the design of intelligent nodes using the Neuron C software and a single-chip program. Keywords: Remote Reading; Power Meter; LonWorks 1 Introduction The advantage of LonWorks technology is that it embeds the communication protocol into the Neuron chip and provides a complete set of development and networking tools—LonBuilder, Nodebuilder, and LNS. This allows users to focus less on network communication and more on the specific application development of nodes. In intelligent meter reading systems, the sampling of low-level meter signals and the corresponding data transmission are the most important guarantees for the system's performance. In this system, the author chooses the LonWorks bus to solve the current bottleneck problem in intelligent meter reading systems—communication. 2 System Composition [align=center] Figure 1 System Structure Diagram [/align] The main processor of the meter sampling module is an AT89C51 microcontroller, which completes the sampling of meter pulse signals, degree calculation, and feedback linkage. The meter reader consists of an AT89C51 as the main processor and an MC143150 Neuron chip forming a Host-based node as the secondary station of the system, connected to the LON network. In this design, the Neuron chip is configured to operate in Slave B mode, specifically, I/O0 to I/O7 are connected to the P0 port of the AT89C51. Through this channel, the management information and real-time data of the AT89C51 can be uploaded to the industrial control computer, the production management computer, and other LON nodes via the LON network. The system structure is shown in Figure 1. The reverse channel also allows the management information and real-time data of the industrial control computer, the production management computer, and other LON nodes to be sent to the AT89C51 controller. The part in the black box in Figure 1 is the meter reader module. 3 Detailed design and implementation of meter reading module hardware 3.1 Meter head sampling module The main processor of the meter head sampling module is the AT89C51 microcontroller. The meter head acquisition module is mainly responsible for collecting the digital quantity (pulse signal) corresponding to the energy. The main CPU processes it, saves the corresponding data signal, and sends it to the meter reader in time-division. Through the transceiver, the signal of the corresponding meter is sent to the LON bus. (1) Signal sampling At present, the meters on the market are basically pulse meters, that is, output standard pulse signals. Taking the single-phase electronic energy meter used in the debugging of this system as an example, the electrical characteristics of the meter are: 220V-1.5 (6) A-3200imp/kWH, indicating that the energy consumption is 1 kWh for every 3200 pulse signals output, and the pulse duty cycle is 50%. The pulse signal output by the meter is sent to the acquisition module, and after passing through the optocoupler switch (as shown in Figure 2), the signal is isolated. Then it is shaped by the 74LS14 and sent to the external interrupt INT0 (P3.2) pin of the microcontroller, causing the CPU to generate an external interrupt. The interrupt method is used to realize real-time counting, eliminating the possibility of missed counting. The optocoupler is TLP521-1, which uses single-channel signal sampling. [align=center] Figure 2 Signal Sampling[/align] (2) Data storage When an interrupt is caused by a sampling signal, the counter works. When the pulse count reaches 3200, a write operation is generated, and the value of the previous address unit is incremented and stored at the current address. The memory uses an online electrically erasable EEPROM28C17. When reading, the 28C17 is used as program memory, and when writing, it is used as external RAM. The working performance is very stable, and no errors have occurred in the read and write operations. In this system, the address code of 28C17 is defined as 7800H-7FFFH, 2K addressing. (3) Calendar clock circuit sampling module needs to perform time-division counting function of the system, so a real-time clock is required to complete the functions of timed interrupt generation, time-division display, time and date acquisition, etc. Specifically, the real-time clock chip DS12887 produced by Dallas Semiconductor is selected. The DS12887 is a complete subsystem of a real-time clock with high integration. It contains a lithium battery, a quartz crystal oscillator, and a write protection circuit. This system uses the DS12887 as the real-time clock chip. (4) Power-off processing When the cost exceeds the limit, the system can automatically power off. The basic schematic diagram is shown in Figure 3. When the host computer finds that a user's cost exceeds the limit, it sends a power-off command to the 89C51. The 89C51 sets the port to zero, inverts it, and sends it to the B terminal of the 8050, causing the relay to operate and the switch to be activated. At this time, it is equivalent to the switch sent to the meter being in the off state, and the system is powered off. Q1 and Q2 in the figure constitute a Darlington transistor. [align=center] Figure 3 Circuit breaker circuit[/align] (5) Display module In addition, the system can also provide an LCD display (using a 12232 dot matrix LCD screen, providing Chinese character display) to achieve real-time display function, and can record the full digit reading accumulated in the counter window of a user's electricity meter within a certain period. As is well known, in the era of manual meter reading, the recorded reading was the cumulative value at the meter head. Billing was based on the difference between the cumulative reading after operation and the original reading, which was the metered electricity consumption. Therefore, the meter reading was not the actual electricity consumption. Furthermore, apart from direct-connection meters for residential electricity use, a user's actual electricity consumption is also greatly influenced by their meter multiplier, metering method (metering point settings, number of meters), etc. Therefore, the metered electricity consumption is also not the user's actual electricity consumption. The author believes that simultaneously recording both the meter serial number and the meter reading allows for a more intuitive verification of the consistency between the meter reading data and the metered object. It also provides the necessary conditions for calculating the metered electricity consumption and actual electricity consumption, enabling users to clearly understand the total meter reading and current usage. 3.2 Hardware Design of the Meter Reading Collector The hardware design of the meter reading collector mainly includes three parts: the processor circuit, the communication interface between the AT89C51 and MC143150 Neuron chips, and the LON bus network interface. (1) Main CPU and its peripheral expansion circuit The main CPU uses a conventional 89C51 microcontroller, connected to a 28C64 EEPROM as an online electrically erasable memory to store the data signals sent by each sampling module. It also includes a reset circuit, clock circuit, external RAM expansion, 232 serial communication circuit, power supply circuit, etc. (2) Design of the communication interface between the main CPU and the MC143150 Neuron chip This meter reading acquisition module adopts a HOST BASED structure. The communication between the main CPU AT89C51 and the slave processor MC143150 Neuron chip is implemented in slave B mode. Generally speaking, the parallel interface can be configured so that the Neuron chip works in master, slave A or slave B mode, and the two Neuron chips interface in master or slave A mode; while the Neuron chip interfaces with the non-Neuron chip in slave B mode, with the non-Neuron chip acting as the master and the Neuron chip working in slave B mode, to perform handshake communication to control the execution of instructions. During the data exchange between the master and slave, the Neuron chip pauses the execution of the application program. A maximum of 255 bytes of data can be exchanged at a time. This parallel I/O interface object method is very useful for applications requiring rapid data exchange. The Neuron chip can act as a coprocessor for an external processor, creating a bridge, gateway, or router. This illustrates a typical application of the Neuron chip in parallel interface objects. Method B belongs to parallel I/O objects. This system uses all 11 pins of the MC143150 Neuron chip, where I/O0 to I/O7 are 8-bit bidirectional data lines, and I/O8 to I/O10 are 3-bit control signal lines. Bidirectional data transfer between the MC143150 Neuron chip and the main processor is achieved using a token passing/handshake protocol. Relative to the main CPU, the MC143150 Neuron chip is equivalent to a parallel I/O device with 8 data lines and 3 control lines. The system interface diagram is shown in Figure 4. [align=center] Figure 4 Interface between the microcontroller and the 3150[/align] (3) Lon Network Interface The authors used a Control Module that supports the FTT-10A free topology twisted-pair transceiver as the interface between the data acquisition unit and the LON bus. The main body of the FTT-10A transceiver is an isolation transformer, which integrates a 78Kbps differential Manchester encoded communication transceiver. The FTT-10A transceiver can automatically detect three clock frequencies: 5M, 10M, or 20M. It presents a high impedance state when not powered on, which will not affect network communication. It is one of the commonly used transceivers. The FTT-10A transceiver provides pins for the interface with the neuron communication chip and the network interface. The interface is shown in Figure 5. [align=center]Figure 5 Transceiver Interface Circuit[/align] 4 Software Design of the Meter Reading Module The meter reading module consists of two parts: the meter head module and the meter reader. The low-level driver software design for both parts involves either a microcontroller program or a NEURON C program in the NODEBUILDER. The upper-level monitoring primarily uses LonMaker, NodeBuilder, and LNS provided by Echelon, combined with other development tools. Every 24 hours, the meter head module sends the collected data to the reader via serial communication. After receiving the meter data from each user at different time periods, the reader stores it in the 28C64 microcontroller and also sends the received data to the LON bus. The LON node software development uses the dedicated NEURON C programming language. NEURON C mainly handles the data exchange and communication between the microcontroller and the LON bus network. Based on the system's tasks, the main function of the software is to obtain data from the AT89C51 and then send the obtained data to the LON bus network. The general structure of a Neuron C program source code typically begins by defining variables, functions, and I/O port usage, followed by writing subroutines and `when()` statements to schedule the program. During the debugging of the data collector node, the author created a network YTY using LONMAKER, added a Development Target Device to the LonMaker network using VISIO, started NodeBuilder, and created a project YTY. Neuron C programming was performed in NodeBuilder, and the device template program was compiled and downloaded, simultaneously obtaining the device template YTY. The device module uses the template YTY generated by NodeBuilder. The author's innovations include: completing the software and hardware design of the meter reading module, realizing parallel communication between the microcontroller and the neuron chip; furthermore, based on the design of the meter collector, the author explored and researched LonWorks technology, using LON development tools to complete the software design of the meter reading system. References: [1] Hong Li. CY7C53120 neuron chip and its application [J], Foreign Electronic Components, 2002 (2), 12-16 [2] Yan Tingyong, Shao Ruping, Lin Jinguo, Liu Dingqiu. Research and development of intelligent nodes based on LON bus technology [J], Journal of Huaiyin Institute of Technology, 2002, 5, 52-55 [3] Zhao Jun. Progress in fieldbus technology [J]. Journal of Harbin University of Science and Technology, 2002 (3), 57-61 [4] Gao Qun, Li Daxing, Zheng Qiang. Application of USB-HOST technology in remote meter reading system [J]. Microcomputer Information, 2007, 8-2: 277-278
Read next

Digital technology of power isolation sensors

I. Overview Power isolation sensors/transmitters are small, high-performance power testing components (products) develop...

Articles 2026-02-22