Near field distance identification method, device and system
Through 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, and the accuracy and reliability of recognition are improved.
Patent Information
- Application Number
- CN202510924209.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-10-10
AI Technical Summary
Existing infrared near-field recognition technology is susceptible to environmental interference and has a high false trigger rate. In particular, when the indoor space is not high enough, the misjudgment of ceiling reflections is serious and the anti-noise ability is weak, affecting user experience and reliability.
It uses coded infrared signals and performs dual-path processing through a narrow-angle infrared receiver, including decoding and intensity filtering, combined with environmental background infrared intensity calibration to determine the distance to obstacles.
It effectively shields lateral interference and avoids false triggering due to ceiling reflections, thus improving recognition accuracy and anti-environmental interference capabilities and reducing false triggering rates.
Smart Images

Figure CN120762042A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of smart toilets and smart trash cans, and in particular to a near-field distance recognition method, device and system. Background Art
[0002] With the increasing prevalence of smart devices, near-field recognition technology has become a key feature in products like smart toilets and smart trash cans. These devices automatically trigger the lid to open when a user's body or an object approaches the device (typically 10-30 cm). This relies on low-cost infrared near-field detection solutions.
[0003] The current mainstream solution uses a continuous infrared emission and intensity detection mechanism: the infrared transmitter continuously transmits 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 light and sunlight) can cause abnormal received signal strength and lead to misjudgment.
[0005] 2. False triggering due to ceiling reflection: In scenarios where the indoor space is not high enough, the infrared signal is reflected by the ceiling and captured by the receiver, which is mistakenly identified as a valid obstacle, causing the device to open randomly without any contact.
[0006] 3. Weak noise immunity: Traditional solutions lack a dynamic environmental calibration mechanism and are unable to distinguish between real obstacle reflections and environmental background noise.
[0007] These issues severely impact user experience and product reliability, restricting 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 low cost. Summary of the Invention
[0008] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, one object of the present invention is to provide a near-field distance recognition method, device, and system, which are novel near-field recognition technologies that are resistant to environmental interference, avoid false triggering, and maintain low cost advantages.
[0009] The present invention also provides a near-field distance recognition method, including the following.
[0010] The infrared signal of the coding format is transmitted by the infrared transmitter, and the coding is generated by the high and low level switching sequence controlled by the single chip microcomputer.
[0011] The reflected signal is received by a narrow-angle infrared receiver with a receiving angle of 10° to 15°, and the received optical signal is converted into a level signal.
[0012] The level signal output by the narrow-angle infrared receiver is processed in parallel in dual paths.
[0013] The first processing path is to decode the level signal and compare the received code obtained by decoding with the transmitted code to see whether they are consistent.
[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 single-chip microcomputer to obtain an ADC value representing the signal strength.
[0015] Before each emission of the coded infrared signal, the ambient background infrared intensity is collected by the narrow-angle infrared receiver and converted into a background ADC value.
[0016] When the first processing path confirms that the received code is consistent with the transmitted code, a 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 return signal strength value with a preset threshold range.
[0018] Specifically, the intensity filter circuit includes a blocking capacitor for filtering out DC noise, an integrating capacitor connected in parallel with the blocking capacitor for signal integration, and an attenuation resistor for signal amplitude attenuation, and the attenuation resistor is connected in series between the output end of the integrating capacitor and the ADC pin of the microcontroller.
[0019] Specifically, the logic of determining the obstacle distance based on the return signal strength value 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 instruction is triggered.
[0023] Specifically, the step of collecting the ambient background infrared intensity before transmitting the coded infrared signal each time includes: turning off the infrared transmitter, collecting the ambient background infrared intensity multiple times at a preset sampling interval, and calculating an average value as the background ADC value.
[0024] Specifically, the sampling interval is 10ms and the total sampling time is 200ms.
[0025] The present invention also discloses an identification device using the near-field distance identification method described in any of the above technical solutions, including the following.
[0026] Infrared transmitter; a code generating circuit connected to the infrared transmitter, for generating the coded infrared signal according to the high and low level switching sequence controlled by the single chip microcomputer.
[0027] Narrow-angle infrared receiver with a receiving angle of 10° to 15°, used to receive reflected signals and convert optical signals into level signals.
[0028] The signal processing unit includes a decoding branch connected to the output end of the narrow-angle infrared receiver, used for decoding the level signal and inputting the decoding result into the single chip microcomputer for code comparison.
[0029] An intensity branch is connected to the output end of the narrow-angle infrared receiver. The intensity branch includes a DC blocking capacitor, an integrating capacitor and an attenuation resistor in sequence, and 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 single chip microcomputer controls the code generation circuit.
[0031] Before controlling the infrared transmitter to transmit a signal each time, the narrow-angle infrared receiver collects the ambient background infrared intensity and converts it into a background ADC value.
[0032] When it is confirmed through the decoding branch that the received code is consistent with the transmitted code, the calculated return signal strength value is the ADC value output by the strength branch minus the background ADC value.
[0033] The obstacle distance is determined based on the return signal strength value and a preset threshold range.
[0034] Specifically, the code generation circuit is directly driven by the output pin of the single chip microcomputer, and generates the coded infrared signal by controlling the high and low level switching intervals.
[0035] Specifically, the decoding branch further includes a filtering and shaping circuit for processing the level signal into a digital signal suitable for decoding and comparison by the single chip microcomputer.
[0036] Specifically, the receiving angle of the narrow-angle infrared receiver is 12°±2°.
[0037] Meanwhile, the present invention also provides a near-field distance recognition system, which includes the near-field distance recognition device as described above.
[0038] For the near-field distance recognition system, the single chip microcomputer is further configured to output a control instruction 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.
[0039] The present invention achieves significant improvements through the above technical means, and the specific beneficial effects are as follows.
[0040] 1. Strong anti-interference ability: Automatically scan the ambient infrared intensity before each startup, and actively deduct the background value during detection to avoid false triggering due to changes in ambient light.
[0041] 2. Completely solve the problem of ceiling misjudgment: using exclusive infrared coding transmission, only the reflected signal carrying the correct code will be responded to, and the messy infrared waves reflected from the ceiling are directly filtered out.
[0042] 3. Lateral interference shielding: The receiver adopts a narrow viewing angle design, only receiving signals within a range of 10-15° in front, physically isolating from side interference.
[0043] 4. Double-check mechanism: First, the decoding path verifies that the received signal carries the correct transmission code to confirm the existence of a valid reflected signal. Then, the intensity path calculates the return signal strength value after subtracting the background and determines whether it is within the effective distance threshold. This two-step verification significantly reduces the false trigger rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments with reference to the accompanying drawings.
[0045] Figure 1 It is a schematic diagram of an application scenario of the present invention.
[0046] Figure 2 It is the infrared decoding flow chart of the present invention.
[0047] Figure 3 It is the infrared longitude flow chart of the present invention.
[0048] Figure 4 It is a flowchart of the intelligent algorithm. DETAILED DESCRIPTION
[0049] The following describes embodiments of the present invention in detail. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended only to explain the present invention and are not to be construed as limiting the present invention.
[0050] Reference below Figures 1 to 4A near field distance recognition method according to an embodiment of the present application is described as follows.
[0051] The coded infrared signal is emitted by an infrared emitter, and the coding is generated by a high-low level switching sequence controlled by a single-chip microcomputer.
[0052] The reflected signal is received by a narrow-angle infrared receiver with a receiving angle of 10° to 15°, and the received optical signal is converted into a level signal.
[0053] The level signal output by the narrow-angle infrared receiver is processed in the following two paths in parallel.
[0054] The first processing path: the level signal is decoded, and it is compared whether the received coding is consistent with the emitted coding.
[0055] The second processing path: the level signal is processed by an intensity filtering circuit, and the processed signal is output to the analog-to-digital converter (ADC) pin of the single-chip microcomputer to obtain an ADC value representing the signal intensity.
[0056] Before each emission of the coded infrared signal, the environmental background infrared intensity is collected by the narrow-angle infrared receiver and converted into a background ADC value.
[0057] When the first processing path confirms that the received coding is consistent with the emitted coding, the return signal intensity value is calculated, which is the ADC value obtained by the second processing path minus the background ADC value.
[0058] The return signal intensity value is compared with a preset threshold range to determine the distance of the obstacle.
[0059] Specifically further, the intensity filtering circuit includes a blocking capacitor for filtering out direct current noise, an integration capacitor connected in parallel with the blocking capacitor for signal integration, and a decay resistor for signal amplitude attenuation, which is connected in series between the output end of the integration capacitor and the ADC pin of the single-chip microcomputer.
[0060] Specifically further, the logic for determining the distance of the obstacle according to the return signal intensity value is as follows.
[0061] If the return signal intensity value is less than the lower limit of the preset threshold range, it is determined that the distance of the obstacle is too far.
[0062] If the return signal intensity value is greater than the upper limit of the preset threshold range, it is determined that the distance of the obstacle is too close.
[0063] If the return signal intensity value is within the preset threshold range, an execution instruction is triggered.
[0064] Specifically further, the step of collecting the ambient background infrared intensity before each emission of the coded infrared signal specifically comprises: closing the infrared emitter, collecting the ambient background infrared intensity multiple times at a preset sampling interval, and calculating the average value as the background ADC value.
[0065] Specifically further, the sampling interval is 10 ms, and the total sampling duration is 200 ms.
[0066] The application also provides an identification device for the near-field distance identification method.
[0067] An infrared emitter; a coding generation circuit connected to the infrared emitter, for generating the coded infrared signal according to a high-low level switching sequence controlled by a single-chip microcomputer.
[0068] A narrow-angle infrared receiver with a receiving angle of 10° to 15°, for receiving a reflected signal and converting the optical signal into a level signal.
[0069] A signal processing unit, comprising: a decoding branch connected to the output end of the narrow-angle infrared receiver, for decoding the level signal and inputting the decoding result into the single-chip microcomputer for coding comparison.
[0070] An intensity branch connected to the output end of the narrow-angle infrared receiver, the intensity branch comprising, in sequence, a direct-current blocking capacitor, an integration capacitor and a decay resistor, for filtering and attenuating the level signal and then outputting the signal to an analog-to-digital converter (ADC) pin of the single-chip microcomputer.
[0071] The single-chip microcomputer controls the coding generation circuit.
[0072] Before each control of the infrared emitter to emit a signal, the ambient background infrared intensity is collected by the narrow-angle infrared receiver and converted into a background ADC value.
[0073] When it is confirmed through the decoding branch that the received code is consistent with the transmitted code, the return signal intensity value is calculated as the ADC value output by the intensity branch minus the background ADC value.
[0074] The distance of an obstacle is determined according to the return signal intensity value and a preset threshold range.
[0075] Specifically further, the coding generation circuit is directly driven by an output pin of the single-chip microcomputer, and the coded infrared signal is generated by controlling the high-low level switching interval.
[0076] Specifically further, the decoding branch further comprises a filter shaping circuit, for processing the level signal into a digital signal suitable for decoding comparison by the single-chip microcomputer.
[0077] Specifically, the receiving angle of the narrow-angle infrared receiver is 12°±2°.
[0078] The present invention also provides a near-field distance recognition system, which includes the near-field distance recognition device described above.
[0079] During this period, the single chip microcomputer is further configured to output a control instruction 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] According to the above technical solution, there are the following specific embodiments.
[0081] Example 1: Specific implementation of the near-field distance recognition method.
[0082] Combine Figure 2 and Figure 3 The process, taking the automatic opening of the smart toilet lid as an example, the specific steps are as follows.
[0083] Coded signal transmission: The microcontroller (STM32F030F4P6) outputs a 38kHz carrier through its GPIO pin (e.g., PB5), superimposed with a specific high and low level coding sequence (for example: 10110011, with a pulse width of 1ms per bit). This signal is amplified by a transistor (MMBT3904) driven by a current-limiting resistor (220Ω). This then illuminates an infrared transmitter (IR333-A, with a divergence angle of approximately 15°), emitting the coded infrared signal. The transmission cycle is set to 100ms.
[0084] Ambient background intensity acquisition (dynamic subtraction basis): Ambient sampling is started 200ms before each coded signal is transmitted.
[0085] Turn off the infrared transmitter.
[0086] A narrow-angle infrared receiver (VSOP38360, receiving angle 12°±2°) is used to collect environmental background infrared noise (such as fluorescent lamps and sunlight).
[0087] The ADC of the microcontroller samples 20 times at 10ms intervals (total duration 200ms).
[0088] Calculate the average of the 20 sampling values as the background ADC baseline value (for example: ADC = 152). This step implements a dynamic background subtraction mechanism and strong environmental interference resistance.
[0089] The dual-path signals are processed in parallel as follows.
[0090] First processing path (decoding branch - code verification): The receiver's output signal first passes through an RC low-pass filter (1kΩ + 0.01μF) to remove high-frequency interference. It is then 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 code generation circuit. Specifically, the microcontroller's built-in decoder compares the received code sequence with the transmitted code to ensure complete consistency. Only when the two are consistent (for example, the received code is also 10110011) does the subsequent strength analysis trigger. This mechanism directly and completely eliminates false ceiling detection and double verification mechanisms.
[0091] Second processing path (intensity branch - signal filtering and acquisition): The receiver's raw output signal passes through the following: A DC blocking capacitor (0.1μF): Filters out DC offset caused by ambient light (such as 50Hz light interference). An integrating capacitor (1μF in parallel with a 10kΩ resistor): Smoothes the signal and filters out high-frequency noise. An attenuation resistor (5.1kΩ): Attenuates the signal amplitude to the microcontroller ADC range (0-3.3V). The processed analog signal is input to the microcontroller ADC pin (PA1), generating a real-time ADC value representing the reflected signal strength. Distance determination (double verification): Distance determination is performed only if the decoding branch confirms encoding consistency: The reflected signal strength is calculated as: real-time ADC value minus background ADC value (for example, if real-time ADC value = 320, reflected strength = 320 - 152 = 168).
[0092] The return signal strength is compared with a preset threshold: If < the lower limit of 120, the obstacle is considered too far away (for example, > 30 cm) and no response is given. If > the upper limit of 220, the obstacle is considered too close (for example, < 10 cm) and anti-collision logic is executed (for example, no opening or slow opening). If between 120 and 220, the obstacle is considered within the effective recognition range (for example, 10-30 cm) and a command is triggered (for example, opening the lid).
[0093] Example 2 is as follows.
[0094] Reference Figure 1 Application scenario, the core hardware configuration of the device is as follows.
[0095] Transmitter module: GPIO pin PB5 of the STM32F030F4P6 microcontroller outputs a code sequence (example: 10110011). A 220Ω current-limiting resistor (±5%, carbon film) is connected in series with PB5, which is then connected to the base of an NPN transistor (MMBT3904). The transistor's collector is connected to the anode of an infrared transmitter (IR333-A), while the emitter is grounded. The IR transmitter's cathode is grounded, and its anode is connected to a +3.3V power supply through the transistor. This allows the microcontroller to directly drive code generation.
[0096] 1. The decoding branch (signal shaping and decoding) is as follows.
[0097] The raw signal from the receiver first flows through a low-pass filter network consisting of a 1kΩ resistor (±5% accuracy, metal film) and a 0.01μF ceramic capacitor (X7R dielectric, 50V rated voltage) connected in parallel to ground. This network filters out high-frequency noise interference from the signal.
[0098] The filtered signal is fed into the input pin (Pin 1) of a Schmitt trigger (74HC14). The Schmitt trigger shapes the input signal, converting it into a regular digital square wave with steep edges, eliminating jitter near the threshold and improving signal quality.
[0099] The shaped digital square wave signal is output from the Schmitt trigger's output pin (Pin 2) and directly input to the digital input pin (PA0) of the STM32F030F4P6 microcontroller. The logic circuit within the microcontroller decodes the received digital signal and compares the decoded result with the transmitted code to verify the signal's validity.
[0100] 2. The intensity branch (analog signal conditioning and intensity acquisition) is as follows.
[0101] The original level signal output by the receiver simultaneously enters the intensity branch and first passes 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 varying or constant DC offset interference introduced by ambient light (such as fluorescent lamps and sunlight).
[0102] The DC-blocked AC signal then enters an integration / low-pass filter network consisting of a 1μF electrolytic capacitor (±20% accuracy, 16V rated voltage) and a 10kΩ resistor (±5% accuracy, metal film) connected in parallel to ground. The capacitor integrates the signal, while the resistor provides a discharge path. Working together, they smooth the signal waveform and further filter out any residual high-frequency noise, resulting in a low-frequency analog voltage that reflects the signal envelope (i.e., strength).
[0103] After integration and filtering, the analog voltage signal then flows through a 5.1kΩ attenuation resistor (±1% accuracy, made of precision metal film). This resistor attenuates the signal amplitude to a range suitable for the analog-to-digital converter (ADC) input pin (PA1) of the STM32F030F4P6 microcontroller (STM32F030F4P6), typically 0-3.3V, to prevent measurement distortion caused by signal overload.
[0104] The final attenuated analog voltage signal is fed into the MCU's ADC input pin (PA1). The ADC module within the MCU digitizes the analog voltage at that moment and converts it into a digital value (i.e., the ADC value) representing the total intensity of the currently received infrared signal (including ambient light and effective reflection).
[0105] The false triggering due to ceiling reflection is verified as follows.
[0106] Test conditions: room with a floor height of 2.4m, device installation height of 0.8m (simulating a smart toilet).
[0107] White latex paint ceiling (reflectivity > 80%).
[0108] Testing process: The device transmits a coded signal (10110011) and the receiver captures the ceiling reflected signal.
[0109] Result: Decoding branch: After the received signal is filtered and shaped, the microcontroller interprets it as an invalid code (such as 00101101).
[0110] The received code ≠ the transmitted code, the comparison fails, and the system discards the signal.
[0111] Intensity branch: After the output signal is DC-isolated, 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 coding verification mechanism filters out invalid reflected signals, and the false trigger rate is 0%.
[0114] The lateral interference shielding is verified as follows.
[0115] Test conditions: A reflective target was placed 30 cm in front of the device. An interfering infrared source (38 kHz continuous wave) was placed 50 cm from the receiver at a 60° angle to the side.
[0116] Results: Physical shielding: The response attenuation of the narrow angle receiver (12°±2°) at 60° direction is >20dB.
[0117] Decoding branch: The trace lateral signal was interpreted as an invalid code and the comparison failed.
[0118] Intensity branch: ADC value fluctuation range ≤ ±10 (for example) is ignored due to decoding failure.
[0119] Anti-ceiling reflection verification is as follows.
[0120] Tested in a room with a ceiling height of 2.4m, the signal reflected from the ceiling was received.
[0121] Decode branch: The reflected signal has no valid encoding or encoding error (such as 00101101), the comparison fails, the system discards the signal and does not trigger the subsequent processing.
[0122] Intensity branch: Even if the signal intensity is high at this time (such as ADC = 280), the system does not respond due to decoding mismatch. It is verified that the exclusive encoding effectively filters non-target reflections (such as ceiling reflections).
[0123] Example 3 is as follows.
[0124] Ambient light interference test: In a 3000 lux strong light environment of daylight lamp, the background ADC reference value collected by the system automatically increases (for example, to ADC = 180).
[0125] When the valid obstacle (carrying the correct coded reflection) approaches, the real-time ADC value increases accordingly (for example, to ADC = 370).
[0126] Calculate the return signal intensity value = 370-180 = 190.
[0127] The value stably falls within the effective threshold range (120-220), successfully triggering the cover opening instruction. It verifies the reliability of dynamic background subtraction against environmental light changes and double verification.
[0128] The multi-device cross interference test is as follows.
[0129] Two devices of the present application are placed side by side with a distance of 50 cm. Device 1 transmits the code: 11001100; Device 2 transmits the code: 00110011.
[0130] Test results: Device 1 only responds when it receives the reflection signal of its own code (11001100) and the intensity meets the conditions. For the signal of device 2 (00110011), the decoding comparison fails, and the false trigger rate is <0.1%. It verifies that the exclusive code effectively avoids cross interference between devices.
[0131] Example 4 is as follows.
[0132] Receiver angle optimization: Tests show that when the angle is > 15°, the false trigger rate caused by lateral interference (such as a person walking next to it) increases significantly (such as to 12%); when the angle is < 10°, the effective detection distance in front is significantly shortened (such as 20%). The comprehensive 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 is optimized as follows: Testing shows that when the total background sampling duration is less than 100ms, noise suppression is insufficient, and sudden environmental changes can easily lead to misjudgments. When the total duration is greater than 300ms, system response delays are significant. A total duration of 200ms (20 samplings at 10ms intervals) achieves the optimal balance between effectively suppressing environmental noise and ensuring system response speed, achieving strong environmental interference resistance.
[0134] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the claims and their equivalents.
Claims
1. A near-field distance recognition method, characterized in that: include: Transmitting a coded infrared signal through an infrared transmitter, wherein the code is generated by a high-low level switching sequence controlled by a single chip microcomputer; The reflected signal is received by a narrow-angle infrared receiver with a receiving angle of 10° to 15°, and the received optical signal is converted into a level signal; The level signal output by the narrow-angle infrared receiver is processed in parallel in two paths: The first processing path is to decode the level signal and compare the received code obtained by decoding with the transmitted code to see whether they are consistent; The second processing path is to process the level signal through an intensity filtering circuit, and output the processed signal to an analog-to-digital converter ADC pin of the single-chip microcomputer to obtain an ADC value representing the signal strength; Before each emission of the coded infrared signal, the narrow-angle infrared receiver collects the ambient background infrared intensity and converts it into a background ADC value; When the first processing path compares and confirms that the received code is consistent with the transmitted code, calculating a return signal strength value, the return signal strength value being the ADC value obtained by the second processing path minus the background ADC value; The distance to the obstacle is determined by comparing the return signal strength value with a preset threshold range.
2. The near-field distance recognition method according to claim 1, wherein: The intensity filter 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 end of the integrating capacitor and the ADC pin of the microcontroller.
3. The near-field distance recognition method according to claim 1, wherein: The logic for determining the obstacle distance based on the return signal strength value 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 instruction is triggered.
4. The near-field distance recognition method according to any one of claims 1 to 3, characterized in that: The step of collecting the ambient background infrared intensity before transmitting the coded infrared signal each time specifically includes: turning off the infrared transmitter, collecting 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 time is 200ms.
6. An identification device using the near-field distance identification method according to any one of claims 1 to 5, characterized in that: include: Infrared transmitter; A code generation circuit, connected to the infrared transmitter, for generating the coded infrared signal according to a high and low level switching sequence controlled by the single chip microcomputer; Narrow-angle infrared receiver with a receiving angle of 10° to 15°, used to receive reflected signals and convert optical signals into level signals; The signal processing unit includes: a decoding branch connected to the output end of the narrow-angle infrared receiver, for decoding the level signal and inputting the decoding result into the single chip microcomputer for code comparison; an intensity branch connected to the output end of the narrow-angle infrared receiver, the intensity branch sequentially comprising a DC blocking capacitor, an integrating capacitor, and an attenuation resistor, for filtering and attenuating the level signal and then outputting it to the analog-to-digital converter ADC pin of the single-chip microcomputer; The single chip microcomputer controls the code generation circuit; Before controlling the infrared transmitter to transmit a signal each time, collecting the ambient background infrared intensity through the narrow-angle infrared receiver and converting it into a background ADC value; When it is confirmed through the decoding branch that the received code is consistent with the transmitted code, the return signal strength value is calculated as the ADC value output by the strength branch minus the background ADC value; The obstacle distance is determined based on the return signal strength value and a preset threshold range.
7. The near-field distance recognition device according to claim 6, characterized in that: The code generation circuit is directly driven by the output pin of the single chip microcomputer and generates the coded infrared signal by controlling the high and low level switching intervals.
8. The near-field distance recognition device according to claim 6, characterized in that: The decoding branch further includes a filtering and shaping circuit for processing the level signal into a digital signal suitable for decoding and comparison by the single chip microcomputer.
9. The near-field distance recognition device according to claim 6, characterized in that: The receiving angle of the narrow-angle infrared receiver is 12°±2°.
10. A near-field distance recognition system, characterized in that: include: The near-field distance recognition device according to any one of claims 6 to 9; The single chip microcomputer is configured to output a control instruction 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.
Citation Information
Patent Citations
Obstacle detection device and detection method based on infrared modulation and robot
CN109031325A
Screen ambient light detection method, electronic equipment, medium and program product
CN116682367A
Electronic equipment, ambient light parameter detection method and related device
CN118776670A
Method and device for obstacle detection and distance measurement by infrared radiation
WO2002059646A1