0% found this document useful (0 votes)
91 views4 pages

Development of Ultrasonic Small Flow Measuring (STC89C52)

Uploaded by

Zafer Onan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views4 pages

Development of Ultrasonic Small Flow Measuring (STC89C52)

Uploaded by

Zafer Onan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

2019 2nd International Conference on Safety Produce Informatization (IICSPI)

Development of Ultrasonic Small Flow Measuring


Instrument Based on STC89C52

Yankai Xu
School of Optics and Photonics, Beijing Institute of Technology, Beijing, China
[email protected]

Abstract—The system uses STC89C52 single-chip container to V , and the bottom area of the container is S .
microcomputer as the core control chip to realize the function
of measuring small flow by ultrasonic, combined with the
minimum system of single-chip microcomputer, liquid crystal V H uS (2)
display, ultrasonic measuring displacement module, button
module and buzzer alarm circuit. The liquid crystal display of According to equations (1) and (2), the M of
the meter displays functions such as instantaneous flow rate, instantaneous flow rate and the A of instantaneous flow
instantaneous flow rate, and flow rate over-limit alarm. At the
rate can be calculated. Time difference is set as T .
same time, the H of the liquid level change height difference
value, the T of the liquid level height difference change time
and the S of the button setting container bottom area value are V
displayed. Though a simple and intelligent operation process, M (3)
the design accurately and quickly obtains traffic data T
information, which not only greatly improves the working
efficiency of detecting traffic but also reduces the working H
intensity. A (4)
T
Keywords—ultrasonic, STC89C52, small flow measurement,
instantaneous flow rate This kind of water flow and water velocity detection is
the data result obtained by the relevant calculation of
I. INTRODUCTION displacement difference detection in specified time. Make
clear the working principle of ultrasonic flow meter,
With the continuous updating and development of
according to the principle can achieve functional design and
electronic products, electronic technology products with
implementation based on SCM.
automation, intelligence and simplicity have attracted the
attention of the society. In recent years, many companies II. THE DESIGN OF SYSTEM FUNCTION
have turned their attention to the direction of gas-liquid flow
monitoring. Whether from the perspective of life or from The system uses STC89C52 single-chip microcomputer
production, accurate and intelligent monitoring of as the main controller, and designs the signal processing
instantaneous small flow and instantaneous flow rate will be circuit based on the ultrasonic ranging module .Which
very important. designs the ultrasonic ranging module used as the front-end
sensor. The right input unit consists of three parts. The
The ultrasonic pulse echo method is used to measure the ultrasonic sensor acquires the liquid level data, and the
propagation time of the ultrasonic wave in the gas. The flow button sets the bottom area size, and the two signals are
velocity and flow rate of the fluid are measured by transmitted to the single chip microcomputer. The liquid
calculating the T of the time difference between sound level detecting circuit can detect the water level in the
waves and the H of the level change value. The specific container, and the signal is transmitted to the single chip
principle is as follows. after the lower limit. The button module can set the value of
the upper and lower limits of the flow rate. The output unit
Set the initial water level as L1 , and the liquid level on the left side of the microcontroller consists of two parts.
after T seconds as L2 . LCD display mainly used to display instantaneous flow and
instantaneous flow rate data. The buzzer module alerts the
over-limit flow rate alarm. The entire system functions from
H L2  L1 (1) the input signal to the microcontroller to the output signal,
achieving a closed-loop control junction. The block diagram
Set water volume change volume per unit time of water of the design is shown in Figure 1.
Buzzer Alarm Transceiver Converter
Module Circuit
STC89C52
Single Chip
LCD Display Microcomputer Key Ultrasound Ranging
Module Circuit Module

Figure.1 The overall design of the system

978-1-7281-4566-2/19/$31.00 ©2019 IEEE -394-

Authorized licensed use limited to: Bursa Uludag Universitesi. Downloaded on July 10,2021 at 19:48:26 UTC from IEEE Xplore. Restrictions apply.
2019 2nd International Conference on Safety Produce Informatization (IICSPI)

Start

System initialization

Ultrasound ranging is placed above


designated water containers

Ultrasound ranging module begins to


work

Whether to get the current no


liquid level height value

yes

yes Water containers drop in


liquid level in time T

no

Obtain the difference between before


and after the change of water volume
and liquid level

Setting the bottom area of water


container S by key-pres

Calculating instantaneous water flow

Calculating instantaneous water


velocity based on time T

no Whether the instantons


velocity exceeds the limit

yes
Buzzer alarm

End

Figure.2 The main program of the system

III. THE DESIGN OF SYSTEM SOFTWARE With the ultrasonic distance measuring sensor, the liquid
level of the water container is measured. When the water
A. The design of system program level in the container is changed, the liquid level is
First, each memory cell is initialized, the circuit is reset measured again. The bottom area of the container(S) and the
and the ultrasonic flow meter system is set, and the time of the water level(T) change are set. Using the acquired
instantaneous flow rate upper and lower limit values are set. known data, the instantaneous water flow and the

-395-

Authorized licensed use limited to: Bursa Uludag Universitesi. Downloaded on July 10,2021 at 19:48:26 UTC from IEEE Xplore. Restrictions apply.
2019 2nd International Conference on Safety Produce Informatization (IICSPI)

instantaneous water speed are detected, which displayed on starts up and sends 8 square waves to the specified liquid
the LCD. If the flow rate is exceeded, the buzzer will alarm. level. At this time, if the liquid level end returns a signal, the
The flow chart of the main program design is shown in ECHO of the I/O terminal of the microcontroller will
Figure 2. continue to emit a high level signal. The time of the entire
high level signal(T) is the ranging time. The time and the
Start speed of sound are calculated, and by dividing the
calculation result by 2, the ranging distance (L)is obtained.

