Photocurrent measuring circuit, method and device for rainfall sensor

Through the measurement circuit composed of photoelectric components, capacitors, constant current sources and comparators, combined with the calculation method of the microcontroller, the infrared LED alternately illuminates and eliminates stray light, solving the problem of photocurrent measurement accuracy and cost in the existing technology. An efficient rainfall assessment was achieved.

CN119165233APending Publication Date: 2024-12-20HUBEI KAIT AUTOMOTIVE ELECTRONICS & ELECTRICAL SYST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411253198.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

Existing photocurrent measurement technologies are difficult to effectively eliminate stray light, resulting in insufficient accuracy and cost in rainfall sensors during measurement.

Method used

The measurement circuit consisting of photoelectric components, capacitors, constant current sources and comparators is used to alternately light up and turn off infrared LEDs, and the photocurrent signal is calculated using the microcontroller to eliminate the influence of stray light, and evaluate the rainfall.

Benefits of technology

The photocurrent signal that eliminates the influence of stray light is realized, which improves the accuracy and cost-effectiveness of rainfall measurement, and can effectively evaluate the magnitude of rainfall.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119165233A_ABST
    Figure CN119165233A_ABST
Patent Text Reader

Abstract

The invention provides a light current measuring circuit for a rainfall sensor. The light current measuring circuit comprises a photoelectric element, a capacitor, a constant current source, a comparator and a microcontroller, the photoelectric element is connected with a power supply and is electrically connected with the capacitor and the non-inverting input end of the comparator, the capacitor is grounded, the constant current source is electrically connected with the non-inverting input end of the comparator, the inverting input end of the comparator is connected with a reference voltage Vref, the output end of the comparator is electrically connected with the microcontroller, and the microcontroller is electrically connected with the comparator. And the release bus is electrically connected with the non-inverting input end of the comparator, so that a light current signal for eliminating the influence of stray light can be obtained, and the rainfall can be evaluated by judging the intensity change of the light current signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of photocurrent measurement, and in particular to a photocurrent measurement circuit, method and device for a rainfall sensor. Background Art

[0002] When realizing high-precision and large-range signal measurement: usually it is necessary to use a high-resolution ADC conversion chip, such as 20bit, 24bit, etc. First, use a voltage divider circuit or other circuit design to adjust the maximum voltage of the measured signal to within the measurement range of the ADC (usually 3.3V or 5V), and then the measured voltage signal can be collected. The measurement of photocurrent is also converted into a voltage signal by a resistor before measurement. This solution is relatively expensive.

[0003] If a logarithmic amplifier is used and then an exponential transformation is performed, logarithmic amplifiers are relatively rare and expensive, and stray light cannot be eliminated. If a variable gain amplifier is used, a high gain is used when the signal amplitude is small; conversely, a small gain is used, which is equivalent to using a piecewise linear gain to achieve an effect similar to a logarithmic amplifier, which is not cheap and cannot eliminate stray light.

[0004] Different voltage divider resistors can be used for photocurrent measurement. When the photocurrent value is small, use a high-resistance voltage divider resistor to obtain a large voltage; otherwise, use a small-resistance resistor. The solution is cheaper, but requires more control pins and an analog channel selector; its idea is to achieve a similar effect to a logarithmic amplifier in segments, and it cannot eliminate stray light.

[0005] In view of this, it is necessary to provide a novel photocurrent measurement circuit, method and device for a rain sensor to overcome the above-mentioned defects. Summary of the invention

[0006] The purpose of the present invention is to provide a circuit, method and device for measuring the photocurrent of a rainfall sensor, which can obtain a photocurrent signal that eliminates the influence of stray light. By judging the strength change of this photoelectric signal, the amount of rainfall can be evaluated.

[0007] In order to achieve the above object, the present invention provides a photocurrent measurement circuit for a rain sensor, comprising: a photoelectric element, a capacitor, a constant current source, a comparator and a microcontroller;

[0008] The photoelectric element is connected to a power supply and is electrically connected to the capacitor and the same-direction input terminal of the comparator. The capacitor is grounded. The constant current source is electrically connected to the same-direction input terminal of the comparator. The reverse input terminal of the comparator is connected to a reference voltage Vref. The output terminal of the comparator is electrically connected to a microcontroller. The microcontroller is also electrically connected to the same-direction input terminal of the comparator through a release bus.

[0009] Preferably, the cathode of the photoelectric element is connected to a power supply, the anode of the photoelectric element is electrically connected to the first end of the capacitor and the same-direction input end of the comparator, and the second end of the capacitor is grounded.

[0010] Preferably, the photoelectric element is a photodiode, and the capacitor is an integrating capacitor.

[0011] A method for measuring a photocurrent measurement circuit for a rain sensor comprises the following steps:

[0012] Light up the infrared LED and irradiate it onto the photoelectric element through the total reflection light path;

[0013] Calculate the photocurrent. Assume that the photocurrent generated by the photoelectric element is Ipd, the capacitance of the capacitor is C, and the timing of the microcontroller is T. Then, C*Vref=∫Ipd*dt=Ipd*T,

