{"id":2710,"date":"2025-05-30T14:07:50","date_gmt":"2025-05-30T06:07:50","guid":{"rendered":"https:\/\/lasersensor.net\/?p=2710"},"modified":"2026-02-28T17:35:01","modified_gmt":"2026-02-28T09:35:01","slug":"esp32-laser-distance-sensor-setup-and-applications","status":"publish","type":"post","link":"https:\/\/lasersensor.net\/ar\/esp32-laser-distance-sensor-setup-and-applications\/","title":{"rendered":"\u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0644\u0644\u064a\u0632\u0631 ESP32: \u0643\u064a\u0641\u064a\u0629 \u0627\u0644\u062a\u0648\u0635\u064a\u0644 \u0648\u0645\u0627 \u064a\u0645\u0643\u0646\u0643 \u0628\u0646\u0627\u0624\u0647"},"content":{"rendered":"<h2 class=\"wp-block-heading\">\u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0644\u0644\u064a\u0632\u0631 ESP32: \u0643\u064a\u0641\u064a\u0629 \u0627\u0644\u062a\u0648\u0635\u064a\u0644 \u0648\u0645\u0627 \u064a\u0645\u0643\u0646\u0643 \u0628\u0646\u0627\u0624\u0647<\/h2><h3 class=\"wp-block-heading\">\u0644\u0645\u062d\u0629 \u0639\u0627\u0645\u0629<\/h3><p>\u0641\u064a \u0639\u0627\u0644\u0645 \u0625\u0646\u062a\u0631\u0646\u062a \u0627\u0644\u0623\u0634\u064a\u0627\u0621 \u0648\u0627\u0644\u062a\u0637\u0648\u064a\u0631 \u0627\u0644\u0645\u0636\u0645\u0646\u060c \u0641\u0625\u0646 <strong>\u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0644\u0644\u064a\u0632\u0631 ESP32<\/strong> \u064a\u0628\u0631\u0632 \u0647\u0630\u0627 \u0627\u0644\u0645\u0632\u064a\u062c \u0643\u062d\u0644 \u0645\u062a\u0639\u062f\u062f \u0627\u0644\u0627\u0633\u062a\u062e\u062f\u0627\u0645\u0627\u062a \u0648\u0641\u0639\u0627\u0644 \u0645\u0646 \u062d\u064a\u062b \u0627\u0644\u062a\u0643\u0644\u0641\u0629 \u0644\u0642\u064a\u0627\u0633 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0641\u064a \u0627\u0644\u0648\u0642\u062a \u0627\u0644\u062d\u0642\u064a\u0642\u064a. \u0633\u0648\u0627\u0621\u064b \u0643\u0646\u062a \u062a\u0642\u0648\u0645 \u0628\u0625\u0646\u0634\u0627\u0621 \u0645\u0633\u0627\u0639\u062f \u0630\u0643\u064a \u0644\u0631\u0643\u0646 \u0627\u0644\u0633\u064a\u0627\u0631\u0627\u062a \u0623\u0648 \u0646\u0638\u0627\u0645 \u0645\u0644\u0627\u062d\u0629 \u0631\u0648\u0628\u0648\u062a \u0623\u0648 \u062c\u0647\u0627\u0632 \u0645\u0631\u0627\u0642\u0628\u0629 \u0635\u0646\u0627\u0639\u064a\u060c \u0641\u0625\u0646 \u0625\u0642\u0631\u0627\u0646 ESP32 \u0645\u0639 \u0645\u0633\u062a\u0634\u0639\u0631 \u0644\u064a\u0632\u0631 \u064a\u0645\u0646\u062d\u0643 \u0627\u0644\u0633\u0631\u0639\u0629 \u0648\u0627\u0644\u062f\u0642\u0629 \u0648\u0627\u0644\u062a\u062d\u0643\u0645 \u0627\u0644\u0644\u0627\u0633\u0644\u0643\u064a - \u0643\u0644 \u0630\u0644\u0643 \u0641\u064a \u0625\u0639\u062f\u0627\u062f \u0645\u062f\u0645\u062c.<\/p><p>\u0641\u064a \u0647\u0630\u0647 \u0627\u0644\u0645\u0642\u0627\u0644\u0629\u060c \u0633\u0646\u0637\u0644\u0639\u0643 \u0639\u0644\u0649 \u0643\u064a\u0641\u064a\u0629 \u062a\u0648\u0635\u064a\u0644 ESP32 \u0628\u0623\u0646\u0648\u0627\u0639 \u0645\u062e\u062a\u0644\u0641\u0629 \u0645\u0646 \u0645\u0633\u062a\u0634\u0639\u0631\u0627\u062a \u0627\u0644\u0644\u064a\u0632\u0631\u060c \u0648\u0633\u0646\u0639\u0631\u0636 \u0623\u0645\u062b\u0644\u0629 \u0639\u0644\u0649 \u0627\u0644\u062a\u0639\u0644\u064a\u0645\u0627\u062a \u0627\u0644\u0628\u0631\u0645\u062c\u064a\u0629\u060c \u0648\u0646\u0633\u062a\u0643\u0634\u0641 \u0646\u0648\u0639 \u0627\u0644\u062a\u0637\u0628\u064a\u0642\u0627\u062a \u0627\u0644\u062a\u064a \u064a\u0645\u0643\u0646\u0643 \u0625\u0646\u0634\u0627\u0624\u0647\u0627 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0647\u0630\u0627 \u0627\u0644\u0625\u0639\u062f\u0627\u062f \u0645\u062a\u0639\u062f\u062f \u0627\u0644\u0627\u0633\u062a\u062e\u062f\u0627\u0645\u0627\u062a.<\/p><div class=\"wp-block-uagb-image uagb-block-b619ee57 wp-block-uagb-image--layout-default wp-block-uagb-image--effect-static wp-block-uagb-image--align-none\"><figure class=\"wp-block-uagb-image__figure\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/05\/ESP32-laser-distance-sensor1.jpg\" alt=\"ESP32 laser distance sensor\" class=\"uag-image-2716\" width=\"800\" height=\"400\" title=\"\u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0644\u0644\u064a\u0632\u0631 ESP32\" role=\"img\" \/><\/figure><\/div><h3 class=\"wp-block-heading\">\u0645\u0627 \u0647\u0648 ESP32 \u0648\u0645\u0627 \u0627\u0644\u0630\u064a \u064a\u0645\u0643\u0646 \u0623\u0646 \u064a\u0641\u0639\u0644\u0647\u061f<\/h3><p>\u0625\u0646 <strong>ESP32<\/strong> \u0647\u0648 \u0645\u062a\u062d\u0643\u0645 \u062f\u0642\u064a\u0642 \u0642\u0648\u064a \u0648\u0645\u0646\u062e\u0641\u0636 \u0627\u0644\u062a\u0643\u0644\u0641\u0629 \u0637\u0648\u0631\u062a\u0647 \u0634\u0631\u0643\u0629 Espressif Systems. \u064a\u062a\u0645\u064a\u0632 \u0628\u062e\u0635\u0627\u0626\u0635:<\/p><ul class=\"wp-block-list\"><li><strong>\u0645\u0639\u0627\u0644\u062c \u062b\u0646\u0627\u0626\u064a \u0627\u0644\u0646\u0648\u0627\u0629 32 \u0628\u062a<\/strong><\/li>\n\n<li><strong>Wi-Fi \u0648Bluetooth (\u0643\u0644\u0627\u0633\u064a\u0643\u064a \u0648BLE)<\/strong> \u0645\u062f\u0645\u062c<\/li>\n\n<li>\u0648\u0627\u062c\u0647\u0627\u062a GPIOs \u0645\u062a\u0639\u062f\u062f\u0629 \u0648 UART \u0648 I2C \u0648 SPI \u0648 PWM \u0648 ADC<\/li>\n\n<li><strong>\u0623\u0648\u0636\u0627\u0639 \u0627\u0644\u0627\u0633\u062a\u0647\u0644\u0627\u0643 \u0627\u0644\u0645\u0646\u062e\u0641\u0636 \u0644\u0644\u0637\u0627\u0642\u0629<\/strong><\/li>\n\n<li>\u062f\u0639\u0645 \u0627\u0644\u0627\u062a\u0635\u0627\u0644 \u0627\u0644\u0633\u062d\u0627\u0628\u064a \u0648\u062a\u062d\u062f\u064a\u062b\u0627\u062a OTA (\u0639\u0628\u0631 \u0627\u0644\u0623\u062b\u064a\u0631)<\/li><\/ul><div class=\"wp-block-uagb-image uagb-block-02ff8815 wp-block-uagb-image--layout-default wp-block-uagb-image--effect-static wp-block-uagb-image--align-none\"><figure class=\"wp-block-uagb-image__figure\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/05\/ESP32-laser-sensor.jpg\" alt=\"ESP32\" class=\"uag-image-2711\" width=\"643\" height=\"643\" title=\"\u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0644\u064a\u0632\u0631 ESP32\" role=\"img\" \/><\/figure><\/div><p>\u0648\u0628\u0641\u0636\u0644 \u0642\u062f\u0631\u0627\u062a\u0647 \u0627\u0644\u0644\u0627\u0633\u0644\u0643\u064a\u0629 \u0648\u0627\u0644\u062f\u0639\u0645 \u0627\u0644\u0645\u062c\u062a\u0645\u0639\u064a \u0627\u0644\u0642\u0648\u064a\u060c \u064a\u064f\u0639\u062f ESP32 \u0645\u062b\u0627\u0644\u064a\u064b\u0627 \u0644\u0645\u0634\u0627\u0631\u064a\u0639 \u0625\u0646\u062a\u0631\u0646\u062a \u0627\u0644\u0623\u0634\u064a\u0627\u0621\u060c \u0648\u062a\u0643\u0627\u0645\u0644 \u0627\u0644\u0645\u0633\u062a\u0634\u0639\u0631\u0627\u062a\u060c \u0648\u062a\u0633\u062c\u064a\u0644 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a \u0641\u064a \u0627\u0644\u0648\u0642\u062a \u0627\u0644\u062d\u0642\u064a\u0642\u064a\u060c \u0648\u0623\u0646\u0638\u0645\u0629 \u0627\u0644\u0623\u062a\u0645\u062a\u0629.<\/p><h3 class=\"wp-block-heading\">\u0644\u0645\u0627\u0630\u0627 \u0627\u0644\u062c\u0645\u0639 \u0628\u064a\u0646 ESP32 \u0648\u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0644\u0644\u064a\u0632\u0631\u061f<\/h3><p>\u0639\u0646\u062f \u062f\u0645\u062c\u0647\u0627 \u0645\u0639 <strong>\u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0644\u0644\u064a\u0632\u0631<\/strong>\u060c \u064a\u0635\u0628\u062d ESP32 \u0645\u0646\u0635\u0629 \u0642\u064a\u0627\u0633 \u0630\u0643\u064a\u0629. \u064a\u0648\u0641\u0631 \u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0644\u064a\u0632\u0631 <strong>\u062f\u0642\u0629 \u0639\u0644\u0649 \u0645\u0633\u062a\u0648\u0649 \u0627\u0644\u0645\u0644\u064a\u0645\u062a\u0631<\/strong>\u0648\u0632\u0645\u0646 \u0627\u0633\u062a\u062c\u0627\u0628\u0629 \u0633\u0631\u064a\u0639\u060c \u0648\u0646\u0637\u0627\u0642 \u0628\u0639\u064a\u062f \u0627\u0644\u0645\u062f\u0649. \u0648\u0647\u0630\u0627 \u064a\u062c\u0639\u0644 <strong><a href=\"https:\/\/lasersensor.net\/ar\/product\/ldl-t-laser-distance-measurement-module\/\"><span style=\"color: #0693e3;\" class=\"stk-highlight\">\u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0644\u0644\u064a\u0632\u0631 esp32<\/span><\/a><\/strong> \u0625\u0639\u062f\u0627\u062f \u0645\u062b\u0627\u0644\u064a \u0644\u062a\u0637\u0628\u064a\u0642\u0627\u062a \u0645\u062b\u0644:<\/p><ul class=\"wp-block-list\"><li>\u0627\u0644\u0631\u0648\u0628\u0648\u062a\u0627\u062a \u0648\u0645\u0644\u0627\u062d\u0629 \u0627\u0644\u0637\u0627\u0626\u0631\u0627\u062a \u0628\u062f\u0648\u0646 \u0637\u064a\u0627\u0631<\/li>\n\n<li>\u0643\u0634\u0641 \u0627\u0644\u0639\u0648\u0627\u0626\u0642 \u0648\u0627\u0644\u062a\u0646\u0628\u064a\u0647\u0627\u062a \u0639\u0646 \u0642\u0631\u0628\u0647\u0627<\/li>\n\n<li>\u0627\u0644\u0623\u062a\u0645\u062a\u0629 \u0627\u0644\u0635\u0646\u0627\u0639\u064a\u0629 \u0648\u0645\u0646\u0627\u0637\u0642 \u0627\u0644\u0623\u0645\u0627\u0646 \u0627\u0644\u0635\u0646\u0627\u0639\u064a<\/li>\n\n<li>\u0627\u0644\u0623\u062c\u0647\u0632\u0629 \u0627\u0644\u0645\u0646\u0632\u0644\u064a\u0629 \u0627\u0644\u0630\u0643\u064a\u0629 (\u0639\u0644\u0649 \u0633\u0628\u064a\u0644 \u0627\u0644\u0645\u062b\u0627\u0644\u060c \u0642\u064a\u0627\u0633 \u0623\u0648\u0636\u0627\u0639 \u0627\u0644\u0623\u0628\u0648\u0627\u0628\/\u0627\u0644\u0646\u0648\u0627\u0641\u0630)<\/li>\n\n<li>\u0645\u0631\u0627\u0642\u0628\u0629 \u0645\u0633\u062a\u0648\u0649 \u0627\u0644\u062e\u0632\u0627\u0646\u0627\u062a \u0648\u0644\u0648\u062c\u0633\u062a\u064a\u0627\u062a \u0627\u0644\u0645\u0633\u062a\u0648\u062f\u0639\u0627\u062a<\/li><\/ul><div class=\"wp-block-uagb-image uagb-block-e9416595 wp-block-uagb-image--layout-default wp-block-uagb-image--effect-static wp-block-uagb-image--align-none\"><figure class=\"wp-block-uagb-image__figure\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/05\/ESP32-laser-distance-sensor.jpg\" alt=\"ESP32 laser distance sensor\" class=\"uag-image-2713\" width=\"723\" height=\"723\" title=\"\u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0644\u0644\u064a\u0632\u0631 ESP32\" role=\"img\" \/><\/figure><\/div><h3 class=\"wp-block-heading\">\u0645\u0627 \u0633\u062a\u062d\u062a\u0627\u062c \u0625\u0644\u064a\u0647<\/h3><p>\u0644\u0628\u0646\u0627\u0621 <strong>\u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0644\u064a\u0632\u0631 ESP32<\/strong> \u0627\u0644\u0646\u0638\u0627\u0645\u060c \u0642\u0645 \u0628\u0625\u0639\u062f\u0627\u062f \u0627\u0644\u0623\u062c\u0647\u0632\u0629 \u0627\u0644\u062a\u0627\u0644\u064a\u0629:<\/p><ul class=\"wp-block-list\"><li>1x \u0644\u0648\u062d\u0629 \u062a\u0637\u0648\u064a\u0631 1x ESP32<\/li>\n\n<li>1x \u0648\u062d\u062f\u0629 \u0627\u0633\u062a\u0634\u0639\u0627\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0644\u0644\u064a\u0632\u0631 (\u0639\u0644\u0649 \u0633\u0628\u064a\u0644 \u0627\u0644\u0645\u062b\u0627\u0644, <a href=\"https:\/\/lasersensor.net\/ar\/product\/1mm-high-precision-laser-distance-sensor\/\"><span style=\"color: #0693e3;\" class=\"stk-highlight\"><strong>\u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0627\u0644\u0644\u064a\u0632\u0631\u064a LDL \u0628\u0627\u0644\u0644\u064a\u0632\u0631<\/strong><\/span><\/a> \u0623\u0648 <a href=\"https:\/\/lasersensor.net\/ar\/product\/ts1224-1500m-laser-rangefinder-sensor\/\"><span style=\"color: #0693e3;\" class=\"stk-highlight\"><strong>\u0645\u0633\u062a\u0634\u0639\u0631 \u062a\u062d\u062f\u064a\u062f \u0627\u0644\u0645\u062f\u0649 \u0628\u0627\u0644\u0644\u064a\u0632\u0631 TS1224<\/strong><\/span><\/a>)<\/li>\n\n<li>\u0623\u0633\u0644\u0627\u0643 \u0627\u0644\u062a\u0648\u0635\u064a\u0644<\/li>\n\n<li>\u0627\u0644\u0644\u0648\u062d (\u0627\u062e\u062a\u064a\u0627\u0631\u064a)<\/li>\n\n<li>\u0645\u0635\u062f\u0631 \u0627\u0644\u0637\u0627\u0642\u0629 (3.3 \u0641\u0648\u0644\u062a \u0623\u0648 5 \u0641\u0648\u0644\u062a \u062d\u0633\u0628 \u0627\u0644\u0645\u0633\u062a\u0634\u0639\u0631)<\/li><\/ul><h3 class=\"wp-block-heading\">\u062f\u0644\u064a\u0644 \u0627\u0644\u0623\u0633\u0644\u0627\u0643: \u062a\u0648\u0635\u064a\u0644 ESP32 \u0628\u062c\u0647\u0627\u0632 \u0627\u0633\u062a\u0634\u0639\u0627\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0644\u0644\u064a\u0632\u0631<\/h3><h4 class=\"wp-block-heading\">\u0628\u0627\u0644\u0646\u0633\u0628\u0629 \u0644\u0645\u0633\u062a\u0634\u0639\u0631\u0627\u062a \u0627\u0644\u0644\u064a\u0632\u0631 I2C :<\/h4><ul class=\"wp-block-list\"><li><strong>VCC<\/strong> \u2192 ESP32 3.3 \u0641\u0648\u0644\u062a<\/li>\n\n<li><strong>GND<\/strong> \u2192 ESP32 GND<\/li>\n\n<li><strong>SDA<\/strong> \u2192 ESP3232 GPIO21<\/li>\n\n<li><strong>SCL<\/strong> \u2192 ESP3232 GPIO22<\/li><\/ul><h4 class=\"wp-block-heading\">\u0644\u0645\u0633\u062a\u0634\u0639\u0631\u0627\u062a \u0627\u0644\u0644\u064a\u0632\u0631 UART :<\/h4><ul class=\"wp-block-list\"><li><strong>VCC<\/strong> \u2192 ESP32 5 \u0641\u0648\u0644\u062a<\/li>\n\n<li><strong>GND<\/strong> \u2192 ESP32 GND<\/li>\n\n<li><strong>TX (\u0645\u0633\u062a\u0634\u0639\u0631)<\/strong> \u2192 ESP32 RX (\u0639\u0644\u0649 \u0633\u0628\u064a\u0644 \u0627\u0644\u0645\u062b\u0627\u0644\u060c GPIO16)<\/li>\n\n<li><strong>RX (\u0645\u0633\u062a\u0634\u0639\u0631)<\/strong> \u2192 ESP32 TX (\u0639\u0644\u0649 \u0633\u0628\u064a\u0644 \u0627\u0644\u0645\u062b\u0627\u0644\u060c GPIO17)<\/li><\/ul><div class=\"wp-block-uagb-image uagb-block-223666d2 wp-block-uagb-image--layout-default wp-block-uagb-image--effect-static wp-block-uagb-image--align-none\"><figure class=\"wp-block-uagb-image__figure\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/05\/Pin-Definitions-and-Wiring.jpg\" alt=\"\" class=\"uag-image-2714\" width=\"735\" height=\"735\" title=\"\u062a\u0639\u0631\u064a\u0641\u0627\u062a \u0627\u0644\u0633\u0646\u0648\u0646 \u0648\u0627\u0644\u0623\u0633\u0644\u0627\u0643\" role=\"img\" \/><\/figure><\/div><h4 class=\"wp-block-heading\">\u0644\u0623\u062c\u0647\u0632\u0629 \u0627\u0633\u062a\u0634\u0639\u0627\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0644\u0644\u064a\u0632\u0631 \u0627\u0644\u0635\u0646\u0627\u0639\u064a\u0629 RS485 \u0628\u0627\u0644\u0644\u064a\u0632\u0631 \u0627\u0644\u0635\u0646\u0627\u0639\u064a:<\/h4><p>\u0627\u0633\u062a\u062e\u062f\u0645 \u0645\u062d\u0648\u0644 RS485 \u0625\u0644\u0649 TTL\u060c \u062b\u0645 \u0642\u0645 \u0628\u062a\u0648\u0635\u064a\u0644 TX \u0648RX \u0627\u0644\u062e\u0627\u0635\u064a\u0646 \u0628\u0627\u0644\u0645\u062d\u0648\u0644 \u0628\u062f\u0628\u0627\u0628\u064a\u0633 ESP32 \u0627\u0644\u062a\u0633\u0644\u0633\u0644\u064a\u0629. \u064a\u0633\u0645\u062d RS485 \u0628\u0627\u0644\u0627\u062a\u0635\u0627\u0644 \u0627\u0644\u0645\u0633\u062a\u0642\u0631 \u0644\u0645\u0633\u0627\u0641\u0627\u062a \u0637\u0648\u064a\u0644\u0629 - \u0648\u0647\u0648 \u0645\u062b\u0627\u0644\u064a \u0644\u0644\u0628\u064a\u0626\u0627\u062a \u0627\u0644\u0635\u0646\u0627\u0639\u064a\u0629 \u0627\u0644\u0642\u0627\u0633\u064a\u0629.<\/p><h3 class=\"wp-block-heading\">\u0645\u062b\u0627\u0644 \u0639\u0644\u0649 \u0627\u0644\u0643\u0648\u062f: I2C \u0645\u0639 LDL<\/h3><pre class=\"wp-block-preformatted\"><code>#P5Tinclude<br>#P5Tinclude<br><br>Adafruit_VL53L0X lox = Adafruit_LDL();<br><br>\u0628\u0627\u0637\u0644\u0629 \u0627\u0644\u0625\u0639\u062f\u0627\u062f() {<br>  Serial.begin(115200);<br>  \u0633\u0644\u0643.\u064a\u0628\u062f\u0623();<br><br>  \u0625\u0630\u0627 (!lox.start())) {<br>    Serial.println(\"\u0641\u0634\u0644 \u062a\u0634\u063a\u064a\u0644 \u0645\u0633\u062a\u0634\u0639\u0631 LDL\");<br>    \u0628\u064a\u0646\u0645\u0627 (1);<br>  }<br>}<br><br>\u062d\u0644\u0642\u0629 \u0628\u0627\u0637\u0644\u0629() {<br>  LDL_RangingMeasurementData_t \u0642\u064a\u0627\u0633;<br>  lox.rangeTest(&amp;measure\u060c \u062e\u0637\u0623);<br><br>  \u0625\u0630\u0627 (\u0625\u0630\u0627 (\u0643\u0627\u0646 (RangeStatus.RangeStatus != 4) {<br>    Serial.print(\"\u0627\u0644\u0645\u0633\u0627\u0641\u0629 (\u0645\u0645): \");<br>    Serial.println(\u0642\u064a\u0627\u0633.RangeMilliMeter);<br>  } \u0648\u0625\u0644\u0627 {<br>    Serial.println(\"\u062e\u0627\u0631\u062c \u0627\u0644\u0646\u0637\u0627\u0642\");<br>  }<br><br>  \u062a\u0623\u062e\u064a\u0631(500);<br>}<br><\/code><\/pre><h3 class=\"wp-block-heading\">\u0645\u0627 \u0627\u0644\u0630\u064a \u064a\u0645\u0643\u0646\u0643 \u0628\u0646\u0627\u0621\u0647 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0644\u0644\u064a\u0632\u0631 ESP32\u061f<\/h3><p>\u0641\u064a\u0645\u0627 \u064a\u0644\u064a \u0628\u0639\u0636 \u0627\u0644\u062a\u0637\u0628\u064a\u0642\u0627\u062a \u0627\u0644\u0648\u0627\u0642\u0639\u064a\u0629 \u0644\u0640 <strong>\u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0644\u064a\u0632\u0631 esp32<\/strong> \u0627\u0644\u0625\u0639\u062f\u0627\u062f:<\/p><h4 class=\"wp-block-heading\">\u0623\u0646\u0638\u0645\u0629 \u0648\u0642\u0648\u0641 \u0627\u0644\u0633\u064a\u0627\u0631\u0627\u062a \u0627\u0644\u0630\u0643\u064a\u0629<\/h4><p>\u0627\u0644\u0643\u0634\u0641 \u0639\u0646 \u0648\u062c\u0648\u062f \u0623\u0648 \u0639\u062f\u0645 \u0648\u062c\u0648\u062f \u0645\u0631\u0643\u0628\u0627\u062a \u0641\u064a \u0623\u0645\u0627\u0643\u0646 \u0648\u0642\u0648\u0641 \u0627\u0644\u0633\u064a\u0627\u0631\u0627\u062a \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0642\u064a\u0627\u0633 \u0627\u0644\u0645\u0633\u0627\u0641\u0629.<\/p><h4 class=\"wp-block-heading\">\u062a\u062c\u0646\u0628 \u0627\u0644\u0639\u0642\u0628\u0627\u062a \u0623\u0645\u0627\u0645 \u0627\u0644\u0631\u0648\u0628\u0648\u062a\u0627\u062a<\/h4><p>\u0645\u0643\u0651\u0646 \u0631\u0648\u0628\u0648\u062a\u0643 \u0645\u0646 \u0627\u0643\u062a\u0634\u0627\u0641 \u0627\u0644\u062c\u062f\u0631\u0627\u0646 \u0623\u0648 \u0627\u0644\u0623\u062b\u0627\u062b \u0623\u0648 \u0627\u0644\u0623\u062c\u0633\u0627\u0645 \u0627\u0644\u0645\u062a\u062d\u0631\u0643\u0629 \u0648\u0627\u0644\u062a\u0646\u0642\u0644 \u0628\u0623\u0645\u0627\u0646.<\/p><h4 class=\"wp-block-heading\">\u0623\u062a\u0645\u062a\u0629 \u0627\u0644\u0645\u0646\u0632\u0644 \u0627\u0644\u0630\u0643\u064a<\/h4><p>\u0627\u0633\u062a\u062e\u062f\u0645 \u0627\u0644\u0645\u0633\u062a\u0634\u0639\u0631 \u0644\u0645\u0631\u0627\u0642\u0628\u0629 \u0627\u0644\u0623\u0628\u0648\u0627\u0628 \u0623\u0648 \u0627\u0644\u0623\u062f\u0631\u0627\u062c \u0623\u0648 \u062d\u062a\u0649 \u0644\u0642\u064a\u0627\u0633 \u0645\u0633\u062a\u0648\u064a\u0627\u062a \u0627\u0644\u0633\u0648\u0627\u0626\u0644 \u0641\u064a \u0627\u0644\u062e\u0632\u0627\u0646\u0627\u062a.<\/p><h4 class=\"wp-block-heading\">\u0645\u0631\u0627\u0642\u0628\u0629 \u0627\u0644\u0639\u0645\u0644\u064a\u0627\u062a \u0627\u0644\u0635\u0646\u0627\u0639\u064a\u0629<\/h4><p>\u062a\u062a\u0628\u0639 \u0627\u0644\u0645\u0633\u0627\u0641\u0627\u062a \u0641\u064a \u0627\u0644\u0622\u0644\u0627\u062a \u0627\u0644\u0622\u0644\u064a\u0629 \u0623\u0648 \u0623\u0646\u0638\u0645\u0629 \u0627\u0644\u062a\u062e\u0632\u064a\u0646 \u0644\u062a\u062d\u0633\u064a\u0646 \u0627\u0644\u0633\u0644\u0627\u0645\u0629 \u0648\u0627\u0644\u062a\u062d\u0643\u0645.<\/p><h4 class=\"wp-block-heading\">\u0645\u0633\u062c\u0644 \u0627\u0644\u0642\u064a\u0627\u0633 \u0627\u0644\u0644\u0627\u0633\u0644\u0643\u064a<\/h4><p>\u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u062a\u0642\u0646\u064a\u0629 Wi-Fi \u0623\u0648 Bluetooth\u060c \u064a\u0645\u0643\u0646\u0643 \u0646\u0642\u0644 \u0628\u064a\u0627\u0646\u0627\u062a \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0641\u064a \u0627\u0644\u0648\u0642\u062a \u0627\u0644\u0641\u0639\u0644\u064a \u0625\u0644\u0649 \u062a\u0637\u0628\u064a\u0642\u0627\u062a \u0627\u0644\u0623\u062c\u0647\u0632\u0629 \u0627\u0644\u0645\u062d\u0645\u0648\u0644\u0629 \u0623\u0648 \u0644\u0648\u062d\u0627\u062a \u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062a \u0627\u0644\u0633\u062d\u0627\u0628\u064a\u0629 \u0623\u0648 \u0642\u0648\u0627\u0639\u062f \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a \u0627\u0644\u0645\u062d\u0644\u064a\u0629.<\/p><div class=\"wp-block-uagb-image uagb-block-115e3e2c wp-block-uagb-image--layout-default wp-block-uagb-image--effect-static wp-block-uagb-image--align-none\"><figure class=\"wp-block-uagb-image__figure\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/03\/laser-distance-sensor-applications.jpg\" alt=\"laser distance sensor applications\" class=\"uag-image-2405\" width=\"553\" height=\"553\" title=\"\u062a\u0637\u0628\u064a\u0642\u0627\u062a \u0627\u0633\u062a\u0634\u0639\u0627\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0644\u0644\u064a\u0632\u0631\" role=\"img\" \/><\/figure><\/div><h3 class=\"wp-block-heading\">\u0627\u0644\u0623\u0641\u0643\u0627\u0631 \u0627\u0644\u0646\u0647\u0627\u0626\u064a\u0629<\/h3><p>\u0625\u0646 <strong>\u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0644\u0644\u064a\u0632\u0631 ESP32<\/strong> \u064a\u0639\u062f \u0627\u0644\u0625\u0639\u062f\u0627\u062f \u0623\u062f\u0627\u0629 \u0642\u0648\u064a\u0629 \u0644\u0644\u0645\u0647\u0646\u062f\u0633\u064a\u0646 \u0648\u0627\u0644\u0647\u0648\u0627\u0629 \u0648\u0645\u0637\u0648\u0631\u064a \u0625\u0646\u062a\u0631\u0646\u062a \u0627\u0644\u0623\u0634\u064a\u0627\u0621 \u0639\u0644\u0649 \u062d\u062f \u0633\u0648\u0627\u0621. \u0648\u0628\u0641\u0636\u0644 \u0627\u0644\u0627\u062a\u0635\u0627\u0644 \u0627\u0644\u0644\u0627\u0633\u0644\u0643\u064a \u0648\u0627\u0644\u0627\u0633\u062a\u0634\u0639\u0627\u0631 \u0627\u0644\u062f\u0642\u064a\u0642 \u0628\u0627\u0644\u0644\u064a\u0632\u0631 \u0648\u0627\u0644\u0628\u0631\u0645\u062c\u0629 \u0627\u0644\u0633\u0647\u0644\u0629\u060c \u064a\u0641\u062a\u062d \u0647\u0630\u0627 \u0627\u0644\u0645\u0632\u064a\u062c \u0625\u0645\u0643\u0627\u0646\u064a\u0627\u062a \u0644\u0627 \u062d\u0635\u0631 \u0644\u0647\u0627 - \u0645\u0646 \u0627\u0644\u0645\u0634\u0627\u0631\u064a\u0639 \u0627\u0644\u0645\u0646\u0632\u0644\u064a\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u0646\u0638\u0645\u0629 \u0627\u0644\u0635\u0646\u0627\u0639\u064a\u0629.<\/p><p>\u0633\u0648\u0627\u0621 \u0643\u0646\u062a \u0642\u062f \u0628\u062f\u0623\u062a \u0644\u0644\u062a\u0648 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 ESP32 \u0623\u0648 \u0643\u0646\u062a \u062a\u062a\u0637\u0644\u0639 \u0625\u0644\u0649 \u062a\u0648\u0633\u064a\u0639 \u0646\u0637\u0627\u0642 \u062d\u0644 \u0642\u064a\u0627\u0633\u060c \u0641\u0625\u0646 \u062f\u0645\u062c <strong>\u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0644\u064a\u0632\u0631 esp32<\/strong> \u062e\u064a\u0627\u0631 \u0630\u0643\u064a \u0648\u062c\u0627\u0647\u0632 \u0644\u0644\u0645\u0633\u062a\u0642\u0628\u0644.<\/p><p>\u0625\u0630\u0627 \u0643\u0646\u062a \u0645\u0647\u062a\u0645\u064b\u0627 \u0628\u062f\u0645\u062c <strong><a href=\"https:\/\/lasersensor.net\/ar\/product\/ldl-t-laser-distance-measurement-module\/\"><span style=\"color: #0693e3;\" class=\"stk-highlight\">\u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0644\u0644\u064a\u0632\u0631 ESP32<\/span><\/a><\/strong> \u0641\u064a \u0645\u0634\u0631\u0648\u0639\u0643 \u0627\u0644\u062a\u0627\u0644\u064a \u0623\u0648 \u0643\u0646\u062a \u0628\u062d\u0627\u062c\u0629 \u0625\u0644\u0649 \u0645\u0633\u0627\u0639\u062f\u0629 \u0641\u064a \u0627\u062e\u062a\u064a\u0627\u0631 \u0645\u0633\u062a\u0634\u0639\u0631 \u0627\u0644\u0644\u064a\u0632\u0631 \u0627\u0644\u0645\u0646\u0627\u0633\u0628 \u0644\u062a\u0637\u0628\u064a\u0642\u0643\u060c \u0641\u0644\u0627 \u062a\u062a\u0631\u062f\u062f \u0641\u064a \u0627\u0644\u062a\u0648\u0627\u0635\u0644 \u0645\u0639\u0646\u0627. \u0641\u0631\u064a\u0642\u0646\u0627 \u0627\u0644\u062a\u0642\u0646\u064a \u0639\u0644\u0649 \u0627\u0633\u062a\u0639\u062f\u0627\u062f \u0644\u062a\u0642\u062f\u064a\u0645 \u0627\u0644\u062a\u0648\u062c\u064a\u0647 \u0648\u062f\u0639\u0645 \u0627\u0644\u0645\u0646\u062a\u062c \u0648\u0627\u0644\u062d\u0644\u0648\u0644 \u0627\u0644\u0645\u0635\u0645\u0645\u0629 \u062e\u0635\u064a\u0635\u064b\u0627 \u0644\u062a\u0646\u0627\u0633\u0628 \u0627\u062d\u062a\u064a\u0627\u062c\u0627\u062a\u0643.<\/p><h3 class=\"wp-block-heading\">FAQ<\/h3><p><strong>Q1: Can a laser distance sensor be directly connected to an ESP32?<\/strong><br>Yes. Most laser distance sensors support UART or TTL interfaces, which can be directly connected to the ESP32 GPIO pins.<\/p><p><strong>Q2: Which interface works best with ESP32?<\/strong><br>UART is the most recommended interface due to stable communication and easy implementation on ESP32.<\/p><p><strong>Q3: Is level shifting required for ESP32?<\/strong><br>ESP32 uses 3.3V logic. Ensure the sensor output is 3.3V compatible or use a level shifter if the sensor operates at 5V TTL.<\/p><p><strong>Q4: What programming environment is commonly used?<\/strong><br>The Arduino IDE is widely used, and the ESP32 can read distance data through standard serial communication.<\/p><p><strong>Q5: What projects can be built with ESP32 and a laser distance sensor?<\/strong><br>Common projects include obstacle avoidance robots, smart level measurement, distance-based triggering systems, and IoT monitoring applications.<\/p><p><strong>\u0627\u0644\u0628\u0631\u064a\u062f \u0627\u0644\u0625\u0644\u0643\u062a\u0631\u0648\u0646\u064a:<\/strong> <a href=\"mailto:sales@lasersensor.net\"><span style=\"color: #0693e3;\" class=\"stk-highlight\">sales@lasersensor.net<\/span><\/a><br><strong>\u0627\u0644\u0645\u0648\u0642\u0639 \u0627\u0644\u0625\u0644\u0643\u062a\u0631\u0648\u0646\u064a:<\/strong> <span style=\"color: #0693e3;\" class=\"stk-highlight\">www.lasersensor.net<\/span><br><strong>\u0627\u0644\u0647\u0627\u062a\u0641:<\/strong> +86 15008368630<\/p><p>\u062f\u0639\u0646\u0627 \u0646\u0639\u0645\u0644 \u0645\u0639\u0627\u064b \u0644\u0646\u062c\u0639\u0644 \u0623\u0641\u0643\u0627\u0631\u0643 \u062a\u0646\u0628\u0636 \u0628\u0627\u0644\u062d\u064a\u0627\u0629 \u0628\u062f\u0642\u0629 \u0648\u0627\u0628\u062a\u0643\u0627\u0631.<\/p><p><\/p>","protected":false},"excerpt":{"rendered":"<p>ESP32 Laser Distance Sensor: How to Connect and What You Can Build Overview In the world of IoT and embedded development, the ESP32 laser distance sensor combination stands out as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2716,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[34],"tags":[],"class_list":["post-2710","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-industry-news"],"uagb_featured_image_src":{"full":["https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/05\/ESP32-laser-distance-sensor1.jpg",800,400,false],"thumbnail":["https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/05\/ESP32-laser-distance-sensor1-150x150.jpg",150,150,true],"medium":["https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/05\/ESP32-laser-distance-sensor1-300x150.jpg",300,150,true],"medium_large":["https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/05\/ESP32-laser-distance-sensor1-768x384.jpg",768,384,true],"large":["https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/05\/ESP32-laser-distance-sensor1.jpg",800,400,false],"1536x1536":["https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/05\/ESP32-laser-distance-sensor1.jpg",800,400,false],"2048x2048":["https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/05\/ESP32-laser-distance-sensor1.jpg",800,400,false],"trp-custom-language-flag":["https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/05\/ESP32-laser-distance-sensor1-18x9.jpg",18,9,true],"woocommerce_thumbnail":["https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/05\/ESP32-laser-distance-sensor1-300x300.jpg",300,300,true],"woocommerce_single":["https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/05\/ESP32-laser-distance-sensor1-600x300.jpg",600,300,true],"woocommerce_gallery_thumbnail":["https:\/\/lasersensor.net\/wp-content\/uploads\/2025\/05\/ESP32-laser-distance-sensor1-100x100.jpg",100,100,true]},"uagb_author_info":{"display_name":"mayerxiao01@gmail.com","author_link":"https:\/\/lasersensor.net\/ar\/author\/mayerxiao01gmail-com\/"},"uagb_comment_info":0,"uagb_excerpt":"ESP32 Laser Distance Sensor: How to Connect and What You Can Build Overview In the world of IoT and embedded development, the ESP32 laser distance sensor combination stands out as [&hellip;]","_links":{"self":[{"href":"https:\/\/lasersensor.net\/ar\/wp-json\/wp\/v2\/posts\/2710"}],"collection":[{"href":"https:\/\/lasersensor.net\/ar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lasersensor.net\/ar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lasersensor.net\/ar\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lasersensor.net\/ar\/wp-json\/wp\/v2\/comments?post=2710"}],"version-history":[{"count":2,"href":"https:\/\/lasersensor.net\/ar\/wp-json\/wp\/v2\/posts\/2710\/revisions"}],"predecessor-version":[{"id":3258,"href":"https:\/\/lasersensor.net\/ar\/wp-json\/wp\/v2\/posts\/2710\/revisions\/3258"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lasersensor.net\/ar\/wp-json\/wp\/v2\/media\/2716"}],"wp:attachment":[{"href":"https:\/\/lasersensor.net\/ar\/wp-json\/wp\/v2\/media?parent=2710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lasersensor.net\/ar\/wp-json\/wp\/v2\/categories?post=2710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lasersensor.net\/ar\/wp-json\/wp\/v2\/tags?post=2710"}],"curies":[{"name":"\u062f\u0628\u0644\u064a\u0648 \u0628\u064a","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}