Design of a Remote Flow Measuring System

Publisher:masphiaLatest update time:2012-02-09 Source: 21IC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

Flow meters are widely used in modern industrial measurement and control for fluid measurement. Remote monitoring and centralized data management of flow meters are the development trend of modern flow meter remote networking and measurement automation [1]. MODEM is one of the remote communication methods. It uses the factory, enterprise or public switched telephone network (PSTN) to achieve long-distance data transmission between computers or between computers in the central control room and embedded systems in the industrial field. This communication method is not restricted by location and time, and the data transmission is complete, economical and convenient without the need for additional wiring. Therefore, it is widely used in modern industrial long-distance measurement and control transmission.

The remote flow metering system is generally composed of a flow meter, a lower computer data transmission system, a communication medium and a PC. The data output of the existing flow meter is generally in two forms: a serial port and a 4-20mA analog signal. Since the output signal of the former is a digital quantity and the latter is an analog quantity, the design principles of its data transmission system are different. For these two data output forms, respectively, combining the advantages of MODEM remote communication and the convenience and practicality of single-chip microcomputer field data collection, a cost-effective remote flow metering system is designed. In particular, the reasonable design of the lower computer hardware system, software system and the effective adoption of anti-interference hardware and software measures are the key and core technology to realize the function of the entire system.

The single-chip microcomputer collects and sends real-time data of each flow measurement node on site. The distribution network diagram of the flow measurement nodes is designed as a user interface. Through the host computer, it is very convenient to dial the telephone number assigned to the flow meter of each measurement node, so as to realize the timely display and centralized management of data. The actual application shows that the system is cost-effective, the lower computer works stably and reliably, and the host computer can display the flow meter data in real time and accurately. Therefore, the design of the system has certain technical innovation significance and great practical value.

2 Overall system design

The remote flow metering system realizes the real-time monitoring, control and data transmission of the remote flow meter, and intuitively displays the important parameters of the system operation and the real-time data of each node. In order to improve the system data transmission speed and increase the transmission distance, improve the system's anti-interference ability and measurement and control accuracy, this design uses the public telephone network to form a remote flow metering system consisting of a central computer (host computer, PC), a modem (MODEM), a single-chip microcomputer (slave computer) and flow meters at each flow measurement point. Figure 1 is a block diagram of the overall design principle of the system. The system adopts a two-level control structure: the first level is the direct control level, that is, the single-chip microcomputer collects the data of the remote flow meter (such as pressure, temperature, instantaneous flow and cumulative flow, etc.) in real time; the second level is the process management level, that is, it is realized by an ordinary PC, mainly realizing the management and real-time display of each flow meter parameter and measurement data, and can adjust and expand the system according to actual needs, so the monitoring software of the host computer includes three parts: communication module, database module and user interface.

Figure 1 System block diagram

The measurement locations of remote flow meters are relatively scattered, and the distribution of each flow meter can be displayed on the host computer. Each flow meter is represented by a Command control and represents a telephone number, forming a distribution diagram of all flow meters. Through the multi-point dialing method of the host computer, the corresponding flow meter data is converted by the corresponding lower computer level, transmitted to the corresponding MODEM, and then transmitted to the host computer from the PC/MODEM adapter card through the public telephone network.

3 Lower computer hardware and software design

According to the usage and data output mode of the existing flow meter, the general data input/output methods are mainly parallel, serial and 4-20mA current analog signals. This system designs the software and hardware of the lower computer for the latter two data input/output methods. The data transceiver and controller of the lower computer use PIC16F877 microcontroller.

3.1 Serial communication between the lower computer and the flow meter

Figure 2 is a circuit schematic diagram when serial communication is used between the lower computer and the flow meter. The upper computer dials the telephone number of the flow meter at the measuring node, and the MODEM of the corresponding node responds. The data is transmitted to the MODEM of the lower computer (providing a standard RS-232 interface), and the level is converted by the RS-232/485 level converter. The PIC16F877 controls the MAX485 to send and receive data. The synchronous/asynchronous transceiver module USART (25-pin RC6/TX/CK and 26-pin RC7/RX/DT) of the PIC receives the level-converted data from the flow meter and transmits it back to the upper computer. Figure 3 is a flow chart when serial communication is used between the PIC and the flow meter.

Figure 2 Schematic diagram of serial communication between the microcontroller and the flow meter