[0014] Assume the current of the constant current source is: Ipull, then there is the formula

[0015] C*Vref=∫(Ipd+Ipull)*dt=(Ipd+Ipull)*T,

[0016] At this time, the photocurrent Ipd is composed of the sunlight photocurrent Isun and the LED photocurrent Iled.

[0017] Assuming the charging time is T1, the above formula (1) can be obtained:

[0018] C*Vref=∫(I sun +I led +I pull )*dt=(I sun +I led +I pull )*T1,

[0019]

[0020] When the infrared LED is turned off, I led = 0, assuming the charging time is T2, the formula is: C*Vref = ∫(I sun +I pull )*dt=(I sun +I pull )*T2,

[0021]

[0022] Subtracting formula (2) from (3) yields:

[0023]

[0024] It can be seen from the above formula (4) that by alternately lighting up and shutting down the infrared LED, a photocurrent signal with the influence of stray light eliminated can be obtained. By judging the intensity change of this photoelectric signal, the amount of rainfall can be evaluated.

[0025] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the method for measuring the photocurrent of a rain sensor are implemented.

[0026] A non-transitory computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the photocurrent measurement method for a rain sensor.

[0027] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the steps of the method for measuring the photocurrent of a rain sensor are implemented.

[0028] Compared with the prior art, the beneficial effect is that a photocurrent signal that eliminates the influence of stray light can be obtained, and the amount of rainfall can be evaluated by judging the intensity change of this photoelectric signal. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0030] Figure 1 A circuit diagram of a photocurrent measurement circuit for a rain sensor provided by the present invention.

[0031] Figure 2 Schematic diagram of the comparison between the comparator output and the charging and discharging of the capacitor. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and beneficial technical effect of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be understood that the specific implementation methods described in this specification are only for explaining the present invention, not for limiting the present invention.

[0033] It should also be noted that, unless otherwise clearly specified and limited, the terms such as "install", "connect", "connect", "fix", "set" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral one; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be determined according to the specific circumstances.

[0034] See also Figure 1 to Figure 2 , the present invention provides a photocurrent measurement circuit for a rain sensor, comprising: a photoelectric element 1, a capacitor 2, a constant current source 3, a comparator 4 and a microcontroller 5;

[0035] The photoelectric element 1 is connected to the power supply VCC and is electrically connected to the capacitor 2 and the same-direction input terminal of the comparator 4, the capacitor 2 is grounded, the constant current source 3 is electrically connected to the same-direction input terminal of the comparator 4, the reverse input terminal of the comparator 4 is connected to the reference voltage Vref, the output terminal of the comparator 4 is electrically connected to the microcontroller 5, and the microcontroller 5 is also electrically connected to the same-direction input terminal of the comparator 4 through the release bus 6. It should be noted that in this embodiment, the photoelectric element 1 is a photodiode, and the capacitor 2 is an integrating capacitor.

[0036] Specifically, the cathode of the photoelectric element 1 is connected to a power supply, the anode of the photoelectric element 1 is electrically connected to the first end of the capacitor 2 and the same-direction input end of the comparator 4, the second end of the capacitor 2 is grounded, the constant current source 3 is electrically connected to the same-direction input end of the comparator 4, the reverse input end of the comparator 4 is connected to the reference voltage Vref, the output end of the comparator 4 is electrically connected to the microcontroller 5, and the microcontroller 5 is also electrically connected to the same-direction input end of the comparator 4 through the release bus 6.

[0037] In this way, by releasing the bus 6 and pulling the level down, the charge of the capacitor 2 is completely discharged, and at the same time the comparator 4 outputs a low level (such as Figure 2 T0 in the figure);

[0038] The microcontroller 5 can set the release bus 6 to a high impedance state, the microcontroller 5 starts timing, the photoelectric element 1 starts charging the capacitor 2, and the voltage of the capacitor 2 starts to rise (e.g. Figure 2 time period T0-T1 in the figure).

[0039] When the voltage of capacitor 2 reaches the reference voltage (such as Figure 2 At time T1, the output of the comparator 4 changes to a high level, and the microcontroller 5 captures the change and stops timing.

[0040] The microprocessor calculates the photocurrent. Assuming the photocurrent generated by the photoelectric element 1 is Ipd, the capacitance of the capacitor 2 is C, and the timing of the microcontroller 5 is T, then C*Vref=∫Ipd*dt=Ipd*T,

[0041] The addition of constant current source 3 can ensure that the normal charging time is maintained in the absence of light. Assuming the current of constant current source 3 is: Ipull, then there is a formula C*Vref=∫(Ipd+Ipull)*dt=(Ipd+Ipull)*T,

[0042] The present invention also provides a method for measuring the photocurrent of a rainfall sensor, comprising the following steps:

[0043] Light up an infrared LED and irradiate it onto the photoelectric element 1 through the total reflection light path; at this time, the photocurrent Ipd is composed of the sunlight photocurrent Isun and the LED photocurrent Iled.

[0044] Assuming the charging time is T1, the above formula (1) can be obtained:

[0045] C*Vref=∫(I sun +I led +I pull )*dt=(I sun +I led +I pull )*T1,

[0046]

[0047] When the infrared LED is turned off, I led = 0, assuming the charging time is T2, the formula is: C*Vref = ∫(I sun +I pull )*dt=(I sun +I pull )*T2,

[0048]

[0049] Subtracting formula (2) from (3) yields:

[0050]

[0051] It can be seen from the above formula (4) that by alternately lighting up and shutting down the infrared LED, a photocurrent signal with the influence of stray light eliminated can be obtained. By judging the intensity change of this photoelectric signal, the amount of rainfall can be evaluated.

[0052] The present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the photocurrent measurement method for a rain sensor when executing the program.

[0053] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method for measuring the photocurrent of a rainfall sensor are implemented.

[0054] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the method for measuring the photocurrent of a rainfall sensor are implemented.

[0055] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0056] In particular, according to some embodiments of the present disclosure, the process described above can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.

