C8051F350 microcontroller realizes the design of gas flow meter detector

Publisher:温柔花香Latest update time:2024-02-23 Source: elecfansKeywords:C8051F350 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Gas flow meter is a commonly used instrument equipment. The bell-type gas flow standard device is a measurement standard device that uses air as the medium to verify, calibrate and detect gas flow meters. It is mainly suitable for the verification, calibration and type evaluation of speed, volumetric and differential pressure gas flow meters, and can also be used for research on gas flow measurement. This article is based on the C8051F350 microcontroller, transforms the existing bell device, and designs a gas flow meter detector.


Overview of Gas Flow Meter Calibration Technology

At present, the calibration methods of gas flow meters can be broadly divided into two types: direct measurement and indirect measurement.

The direct measurement method uses actual fluid for measurement verification. Its specific definition is to use a standard device (standard flow meter or measuring instrument) in series with the flow meter under test. By comparing the cumulative flow value of the fluid measured between the two, the measured flow value is obtained. Flowmeter measurement error method. The real flow detection method has the characteristics that the calibration environment is consistent with the working environment, the flow value is accurate and reliable, and it truly reflects the measurement characteristics of the flow meter under test. The real flow detection method can be divided into offline real flow detection and online real flow detection. Offline real flow testing is mainly carried out in the laboratory, which means to connect the flowmeter under test with the laboratory's flow standard device in series, and measure the flowmeter measurement error under laboratory reference conditions. This method can ensure that the flow meter is measured under laboratory conditions. The measurement is accurate, but its measurement characteristics under working conditions are ignored. Online real flow detection is to install the standard flow meter on the reserved calibration pipeline behind the flow meter under test, use the actual fluid for measurement, and obtain the actual working condition error through on-site online testing.

The indirect measurement method is a method that indirectly obtains the indication error of the measured flow meter by measuring several physical quantities related to the flow value and calculating the errors of several related physical quantities.

Gas flow meter detector principle

How the bell mechanism works

Bell type gas flow standard device is one of the main forms of gas flow standard device. When the pressure is not high (generally less than 10kPa) and the flow rate is not large, it is relatively simple to use it to calibrate the flow meter. The device can be divided into exhaust type and air intake type according to the direction of air flow. Its characteristics are: ① It is suitable for calibrating gas flow meters with low pressure and low flow rate; ② In exhaust-type devices, the gas pressure flowing through the flow meter being tested is very low, close to atmospheric pressure, and the gas humidity is very high, which is The calibration results will be affected, so humidity correction is necessary; ③ The air-intake device requires a dry and stable air source to ensure that the dryness of the calibration gas meets the specified requirements, and to ensure that the air flow pressure, temperature and flow rate of the test pipe section are constant. This makes it more difficult to build an air-intake device than an exhaust-type device; ④ Since the internal pressure of the bell is only determined by its own gravity, the gravity of the counterweight, the buoyancy of the liquid, and the pulling force of the compensation mechanism, no matter it is an exhaust-type device, It is still an air-intake type, and the internal pressure remains unchanged.

The standard volume of the bell jar is obtained by measuring the displacement of the bell jar. The automatic measurement of the bell jar displacement is an important part of the detector (bell jar device). The grating ruler is a high-precision displacement measuring element. It has been widely used in precision instruments, high-precision precision machining and other fields. The grating ruler is used in detectors and as the displacement sensing element of the bell measuring cylinder, which can accurately correspond to the bell jar. Volume amount. The principle of the detector is that when the bell jar descends, the gas in the bell jar flows through the flowmeter to be tested through the connecting pipe. When the bell jar descends, the descending height of the bell jar is converted into a pulse signal through the grating ruler, which is conditioned by the hardware interface circuit. Then it is sent to the computer, which converts it into a gas standard volume or volume flow rate through compensation and correction. In addition, the calibrated detector is equipped with a baffle and a photoelectric sensor. The volume between the two baffles of the bell jar is fixed. The time it takes for the baffles to pass through the photoelectric sensor can be measured, and the standard volume of the exhaust gas can also be obtained. or volumetric flow. By comparing the measured value with the volume or flow indicated by the flowmeter being tested, the basic error of the flowmeter being tested can be obtained.

Flow calculation formula

The volume of gas discharged from the bell jar during the measurement time t is VS, then the volume flow rate passing through the flow meter being calibrated

In formula (1), PS, TS and ZS are the absolute pressure (Pa), thermodynamic temperature (K) and gas compression coefficient in the bell jar respectively; Pm, Tm and Zm are the absolute pressure (Pa) and gas compression coefficient in front of the flow meter respectively. Thermodynamic temperature (K) and gas compression coefficient; Vs is the gas volume discharged by the bell jar in the PS and TS states (m3); Vm is the gas volume discharged by the bell jar in the Pm and Tm states (m3); t is Measurement time (s).

