Transparent tube liquid monitoring device and method capable of preventing misjudgment
Technical Field
The invention belongs to the field of automatic monitoring of liquid in a pipeline, and particularly relates to a transparent tube liquid monitoring device and method capable of preventing misjudgment.
Background
In the field of automation of instruments and meters, there is an increasing need to judge whether a liquid flows through a transparent pipeline. For example, in technical requirements and detection methods (survey) of chemical oxygen demand (CODCr) water quality on-line automatic monitor issued by ecological environment department of people's republic of china in 2018, it was explicitly proposed: "quality of water automatic monitoring appearance should have unusual information recording, upload and feedback function, if: the alarm of reagent shortage, the alarm of component failure, the alarm of liquid leakage, the alarm of sampling failure, the alarm of standard exceeding and the like. For another example, the infusion alarm applied to the medical field can monitor whether liquid exists in an infusion tube in real time, and alarm in time when the liquid is deficient so as to remind of changing the liquid.
The sensor technology which can be applied at present mainly comprises a capacitance type sensor and a photoelectric type sensor, and an integrated sensor generally comprises a knob which can adjust a detection threshold value. The capacitive sensor has high sensitivity when used for detecting the liquid state in the pipeline, but when other metals exist around the sensor, the sensor is influenced by the metals, which puts high requirements on the installation of the sensor in the instrument. The photoelectric sensor has the basic principle that light emitted by an LED transmits through a transparent tube, the other side of the transparent tube detects light intensity by a photoelectric sensor and converts the light intensity into an electric signal, and the electric signal is compared with a preset electric signal so as to output a changed electric signal. The photoelectric liquid sensor has the biggest defect that the LED and the photoelectric sensor have larger temperature drift, the light transmittance of liquid in the transparent tube can be changed, and the real-time adjustment can not be carried out once the judgment threshold value is set. When the temperature drift is too large or the light transmittance of the transparent tube is greatly changed, the signal amplitudes of the liquid state and the liquid-free state may be simultaneously greater than or less than the set judgment threshold, and the output signal of the photoelectric liquid sensor may be subjected to misjudgment. Although integrated photosensors generally have the function of manually adjusting the threshold value, the above-mentioned problems cannot be solved completely in real time.
Disclosure of Invention
The invention aims to provide a transparent tube liquid monitoring device and method capable of preventing misjudgment, and solves the problem that misjudgment is easy to occur in a method for monitoring whether liquid exists in a transparent tube in the prior art.
In order to achieve the purpose, the invention adopts the technical scheme that:
the invention provides a transparent tube liquid monitoring device capable of preventing misjudgment, which comprises an LED light source, a transparent infusion tube, a photoelectric sensor, a signal modulation and amplification circuit module, an ADC and a rear-end processor module, wherein the LED light source is used for providing a light source for the transparent infusion tube; the photoelectric sensor is used for collecting a light intensity signal of the transparent infusion tube, converting the collected light intensity signal into a current signal and transmitting the current signal to the signal modulation and amplification circuit module; the signal modulation and amplification circuit module is used for converting the current signal into a voltage signal, amplifying the voltage signal through the amplification circuit, and then transmitting the amplified signal to the ADC and the back-end processor module; the ADC and back-end processor module is used for converting the received voltage analog signal into a digital signal and performing back-end processing, and is used for realizing real-time updating of the set judgment threshold value.
Preferably, the LED light source is an infrared light source.
Preferably, the photosensor is a photocell, photodiode, or phototransistor.
A transparent tube liquid monitoring method capable of preventing misjudgment comprises the following steps:
s1, initializing the device and determining an initial threshold;
s2, monitoring the transparent infusion tube to be detected to obtain an electric signal value, and comparing the electric signal value with the initial threshold value determined in the step S1, wherein if the measured electric signal value is larger than the initial threshold value, the transparent infusion tube to be detected is judged to have liquid, the initial threshold value is calculated and updated according to the measured electric signal value, and the updated threshold value is used as the judgment threshold value for the next judgment; if the measured electric signal value is smaller than the initial threshold value, judging that the transparent infusion tube to be measured has no liquid, calculating and updating the initial threshold value according to the measured electric signal value, and simultaneously taking the updated threshold value as a judgment threshold value for next judgment; and if the measured electric signal value is equal to the initial threshold value, judging the abnormal state and judging again.
Preferably, in step S1, the specific method for determining the initial threshold is:
s101, collecting the intensity of an electric signal in a liquid-free state in a transparent infusion tube, and recording the intensity as Vr 1;
s102, collecting the intensity of an electric signal when the transparent infusion tube is in a liquid state, and recording the intensity as Vr 2;
s103, a device initialization threshold Vr is calculated from S101 and S102, and initialization of the device is completed, where Vr ═ (Vr1+ Vr 2)/2.
Preferably, in step S2, the initial threshold is calculated and updated according to the measured electrical signal value by:
if the measured electrical signal value is greater than the initial threshold value, assigning the measured electrical signal value to Vr 2;
if the measured electrical signal value is less than the initial threshold value, the measured electrical signal value is assigned to Vr 1.
Compared with the prior art, the invention has the beneficial effects that:
according to the transparent tube liquid monitoring device capable of preventing misjudgment, the system can quantify the amplitude of a signal when liquid exists or does not exist in the transparent tube according to the difference of the light transmittance when the liquid exists or does not exist in the transparent tube. The device uses the scheme of optical principle detection, has realized the non-contact monitoring of liquid state in the pipe, has avoided the condition that probe and liquid take place electrochemical corrosion and chemical corrosion than contact monitoring. The device uses the light-emitting light source as an infrared light source, and if the light source is a light source with a visible waveband, the light source is easily absorbed by liquid flowing through the transparent tube, so that the monitoring process is interfered. The device uses an infrared light source as an LED, and mainly considers that the infrared LED has low cost and simple use in engineering application occasions; for use with a light source, the sensor also uses a photoelectric sensor whose detection wavelength band response band contains the light emission wavelength band of the light source.
A transparent tube liquid monitoring method capable of preventing misjudgment determines a threshold value for judging the liquid state in the next transparent tube according to a signal amplitude corresponding to the state of liquid or no liquid in the transparent tube; the judgment threshold value is refreshed in real time along with the change of the signal amplitude value in each state judgment, so that the aim of dynamically calibrating the judgment threshold value is fulfilled, and the misjudgment condition caused by the fact that the signal amplitude has large drift for a long time and the threshold value cannot be adjusted in real time is prevented.
Further, since the system does not have pre-stored signal amplitudes corresponding to the liquid-filled and liquid-free states, an initialization operation is required. And respectively recording signal amplitudes corresponding to a liquid state and a liquid-free state for the first time in the initialization process, and calculating a judgment threshold value for the first time. After the initialization is finished, the state of liquid or no liquid in the transparent tube can be judged for the first time according to the threshold value determined during the initialization.
Furthermore, when liquid exists in the transparent tube, the liquid and the transparent tube focus the light source together, so that the light transmittance of the transparent tube is strong, and the signal amplitude is relatively large; conversely, the corresponding detected signal amplitude is relatively small when the liquid is free of liquid. The threshold value set by the principle is between the corresponding signal amplitude when liquid exists in the transparent tube and the corresponding signal amplitude when no liquid exists in the transparent tube. When liquid exists in the transparent tube, the liquid is detected again, and the corresponding signal amplitude is larger than the previously set signal amplitude; when no liquid exists in the transparent tube, the detection is carried out again, and the corresponding signal amplitude is smaller than the previously set signal amplitude. This enables the judgment to be accurate.
In summary, the transparent tube liquid monitoring device and method capable of preventing erroneous judgment provided by the present invention utilize the ADC and the back-end processor module to convert the voltage analog signal collected by the photoelectric sensor into a digital signal, and then the digital signal is processed by the back-end processor to update the initial threshold in real time, so as to improve the judgment accuracy.
Drawings
FIG. 1 is a schematic diagram of a monitoring device according to the present invention;
fig. 2 is a schematic flow chart of a monitoring method according to the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
As shown in fig. 1, the transparent tube liquid monitoring device capable of preventing misjudgment provided by the invention comprises an LED light source 1, a transparent infusion tube 2, a photoelectric sensor 3, a signal modulation and amplification circuit module 4, an ADC and a rear-end processor module 5, wherein the LED light source 1 is used for providing a light source for the transparent infusion tube 2; the photoelectric sensor 3 is used for collecting a light intensity signal of the transparent infusion tube 2, converting the collected light intensity signal into a current signal and transmitting the current signal to the signal modulation and amplification circuit module 4; the signal modulation and amplification circuit module 4 is used for converting the current signal into a voltage signal, amplifying the voltage signal by an amplification circuit, and transmitting the amplified signal to the ADC and the back-end processor module 5; the ADC and back-end processor module 5 converts the received voltage analog signal into a digital signal and performs back-end processing.
The LED light source is an infrared light source.
The photoelectric sensor is a photocell, a photodiode or a phototriode.
The current signal generated by the photoelectric sensor is converted into a small voltage signal through an I-V conversion circuit, and the small voltage signal is converted into a voltage signal belonging to the ADC input voltage range through an amplifying circuit.
The amplified voltage signal is accessed to an ADC; the ADC is connected with the back-end processor through a bus, and the voltage signal amplitude detected by the ADC is transmitted to the back-end processor through the bus for processing, calculation and judgment.
As shown in fig. 2, the working process of the present invention includes the following steps:
step 1, starting equipment;
step 2, collecting the electric signal intensity of the transparent infusion tube 2 in the initial state, and recording the electric signal intensity as Vr 1; the transparent infusion tube 2 is in an initial state that no liquid exists in the transparent infusion tube;
step 3, injecting liquid into the transparent infusion tube 2, collecting the electric signal intensity in the state, and recording the electric signal intensity as Vr 2;
step 4, calculating the initial threshold Vr of the equipment according to the step 2 and the step 3, and finishing the initialization of the equipment; wherein, Vr ═ is (Vr1+ Vr 2)/2;
step 5, starting to monitor whether liquid exists in the transparent infusion tube, specifically: comparing the monitored electric signal value v1 with an initial threshold value, and if the electric signal value v1 is smaller than the initial threshold value; judging that the transparent tube is not filled with liquid, giving the value of the electric signal value v1 to Vr1 during initialization, and recalculating and updating the threshold Vr to be (Vr1+ Vr 2)/2; if v1 is larger than Vr, judging that liquid exists in the transparent tube, giving the value of the electric signal value v1 to Vr2, and recalculating and updating the threshold Vr to be (Vr1+ Vr 2)/2; if v1 is equal to Vr, the judgment is determined to be abnormal, and the judgment is re-made without any processing.
And repeating the measuring procedure for judging whether liquid exists in the transparent tube, comparing the monitored electric signal value v with the updated threshold value Vr, and updating the threshold value Vr according to the comparison result, so that the effects of judging whether liquid exists in the transparent tube in real time and judging whether the voltage threshold value of the liquid exists in real time through real-time calibration are achieved.
The signal threshold of the photoelectric sensor is readjusted according to each judgment result, so that the real-time updating of the judgment threshold is realized. In the field of automatic instruments which cannot be adjusted in real time, the threshold value is adjusted in real time, and the accuracy of judgment can be greatly improved.
The conventional photoelectric sensor generally does not use an ADC, but uses a comparator to output high and low levels for judgment. The judgment threshold of the comparator is manually adjusted and cannot be updated in real time. The method is applied in the application fields of instruments and meters for a long time, and abnormal judgment can occur after the light transmittance changes or the semiconductor device drifts.