Range finder system capable of controlling alarm distance
By importing the Mind library and combining it with an OLED display and ultrasonic ranging, the problem of low flexibility in existing rangefinder systems has been solved. This enables flexible alarm distance control and rich functionality, making it compatible with various motherboards and improving the system's versatility and security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 翟轩锐
- Filing Date
- 2024-01-15
- Publication Date
- 2026-05-05
AI Technical Summary
Existing rangefinder systems are inflexible, inefficient, complex, and have limited functionality, lacking flexibility and versatility, and are unable to achieve flexible alarm distance control.
By importing third-party libraries using the Mind library, creating variables and classes, and using the setup() and loop() functions, combined with an OLED display and ultrasonic distance measurement, an alarm function is implemented through pin configuration, making it suitable for various motherboards.
It achieves high flexibility, rich functionality, ease of use, user-friendly interface, security, and configurability, and can be integrated on different hardware platforms, providing accurate distance measurement and alarm prompts, thus improving the system's versatility and security.
Smart Images

Figure CN121978662A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of rangefinders, specifically to a rangefinder system with controllable alarm distance. Background Technology
[0002] In the field of sensor technology, with the continuous development of science and technology, sensors are being used more and more widely in various fields. Distance sensors, as a type of sensor, are also seeing increasingly widespread applications. Currently, there are various types of distance sensors on the market, such as laser distance sensors, infrared distance sensors, and ultrasonic distance sensors. These sensors, through different working principles, can quickly and accurately measure the distance to target objects. In the field of distance measurement technology, distance measurement is an important application technology in modern science and technology, with broad application prospects in areas such as robot navigation, security monitoring, and automatic control. Currently, distance measurement technology has made significant progress, with various high-precision and high-efficiency distance measurement methods constantly emerging. In the field of ultrasonic technology, ultrasound is a type of sound wave with a frequency higher than that of the human ear. Ultrasonic sensors utilize the characteristics of ultrasound to accurately measure distances, unaffected by factors such as light and color. Therefore, ultrasonic sensors have wide applications in many fields. In the field of hardware programming, with the development of the Internet of Things and embedded systems, various new hardware devices are constantly emerging. Developers need to be proficient in various hardware platforms and programming languages, such as Arduino and Raspberry Pi, to achieve efficient hardware configuration and software development. In the field of Internet of Things (IoT) technology, IoT refers to connecting the physical and virtual worlds through network technology to achieve intelligent control and management. The development of IoT technology has provided more possibilities for ranging systems; through wireless network technology, ranging systems can achieve remote data transmission and control.
[0003] However, there are very few rangefinder systems on the market that can control the alarm distance, or the existing technologies have certain defects, such as low flexibility, inefficiency, complexity, and limited functionality. Summary of the Invention
[0004] The purpose of this invention is to overcome the above-mentioned technical defects and provide a rangefinder system with controllable alarm distance, solving the problems of low flexibility, inefficiency, complexity, and limited functionality.
[0005] To solve the above-mentioned technical problems, the technical solution provided by the present invention is: a rangefinder system with controllable alarm distance, wherein the system steps are as follows: importing a third-party library, then creating variables, creating a class, using the function setup(), and using the function loop().
[0006] Furthermore, the third-party library mentioned is the Mind library.
[0007] Furthermore, the variable type mentioned is float.
[0008] Furthermore, the setup() function initializes the OLED display and performs OLED screen clearing.
[0009] Furthermore, the function loop() will be executed repeatedly in sequence.
[0010] Furthermore, the logic of the function loop() is as follows: set the length value to read the ultrasonic distance and the value of the analog pin, display the connection length value and the reminder value in one row on the OLED, if the length value is less than or equal to the reminder value, display "Reminder value is correct" in three rows on the OLED, set digital pin 2 to high level, set digital pin 3 to low level, and set PWM pin 6 to 0, if the length value is greater than the reminder value, display "Reminder value is incorrect" in three rows on the OLED, set digital pin 2 to low level, set digital pin 3 to high level, and set PWM pin 6 to 255.
[0011] Furthermore, the system described is applicable to various motherboards.
[0012] The advantages of this invention compared to existing technologies are: high flexibility: the system is applicable to various motherboards, has high versatility and flexibility, and can be easily integrated into different hardware platforms.
[0013] Efficient and concise: By importing third-party libraries, existing mature technologies and resources can be fully utilized, reducing development time and costs.
[0014] Feature-rich: This system can not only measure distances using ultrasound, but also obtain more environmental information by reading the values of analog pins.
[0015] Easy to use: System initialization is simple, including operations such as OLED screen clearing. Furthermore, the logic of the loop() function is clear, facilitating development and debugging.
[0016] Alarm function: When the measured length value is less than or equal to the warning value, the system will issue an alarm message through specific pin configuration and OLED display, enhancing the system's practicality and functionality.
[0017] User-friendly interface: Through the OLED display, users can intuitively see the connection length value, the alert value, and the corresponding alarm status, giving users a clear understanding of the system's status.
[0018] Highly scalable: Since the system is based on third-party libraries, new features can be added or existing features can be improved by updating or adding new libraries in the future.
[0019] High security: Through precise distance measurement and alarm functions, it can prevent safety problems that may be caused by being too close, thus improving the security of the system.
[0020] Highly configurable: The reminder value can be set according to actual needs, making the system more flexible and personalized.
[0021] Easy to maintain and upgrade: Thanks to the modular design, system maintenance and upgrades are simpler and more convenient.
[0022] In summary, compared with existing technologies, this rangefinder system with controllable alarm distance has significant advantages in terms of flexibility, feature richness, ease of use, user-friendly interface, security, configurability, and maintainability. Attached Figure Description
[0023] Figure 1 This is a schematic diagram of the overall logic of the rangefinder system with controllable alarm distance according to the present invention.
[0024] Figure 2 This is a logical diagram of the loop() function of the rangefinder system that can control the alarm distance according to the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0026] Example:
[0027] The system of a rangefinder that can control the alarm distance is described in the following steps: importing a third-party library, then creating variables, creating a class, using the function setup(), and using the function loop().
[0028] The third-party library mentioned is the Mind library.
[0029] The variable type mentioned is float.
[0030] The function setup() initializes the OLED display and performs OLED screen clearing.
[0031] The function loop() will be executed repeatedly in sequence.
[0032] The logic of the function loop() is as follows: Set the length value to read the ultrasonic distance and the value of the analog pin. The OLED displays the connection length value and the reminder value in one row. If the length value is less than or equal to the reminder value, the OLED displays three rows indicating that the reminder value is correct. Set digital pin 2 to high level, set digital pin 3 to low level, and set PWM pin 6 to 0. If the length value is greater than the reminder value, the OLED displays three rows indicating that the reminder value is incorrect. Set digital pin 2 to low level, set digital pin 3 to high level, and set PWM pin 6 to 255.
[0033] The system described is applicable to various motherboards.
[0034] Specific code:
[0035] / *!
[0036] *MindPlus
[0037] *nano
[0038] *
[0039] /
[0040] #include<DFRobot-URM10.h>
[0041] #include<DFRobot_SSD1306 I2C.h>
[0042] / / Dynamic variables
[0043] volatile float mind_n_lenth,mind_n_alarm;
[0044] / / Create object
[0045] DFRobot_SSD1306_I2Coled12864;
[0046] DFRobot_URM10urm10;
[0047] / / Main program starts
[0048] Void setup(){
[0049] oled12864.begin(x3c);
[0050] oled12864.fillScreen(0);
[0051] }
[0052] Void loop(){
[0053] mind_n_lenth=(urml.getDistanceCM(4,5));
[0054] mind_n_alarm=(analogRead(A0) / 10);
[0055] oled12864.setCursorLine(1);
[0056] oled12864.printLine((string(mind_n_lenth)+
[0057] String("cm")));
[0058] oled12864.setCursorLine(2);
[0059] oled12864.printLine((string(mind_n_alarm)+
[0060] Sstring("cm")));
[0061] If((mind_n_lenth≤mind_n_alarm)){
[0062] ifoled12864.setCursorLine(3);
[0063] oled12864.printLine("Alarm:true");
[0064] digitalWrite(2,HIGH);
[0065] digitalwrite(3,LOW);
[0066] analogwrite(6,0);
[0067] }
[0068] else{
[0069] oled12864.setCursorLine(3);
[0070] oled12864.printLine("Alarm:false");
[0071] digitalwrite(2,LOW);
[0072] digitalWrite(3, HIGH);
[0073] analogWrite(6, 255);
[0074] }
[0075] }
[0076] The present invention and its embodiments have been described above. This description is not restrictive, and the accompanying drawings are only one embodiment of the present invention, and are not actually limited thereto. In conclusion, if those skilled in the art are inspired by this description and design similar embodiments without departing from the spirit of the present invention, such embodiments should fall within the protection scope of the present invention.
Claims
1. A rangefinder system with controllable alarm distance, characterized in that, The system steps are as follows: import the third-party library, then create variables, create a class, use the function setup(), and use the function loop().
2. The rangefinder system with controllable alarm distance according to claim 1, characterized in that, The third-party library mentioned is the Mind library.
3. The rangefinder system with controllable alarm distance according to claim 1, characterized in that, The variable type mentioned is float.
4. The rangefinder system with controllable alarm distance according to claim 1, characterized in that, The function setup() initializes the OLED display and performs OLED screen clearing.
5. The rangefinder system with controllable alarm distance according to claim 1, characterized in that, The function loop() will be executed repeatedly in sequence.
6. The rangefinder system with controllable alarm distance according to claim 5, characterized in that, The logic of the function loop() is as follows: Set the length value to read the ultrasonic distance and the value of the analog pin. The OLED displays the connection length value and the reminder value in one row. If the length value is less than or equal to the reminder value, the OLED displays three rows indicating that the reminder value is correct. Set digital pin 2 to high level, set digital pin 3 to low level, and set PWM pin 6 to 0. If the length value is greater than the reminder value, the OLED displays three rows indicating that the reminder value is incorrect. Set digital pin 2 to low level, set digital pin 3 to high level, and set PWM pin 6 to 255.
7. The rangefinder system with controllable alarm distance according to claim 1, characterized in that, The system described is applicable to various motherboards.