Humidity detection method and device, computer equipment and storage medium
Through the combination of dual-wavelength infrared light detection and Kalman filtering algorithm, the problem of insufficient accuracy and stability in traditional humidity detection technology is solved, and high-precision and fast contactless humidity measurement is achieved.
Patent Information
- Application Number
- CN202510756451.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-06-09
AI Technical Summary
Traditional humidity detection technology has problems such as contact sensors that are prone to contamination, short life and poor anti-interference of non-contact solutions, which is difficult to meet the needs of high precision and long-term stability.
Dual-wavelength infrared light detection technology is used to measure the difference in the light intensity signal between the optical path and the reference optical path, and combine the Kalman filtering algorithm to compensate and correct the humidity value to achieve contactless detection.
It improves the accuracy and anti-interference of humidity detection, the measurement error is ≤±1.5%RH, and the response time is <0.5 seconds. It is suitable for industrial production, agricultural greenhouses and storage environments.
Smart Images

Figure CN120253740A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of sensor humidity detection, and particularly relates to a method, device, computer device and storage medium for humidity detection. Background Art
[0002] Humidity detection has important application values in fields such as the construction field, industrial production, agricultural environment monitoring, warehousing logistics, and medical health. In addition, the detection accuracy and real-time performance of traditional methods also need to be improved. Traditional humidity detection technologies are mainly divided into two categories: contact type and non-contact type, but both have significant limitations.
[0003] In the contact detection technology, the capacitance / resistance type sensor realizes measurement through the change of the electrical characteristics of the humidity-sensitive material. However, it needs to directly contact the measured medium. When exposed to corrosive gases (such as ammonia and hydrogen sulfide) or high-humidity environments for a long time, problems such as electrode oxidation and humidity-sensitive film pollution are likely to occur, resulting in the attenuation of measurement accuracy (typical error > ±5%RH), and the service life is generally less than 2 years. Although the electrolysis method sensor can achieve fast response, there is a risk of electrolyte volatilization, frequent calibration is required, the maintenance cost is high, and it is not suitable for flammable and explosive environments.
[0004] In the non-contact detection technology, the single-path infrared absorption method utilizes the absorption characteristics of water molecules in a specific infrared band, and calculates the humidity by measuring the attenuation of the transmitted / reflected light intensity. However, the existing solutions are significantly affected by light source fluctuations, environmental temperature drift, and background radiation interference. Especially in complex industrial scenarios, the dark current drift of the detector caused by temperature changes can lead to a measurement error of more than ±3%RH. The microwave resonance method is based on the influence of medium humidity on the propagation of electromagnetic waves, but the device is bulky and is easily interfered by metal objects, making it difficult to achieve local accurate measurement. The ultrasonic detection method calculates through the correlation between the sound velocity and humidity, but it is seriously affected by air flow velocity and dust particles, and the accuracy stability is insufficient.
[0005] In summary, the contact sensor is limited by the physical contact mechanism and has inherent problems such as pollution sensitivity and short lifespan; the traditional infrared non-contact solution lacks real-time compensation ability due to the single-path design and has poor anti-interference ability, making it difficult to meet the high-precision requirements. Therefore, there is an urgent need for a humidity detection solution that combines the advantages of non-contact measurement, high environmental adaptability, and excellent long-term stability. Summary of the Invention
[0006] In order to solve the problems in the background art, the present invention provides a method, device, computer device and storage medium for humidity detection, and specifically provides the following technical solutions: Emit two infrared lights with set wavelengths, one is directed to the object to be measured to form a measurement optical path; the other does not pass through the object to be measured to form a reference optical path.
[0007] Obtain the light intensity signal of the absorption peak band of the infrared light in the measurement optical path I 强 , the light intensity signal of the absorption reference baseline band of the infrared light in the measurement optical path I 弱 and the light intensity signal of the infrared light in the reference optical path I ref ; Through the light intensity signal of the absorption peak band of the infrared light in the measurement optical path I 强 , the light intensity signal of the absorption reference baseline band of the infrared light in the measurement optical path I 弱 and the light intensity signal of the infrared light in the reference optical path I ref , calculate the humidity value H rew .
[0008] Based on the temperature, air pressure and optical path data of the infrared light in the measurement optical path and the reference optical path collected in real time, use the Kalman filter algorithm to compensate and correct the humidity value H rew to obtain the humidity value of the measured object H corrected .
[0009] Preferably, the light intensity signal of the absorption peak band of the infrared light in the measurement optical path I 强 , the light intensity signal of the absorption reference baseline band of the infrared light in the measurement optical path I 弱 and the light intensity signal of the infrared light in the reference optical path I ref , calculate the humidity value H rew , H rew The expression is as follows: ; Among them, is the absorption coefficient of water molecules in the absorption peak band, is the absorption coefficient of water molecules in the absorption reference baseline band, and is calculated by the differential absorption ratio algorithm based on the difference in the light intensity signals between the absorption peak band and the absorption reference baseline band H rew .
[0010] Preferably, the wavelength corresponding to the absorption peak band is 1.94μm, and the wavelength corresponding to the absorption reference baseline band is 2.3μm
[0011] Preferably, the calculation expression of the humidity value H corrected of the measured object is as follows: ; Wherein, e is the natural constant, T is the real-time temperature value, T 0 is the reference temperature value, P is the current barometric pressure value, P 0 is the reference pressure value, d is the optical path data of the measurement optical path and the reference optical path, d 0 is the initial concentration parameter related to humidity measurement and is dynamically updated through Kalman filtering K 、 β .
[0012] Preferably, when emitting infrared light of two set wavelengths, the infrared light first passes through an integrated ultrasonic piezoelectric oscillator capable of periodically exciting surface vibration waves.
[0013] Preferably, when obtaining the light intensity signal of the absorption peak band of the infrared light in the measurement optical path I 强 、the light intensity signal of the absorption reference baseline band of the infrared light in the measurement optical path I 弱 and the light intensity signal of the infrared light in the reference optical path I ref , the wasted infrared light energy is collected and converted into electrical energy for storage.
[0014] The present invention also provides a humidity detection device, including: An infrared light emission module for emitting infrared light of two set wavelengths, one path is directed to the object to be measured to form a measurement optical path; the other path does not pass through the object to be measured to form a reference optical path.
[0015] A humidity preliminary calculation module for obtaining the light intensity signal of the absorption peak band of the infrared light in the measurement optical path I 强 、the light intensity signal of the absorption reference baseline band of the infrared light in the measurement optical path I 弱 and the light intensity signal of the infrared light in the reference optical path I ref ; through the light intensity signal of the absorption peak band of the infrared light in the measurement optical path I 强 、the light intensity signal of the absorption reference baseline band of the infrared light in the measurement optical path I 弱 and the light intensity signal of the infrared light in the reference optical path I ref , the humidity value H rew is calculated.
[0016] A humidity high-precision calculation module, which is used to apply the Kalman filtering algorithm to compensate and correct the humidity value based on the temperature, air pressure, and optical path data of the infrared light in the measurement optical path and the infrared light in the reference optical path collected in real time, so as to obtain the humidity value of the object to be measured H rew and obtain the humidity value of the object to be measured H corrected 。
[0017] The present invention also provides a computer device, including a memory, a processor, and a computer program stored on the memory. The processor executes the computer program to implement the steps of any one of the methods for humidity detection
[0018] The present invention also provides a computer-readable storage medium. When the computer program stored on the storage medium is loaded by a processor, it can execute the steps of any one of the methods for humidity detection
[0019] A method for humidity detection provided by the present invention has the following beneficial effects The present invention discloses a method for humidity detection. Based on the absorbance difference between the strong absorption peak band and the weak absorption reference baseline band of water molecules, the humidity value is obtained H rew , this method has strong anti-interference ability and improves the humidity detection accuracy; based on the temperature, air pressure, and optical path data collected in real time, the Kalman filtering algorithm is used to H rew compensate and correct, with real-time compensation ability, and finally calculate the humidity value of the object to be measured H corrected with relatively high accuracy. This method uses non-contact detection, will not damage the object to be measured, has a fast detection speed, can accurately reflect the humidity change of the object to be measured, the measurement error ≤ ±1.5%RH, the response time < 0.5 seconds, and this method has a simple structure, is easy to operate, is easy to promote, and can be applied to scenarios such as industrial production, agricultural greenhouses, and storage environments, solving the problems of easy contamination and short service life of traditional contact sensors BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present invention and its design solutions, the accompanying drawings required for the present embodiments will be briefly introduced below. The accompanying drawings in the following description are only partial embodiments of the present invention. For those of ordinary skill in the art, other accompanying drawings can be obtained based on these drawings without creative efforts
[0021] Figure 1 is a flowchart of a method for humidity detection provided by an embodiment of the present invention DETAILED DESCRIPTION OF THE EMBODIMENTS
[0022] To enable those skilled in the art to better understand the technical solution of the present invention and be able to implement it, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention and cannot be used to limit the protection scope of the present invention.
[0023] The present invention provides a method for humidity detection, specifically as Figure 1 shown, including: S1. Emit two infrared lights with set wavelengths, one is emitted towards the object to be measured to form a measurement optical path; the other does not pass through the object to be measured to form a reference optical path.
[0024] The infrared light emission module includes an infrared light emitter and a drive circuit, which are used to emit infrared light with a specific wavelength and the output power is adjustable. Turn on the infrared light detection device to make it in a working state, adjust the temperature sensor and the pressure sensor to correct the influence of environmental parameters on the optical path in real time, align the infrared light emission module with the object to be measured, emit infrared light, and adjust the three-dimensional translation stage and the angle adjuster to optimize the optical path alignment.
[0025] S2. Obtain the light intensity signal in the absorption peak band of the infrared light in the measurement optical path I 强 , the light intensity signal in the absorption reference baseline band of the infrared light in the measurement optical path I 弱 and the light intensity signal of the infrared light in the reference optical path I ref ; through the light intensity signal in the absorption peak band of the infrared light in the measurement optical path I 强 , the light intensity signal in the absorption reference baseline band of the infrared light in the measurement optical path I 弱 and the light intensity signal of the infrared light in the reference optical path I ref , calculate to obtain the humidity value H rew .
[0026] The infrared light receiving module includes an infrared light receiver and a signal processing circuit, which are used to receive the infrared light reflected or transmitted from the object to be measured and convert it into an electrical signal for processing. The infrared light receiving module receives the infrared light reflected or transmitted from the object to be measured and converts it into an electrical signal and transmits it to the data analysis module.
[0027] The infrared light emitted by the infrared light emission module is reflected or transmitted by the object to be measured and then received by the infrared light reception module. In this process, the main function of the infrared light reception module is to convert the optical signal into an electrical signal. Because subsequent analysis and processing devices, such as microprocessors, are more suitable for processing electrical signals. The original light intensity signal cannot be directly read and analyzed by these devices. Only after being converted into an electrical signal can subsequent quantization and operations be carried out.
[0028] The traditional Beer-Lambert law is the basis for constructing the humidity calculation model. Its core content is that the absorbance is proportional to the concentration of the light-absorbing substance and the optical path. In the humidity detection technology of the present invention, humidity (water molecule concentration) is closely related to light intensity and optical path. A reference optical path I ref is introduced and compared with the measurement optical path I meas in real time, significantly suppressing noise and improving stability. Based on the Beer-Lambert law, a humidity calculation model is constructed to calculate the preliminary humidity value H . The expression of the humidity calculation model is: ; where I ref and I meas are the light intensity signals of the reference optical path and the measurement optical path respectively, is the water molecule absorption coefficient, is the optical path difference, and are calibration parameters.
[0029] The multi-band collaborative detection proposed by the present invention uses the dual-wavelength lock-in amplification technology to synchronously detect the absorbance difference of water molecules at 1.94 μm (absorption peak band, i.e., strong absorption peak) and 2.3 μm (absorption reference baseline band, i.e., weak absorption reference baseline), and combines the differential absorption ratio algorithm to eliminate non-target interferences such as aerosols and dust. The formula of the differential absorption ratio algorithm is as follows: ; where is the absorption coefficient of water molecules in the absorption peak band, is the absorption coefficient of water molecules in the absorption reference baseline band, and is calculated by the differential absorption ratio algorithm based on the light intensity signal difference between the absorption peak band and the absorption reference baseline band H rew .
[0030] S3. Based on the temperature, pressure, and optical path data of the infrared light in the measurement optical path and the reference optical path collected in real time, the Kalman filter algorithm is used to compensate and correct the humidity value H rew to obtain the humidity value of the object to be measuredH corrected 。
[0031] When the ambient temperature and air pressure change, the optical path changes. According to the Beer-Lambert law, the light absorption also changes, thus affecting the humidity measurement result. Therefore, the temperature-pressure-optical path-humidity four-dimensional compensation function refers to the Beer-Lambert law, considers the influence of the optical path change on humidity measurement, and makes the humidity value calculated based on this law more accurate by compensating the optical path and related environmental factors, ensuring accurate humidity measurement under different environmental conditions.
[0032] Integrate a temperature sensor and a pressure sensor to correct the influence of environmental parameters on the optical path in real time. Correct the influence of temperature, pressure, and optical path in real time through Kalman filtering, establish a temperature-pressure-optical path-humidity four-dimensional compensation model, and obtain the final humidity value. H corrected ,The model expression is as follows: ; Among them, e is the natural constant, T is the real-time temperature value, T 0 is the reference temperature value, P is the current air pressure value, P 0 is the reference pressure value, d is the optical path data of the measurement optical path and the reference optical path, d 0 is the initial concentration parameter related to humidity measurement, which is dynamically updated through Kalman filtering. K 、 β 。
[0033] Based on the same inventive concept, the present invention also provides a humidity detection device, including: An infrared light emission module for emitting two infrared lights with set wavelengths. One is emitted to the object to be measured to form a measurement optical path; the other does not pass through the object to be measured to form a reference optical path.
[0034] A humidity preliminary calculation module for obtaining the light intensity signal of the absorption peak band of the infrared light in the measurement optical path I 强 、the light intensity signal of the absorption reference baseline band of the infrared light in the measurement optical path I 弱 and the light intensity signal of the infrared light in the reference optical path I ref ;Through the light intensity signal of the absorption peak band of the infrared light in the measurement optical path I 强 、the light intensity signal of the absorption reference baseline band of the infrared light in the measurement optical path I 弱 and the light intensity signal of the infrared light in the reference optical path Iref , the humidity value is calculated H rew .
[0035] The high-precision humidity calculation module is used to apply the Kalman filtering algorithm to the humidity value based on the temperature, air pressure, and the optical path data of the infrared light in the measurement optical path and the reference optical path collected in real time H rew for compensation and correction to obtain the humidity value of the measured object H corrected .
[0036] In the present invention, an ultrasonic piezoelectric vibrator (frequency 40 kHz) is integrated on the surfaces of the infrared light emission and reception modules to periodically excite surface vibration waves, prevent dust / water mist adhesion, and ensure long-term stability. The integrated ultrasonic piezoelectric vibrator is composed of oscillator units made of piezoelectric materials (such as quartz crystals, piezoelectric ceramics), which can be excited by electrical signals to generate high-frequency mechanical vibrations and are integrated on the surfaces of the infrared light emission module and the reception module, directly coupled to the infrared optical path; when the oscillator is applied with a periodic electrical signal, the piezoelectric material generates surface vibration waves (ultrasonic waves) due to the inverse piezoelectric effect, and the vibration waves cause particles such as dust, water mist, and pollutants attached to the optical path surface to detach due to resonance, avoiding blocking infrared light or contaminating optical components.
[0037] And the waste infrared light energy is converted into electrical energy to power the sensor, realizing energy self-circulation. A mechanical adjustment mechanism including a three-dimensional translation stage and an angle adjuster is provided for optimizing the optical path alignment. And a duty cycle adjustable pulse drive circuit is adopted to reduce the light source working cycle to 5% in the standby mode, reducing the overall power consumption of the machine from 3 W to 0.5 W, supporting long-term field monitoring powered by solar energy, and displaying the humidity information of the measured object.
[0038] The present invention also provides a computer device. At the hardware level, the computer device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory. Of course, it may also include other hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the method for humidity detection provided above.
[0039] The present invention also provides a computer-readable storage medium, which stores a computer program that can be used to execute the method for humidity detection provided above.
[0040] For the specific limitations on the method for humidity detection, reference can be made to the limitations on the method for humidity detection in the above text, which will not be elaborated here. Each module in the above method for humidity detection can be implemented in whole or in part by software, hardware, or a combination thereof. The above modules can be embedded in the processor of a computer device in hardware form or be independent of it, or be stored in the memory of the computer device in software form, so as to facilitate the processor to call and execute the operations corresponding to each of the above modules.
[0041] Embodiment 1 Preparation work: Select appropriate infrared light emitters and receivers to ensure their stable performance and high precision.
[0042] Build a data analysis module and a display module, which can be implemented using a microprocessor and a display screen. Detection process: Install the infrared light emission module and the reception module on a fixed bracket and align them with the object to be measured. Turn on the infrared light emitter and emit infrared light with a specific wavelength towards the object to be measured. The infrared light reception module receives the infrared light reflected or transmitted from the object to be measured and converts it into an electrical signal for transmission to the data analysis module.
[0043] The data analysis module analyzes and processes the electrical signal, calculates the humidity value of the object to be measured, and transmits the result to the display module for display.
[0044] Embodiment 2 Preparation work: Design a portable infrared light detection device for convenient detection at different locations.
[0045] Select a high-performance battery as the power source to ensure the battery life of the device. Detection process: Hold the infrared light detection device and align it with the object to be measured. Turn on the device, and the infrared light emission module emits infrared light towards the object to be measured. The infrared light reception module receives the infrared light reflected or transmitted from the object to be measured and converts it into an electrical signal for transmission to the data analysis module. The data analysis module analyzes and processes the electrical signal, calculates the humidity value of the object to be measured, and displays the result on the display screen of the device.
[0046] It should be noted that the above specific embodiments can enable those skilled in the art to understand the present invention more comprehensively, but do not limit the present invention in any way. Therefore, although this specification and the embodiments have described the present invention in detail, those skilled in the art should understand that the present invention can still be modified or equivalently replaced; and all technical solutions and improvements that do not depart from the spirit and scope of the present invention are covered by the protection scope of the patent of the present invention. Any reference signs in the claims should not be regarded as limiting the claimed claims.
Claims
1. A method for humidity detection, characterized in that, The method includes: Emitting two infrared lights with set wavelengths, one is directed towards the object to be measured to form a measurement optical path; the other does not pass through the object to be measured to form a reference optical path. Obtain the light intensity signal of the absorption peak band of the infrared light in the measurement optical path I 强 , the light intensity signal of the absorption reference baseline band of the infrared light in the measurement optical path I 弱 and the light intensity signal of the infrared light in the reference optical path I ref ; Through the light intensity signal of the absorption peak band of the infrared light in the measurement optical path I 强 , the light intensity signal of the absorption reference baseline band of the infrared light in the measurement optical path I 弱 and the light intensity signal of the infrared light in the reference optical path I ref , calculate the humidity value H rew ; Based on the temperature, air pressure, and optical path data of the infrared light in the measurement optical path and the reference optical path collected in real time, the Kalman filtering algorithm is used to compensate and correct the humidity value H rew to obtain the humidity value of the measured object H corrected .
2. The method for humidity detection according to claim 1, characterized in that The light intensity signal of the absorption peak band of the infrared light passing through the measurement optical path I 强 , the light intensity signal of the absorption reference baseline band of the infrared light in the measurement optical path I 弱 and the light intensity signal of the infrared light in the reference optical path I ref , and the humidity value is calculated H rew , H rew The expression of which is as follows: ; Among them, is the absorption coefficient of water molecules in the absorption peak band, is the absorption coefficient of water molecules in the absorption reference baseline band, and is calculated by the differential absorption ratio algorithm based on the light intensity signal difference between the absorption peak band and the absorption reference baseline band H rew .
3. A method for humidity detection according to claim 1, characterized in that, The wavelength corresponding to the absorption peak band is 1.94 μm, and the wavelength corresponding to the absorption reference baseline band is 2.3 μm.
4. A method for humidity detection according to claim 1, characterized in that, The humidity value of the object under test H corrected The calculation expression is as follows: ; Among them, e is the natural constant, T is the real-time temperature value, T 0 is the reference temperature value, P is the current barometric pressure value, P 0 is the reference pressure value, d is the optical path data of the measurement optical path and the reference optical path, d 0 is the initial concentration parameter for humidity measurement and is dynamically updated through Kalman filtering K 、 β 。 5. A method for humidity detection according to claim 1, characterized in that, When emitting the two infrared lights with set wavelengths, the infrared light first passes through an integrated ultrasonic piezoelectric oscillator that can periodically excite surface vibration waves.
6. A method for humidity detection according to claim 1, characterized in that, Obtaining the light intensity signal of the absorption peak band of the infrared light in the measurement optical path I 强 and the light intensity signal of the absorption reference baseline band of the infrared light in the measurement optical path I 弱 as well as the light intensity signal of the infrared light in the reference optical path I ref When doing so, collect the wasted infrared light energy and convert it into electrical energy for storage.
7. A humidity detection device, characterized in that, It includes: An infrared light emission module for emitting two infrared lights with set wavelengths, one is directed towards the object to be measured to form a measurement optical path; the other does not pass through the object to be measured to form a reference optical path. A humidity preliminary calculation module, configured to obtain the light intensity signals of the absorption peak band of the infrared light in the measurement optical path I 强 , the light intensity signals of the absorption reference baseline band of the infrared light in the measurement optical path I 弱 and the light intensity signals of the infrared light in the reference optical path I ref ; Based on the light intensity signals of the absorption peak band of the infrared light in the measurement optical path I 强 , the light intensity signals of the absorption reference baseline band of the infrared light in the measurement optical path I 弱 and the light intensity signals of the infrared light in the reference optical path I ref , a humidity value is calculated H rew ; The high-precision humidity calculation module is used to apply the Kalman filtering algorithm to compensate and correct the humidity value based on the temperature, air pressure, and the optical path data of the infrared light in the measurement optical path and the reference optical path collected in real time H rew to obtain the humidity value of the measured object H corrected .
8. A computer device, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method steps described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method steps described in any one of claims 1 to 6.
Citation Information
Patent Citations
Device for detecting fluctuation in moisture content, method for detecting fluctuation in moisture content, vacuum gauge, and method for detecting fluctuation in vacuum degree
CN103620383A
Photoacoustic spectrometry gas sensor and preparation method thereof
CN117871422A
CO laser detection system based on thermal radiation background
CN119246454A
Projector automatic focusing method based on spectrum sensor and related equipment
CN119484789A
Method and system for detecting concentration of glucose solution based on near infrared spectrum
CN119619057A