A near field distance recognition method, device and system
By using dual-path processing of coded infrared signals and narrow-angle receivers, combined with environmental background calibration, the environmental interference and false triggering problems of infrared near-field recognition technology are solved, improving the reliability and accuracy of recognition.
Patent Information
- Application Number
- CN202510924209.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2045-07-04
AI Technical Summary
Existing infrared near-field recognition technology is susceptible to environmental interference and has a high false trigger rate. In particular, it suffers from serious misjudgments due to ceiling reflection when the indoor space is not tall enough. Furthermore, it has weak noise resistance, which affects user experience and product reliability.
Using coded infrared signals, dual-path processing is performed through a narrow-angle infrared receiver, including decoding and intensity filtering, combined with environmental background infrared intensity calibration, to achieve obstacle distance judgment.
It effectively shields lateral interference, avoids false triggering due to ceiling reflection, improves the environmental anti-interference capability and reliability of identification, and reduces the false triggering rate.
Smart Images

Figure CN120762042B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart toilets and smart trash cans, and in particular to a near-field distance recognition method, device and system. Background Technology
[0002] With the widespread adoption of smart devices, near-field recognition technology has become a key feature in products such as smart toilets and smart trash cans. These devices need to automatically trigger the lid opening operation when a user's limb or an object approaches the device (typically at a distance of 10-30 centimeters), and their core relies on a low-cost infrared near-field detection solution.
[0003] The current mainstream solution employs a continuous infrared emission and intensity detection mechanism: the infrared transmitter continuously emits non-coded infrared signals, and the receiver determines the distance to obstacles by measuring the intensity of the reflected signal. However, this solution has significant drawbacks, as follows.
[0004] 1. Susceptible to environmental interference: Clutter from other infrared sources in the environment (such as lights and sunlight) can cause abnormal received signal strength, leading to misjudgment.
[0005] 2. Ceiling reflection false triggering: In indoor spaces with insufficient height, infrared signals are reflected off the ceiling and captured by the receiver, which incorrectly identifies them as valid obstacles, causing the device to open randomly without contact.
[0006] 3. Weak noise resistance: Traditional solutions lack a dynamic environmental calibration mechanism and cannot distinguish between real obstacle reflections and environmental background noise.
[0007] The aforementioned issues severely impact user experience and product reliability, hindering the application and expansion of low-cost near-field recognition technology. Therefore, there is an urgent need for a new near-field recognition technology that can resist environmental interference, avoid false triggering, and maintain its low-cost advantage. Summary of the Invention
[0008] The present invention aims to at least solve one of the technical problems existing in the prior art. Therefore, one object of the present invention is to provide a novel near-field distance recognition method, apparatus, and system that is resistant to environmental interference, avoids false triggering, and maintains the advantage of low cost.
[0009] The present invention also provides a near-field distance recognition method, comprising the following:
[0010] The infrared transmitter emits an coded infrared signal, the code of which is generated by a high-low level switching sequence controlled by a microcontroller.
[0011] The reflected signal is received by a narrow-angle infrared receiver with a receiving angle of 10° to 15°, and the received light signal is converted into an electrical signal.
[0012] The level signal output by the narrow-angle infrared receiver is processed in parallel via dual paths.
[0013] First processing path: Decode the level signal and compare whether the received code obtained by decoding is consistent with the transmitted code.
[0014] The second processing path is to process the level signal through an intensity filtering circuit and output the processed signal to the analog-to-digital converter (ADC) pin of the microcontroller to obtain the ADC value that characterizes the signal strength.
[0015] Before each transmission of the coded infrared signal, the ambient background infrared intensity is acquired by the narrow-angle infrared receiver and converted into a background ADC value.
[0016] When the first processing path confirms that the received code and the transmitted code are consistent, the return signal strength value is calculated. The return signal strength value is the ADC value obtained by the second processing path minus the background ADC value.
[0017] The distance to the obstacle is determined by comparing the reflected signal strength value with a preset threshold range.
[0018] Specifically, the intensity filtering circuit includes a DC blocking capacitor for filtering out DC noise, an integrating capacitor connected in parallel with the DC blocking capacitor for signal integration, and an attenuation resistor for signal amplitude attenuation. The attenuation resistor is connected in series between the output terminal of the integrating capacitor and the ADC pin of the microcontroller.
[0019] Specifically, the logic for determining the distance to the obstacle based on the strength value of the reflected signal is as follows.
[0020] If the return signal strength value is less than the lower limit of the preset threshold range, it is determined that the obstacle is too far away.
[0021] If the return signal strength value is greater than the upper limit of the preset threshold range, it is determined that the obstacle is too close.
[0022] If the return signal strength value is within the preset threshold range, an execution command is triggered.
[0023] Specifically, the step of acquiring the ambient background infrared intensity before each transmission of the coded infrared signal includes: turning off the infrared transmitter, acquiring the ambient background infrared intensity multiple times at a preset sampling interval, and calculating the average value as the background ADC value.
[0024] Specifically, the sampling interval is 10ms, and the total sampling duration is 200ms.
[0025] The present invention also discloses an identification device that applies the near-field distance identification method described in any of the above technical solutions, comprising the following.
[0026] Infrared transmitter; encoding generation circuit, connected to the infrared transmitter, used to generate the encoded infrared signal according to the high and low level switching sequence controlled by the microcontroller.
[0027] A narrow-angle infrared receiver, with a receiving angle of 10° to 15°, is used to receive reflected signals and convert light signals into level signals.
[0028] The signal processing unit includes: a decoding branch connected to the output of the narrow-angle infrared receiver, used to decode the level signal and input the decoding result into the microcontroller for encoding comparison.
[0029] The intensity branch is connected to the output terminal of the narrow-angle infrared receiver. The intensity branch includes a DC blocking capacitor, an integrating capacitor, and an attenuation resistor in sequence. It is used to filter and attenuate the level signal and then output it to the analog-to-digital converter (ADC) pin of the microcontroller.
[0030] The microcontroller controls the encoding generation circuit.
[0031] Before each signal is emitted by the infrared transmitter, the ambient background infrared intensity is acquired by the narrow-angle infrared receiver and converted into a background ADC value.
[0032] When the received code is confirmed to be consistent with the transmitted code through the decoding branch, the calculated return signal strength value is the ADC value output by the strength branch minus the background ADC value.
[0033] The distance to the obstacle is determined based on the strength value of the reflected signal and a preset threshold range.
[0034] Specifically, the encoding generation circuit is directly driven by the output pin of the microcontroller, and generates the encoded infrared signal by controlling the high and low level switching interval.
[0035] Furthermore, the decoding branch also includes a filtering and shaping circuit for processing the level signal into a digital signal suitable for decoding and comparison by the microcontroller.
[0036] Specifically, the narrow-angle infrared receiver has a receiving angle of 12°±2°.
[0037] During this period, the present invention also provides a near-field distance recognition system, which includes the near-field distance recognition device as described above.
[0038] For this near-field distance recognition system, the microcontroller is further configured to output a control command when the received code is confirmed to be consistent with the transmitted code through the decoding branch, and the foldback signal strength value is within a preset threshold range.
[0039] The present invention achieves significant improvement through the above technical means, and the specific beneficial effects are as follows.
[0040] 1. Strong resistance to environmental interference: It automatically scans the ambient infrared intensity before each startup and actively subtracts the background value during detection to avoid false triggering due to changes in ambient light.
[0041] 2. Completely eliminate ceiling misjudgment: Adopting exclusive infrared coding for transmission, only reflected signals carrying the correct code will be responded to, and the messy infrared waves reflected from the ceiling are directly filtered out.
[0042] 3. Side interference shielding: The receiver adopts a narrow viewing angle design, only receiving signals within a 10-15° range directly in front, physically isolating side interference.
[0043] IV. Dual verification mechanism: First, the received signal is verified to carry the correct transmission code through the decoding path to confirm the existence of a valid reflected signal. Then, the strength value of the reflected signal after background subtraction is calculated through the strength path and it is determined whether it is within the effective distance threshold range. The two-step verification significantly reduces the false trigger rate. Attached Figure Description
[0044] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings.
[0045] Figure 1 This is a schematic diagram illustrating the application scenario of the present invention.
[0046] Figure 2 This is a flowchart of the infrared decoding process of the present invention.
[0047] Figure 3 This is the infrared longitude flowchart of the present invention.
[0048] Figure 4 This is a flowchart of an intelligent algorithm. Detailed Implementation
[0049] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0050] The following is for reference. Figures 1 to 4A near-field distance recognition method according to an embodiment of the present invention is described as follows.
[0051] The infrared transmitter emits an coded infrared signal, the code of which is generated by a high-low level switching sequence controlled by a microcontroller.
[0052] The reflected signal is received by a narrow-angle infrared receiver with a receiving angle of 10° to 15°, and the received light signal is converted into an electrical signal.
[0053] The level signal output by the narrow-angle infrared receiver is processed in a dual-path parallel manner as follows.
[0054] First processing path: Decode the level signal and compare whether the received code obtained by decoding is consistent with the transmitted code.
[0055] The second processing path is to process the level signal through an intensity filtering circuit and output the processed signal to the analog-to-digital converter (ADC) pin of the microcontroller to obtain the ADC value that characterizes the signal strength.
[0056] Before each transmission of the coded infrared signal, the ambient background infrared intensity is acquired by the narrow-angle infrared receiver and converted into a background ADC value.
[0057] When the first processing path confirms that the received code and the transmitted code are consistent, the return signal strength value is calculated. The return signal strength value is the ADC value obtained by the second processing path minus the background ADC value.
[0058] The distance to the obstacle is determined by comparing the reflected signal strength value with a preset threshold range.
[0059] Specifically, the intensity filtering circuit includes a DC blocking capacitor for filtering out DC noise, an integrating capacitor connected in parallel with the DC blocking capacitor for signal integration, and an attenuation resistor for signal amplitude attenuation. The attenuation resistor is connected in series between the output terminal of the integrating capacitor and the ADC pin of the microcontroller.
[0060] Specifically, the logic for determining the distance to the obstacle based on the strength value of the reflected signal is as follows.
[0061] If the return signal strength value is less than the lower limit of the preset threshold range, it is determined that the obstacle is too far away.
[0062] If the return signal strength value is greater than the upper limit of the preset threshold range, it is determined that the obstacle is too close.
[0063] If the return signal strength value is within the preset threshold range, an execution command is triggered.
[0064] Specifically, the step of acquiring the ambient background infrared intensity before each transmission of the coded infrared signal includes: turning off the infrared transmitter, acquiring the ambient background infrared intensity multiple times at a preset sampling interval, and calculating the average value as the background ADC value.
[0065] Specifically, the sampling interval is 10ms, and the total sampling duration is 200ms.
[0066] The present invention also provides an identification device that applies the near-field distance identification method described above, comprising the following components.
[0067] Infrared transmitter; encoding generation circuit, connected to the infrared transmitter, used to generate the encoded infrared signal according to the high and low level switching sequence controlled by the microcontroller.
[0068] A narrow-angle infrared receiver, with a receiving angle of 10° to 15°, is used to receive reflected signals and convert light signals into level signals.
[0069] The signal processing unit includes: a decoding branch connected to the output of the narrow-angle infrared receiver, used to decode the level signal and input the decoding result into the microcontroller for encoding comparison.
[0070] The intensity branch is connected to the output terminal of the narrow-angle infrared receiver. The intensity branch includes a DC blocking capacitor, an integrating capacitor, and an attenuation resistor in sequence. It is used to filter and attenuate the level signal and then output it to the analog-to-digital converter (ADC) pin of the microcontroller.
[0071] The microcontroller controls the encoding generation circuit.
[0072] Before each signal is emitted by the infrared transmitter, the ambient background infrared intensity is acquired by the narrow-angle infrared receiver and converted into a background ADC value.
[0073] When the received code is confirmed to be consistent with the transmitted code through the decoding branch, the calculated return signal strength value is the ADC value output by the strength branch minus the background ADC value.
[0074] The distance to the obstacle is determined based on the strength value of the reflected signal and a preset threshold range.
[0075] Specifically, the encoding generation circuit is directly driven by the output pin of the microcontroller, and generates the encoded infrared signal by controlling the high and low level switching interval.
[0076] Furthermore, the decoding branch also includes a filtering and shaping circuit for processing the level signal into a digital signal suitable for decoding and comparison by the microcontroller.
[0077] Specifically, the narrow-angle infrared receiver has a receiving angle of 12°±2°.
[0078] The present invention also discloses a near-field distance recognition system, which includes the near-field distance recognition device described above.
[0079] During this period, the microcontroller is further configured to output a control command when it is confirmed through the decoding branch that the received code is consistent with the transmitted code and the return signal strength value is within a preset threshold range.
[0080] Based on the above technical solution, the following specific embodiments are provided.
[0081] Example 1: Specific implementation of the near-field distance recognition method.
[0082] Combination Figure 2 and Figure 3 The process, taking the automatic opening of a smart toilet seat as an example, involves the following specific steps.
[0083] Encoded signal transmission: The microcontroller (STM32F030F4P6) outputs a 38kHz carrier wave through its GPIO pin (e.g., PB5), superimposed with a specific high-low level encoded sequence (example: 10110011, each pulse width 1ms). This signal is amplified by a transistor (MMBT3904) driven by a current-limiting resistor (220Ω), which then illuminates an infrared emitting diode (IR333-A, divergence angle approximately 15°) to transmit the encoded infrared signal. The transmission period is set to 100ms / transmission.
[0084] Environmental background intensity acquisition (dynamic subtraction of the base): Environmental sampling is initiated 200ms before each transmission of the coded signal.
[0085] Turn off the infrared transmitter.
[0086] Ambient background infrared noise (such as fluorescent lights and sunlight) is collected using a narrow-angle infrared receiver (VSOP38360, receiving angle 12°±2°).
[0087] The microcontroller's ADC samples 20 times at 10ms intervals (total duration 200ms).
[0088] The average of 20 sampled values is calculated as the background ADC reference value (e.g., ADC=152). This step implements a dynamic background subtraction mechanism and strong environmental interference resistance.
[0089] The parallel processing of dual signals is as follows.
[0090] The first processing path (decoding branch - encoding verification): The receiver's output signal first passes through an RC low-pass filter (1kΩ + 0.01μF) to remove high-frequency interference, and then is shaped into a regular square wave by a Schmitt trigger (74HC14). The shaped digital signal is input to the microcontroller (PA0). The microcontroller controls the encoding generation circuit; specifically, the microcontroller's built-in decoder compares the received encoding sequence with the transmitted encoding to see if they are completely consistent. Only when they are consistent (e.g., the received encoding is also 10110011) is subsequent strength analysis triggered. This mechanism directly and completely solves the problems of false positives and double verification mechanisms.
[0091] The second processing path (intensity branch - signal filtering and acquisition): The receiver's original output level signal passes through the following in sequence: DC blocking capacitor (0.1μF): Filters out DC offset caused by ambient light (such as 50Hz light interference). Integrating capacitor (1μF in parallel with a 10kΩ resistor): Smooths the signal and filters out high-frequency noise. Attenuation resistor (5.1kΩ): Attenuates the signal amplitude to the microcontroller's ADC range (0-3.3V). The processed analog signal is input to the microcontroller's ADC pin (PA1) to obtain the real-time ADC value characterizing the reflected signal strength. Distance judgment (double verification): Distance judgment is performed only when the decoding branch confirms that the encoding is consistent: Calculate the reflected signal strength value = real-time ADC value - background ADC value (e.g., real-time ADC = 320, reflected strength = 320 - 152 = 168).
[0092] Based on the comparison between the return signal strength value and a preset threshold range: If < lower limit 120: the obstacle is too far away (e.g., > 30cm), no response is given. If > upper limit 220: the obstacle is too close (e.g., < 10cm), anti-collision logic is executed (e.g., do not open or open slowly). If between 120 and 220: the obstacle is within the effective recognition distance (e.g., 10-30cm), and an execution command is triggered (e.g., open the cover).
[0093] Example 2 is as follows.
[0094] Reference Figure 1 The application scenarios and core hardware configuration of the device are as follows.
[0095] Transmitter Module: The GPIO pin PB5 of the microcontroller (STM32F030F4P6) outputs the encoded sequence (example: 10110011). A 220Ω current-limiting resistor (±5%, carbon film) is connected in series with pin PB5 and then to the base of an NPN transistor (MMBT3904). The collector of the transistor is connected to the anode of an infrared emitting diode (IR333-A), and the emitter is grounded. The cathode of the infrared emitting diode is grounded, and the anode is connected to a +3.3V power supply through the transistor. This enables direct microcontroller-driven code generation.
[0096] I. Decoding branch (signal shaping and decoding) is as follows.
[0097] The raw signal output from the receiver first flows through a low-pass filter network consisting of a 1kΩ resistor (with parameters of ±5% accuracy and metal film material) and a 0.01μF ceramic capacitor (with parameters of X7R dielectric and 50V rated voltage) connected in parallel to ground. The function of this network is to filter out high-frequency noise interference in the signal.
[0098] The filtered signal is fed into the input pin (Pin 1) of the Schmitt trigger (model 74HC14). The Schmitt trigger shapes the input signal, converting it into a regular digital square wave signal with steep edges, eliminating jitter near the threshold and improving signal quality.
[0099] The shaped digital square wave signal is output from the output pin (Pin 2) of the Schmitt trigger and directly input to the digital input pin (PA0) of the microcontroller (model STM32F030F4P6). The internal logic circuit of the microcontroller is responsible for decoding the received digital signal and comparing the decoding result with the transmitted code to verify the validity of the signal.
[0100] II. The intensity branch (analog signal conditioning and intensity acquisition) is as follows.
[0101] The raw signal level output from the receiver simultaneously enters the intensity branch, first passing through a 0.1μF DC blocking capacitor (X7R dielectric, 50V rated voltage). This capacitor blocks the DC component in the signal, effectively filtering out slowly changing or constant DC offset interference introduced by ambient light (such as fluorescent lights or sunlight).
[0102] The DC-blocked AC signal then enters an integrating / low-pass filter network consisting of a 1μF electrolytic capacitor (±20% accuracy, 16V rated voltage) and a 10kΩ resistor (±5% accuracy, metal film material) connected in parallel to ground. The capacitor integrates the signal, and the resistor provides a discharge circuit. Together, they smooth the signal waveform and further filter out residual high-frequency noise, resulting in a low-frequency analog voltage that reflects the signal envelope (i.e., intensity).
[0103] The analog voltage signal, after integration and filtering, then flows through a 5.1kΩ attenuation resistor (with ±1% accuracy and precision metal film material). This resistor attenuates the signal amplitude to a range suitable for the input pin (PA1) of the STM32F030F4P6 analog-to-digital converter (ADC), typically 0-3.3V, preventing signal overload and measurement distortion.
[0104] The attenuated final analog voltage signal is sent to the microcontroller's ADC input pin (PA1). The microcontroller's internal ADC module digitizes the analog voltage value at this moment, converting it into a digital value that represents the total intensity of the currently received infrared signal (including ambient light and effective reflection) (i.e., the ADC value).
[0105] The false triggering of ceiling reflection is verified as follows.
[0106] Test conditions: Room with a ceiling height of 2.4m, device installation height of 0.8m (simulating a smart toilet).
[0107] White latex paint ceiling (reflectivity > 80%).
[0108] Test procedure: The device transmits an coded signal (10110011), and the receiver captures the signal reflected from the ceiling.
[0109] Result: Decoding branch: After the received signal is filtered and shaped, the microcontroller interprets it as invalid code (such as 00101101).
[0110] If the received code is not the same as the transmitted code, the comparison will fail, and the system will discard the signal.
[0111] Intensity branch: After the output signal is blocked, integrated and attenuated, the ADC value is 280 (example).
[0112] Although the ADC value is greater than the lower threshold of 120, the system does not respond due to decoding failure.
[0113] Conclusion: The encoding verification mechanism filters out invalid reflected signals, with a false trigger rate of 0%.
[0114] Lateral interference shielding verification is as follows.
[0115] Test conditions: A reflective target is placed 30cm directly in front of the device. An interfering infrared source (38kHz continuous wave) is placed 50cm to the side of the receiver at a 60° angle.
[0116] Results: Physical shielding: The response attenuation of the narrow-angle receiver (12°±2°) in the 60° direction is >20dB.
[0117] Decoding branch: The trace lateral signal was interpreted as invalid code, and the comparison failed.
[0118] Strength branch: ADC value fluctuation range ≤ ±10 (example), ignored due to decoding failure.
[0119] The anti-ceiling reflection verification is as follows.
[0120] In a room with a ceiling height of 2.4m, the reflected signal from the ceiling was received.
[0121] Decoding branch: If the reflected signal has no valid encoding or is encoded incorrectly (such as 00101101), the comparison fails, the system discards the signal, and does not trigger subsequent processing.
[0122] Strength branch: Even if the signal strength is high (e.g., ADC=280), the system does not respond due to decoding mismatch. This verifies that the dedicated encoding effectively filters non-target reflections (e.g., ceiling reflections).
[0123] Example 3 is as follows.
[0124] Ambient light interference test: Under strong light of 3000 lux fluorescent lamp, the background ADC reference value automatically collected by the system increases (for example, it increases to ADC=180).
[0125] When a valid obstacle (carrying the correct coded reflection) approaches, the real-time ADC value increases accordingly (e.g., to ADC=370).
[0126] The calculated return signal strength value is 370 - 180 = 190.
[0127] The value consistently fell within the effective threshold range (120-220), successfully triggering the lid-opening command. This verified the reliability of dynamic background subtraction in effectively resisting changes in ambient light and the reliability of dual verification.
[0128] The cross-interference test of multiple devices is as follows.
[0129] Two devices of this invention are placed side by side, with a distance of 50cm between them. Device 1 transmits code: 11001100; Device 2 transmits code: 00110011.
[0130] Test results: Device 1 only responds when it receives a reflected signal with its own encoding (11001100) and the strength meets the requirements. For the signal from Device 2 (00110011), decoding and matching failed, with a false trigger rate of <0.1%. This verifies that the dedicated encoding effectively avoids cross-interference between devices.
[0131] Example 4 is as follows.
[0132] Receiver viewing angle optimization: Tests show that when the viewing angle is > 15°, the false trigger rate caused by lateral interference (such as people walking by) increases significantly (e.g., to 12%); when the viewing angle is < 10°, the effective detection distance directly in front is significantly shortened (e.g., shortened by 20%). The overall performance (lateral interference shielding) meets the requirements, and the preferred receiving angle is 12°±2°, which maximizes the suppression of lateral interference while ensuring sufficient detection distance.
[0133] The background sampling period was optimized as follows: Tests show that when the total background sampling duration is < 100ms, noise suppression is insufficient, and sudden environmental changes can easily lead to misjudgments; when the total duration is > 300ms, the system response delay is significant. A total duration of 200ms (20 samples at 10ms intervals) achieves the best balance between effectively suppressing environmental noise and ensuring system response speed, resulting in strong environmental anti-interference capabilities.
[0134] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A near-field distance recognition method, characterized in that, include: The infrared transmitter emits an coded infrared signal, the code of which is generated by a high-low level switching sequence controlled by a microcontroller. The reflected signal is received by a narrow-angle infrared receiver with a receiving angle of 10° to 15°, and the received light signal is converted into an electrical signal. The level signal output by the narrow-angle infrared receiver is processed in parallel via dual paths: First processing path: Decode the level signal and compare whether the received code obtained by decoding is consistent with the transmitted code; The second processing path is to process the level signal through an intensity filtering circuit and output the processed signal to the analog-to-digital converter (ADC) pin of the microcontroller to obtain the ADC value that characterizes the signal strength. Before each transmission of the coded infrared signal, the ambient background infrared intensity is acquired by the narrow-angle infrared receiver and converted into a background ADC value; When the first processing path confirms that the received code and the transmitted code are consistent, the return signal strength value is calculated. The return signal strength value is the ADC value obtained by the second processing path minus the background ADC value. The distance to the obstacle is determined by comparing the reflected signal strength value with a preset threshold range.
2. The near-field distance recognition method according to claim 1, characterized in that: The intensity filtering circuit includes a DC blocking capacitor for filtering out DC noise, an integrating capacitor connected in parallel with the DC blocking capacitor for signal integration, and an attenuation resistor for signal amplitude attenuation. The attenuation resistor is connected in series between the output terminal of the integrating capacitor and the ADC pin of the microcontroller.
3. The near-field distance recognition method according to claim 1, characterized in that: The logic for determining the distance to the obstacle based on the strength value of the reflected signal is as follows: If the return signal strength value is less than the lower limit of the preset threshold range, it is determined that the obstacle is too far away; If the return signal strength value is greater than the upper limit of the preset threshold range, it is determined that the obstacle is too close; If the return signal strength value is within the preset threshold range, an execution command is triggered.
4. The near-field distance recognition method according to any one of claims 1 to 3, characterized in that: The step of acquiring the ambient background infrared intensity before each transmission of the coded infrared signal specifically includes: turning off the infrared transmitter, acquiring the ambient background infrared intensity multiple times at a preset sampling interval, and calculating the average value as the background ADC value.
5. The near-field distance recognition method according to claim 4, characterized in that: The sampling interval is 10ms, and the total sampling duration is 200ms.
6. A near-field distance recognition device applying the near-field distance recognition method according to any one of claims 1 to 5, characterized in that, include: Infrared transmitter; An encoding generation circuit, connected to the infrared transmitter, is used to generate the encoded infrared signal according to the high-low level switching sequence controlled by the microcontroller. A narrow-angle infrared receiver, with a receiving angle of 10° to 15°, is used to receive reflected signals and convert light signals into level signals; The signal processing unit includes: a decoding branch connected to the output of the narrow-angle infrared receiver, used to decode the level signal and input the decoding result into the microcontroller for encoding comparison; The intensity branch is connected to the output terminal of the narrow-angle infrared receiver. The intensity branch includes a DC blocking capacitor, an integrating capacitor, and an attenuation resistor in sequence. It is used to filter and attenuate the level signal and then output it to the analog-to-digital converter (ADC) pin of the microcontroller. The microcontroller controls the encoding generation circuit; Before each signal is emitted by the infrared transmitter, the ambient background infrared intensity is acquired by the narrow-angle infrared receiver and converted into a background ADC value. When the received code is confirmed to be consistent with the transmitted code through the decoding branch, the calculated return signal strength value is the ADC value output by the strength branch minus the background ADC value. The distance to the obstacle is determined based on the strength value of the reflected signal and a preset threshold range.
7. The near-field distance recognition device according to claim 6, characterized in that: The encoding generation circuit is directly driven by the output pin of the microcontroller, and generates the encoded infrared signal by controlling the high and low level switching interval.
8. The near-field distance recognition device according to claim 6, characterized in that: The decoding branch also includes a filtering and shaping circuit for processing the level signal into a digital signal suitable for decoding and comparison by the microcontroller.
9. The near-field distance recognition device according to claim 6, characterized in that: The narrow-angle infrared receiver has a receiving angle of 12°±2°.
10. A near-field distance recognition system, characterized in that, include: The near-field distance recognition device as described in any one of claims 6 to 9; The microcontroller is configured to output a control command when it is confirmed through the decoding branch that the received encoding is consistent with the transmitted encoding and the foldback signal strength value is within a preset threshold range.
Citation Information
Patent Citations
Obstacle detection device and detection method based on infrared modulation and robot
CN109031325A