[0057] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a mission data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated mission data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0058] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperTextTransferProtocol), and may be interconnected with any form or medium of digital task data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an adhoc peer-to-peer network), as well as any currently known or future developed network.

[0059] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: in response to detecting a query operation on a production collaboration document in a switch production line management application, determines the network connection status of the switch production line management application; in response to determining that the network connection status of the switch production line management application represents an offline state, replaces the web page entry information corresponding to the production collaboration document with target entry file information, and loads target web page resource information to display the web page of the production collaboration document offline in the switch production line management application, wherein the target entry file information is file information of a pre-downloaded entry file corresponding to the web page of the production collaboration document, and the target web page resource information is locally stored resource information corresponding to the web page; in response to determining that the network connection status of the switch production line management application represents an online state, and the web page resource information corresponding to the production collaboration document is not stored locally, downloads the web page resource information of the web page from the production line document server, wherein the web page resource information includes an entry file and resource information; according to the web page resource information, displays the web page of the production collaboration document in the switch production line management application, and stores the web page resource information in a local database.

[0060] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including product-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0061] The present invention is not limited to what is described in the specification and implementation modes, and therefore additional advantages and modifications can be easily realized by those skilled in the art. Therefore, without departing from the spirit and scope of the general concept defined by the claims and the equivalent scope, the present invention is not limited to the specific details, representative devices, and examples shown and described herein.

Claims

1. A photocurrent measurement circuit for a rain sensor, characterized in that: include: Photoelectric element (1), capacitor (2), constant current source (3), comparator (4) and microcontroller (5); The photoelectric element (1) is connected to a power supply and is electrically connected to the capacitor (2) and the same-direction input terminal of the comparator (4); the capacitor (2) is grounded; the constant current source (3) is electrically connected to the same-direction input terminal of the comparator (4); the reverse input terminal of the comparator (4) is connected to a reference voltage Vref; the output terminal of the comparator (4) is electrically connected to a microcontroller (5); and the microcontroller (5) is also electrically connected to the same-direction input terminal of the comparator (4) via a release bus (6).

2. The photocurrent measurement circuit for a rain sensor according to claim 1, characterized in that: The cathode of the photoelectric element (1) is connected to a power supply, the anode of the photoelectric element (1) is electrically connected to the first end of the capacitor (2) and the same-direction input end of the comparator (4), and the second end of the capacitor (2) is grounded.

3. The photocurrent measurement circuit for a rain sensor according to claim 1, characterized in that: The photoelectric element (1) is a photodiode, and the capacitor (2) is an integrating capacitor.

4. The method for measuring the photocurrent measurement circuit for a rain sensor according to any one of claims 1 to 3, characterized in that: The steps include: Light up the infrared LED and irradiate it onto the photoelectric element through the total reflection light path; Calculate the photocurrent. Assume that the photocurrent generated by the photoelectric element is Ipd, the capacitance of the capacitor is C, and the timing of the microcontroller is T. Then, C*Vref=∫Ipd*dt=Ipd*T, Assume the current of the constant current source is: Ipull, then there is the formula At this time, the photocurrent Ipd is composed of the sunlight photocurrent Isun and the LED photocurrent Iled. Assuming the charging time is T1, the above formula (1) can be obtained: C*Vref=∫(I sun +I led +I pull )*dt=(I sun +I led +I pull )*T1, When the infrared LED is turned off, I led = 0, assuming the charging time is T2, the formula is: C*Vref = ∫(I sun +I pull )*dt=(I sun +I pull )*T2, Subtracting formula (2) from (3) yields: It can be seen from the above formula (4) that by alternately lighting up and shutting down the infrared LED, a photocurrent signal with the influence of stray light eliminated can be obtained. By judging the intensity change of this photoelectric signal, the amount of rainfall can be evaluated.

5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method for measuring the photocurrent of a rain sensor according to claim 4 are implemented.

6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for measuring photocurrent of a rain sensor according to claim 4 are implemented.

7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method for measuring photocurrent of a rain sensor according to claim 4 are implemented.