Ultrasonic acquisition of high level ex IV. DEBUGGING AND ENTRY OF SOFTWARE PROGRAMS
ecution signal After the physical welding of the ultrasonic flow meter
is completed, the functional program needs to be developed
and designed. The most commonly used program
Transmitting a square wave signal to a development software in single-chip microcomputers is Keil,
specified location because the software has a relatively mature development
environment and has an independently integrated IDE. The
programming software includes several important operating
Signal returns, ECHO sends a procedures: program editing design, compilation part,
high level signal connection, and final debugging. All processes are
contained in the same programming environment that the
program is written in the C- language editor, and the
Use the high level duration and the win to divide by 2 to program is compiled by the compiler. If there is no problem
obtain the ultrasonic distance value during the compilation process, the program can be
programmed into the microcontroller for debugging. In
order to make the software designer convenient, the IDE
and other callable source files can be used in the design
End process to edit the program, and the relevant compiler
compiles the program into a file with the .HEX extension.
Figure.3 The ultrasonic ranging
As shown in Figure 4.
B. The design of ultrasonic ranging procedure
The ultrasonic ranging sensor is initialized. When the
sensor receives a high level signal for 10ȝs, the module

Figure.4 Hex file

C18
C12 VCC
5 B1
9 0.1uF 1 2 0.1uF
4 3 C1+ VDD 16
8 4 C1- VCC C17 VCC
10 3 COM3 5 C2+
7 C13 C2-
11 2 COM2 0.1uF P31 11 14 COM2 0.1uF
6 10 T1IN T1OUT 7
1 T2IN T2OUT
P30 12 R1OUT R1IN 13 COM3
9 R2OUT R2IN 8
C16
CONNECTOR 15 GND VEE 6

Figure.5 Circuit diagram of the computer connection port

The STC89C52 model MCU used in this design has its programmed program in the system.It mainly uses the
own ISP/IAP function that can be able to apply the STC-ISP.exe software provided by STC to entry the

-396-

Authorized licensed use limited to: Bursa Uludag Universitesi. Downloaded on July 10,2021 at 19:48:26 UTC from IEEE Xplore. Restrictions apply.
2019 2nd International Conference on Safety Produce Informatization (IICSPI)

programmed hex file through the P3.0 or P3.1 pin of the REFERENCES
SCM.When the discharge is completely completed, the [1] YAN Limei,XIE Yibing, XU Jianjun, et.al. Improved Forward and
SCM will Reset.The first step is the ISP check. If the Backward Substitution in Calculation of Power Distribution Network
P3.0/RxD pin receives the program download command, with Distributed Generation. JOURNAL OF XI’AN JIAOTONG
SCM will automatically download and entry the compiled UNIVERSITY,2013, Vol.47, No.6, p117-123. (In Chinese)
program file to the specified area that used save [2] Yan Limei, Zhu Yusong, Xu Jianjun,et.al. Transmission Lines
Modeling Method Based on Fractional Order Calculus Theory.
program,and running the corresponding program function. TRANSACTIONS OF CHINA ELECTROTECHNICAL SOCIETY,
If the ISP check wants to be jumped directly, the MCU 2014 ,Vol.29,No. 9:260-268 (In Chinese)
runs the function program directly, and the pin settings and [3] Longchao, Zhu Jianjun, Xu; Limei, Yan. Research on congestion
elimination method of circuit overload and transmission congestion in
connection lines of the MCU are removed, which can the internet of things. Multimedia Tools and Applications,
implement the specific demonstration of the SCM program Multimedia Tools and Applications, September 2017,76(17),pp
function. The circuit diagram of download program 18047–18066
connected to the computer shown in Figure 5. [4] Nai-bo Zhang,Jian-jun Xu,Chen-guang Xue. Core-shell structured
mesoporous silica nanoparticles equipped with pyrene-based
V. CONCLUSIONS chemosensor: Synthesis, characterization, and sensing activity
towards Hg(II). Journal of Luminescence,2011,131(9):2021-2025
The main functions implemented are as follows.
[5] Xu, J., Huang, L., Yin, S. et al. All-fiber self-mixing interferometer
(1) Dating collection of the liquid level of the water for displacement measurement based on the quadrature demodulation
technique. OPTICAL REVIEW, 2018,25(1):40-45.
container by the Ultrasonic distance measurement Module.
[6] Xu Jianjun, Wang Bao’e, Yan Limei, et al. The Strategy of the Smart
Setting the bottom area of the water container by Home Energy Optimization Control of the Hybrid Energy
pressing the button Coordinated Control. Transactions of China Electrotechnical Society,
2017, 32(12) 214-223.
(3) Determining whether it is over-limit by setting the [7] YAN Limei, ZHOU Zhongyuan, XU Jianjun, et al. Research on the
instantaneous flow rate maximum value and over-limit method of fault location of transmission device based on time series
buzzer will alarm. of alarm. Power System Protection and Control . Vol.46, No.7,Apr. 1,
2018,P38-48
(4) Calculating Instantaneous amount of flow and [8] Yang F, Yan L, Xu J, Li H. Analysis of optimal PMU configuration
instantaneous flow rate by the internal program of the SCM. method based on incomplete observation. Concurrency Computat
Pract Exper. 2018; e4835. https://doi.org/10.1002/cpe.4835.
(5) Revealing data information via LCD display.
ACKNOWLEDGMENTS
This work is supported by the Innovation Project of
University Students of Beijing Institute of Technology.

-397-

Authorized licensed use limited to: Bursa Uludag Universitesi. Downloaded on July 10,2021 at 19:48:26 UTC from IEEE Xplore. Restrictions apply.

You might also like