系统结构，包括传感器、信号处理电路、AT89C2051单片机、LCD显示电路、数据存储电路和电源。 Intelligent turbine flowmeter system structure, including sensors, signal processing circuits, AT89C2051 single-chip microcomputer, LCD display circuit, data storage circuit and power supply. This design uses a button to control and display the real-time flow rate or cumulative flow or segmented flow. Considering the signal attenuation, strength, etc., the signal should be amplified before it is sent to the microcontroller, and then input to the microcontroller for calculation. The single-chip computer uses the counting function of the timer T1 to measure the number of input signals, and then uses the single-chip's arithmetic operation function to convert the number to speed, and at the same time, it accumulates the flow rate every second to calculate the accumulated flow rate. Finally, the obtained flow rate, segmented flow rate and accumulated flow rate are stored in the E2PROM, and the flow rate or flow rate is displayed according to the pressing of the button. In order to conveniently calculate the segment code of the data value to be displayed, the BCD code of each digit of the data value to be displayed can be converted into an 8-segment code by displaying the table and sent to the display buffer, and finally sent to the LCD module for display via the serial port. Measured flow rate or flow. The speed and flow value are displayed in 8 digits. The flow rate uses 1 decimal place and the flow rate uses 2 decimal places. The system software adopts a modular design method. The entire system consists of a system initialization module, a signal processing module, a timer interrupt module, a flow and velocity calculation and storage module, a display data processing module, a data display module, and other functional modules. Its software structure is shown in the figure. After power-on, first enter the system initialization module, after which the system software will start running to display the measured value on the LCD module in real time.
硬件选用AT89C2051作为信号处理核心。 Intelligent turbine flowmeter hardware selects AT89C2051 as the signal processing core. T89C2051 includes 2kB of rewritable flash memory, 128 bytes of internal RAM, 15 programmable I / O port lines, 2 16-bit timer / counters, 1 5-vector two-level interrupt structure, and 1 full-duplex The serial communication port supports 2 software-selectable power-saving working modes at the same time [1-2]. The design uses T0, T1 timer of AT89C2051, and 8 lines of P1 port. Because the microcontroller is compatible with 89C51, it is more convenient in terms of hardware circuit design and software programming. Due to the inherent characteristics of AT89C2051, the design should take into account: First, its program memory space is 2kB, so all branches and branch instructions must be limited to this range. Second, it has no MOVX instruction and does not support external memory operations. In addition, AT89C2051 itself has some other features, such as the ability to use commands to make it work in a low power mode.
是将涡轮传感器产生的与原油流量成正比的脉动信号转换成流量值，即将传感器单位时间输出脉冲数和输出脉冲总数转换成瞬时流量和总流量，并显示出来。 The intelligent turbine flowmeter converts the pulsation signal that is proportional to the crude oil flow rate generated by the turbine sensor into a flow value. That is, the number of output pulses and the total number of output pulses per unit time of the sensor are converted into instantaneous flow and total flow, and displayed. The system can display the current instantaneous flow, the current accumulated total flow, the current time in real time, and has an online parameter setting function. At the same time, signals such as flow rate and time can be converted into 4-20mA current signals to facilitate remote signal transmission . The system adopts LCD display and low power consumption. Except for the communication module, the whole circuit can work under the voltage of 2.7 ~ 3V. In the field without power, it can be powered by two 1.5V dry batteries to complete the flow detection and display functions. The one-chip computer chooses PIC16F873 produced by American Microchip Company. The PIC series 8-bit single-chip microcomputer uses a reduced instruction set computer structure (RISCCPU) with only 35 single-word instructions, which can be applied in the fields of digital instrumentation, automatic test and control, and intelligent household appliances . The operating frequency range is DC to 20MHz; its power consumption is typically less than 2mA when the operating voltage is 5V, the crystal frequency is 4MHz, and less than 20μA at 3V / 32kHz; the operating voltage range is 2.0 to 5.5V; there are three sets of bidirectional I / O Port, the pin has a strong load direct drive capability, 25mA sink / pull current; supports interrupt processing (13 interrupt sources); has a 8-level depth hardware stack, which is convenient for implementing multi-level subroutine calls; serial In terms of communication mode, USART, SPI, and I2C can be supported [3-4].