Comparing (qv)s with the displayed value (qv)m of the flowmeter being calibrated, the relative error of the displayed value of the flowmeter being calibrated can be calculated as:

For velocity flow meters, the instrument coefficient of the flow meter is calibrated based on the standard volume discharged by the bell device and the number of pulses output by the calibrated flow meter.

Basic structure of gas flow meter detector

The gas flow meter detector uses the C8051F350 microcontroller as the core to monitor all measurements. Its basic structure is shown in Figure 1.

C8051F350 microcontroller realizes the design of gas flow meter detector

Figure 1 Structural diagram of gas flow meter detector

In order to ensure that the difference between the air temperature in the bell jar and the liquid temperature in the liquid tank meets the specified requirements, the temperature of the detector should be strictly controlled, so five temperature sampling points are set up, and a temperature and humidity sensor is added to monitor the on-site calibration environment. All the signals monitored by the detector are as follows: ① Bell jar, five-way temperature includes the temperature of the top of the bell, the upper, middle and lower temperatures in the bell, and the liquid temperature; ② The flowmeter being tested, the temperature, pressure, differential pressure, simulation before the flowmeter is calibrated Flow meter signal; ③ environment, room temperature, humidity; ④ pulse signal, bell grating ruler, baffle, limit, pulse flow meter signal.

Gas flow meter detector hardware design

The hardware part of the gas flow meter detector is composed of microcontroller, communication, valve control and voltage conversion circuits. It is controlled by the computer to complete various calibration instructions and realize functions such as real-time data collection and high-precision timing.

Introduction to C8051F350 microcontroller

The detector uses the C8051F350 microcontroller as the control core. It is a highly integrated mixed-signal system-on-chip microcontroller that integrates rich on-chip resources such as PGA, ADC, and DAC, and has low power consumption, high resolution, small package, With advantages such as high cost performance, it is an ideal choice for high-precision measurement applications. The input and output of the microcontroller signal are shown in Figure 2.

Functional characteristics of the C8051F350 microcontroller: ① The execution time of 70% of the instructions is 1 or 2 system clock cycles, so that when ensuring the system speed requirements, the system clock frequency can be reduced, thereby reducing system power consumption; ② PGA can amplify 1~128 times, Suitable for direct measurement of small signals; ③ 8-channel 24-bit ADC, its nonlinearity can reach 0.0015%, ensuring high accuracy of the system; ④ 8kB on-chip FLASH memory, ensuring sufficient code space, can be used for linear correction programs of sensors, and can be One sector (512 bytes) is used as a non-volatile memory to store system calibration parameters; ⑤ High-precision programmable 24.5MHz internal oscillator, ±2% accuracy, can support crystalless UART operation; ⑥ 768 bytes Internal RAM can be used to store large amounts of data required for linearization operations; ⑦Programmable counter/timer array, which can realize 16-bit PWM, and can achieve D/A conversion with simple peripheral circuits; ⑧32-pin LQFP package, saving PCB area, Can be used for miniaturized products; ⑨ The on-chip debugging circuit provides full-speed, non-invasive in-system debugging to ensure easy development.

There are four types of external oscillation circuits that can be connected to the C8051F350 chip. In the design, a crystal is selected as the external oscillation source. In order to facilitate the setting of the baud rate, Y1 shown in Figure 2 is 22.1184MHz. The C8051F350 chip has a total of 17 digital I/O ports, of which P2.0/C2D is used for JTAG debugging. After the hardware connection and crossbar switch configuration, the pin functions of the remaining 16 ports are as follows: P0.0 grating ruler input pulse count; P0 .2. P0.3 is connected to the external crystal oscillator; P0.4, P0.5 serial port communication; P0.6 bell shield baffle, limit signal (INT0 interrupt); P0.7 flow meter pulse signal (INT1 interrupt); P1. 0 button (power-on reset); P1.1 and P1.2 microcontrollers read the baffle and limit signals; P1.4 controls the CD4053; P1.5~P1.7 control the 74HC595, and P0.1 and P1.3 are free.

[1] [2] [3]
Keywords:C8051F350 Reference address:C8051F350 microcontroller realizes the design of gas flow meter detector

Previous article:Design of indoor natural lighting system using two-dimensional fuzzy controller and C8051 microcontroller
Next article:Design of solar street light intelligent control system based on C8051F330 chip and MPPT technology

Latest Microcontroller 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号