Liquid detection circuit and liquid detection method
Through the liquid detection circuit composed of a frequency synthesizer, radio frequency detector and a microcontroller, the problems of low liquid detection efficiency and low accuracy in the prior art are solved, and efficient and accurate liquid detection without the need to fit the inner wall of the container is achieved.
Patent Information
- Application Number
- CN202411989581.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-03-18
AI Technical Summary
The existing liquid detection technology is inefficient and has low accuracy, is greatly affected by the shape of the container, has high hardware costs, and has low consistency of detection parameters.
A frequency synthesizer, radio frequency detector and a microcontroller are used to form a liquid detection circuit, and a voltage-controlled oscillator and a phase-locked loop generate a frequency and power adjustable detection signal, receive a reflected signal and detect its amplitude difference and phase difference with the preset radio frequency signal. The microcontroller determines the liquid type based on these differences.
It realizes non-contact liquid detection without the need to fit the inner wall of the container. It has a wide range of application, high detection efficiency, high accuracy, simple structure and low cost.
Smart Images

Figure CN119643591A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of radio frequency identification technology, and in particular to a liquid detection circuit and a liquid detection method. Background Art
[0002] In some life scenarios, such as train stations, subway stations, large event venues, etc., it is necessary to test the liquids in non-metallic bottles carried by people to determine the type of liquid.
[0003] In the related art, the liquid type is usually distinguished by the characteristics of the liquid dielectric constant. Electrodes are placed on the side of the liquid sample, and the capacitance value of the liquid sample is measured by applying an AC electric field, so that the dielectric constant of the liquid sample is obtained by the correlation between the capacitance value and the dielectric constant. However, this detection method is greatly affected by the shape of the bottle side, and it is difficult to fit the bottle shape, resulting in low test accuracy, high error rate, and a single distinction boundary. For bottles of different capacities, it is necessary to operate the gear selection in advance before testing, which is inefficient. In the related art, non-metallic ultra-wideband pulse microwave reflection method is also used for liquid detection. The pulse wave with a fast rising edge of the high-frequency electromagnetic wave is transmitted to the liquid sample as a transmission signal, and the type of the liquid sample is determined by the waveform characteristics of the echo signal. However, this detection method requires the construction of a complex analog circuit through multiple separation devices, which has high requirements for electronic device parameters and high hardware costs. In addition, each separation device may have slight differences due to different production batches, resulting in low consistency of the overall detection parameters of the final device, low detection accuracy, and the need to cooperate with more cumbersome circuits and algorithms to determine the waveform characteristics of the echo signal, which has high requirements for devices and computing resources.
[0004] Therefore, there is an urgent need for a liquid detection solution that is simple to implement, efficient and accurate. Summary of the invention
[0005] In view of this, an object of the present invention is to provide a liquid detection circuit and a liquid detection method to solve the problems of low efficiency and low accuracy when performing liquid detection.
[0006] In a first aspect, the present invention provides a liquid detection circuit, the circuit comprising:
[0007] A frequency synthesizer, including a voltage-controlled oscillator and a phase-locked loop, is used to generate a detection signal through the voltage-controlled oscillator and the phase-locked loop and inject it into the liquid to be tested;
[0008] A radio frequency detector, used to receive a reflection signal formed by the detection signal reflected by the liquid to be tested, and detect an amplitude difference and a phase difference between the reflection signal and a preset radio frequency signal;
[0009] The single chip microcomputer is used to determine the liquid type of the liquid to be tested according to the amplitude difference and phase difference between the reflected signal and the preset radio frequency signal.
[0010] In an optional embodiment, the liquid detection circuit further includes a first coaxial cable, a first antenna, a second coaxial cable, and a second antenna;
[0011] The frequency synthesizer is connected to the first antenna via the first coaxial cable; the first antenna is used to inject the detection signal generated by the frequency synthesizer into the liquid to be tested;
[0012] The radio frequency detector is connected to the second antenna via the second coaxial cable; the second antenna is used to receive a reflected signal formed by the liquid to be tested reflecting the detection signal, and transmit the reflected signal to the radio frequency detector via the second coaxial cable.
[0013] In an optional embodiment, the RF detector includes a first signal source access terminal and a second signal source access terminal; the first signal source access terminal is connected to a preset RF signal; the second signal source access terminal is connected to a reflected signal; and an input impedance with a preset resistance value is set between the first signal source access terminal and the second signal source access terminal.
[0014] In an optional embodiment, the liquid detection circuit further includes a micro control unit; the micro control unit is communicatively connected to the frequency synthesizer and is used to send program instructions to the frequency synthesizer to control the output frequency of the detection signal.
[0015] In an optional embodiment, the liquid detection circuit further includes a crystal oscillator with a preset frequency; the crystal oscillator is electrically connected to the frequency synthesizer for providing a reference frequency to the frequency synthesizer.
[0016] In a second aspect, the present invention provides a liquid detection method, the method being executed by a single chip microcomputer in the liquid detection circuit according to the first aspect or any corresponding embodiment thereof; the method comprising:
[0017] Acquire the amplitude difference and phase difference between the reflected signal and the preset radio frequency signal; the reflected signal is formed by the reflection detection signal of the liquid to be tested;
[0018] The liquid type of the liquid to be tested is obtained by processing the amplitude difference and phase difference between the reflected signal and the preset radio frequency signal through a liquid type prediction model.
[0019] In a third aspect, the present invention provides a liquid detection device, which is applied to a single chip microcomputer in a liquid detection circuit according to the first aspect or any corresponding embodiment thereof; the device comprises:
[0020] A data acquisition module, used to acquire the amplitude difference and phase difference between the reflection signal and the preset radio frequency signal; the reflection signal is formed by the reflection detection signal of the liquid to be tested;
[0021] The liquid type prediction module is used to process the amplitude difference and phase difference between the reflected signal and the preset radio frequency signal through a liquid type prediction model to obtain the liquid type of the liquid to be tested.
[0022] In a fourth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the liquid detection method of the above-mentioned second aspect or any corresponding embodiment thereof by executing the computer instructions.
[0023] In a fifth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the liquid detection method of the second aspect or any corresponding embodiment thereof.
[0024] In a sixth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the liquid detection method of the first aspect or any corresponding embodiment thereof.
[0025] The technical solution provided by the present invention may include the following beneficial effects:
[0026] The liquid detection circuit provided by the present invention includes a frequency synthesizer, a radio frequency detector and a single chip microcomputer. The frequency synthesizer includes a voltage-controlled oscillator and a phase-locked loop, which are used to generate a detection signal through the voltage-controlled oscillator and the phase-locked loop and inject it into the liquid to be tested; the radio frequency detector is used to receive a reflection signal formed by the liquid to be tested reflecting the detection signal, and detect the amplitude difference and phase difference between the reflection signal and the preset radio frequency signal; the single chip microcomputer is used to determine the liquid type of the liquid to be tested according to the amplitude difference and phase difference between the reflection signal and the preset radio frequency signal. The above scheme can generate a detection signal with adjustable frequency and power through the voltage-controlled oscillator and the phase-locked loop in the frequency synthesizer, optimize the liquid detection accuracy, and does not need to fit the inner wall of the container where the liquid to be tested is located, is not limited by the container shape, and realizes non-contact detection, has a wide range of applications, and has high detection efficiency. In addition, the liquid detection circuit provided by the present invention has a simple structure, is easy to implement, does not need to use a separation device, and generates a detection signal with high accuracy and good consistency, so that the accuracy of liquid detection is high. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0028] Figure 1 is a structural schematic diagram of a liquid detection circuit according to an embodiment of the present invention;
[0029] Figure 2 is a circuit diagram of a frequency synthesizer according to the present embodiment;
[0030] Figure 3 is a circuit diagram of a radio frequency detector according to this embodiment;
[0031] Figure 4 is a schematic flow chart of a liquid detection method according to an embodiment of the present invention;
[0032] Figure 5 is a schematic diagram of time-phase characteristics according to an embodiment of the present invention;
[0033] Figure 6 is a schematic diagram of time-amplitude characteristics according to an embodiment of the present invention;
[0034] Figure 7 is a structural block diagram of a liquid detection device according to an embodiment of the present invention;
[0035] Figure 8 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0037] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0038] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0039] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0040] In some life scenarios, such as train stations, subway stations, large event venues, etc., it is necessary to test the liquids in non-metallic bottles carried by people to determine the type of liquid.
[0041] In the related technology, the dielectric constant characteristics of the liquid are usually used to distinguish the liquid type. Electrodes are placed on the side of the liquid sample, and the capacitance value of the liquid sample is measured by applying an AC electric field. The capacitance value is directly related to the dielectric constant, and the dielectric constant of the liquid sample is obtained through the capacitance value. However, this detection method is greatly affected by the shape of the bottle side. For some bottles with irregular shapes, the fitting effect is poor, resulting in low test accuracy, high error rate, and a single distinction boundary. Bottles of different bottle sizes and different capacities need to be distinguished in advance and then tested. It is difficult to meet the needs of rapid detection and the detection efficiency is low. Related technologies also use non-metallic ultra-wideband pulse microwave reflection method for liquid detection. The high-voltage excitation transistor is in a critical avalanche state, and the pulse wave with the fast rising edge of the high-frequency electromagnetic wave is transmitted to the liquid sample as the transmission signal. Then, a series of signal processing is performed on the echo signal to obtain the waveform characteristics of the echo signal to determine the type of the liquid sample. However, this detection method has many circuit modules and requires building a complex analog circuit through multiple separation devices. It has high requirements on the parameters of electronic devices and high hardware costs. In addition, there may be slight differences between the individual separation devices due to different production batches, resulting in low consistency in the overall detection parameters of the final device and low detection accuracy. In addition, it is necessary to cooperate with more complicated circuits and algorithms to determine the waveform characteristics of the echo signal, which has high requirements on devices and computing power resources.
[0042] Therefore, an embodiment of the present invention provides a liquid detection circuit, which achieves the effect of improving the efficiency and accuracy of liquid detection by using a frequency synthesizer and a radio frequency detector in combination.
[0043] Figure 1 Schematic diagram of the structure of the liquid detection circuit according to an embodiment of the present invention. Figure 1 As shown, the liquid detection circuit includes a frequency synthesizer, a radio frequency detector and a single-chip microcomputer.
[0044] The frequency synthesizer comprises a voltage-controlled oscillator and a phase-locked loop, and is used for generating a detection signal through the voltage-controlled oscillator and the phase-locked loop and injecting the detection signal into the liquid to be detected.
[0045] The radio frequency detector is used to receive a reflection signal formed by the liquid to be tested reflecting the detection signal, and detect an amplitude difference and a phase difference between the reflection signal and a preset radio frequency signal.
[0046] The single chip microcomputer is used to determine the liquid type of the liquid to be tested according to the amplitude difference and phase difference between the reflected signal and the preset radio frequency signal.
[0047] Figure 1 The working principle of the liquid detection circuit shown is as follows:
[0048] The voltage controlled oscillator (VCO) can output a periodic signal of the corresponding frequency according to the input voltage, and the phase-locked loop (PLL) can lock the frequency and phase of the input signal through a feedback mechanism, thereby achieving synchronization between the output signal and the input signal. The frequency synthesizer can generate a stable and frequency-adjustable RF signal as a detection signal by setting the frequency division ratio of the phase-locked loop and the input voltage of the voltage controlled oscillator, scan the liquid to be tested at different frequencies, obtain more comprehensive detection data, and improve the accuracy of liquid detection.
[0049] Since different liquids or different states of the same liquid will cause different attenuation and phase changes of the RF signal, and are reflected in the reflected signal, after the frequency synthesizer generates the detection signal, the detection signal is injected into the liquid to be tested. The liquid to be tested will cause the injected detection signal to undergo corresponding attenuation and phase changes, and form a reflected signal corresponding to the effect of the liquid to be tested on the detection signal. The reflected signal can be received by the RF detector, and the reflected signal can be processed to obtain information that can reflect the liquid characteristics of the liquid to be tested, so as to perform subsequent liquid type detection. Specifically, the preset RF signal is a reference signal for measuring the amplitude and phase of the reflected signal, which can be set according to actual needs, for example, set to an idle signal when the liquid to be tested is not placed. The RF detector can process the reflected signal and the preset RF signal, obtain the amplitude difference and phase difference between the reflected signal and the preset RF signal, and send the detected amplitude difference and phase difference to the single-chip microcomputer.
[0050] The single chip microcomputer is pre-set with an algorithm that can associate the amplitude difference and phase difference with the liquid type, and can determine the liquid type of the liquid to be tested according to the amplitude difference and phase difference, thereby realizing the detection of the liquid to be tested. The liquid type of the liquid to be tested is the type of liquid, such as water, alcohol, etc.
[0051] In an optional embodiment, the liquid detection circuit also includes a first coaxial cable, a first antenna, a second coaxial cable and a second antenna. The frequency synthesizer is connected to the first antenna via the first coaxial cable, and the first antenna is used to inject the detection signal generated by the frequency synthesizer into the liquid to be tested. The radio frequency detector is connected to the second antenna via the second coaxial cable, and the second antenna is used to receive the reflected signal formed by the liquid to be tested reflecting the detection signal, and transmit it to the radio frequency detector via the second coaxial cable. The shielding layer of the coaxial cable (Bayonet Neill-Concelman, BNC) can effectively reduce electromagnetic interference. By setting the first coaxial cable and the second coaxial cable, the electromagnetic interference in the process of injecting the detection signal into the liquid to be tested and receiving the reflected signal can be effectively reduced, thereby ensuring the reliability of the detection signal and the reflected signal, thereby improving the accuracy of liquid detection.
[0052] In an optional embodiment, the radio frequency detector includes a first signal source access terminal and a second signal source access terminal. The first signal source access terminal is connected to a preset radio frequency signal, and the second signal source access terminal is connected to a reflected signal. An input impedance of a preset resistance value is set between the first signal source access terminal and the second signal source access terminal. The preset resistance value is set based on the first signal source and the second signal source. By setting a matching input impedance between the first signal source access terminal and the second signal source access terminal, the loss and reflection of the first signal source and the second signal source can be reduced, thereby ensuring the accuracy of the first signal source and the second signal source.
[0053] In an optional embodiment, the liquid detection circuit further includes a micro control unit, which is communicatively connected to the frequency synthesizer and is used to send program instructions to the frequency synthesizer to control the output frequency of the detection signal.
[0054] In an optional embodiment, the liquid detection circuit further includes a crystal oscillator of a preset frequency, wherein the crystal oscillator is electrically connected to the frequency synthesizer for providing a reference frequency to the frequency synthesizer.
[0055] In an optional implementation, the frequency synthesizer includes a first chip. Exemplarily, the model of the first chip is LMX2581. Figure 2 is a circuit diagram of a frequency synthesizer according to this embodiment. Figure 2As shown, the first pin (clock input pin CLK), the second pin (data input pin DATA), the third pin (latch enable pin LE), and the fourth pin (chip enable pin CE) of the first chip are respectively connected to the SPI interface (Serial Peripheral interface, also known as MICROWIRE interface) through the fourth resistor R4 to connect to the microcontroller unit MCU. The microcontroller unit can issue program instructions to the frequency synthesizer and send configuration data through these four pins, thereby programming the programming register inside the first chip to control the detection signal generation process.
[0056] The fifth pin of the first chip (fast lock output pin FLout, which can switch the external resistor to the loop filter during the locking process to improve the locking time) is grounded through the second resistor R2 and the first resistor R1 in sequence. The fifth pin of the first chip is also grounded through the second resistor R2, the first resistor R1, the sixth capacitor C6, and the tenth capacitor C10 in sequence. The fifth pin of the first chip is also grounded through the second resistor R2, the seventh capacitor C7, the fifth resistor R5, and the tenth capacitor C10 in sequence. The sixth pin of the first chip (charge pump power supply pin VccCP) is connected to the first power supply voltage terminal, and the first power supply voltage terminal is also grounded through the second capacitor C2. The seventh pin of the first chip (charge pump output pin CPout) is connected to the twentieth pin of the first chip (voltage-controlled oscillator tuning voltage input pin Vtune) through the fifth resistor R5 and the seventh resistor R7 in sequence. The eighth pin of the first chip (charge pump ground pin) is grounded. The first resistor R1, the fifth resistor R5, the seventh resistor R7, the sixth capacitor C6, the seventh capacitor C7 and the tenth capacitor C10 form a loop filter (Loop Filter) of a phase-locked loop, which can filter out high-frequency noise and clutter, optimize the response speed and stability of the phase-locked loop, ensure that the phase-locked loop can quickly lock to the reference frequency, and provide a stable DC control voltage for the voltage-controlled oscillator to ensure that the voltage-controlled oscillator can work stably at the required frequency. The ninth pin of the first chip (the ground pin of the N divider and the R divider of the phase-locked loop) is grounded. The tenth pin of the first chip (the phase-locked loop power supply pin VccPLL) is connected to the first power supply voltage terminal. The eleventh pin of the first chip (the high-frequency input pin Fin of the external voltage-controlled oscillator) can be selected as needed. The twelfth pin of the first chip (the first differential frequency division output positive pin RFoutA+) is connected to the first coaxial cable J4 through the eighteenth capacitor C18, and the shielding layer of the first coaxial cable J4 can be grounded as a ground wire. The twelfth pin of the first chip is used to output the first radio frequency signal, and the first radio frequency signal is injected into the liquid to be tested as a detection signal after passing through the first coaxial cable J4 and the first antenna. The twelfth pin of the first chip is also connected to the first power supply voltage terminal through the first inductor L1, and the twelfth pin of the first chip is also grounded through the first inductor L1 and the fifteenth capacitor C15 in turn, the sixteenth capacitor C16 is connected in parallel with the fifteenth capacitor C15, and the seventeenth capacitor C17 is connected in parallel with the fifteenth capacitor C15. The fifteenth capacitor C15, the sixteenth capacitor C16 and the seventeenth capacitor C17 are used for output matching. The first inductor L1 is a shunt inductor, which acts as a radio frequency choke connected to the voltage-controlled oscillator to obtain better impedance matching performance, thereby providing higher output power.The thirteenth pin of the first chip (the first differential frequency division output negative terminal pin RFoutA) and the twelfth pin of the first chip are a pair of differential output pins. In the present embodiment, only one of the pair of differential output pins is used as the output, and the differential pair output form is not used, that is, the thirteenth pin of the first chip is not used in the present embodiment. The fourteenth pin of the first chip (the second differential frequency division output positive terminal pin RFoutB+) is used to output the second RF signal, which is the same as the first RF signal and is a no-load signal when the liquid to be tested is not placed. The second RF signal can be used as the preset RF signal. The fifteenth pin of the first chip (the second differential frequency division output negative terminal pin RFoutB) and the fourteenth pin of the first chip are a pair of differential output pins. In the present embodiment, the fifteenth pin of the first chip is not used for the same reason as the thirteenth pin of the first chip, which will not be repeated here. The sixteenth pin of the first chip (the output buffer power supply pin VccBUF) is connected to the power supply voltage terminal.
[0057] The seventeenth pin of the first chip (voltage-controlled oscillator power supply pin VccVCO) is connected to the power supply voltage terminal. The eighteenth pin of the first chip (voltage-controlled oscillator ground pin) is grounded. The nineteenth pin of the first chip (voltage-controlled oscillator bias circuit output pin VbiasVCO) is grounded through the fourteenth capacitor C14, and the fourteenth capacitor C14 can decouple and filter, reduce phase noise, prevent circuit oscillation, perform temperature compensation, provide temperature compensation, etc., to improve the stability of the voltage-controlled oscillator bias voltage. The twenty-first pin of the first chip (voltage-controlled oscillator ground pin) is grounded. The twenty-second pin of the first chip (voltage-controlled oscillator reference voltage pin VrefVCO) is grounded through the thirteenth capacitor C13, and the role of the thirteenth capacitor C13 is similar to the fourteenth capacitor C14, which will not be repeated here. The twenty-third pin of the first chip (voltage-controlled oscillator bias voltage temperature compensation pin VbiasCOMP) is grounded through the twelfth capacitor C12, and the role of the twelfth capacitor C12 is similar to the fourteenth capacitor C14. The 24th pin of the first chip (voltage-controlled oscillator regulator output pin VregVCO) is grounded through the 11th capacitor C11, and the function of the 11th capacitor C11 is similar to that of the 14th capacitor C14. The 25th pin of the first chip (lock detection output pin LD) is grounded through the 8th resistor R8 and the first LED light source LED1 in turn, and is used to perform the lock detection function. When the 25th pin of the first chip outputs a high level, the first LED light source LED1 lights up, indicating that the phase-locked loop is locked. It should be noted that Figure 2 Devices marked with NC characters represent that these devices can be chosen not to be used. For example, the first LED light source LED1 is marked with NC characters, which means that the first LED light source LED1 can be chosen not to be used, that is, the lock detection indicator light is not used, which does not affect the overall function of the circuit.
[0058] The 26th pin of the first chip (enable pin BUFEN of the RF output buffer) is not used in this embodiment. The 27th pin of the first chip (digital ground pin) is grounded to provide a reference potential point for the digital circuit. The 28th pin of the first chip (digital power supply pin VccDIG) is connected to the first power supply voltage terminal, and the first power supply voltage terminal is also grounded through the first capacitor C1. The output end (end 3) of the crystal oscillator Y1 is connected to the 29th pin (reference clock input pin OSCin) of the first chip through the fifth capacitor C5 and the fourth capacitor C4 in sequence. The output end of the crystal oscillator Y1 is used to provide a stable frequency signal generated by the crystal oscillator as a reference signal of the first chip. The fourth capacitor C4 and the fifth capacitor C5 are used to allow AC signals to pass through, while blocking DC signals to prevent the DC bias of the active crystal oscillator from having adverse effects on subsequent circuits, thereby affecting the performance of the entire circuit; the output end of the crystal oscillator Y1 is also connected to ground through the fifth capacitor C5 and the sixth resistor R6 in sequence; the ground end (end 2) of the crystal oscillator Y1 is grounded; the power supply end (end 4) of the crystal oscillator Y1 is connected to the first power supply voltage end, and the first power supply voltage end is grounded through the ninth capacitor C9; the power supply end of the crystal oscillator Y1 is also grounded through the eighth capacitor C8; the enable end (end 1) of the crystal oscillator Y1 is grounded through the third resistor R3 and the eighth capacitor C8 in sequence. The third resistor R3 is used to provide an enable voltage, and the eighth capacitor C8 and the ninth capacitor C9 are filter capacitors. The crystal oscillator Y1 is used to provide a reference frequency, and the phase-locked loop will perform frequency multiplication and frequency division operations based on the reference frequency. The microcontroller unit adjusts the frequency divider parameters of the phase-locked loop through programming to generate a detection signal of the required output frequency. The 30th pin (multiplexing output pin MUXout) of the first chip is connected to the SPI interface through the third capacitor C3 to connect to the microcontroller unit MCU, which is used to perform lock detection, N divider and R divider count output, read back and other diagnostic functions. The 31st pin (fractional circuit ground pin) of the first chip is grounded, and the fractional circuit (Fractional Circuit) is used to implement the fractional frequency division function in the phase-locked loop. The 32nd pin (fractional circuit power supply pin VccFRAC) of the first chip is connected to the first power supply voltage terminal. The 33rd pin of the first chip is grounded, which is the total ground pin of the first chip.
[0059] In an optional implementation, the radio frequency detector includes a second chip. Exemplarily, the model of the first chip is AD8302. Figure 3 is a circuit diagram of a radio frequency detector according to this embodiment. Figure 3As shown, the first pin of the second chip and the seventh pin of the second chip are both common ground pins, both grounded. The second power supply voltage terminal is grounded through the twenty-fourth capacitor C24, and the twenty-fourth capacitor C24 is used for power supply filtering. The preset radio frequency signal RFOUT is connected to the second pin INPA (channel A input pin) of the second chip through the thirty-ninth capacitor C39, the twenty-third capacitor C23, and the twenty-second capacitor C22 in sequence. The preset radio frequency signal RFOUT is also connected to the first node through the thirty-ninth capacitor C39, the twenty-third capacitor C23, and the nineteenth resistor R19 in sequence, and the first node is grounded. The third pin OFSA of the second chip is connected to the second node through the twenty-first capacitor C21, and the second node is connected to the first node. The fourth pin VPOS of the second chip is connected to the second power supply voltage terminal, and the fourth pin of the second chip is also grounded through the twenty-fifth capacitor C25. The fifth pin OFSB of the second chip is connected to the second node through the twentieth capacitor C20. The sixth pin INPB (channel B input pin) of the second chip is connected to the first node through the eighteenth capacitor C18 and the eighteenth resistor R18 in sequence, and the sixth pin of the second chip is also connected to the second coaxial cable J3 through the eighteenth capacitor C18 and the nineteenth capacitor C19 in sequence, and the shielding layer of the second coaxial cable J3 can be grounded as a ground wire. Among them, the eighteenth resistor R18 and the nineteenth capacitor C19 impedance match the reflected signal input by the second coaxial cable, and the nineteenth resistor R19 and the twenty-third capacitor C23 impedance match the preset RF signal. Since the second pin INPA and the sixth pin INPB of the second chip require high impedance input, it must be an AC input, so the twenty-second capacitor C22 and the eighteenth capacitor C18 allow AC signals to pass through while blocking DC signals. The twenty-first capacitor C21 and the twentieth capacitor C20 are grounded, and the cut-off frequency of the compensation filter can be set, and an input decoupling function is provided.
[0060] It should be noted that the preset RF signal RFOUT can be the second RF signal output by the fourteenth pin of the first chip. The second RF signal is used as the first signal source, and the detection signal obtained by the first RF signal identical to the second RF signal through the first coaxial cable and the first antenna is emitted into the liquid to be tested, and the reflected signal received through the second antenna and the second coaxial cable is used as the second signal source. The phase difference and amplitude difference between the second RF signal and the reflected signal obtained by the amplitude-frequency phase change generated by the first RF signal after passing through the liquid to be tested can be compared, thereby obtaining the liquid characteristics of the liquid to be tested.
[0061] The eighth pin PFLT of the second chip is the low-pass filter terminal of the phase output, and is grounded through the seventeenth capacitor C17. The ninth pin VPHS of the second chip is connected to the digital I / O pin of the microcontroller through the sixteenth resistor R16 and the tenth resistor R10 in sequence. Figure 3Taking the 0th pin PB0 of port B connected to the microcontroller as an example, the output voltage (linear voltage) of the ninth pin of the second chip is proportional to the phase difference between the channel A input and the channel B input, that is, it is used to indicate the phase difference between the reflected signal and the preset RF signal. The tenth pin PSET of the second chip is the feedback pin of the ninth pin of the second chip, which is used to adjust the output voltage of the ninth pin of the second chip in the measurement mode, and is used to apply the set point voltage in the controller mode. In this embodiment, the relevant function is not used, and it is connected to the ninth pin of the second chip. The eleventh pin VREF of the second chip is grounded through the fifteenth resistor R15, and is used to output the reference voltage generated inside the second chip for actual debugging. The twelfth pin MSET of the second chip is the feedback pin of the thirteenth pin of the second chip, which is used to adjust the output voltage of the thirteenth pin of the second chip in the measurement mode, and is used to apply the set point voltage in the controller mode. In this embodiment, the relevant function is not used, and it is connected to the thirteenth pin of the second chip. The thirteenth pin VMAG of the second chip is connected to the digital I / O pin of the microcontroller through the seventeenth resistor R17 and the ninth resistor R9 in sequence. Figure 3 Taking the seventh pin PA7 of port A connected to the microcontroller as an example, the output voltage (linear voltage) of the thirteenth pin of the second chip is proportional to the decibel ratio of the channel A input and the channel B input, that is, it is used to indicate the amplitude difference between the reflected signal and the preset RF signal. The fourteenth pin MFLT of the second chip is the low-pass filter terminal of the amplitude output, which is grounded through the sixteenth capacitor C16. It should be noted that Figure 3 A resistor with a medium resistance value of 0R, such as the tenth resistor R10, indicates that it can be selected without being set.
[0062] It should be noted that compared with the solution of using separate devices to build complex analog circuits, the present invention requires fewer devices, and the peripheral circuits are mostly made of resistors and capacitors. The devices are highly available and low in cost. At the same time, the separate devices use multiple devices to cooperate, and it is difficult to ensure the output consistency and the accuracy of the built signal. The detection signal generated by the frequency synthesizer of the present invention has high accuracy and good output consistency. In addition, the present invention can dynamically adjust the frequency and power of the detection signal generated by the frequency synthesizer through a voltage-controlled oscillator and a phase-locked loop to optimize the detection accuracy, and can also be combined with additional auxiliary sensors such as temperature sensors to further compensate for the impact of environmental factors on the detection results. By combining the frequency synthesizer with the radio frequency detector, it is possible to achieve high-precision radio frequency signal generation and sensitive phase and amplitude change detection, and realize non-contact and rapid detection of liquid properties.
[0063] The liquid detection circuit provided in this embodiment includes a frequency synthesizer, a radio frequency detector and a single chip microcomputer. The frequency synthesizer includes a voltage-controlled oscillator and a phase-locked loop, which are used to generate a detection signal through the voltage-controlled oscillator and the phase-locked loop and inject it into the liquid to be tested; the radio frequency detector is used to receive the reflection signal formed by the liquid to be tested reflecting the detection signal, and detect the amplitude difference and phase difference between the reflection signal and the preset radio frequency signal; the single chip microcomputer is used to determine the liquid type of the liquid to be tested according to the amplitude difference and phase difference between the reflection signal and the preset radio frequency signal. The above scheme can generate a detection signal with adjustable frequency and power through the voltage-controlled oscillator and the phase-locked loop in the frequency synthesizer, optimize the liquid detection accuracy, and does not need to fit the inner wall of the container where the liquid to be tested is located, is not limited by the container shape, and realizes non-contact detection, has a wide range of applications, and has high detection efficiency. In addition, the liquid detection circuit provided by the present invention has a simple structure, is easy to implement, does not need to use a separation device, and generates a detection signal with high accuracy and good consistency, so that the accuracy of liquid detection is high.
[0064] According to an embodiment of the present invention, an embodiment of a liquid detection method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0065] In this embodiment, a liquid detection method is provided. Figure 1 The liquid detection circuit shown in the embodiment is executed by a single chip microcomputer. Figure 4 is a flow chart of a liquid detection method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0066] Step S401, obtaining an amplitude difference and a phase difference between a reflected signal and a preset radio frequency signal.
[0067] The reflection signal is formed by the detection signal reflected by the liquid to be tested. Specifically, the detection signal is generated by the voltage-controlled oscillator and injected into the liquid to be tested, and then the RF detector receives the reflection signal formed by the detection signal reflected by the liquid to be tested, and compares the reflection signal with the preset RF signal, and obtains the amplitude difference and phase difference between the reflection signal and the preset RF signal and sends them to the single-chip microcomputer. Figure 1 The embodiments shown will not be described in detail here.
[0068] Step S402: Processing the amplitude difference and phase difference between the reflected signal and the preset radio frequency signal through a liquid type prediction model to obtain the liquid type of the liquid to be tested.
[0069] The liquid type detection model is a deep learning model with a liquid type prediction function, which can predict the liquid type of the liquid to be tested based on the amplitude difference and phase difference between the reflected signal and the preset radio frequency signal.
[0070] As one or more specific application embodiments of the embodiments of the present invention, the optimal implementation scheme or the scheme that the inventor most wants to embody is described below in combination with specific application scenarios.
[0071] In this embodiment, the signal frequency range of the detection signal is set between 600 MHz and 2.4 GHz, the voltage-controlled oscillator power supply is +3.3 V, the crystal oscillator is 100 MHz, the preset RF signal (first signal source) is configured with capacitors (specifically the thirty-ninth capacitor C39, the twenty-third capacitor C23, the twenty-second capacitor C22 and the twenty-first capacitor C21), the amplitude range is -60 dBm to 0 dBm, and the frequency range is 100 Hz to 2.7 GHz. The reflected signal (second signal source) is also configured with capacitors (specifically the second signal source is configured with the nineteenth capacitor C19, the eighteenth capacitor C18 and the twentieth capacitor C20), and an input impedance of 50 Ω is set between the first signal source and the second signal source (specifically the eighteenth resistor R18, the nineteenth resistor R19, the nineteenth capacitor C19 and the twenty-third capacitor C23) to reduce signal loss and reflection and improve signal accuracy.
[0072] When conducting liquid testing, four different types of liquid samples are selected for testing. Sample one is 500ml of water in a 550ml plastic beverage bottle, sample two is 500ml of 60% alcohol in a 550ml plastic beverage bottle, sample three is 400ml of gasoline in a 550ml plastic beverage bottle, and sample four is 500ml of hydrochloric acid in a 500ml chemical reagent glass bottle. The sampling frequency (the frequency of the detection signal) is gradually increased from 600MHz to 2.4GHz within one cycle, and the amplitude and phase change data are sampled at each frequency point. The four liquid samples to be tested are tested separately on the machine to collect data within one cycle, and 240 points are sampled at even intervals for drawing, as shown Figure 5 and Figure 6 As shown, Figure 5 is a schematic diagram of time-phase characteristics according to an embodiment of the present invention, Figure 6 3 is a schematic diagram of the time-amplitude characteristics according to an embodiment of the present invention. The corresponding frequency sweep points in one cycle are from 600 MHz to 2400 MHz, and the waveform trends presented by the four samples are substantially the same.
[0073] like Figure 5As shown in the figure, the phase characteristics of the four liquid samples to be tested change with time, and some positions shift left and right. In the range of 0.08s to 1s, the corresponding frequency is about 1600MHz-2000MHz. The phase characteristics of the liquid samples to be tested of different types are clearly distinguishable, and the output voltage is positively correlated with the dielectric constant, which can be used as a basis for category determination. Figure 6 As shown in the figure, some positions are shifted up and down. In most cases, the four liquid samples to be tested have obvious amplitude distinctions, whether in a single frequency point or in the entire frequency detection range. If the output voltage values of each frequency point are accumulated, the amplitude parameter distinction effect of different types of samples can be further amplified. Combining the two parameters of phase and amplitude can improve the accuracy of distinguishing liquid types.
[0074] In the present embodiment, a liquid detection device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0075] This embodiment provides a liquid detection device for use in Figure 1 The single chip microcomputer in the liquid detection circuit shown in the embodiment, such as Figure 7 As shown, including:
[0076] The data acquisition module 701 is used to acquire the amplitude difference and phase difference between the reflection signal and the preset radio frequency signal; the reflection signal is formed by the reflection detection signal of the liquid to be tested;
[0077] The liquid type prediction module 702 is used to process the amplitude difference and phase difference between the reflected signal and the preset radio frequency signal through a liquid type prediction model to obtain the liquid type of the liquid to be tested.
[0078] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0079] The liquid detection device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0080] The embodiment of the present invention also provides a computer device having the above Figure 7 The liquid detection device shown.
[0081] See also Figure 8 , Figure 8 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 8 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.
[0082] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0083] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0084] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0085] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0086] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0087] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0088] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0089] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations shall all fall within the scope of protection of the present invention.
Claims
1. A liquid detection circuit, characterized in that: The circuit comprises: A frequency synthesizer, including a voltage-controlled oscillator and a phase-locked loop, is used to generate a detection signal through the voltage-controlled oscillator and the phase-locked loop and inject it into the liquid to be tested; A radio frequency detector, used to receive a reflection signal formed by the detection signal reflected by the liquid to be tested, and detect an amplitude difference and a phase difference between the reflection signal and a preset radio frequency signal; The single chip microcomputer is used to determine the liquid type of the liquid to be tested according to the amplitude difference and phase difference between the reflected signal and the preset radio frequency signal.
2. The circuit according to claim 1, characterized in that The liquid detection circuit also includes a first coaxial cable, a first antenna, a second coaxial cable, and a second antenna; The frequency synthesizer is connected to the first antenna via the first coaxial cable; The first antenna is used to emit the detection signal generated by the frequency synthesizer into the liquid to be tested; The radio frequency detector is connected to the second antenna via the second coaxial cable; The second antenna is used to receive a reflected signal formed by the liquid to be tested reflecting the detection signal, and transmit the reflected signal to the radio frequency detector through the second coaxial cable.
3. The circuit according to claim 2, characterized in that The radio frequency detector comprises a first signal source access terminal and a second signal source access terminal; The first signal source access terminal accesses a preset radio frequency signal; The second signal source access terminal is connected to the reflected signal; and an input impedance with a preset resistance value is set between the first signal source access terminal and the second signal source access terminal.
4. The circuit according to any one of claims 1 to 3, characterized in that: The liquid detection circuit also includes a micro control unit; the micro control unit is communicatively connected to the frequency synthesizer and is used to send program instructions to the frequency synthesizer to control the output frequency of the detection signal.
5. The circuit according to claim 4, characterized in that The liquid detection circuit also includes a crystal oscillator with a preset frequency; the crystal oscillator is electrically connected to the frequency synthesizer and is used to provide a reference frequency to the frequency synthesizer.
6. A liquid detection method, characterized in that: The method is performed by a single chip microcomputer in the liquid detection circuit according to any one of claims 1 to 5; the method comprises: Acquire the amplitude difference and phase difference between the reflected signal and the preset radio frequency signal; the reflected signal is formed by the reflection detection signal of the liquid to be tested; The liquid type of the liquid to be tested is obtained by processing the amplitude difference and phase difference between the reflected signal and the preset radio frequency signal through a liquid type prediction model.
7. A liquid detection device, characterized in that: The device is applied to a single chip microcomputer in a liquid detection circuit according to any one of claims 1 to 5; the device comprises: A data acquisition module, used to acquire the amplitude difference and phase difference between the reflection signal and the preset radio frequency signal; the reflection signal is formed by the reflection detection signal of the liquid to be tested; The liquid type prediction module is used to process the amplitude difference and phase difference between the reflected signal and the preset radio frequency signal through a liquid type prediction model to obtain the liquid type of the liquid to be tested.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the liquid detection method described in claim 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the liquid detection method described in claim 6.
10. A computer program product, characterized in that The invention comprises computer instructions, wherein the computer instructions are used to make a computer execute the liquid detection method described in claim 6.