3.2 The flow meter uses 4~20mA analog signal output

When the output of the flow meter is a 4-20mA analog signal, the circuit structure shown in Figure 4 is used. The flow meter data is output as a 4-20mA current signal and converted into a voltage signal through a 250Ω standard resistor R1. The voltage is converted into a digital quantity through the A/D converter ADS1202 and enters the PIC16F877, and is sent to the MAX232 by the USART module of the microcontroller and transmitted to the telephone line.

4 System Anti-interference Measures

According to practical experience and on-site usage, improving the anti-interference ability of the lower computer system is the main guarantee for the stable and reliable operation of the entire system. Therefore, the following focuses on introducing effective measures to ensure the reliable operation of the system from two aspects: the interference source of the lower computer hardware system and the software system.

4.1 Hardware system anti-interference measures

Solving the problem of the circuit board itself is a basic measure to improve the anti-interference ability of the system, such as the selection of components, line routing to reduce distributed resistance and voltage drop, reduce coupling noise, reduce high-frequency noise emission, reduce inductive noise, and reduce the number of IC sockets. In addition, the following anti-interference measures should be taken:

(1) Anti-interference design of system grounding

Figure 3 Flowchart of serial communication between PIC16F877 and flow meter

Figure 4 Communication circuit when the flow meter uses 4-20mA analog output

When making a PCB board, a three-layer board with an additional ground layer can be used. The area covered by the ground layer should be as large as possible, so that the ground of the high-frequency device is directly connected to the ground layer through vias, so that the ground line and the signal line are not arranged in parallel, thereby reducing induction and radiation. The digital ground and the system safety ground are connected at only one point to avoid forming a loop between the ground lines. [page]

(2) Eliminate power supply spike interference

Spike interference is an interference signal that is injected into the power supply system from the AC power grid. The basic method to eliminate spike interference is to add a filter capacitor to the power supply of the microcontroller system. That is, two capacitors are connected in parallel at the input end of the power supply for filtering and decoupling, where the large-capacity capacitor is responsible for filtering low-frequency interference, while the small-capacity capacitor is responsible for filtering high-frequency interference.

(3) Filter out high-frequency noise in the crystal oscillation signal

In order to ensure that the system can obtain the ideal clock pulse, the following measures should be taken: select a crystal oscillator with stable performance and small temperature drift; the installation position of the crystal oscillator should be as close to the microcontroller chip as possible to reduce the transmission distance of the oscillation pulse signal; connect high-frequency filter capacitors at both ends of the crystal oscillator; if necessary, add a shielding cover to the oscillator, and connect the shielding body to the safety ground at one point.

In addition, separate the strong and weak signals for routing; connect the unused input terminals of the chip to ground or high level instead of leaving them floating; connect pull-up resistors to the signals (such as R2 and R3 in Figure 4).

4.2 Software Anti-interference Measures

Perfect software design complements the anti-interference measures of the hardware system, such as setting up self-test procedures, setting software traps, and using software redundancy technology.

(1) Set up the self-test program

Flags are set in specific parts of the program or certain memory units, and loop tests are continuously performed during operation to ensure high reliability of information storage, transmission, and operation in the system. In the software system of the host computer, the connectivity of the communication line must be tested every time information is read from a remote node. If the line is connected, the data is read directly; if the line is disconnected, it is necessary to redial to establish a connection before reading the data.

(2) Setting up software traps

To prevent the program from running away, the GOTO instruction of the PIC microcontroller is used to force the program to jump to the main program entry after the system is reset. Traps can be set in the free area of ​​the system's program memory or the unused interrupt area. However, this method is powerless against the chaos caused by the program pointer entering the data area. In this case, a watchdog circuit must be used to solve it.

(3) Software Redundancy

Add several no-operation NOP instructions before the key statements that affect the program flow to ensure the stability of system signals when the key statements in the program are executed.

5 Conclusion

The remote flow metering system designed based on MODEM and PSTN is an innovative application of MODEM remote communication technology to remote flow metering. In particular, the software design of the lower computer is the core technology and intellectual property of the system.

Reference address:Design of a Remote Flow Measuring System

Previous article:Application of Ultrasonic Level Meter in Powder Silo Level Measurement
Next article:Infrared Temperature Measurement System for Transmission Lines Based on GPRS Transmission

Latest Test Measurement Articles
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号