{"id":3041,"date":"2024-12-09T17:05:54","date_gmt":"2024-12-09T09:05:54","guid":{"rendered":"https:\/\/meskernel.net\/?p=3041"},"modified":"2025-06-09T15:08:53","modified_gmt":"2025-06-09T07:08:53","slug":"%d9%86%d8%b8%d8%a7%d9%85-%d9%82%d9%8a%d8%a7%d8%b3-%d8%a7%d9%84%d9%85%d8%b3%d8%a7%d9%81%d8%a9","status":"publish","type":"post","link":"https:\/\/meskernel.net\/ar\/distance-measurement-system\/","title":{"rendered":"\u0643\u064a\u0641\u064a\u0629 \u0628\u0646\u0627\u0621 \u0646\u0638\u0627\u0645 \u0642\u064a\u0627\u0633 \u0627\u0644\u0645\u0633\u0627\u0641\u0629 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0627\u0644\u0623\u0631\u062f\u0648\u064a\u0646\u0648 \u0641\u064a 5 \u062e\u0637\u0648\u0627\u062a"},"content":{"rendered":"<h4 class=\"wp-block-heading\"><strong>\u0645\u0642\u062f\u0645\u0629<\/strong><\/h4>\n\n\n\n<p>\u062f\u0642\u064a\u0642 <a href=\"https:\/\/meskernel.net\/ar\/object-distance-measurement\/\">\u0642\u064a\u0627\u0633 \u0627\u0644\u0645\u0633\u0627\u0641\u0629<\/a> system plays a critical role in fields like robotics, automation, and IoT. The LDK laser sensor series stands out with its high precision, fast response times, and stable performance, making it the ideal choice for modern distance measurement system. By integrating an <a href=\"https:\/\/forum.arduino.cc\/t\/witch-sensor-do-you-recommend-for-my-project\/1334504\/6\" target=\"_blank\" rel=\"noopener\">\u0623\u0631\u062f\u0648\u064a\u0646\u0648<\/a> board with an LDK laser sensor, you can easily build an efficient and reliable distance measurement system tailored to your project needs. This guide explains how to achieve this goal in 5 simple steps, perfect for beginners and tech enthusiasts.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1. Introduction to LDK Laser Sensors<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.1 How LDK Laser Sensors Work<\/strong><\/h3>\n\n\n\n<p>\u0644.\u062f.\u0643 <a href=\"https:\/\/meskernel.net\/ar\/laser-sensors-for-railway\/\">\u0645\u0633\u062a\u0634\u0639\u0631\u0627\u062a \u0627\u0644\u0644\u064a\u0632\u0631<\/a> measure distance by emitting a laser beam, receiving the reflected light, and calculating the round-trip time of the beam to determine the object&#8217;s distance. Compared to traditional ultrasonic sensors, LDK sensors deliver higher accuracy and better adaptability in complex environments.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Measurement Process:<\/strong><\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Laser Emission:<\/strong> The sensor emits a laser beam toward the target.<\/li>\n\n\n\n<li><strong>Reflection Reception:<\/strong> The reflected beam returns to the sensor.<\/li>\n\n\n\n<li><strong>Time-Based Calculation:<\/strong> The sensor calculates the distance based on the round-trip time of the laser beam.<\/li>\n<\/ol>\n\n\n\n<p><strong>Recommended Models:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>LDK-20M:<\/strong> \u0645\u062b\u0627\u0644\u064a\u0629 \u0644\u0640 <a href=\"https:\/\/meskernel.net\/ar\/product\/%d8%ac%d9%87%d8%a7%d8%b2-%d8%a7%d8%b3%d8%aa%d8%b4%d8%b9%d8%a7%d8%b1-%d8%a7%d9%84%d9%85%d8%b3%d8%a7%d9%81%d8%a9-%d8%a8%d8%a7%d9%84%d9%84%d9%8a%d8%b2%d8%b1-tof\/\">mid-range measurements<\/a>, commonly used in industrial scenarios.<\/li>\n\n\n\n<li><strong>LDK-50M:<\/strong> Suitable for <a href=\"https:\/\/meskernel.net\/ar\/product\/laser-ranging-sensor-ptfs-700m\/\">long-range precision measurements<\/a>, even in bright outdoor conditions.<\/li>\n\n\n\n<li><strong>LDK-100M:<\/strong> Designed for <a href=\"https:\/\/meskernel.net\/ar\/product\/proximity-sensor\/\">ultra-long-distance measurements<\/a> in large-scale industrial monitoring.<\/li>\n<\/ul>\n\n\n\n<p>\ud83d\udc49 <strong><a href=\"https:\/\/meskernel.net\/ar\/%d8%a7%d9%84%d9%85%d9%86%d8%aa%d8%ac%d8%a7%d8%aa\/\">Explore more about LDK laser sensor products<\/a><\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2. Connecting the LDK Laser Sensor to Arduino<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.1 Required Components<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/meskernel.net\/ar\/arduino-laser-distance-modules\/\">\u0623\u0631\u062f\u0648\u064a\u0646\u0648<\/a> Board:<\/strong> Arduino Uno or Nano works well.<\/li>\n\n\n\n<li><strong>LDK Laser Sensor:<\/strong> Example models like LDK-20M or LDK-50M.<\/li>\n\n\n\n<li><strong>Jumper Wires:<\/strong> For connections.<\/li>\n\n\n\n<li><strong>Power Source:<\/strong> USB power or an external battery.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.2 Wiring Instructions<\/strong><\/h3>\n\n\n\n<p>Using LDK-20M as an example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>VCC:<\/strong> Connect to Arduino&#8217;s <strong>5V<\/strong> (or 3.3V, depending on the sensor).<\/li>\n\n\n\n<li><strong>GND:<\/strong> Connect to Arduino <strong>GND<\/strong>.<\/li>\n\n\n\n<li><strong>SDA:<\/strong> Connect to Arduino&#8217;s <strong>A4<\/strong> (on Uno).<\/li>\n\n\n\n<li><strong>SCL:<\/strong> Connect to Arduino&#8217;s <strong>A5<\/strong> (on Uno).<\/li>\n<\/ul>\n\n\n\n<p><strong>Wiring Tip:<\/strong><br>Double-check each connection to ensure stability and prevent errors.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.3 Real-World Example: Smart Warehouse System<\/strong><\/h3>\n\n\n\n<p>In a smart warehouse project, the LDK-20M laser sensor accurately measured shelf spacing, optimizing storage space and reducing errors during item placement. <a href=\"https:\/\/meskernel.net\/ar\/%d8%a7%d9%84%d9%85%d8%af%d9%88%d9%86%d8%a9\/\">See the full case study<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>3. Writing the Arduino Code<\/strong><\/h2>\n\n\n\n<p>Upload the following code to your <strong>Arduino IDE<\/strong> to read distance measurements from the LDK sensor and display the results in real-time.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;Wire.h&gt;\n\nvoid setup() {\n  Serial.begin(9600);\n  Wire.begin();\n}\n\nvoid loop() {\n  Wire.beginTransmission(0x29); \/\/ LDK sensor I2C address\n  Wire.write(0x00); \/\/ Request measurement data\n  Wire.endTransmission();\n  Wire.requestFrom(0x29, 2); \/\/ Read 2 bytes of data\n\n  if (Wire.available() == 2) {\n    uint16_t distance = Wire.read() &lt;&lt; 8 | Wire.read();\n    Serial.print(\"Distance: \");\n    Serial.print(distance);\n    Serial.println(\" mm\");\n  }\n\n  delay(500);\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.1 Code Explanation<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>I2C Communication:<\/strong> \u0625\u0646 <code>Wire<\/code> library handles communication between Arduino and the LDK sensor.<\/li>\n\n\n\n<li><strong>Distance Measurement:<\/strong> The code retrieves and displays real-time distance data.<\/li>\n\n\n\n<li><strong>Serial Monitor:<\/strong> Results appear on the serial monitor in millimeters.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>4. Testing<\/strong> \u0646\u0638\u0627\u0645 \u0642\u064a\u0627\u0633 \u0627\u0644\u0645\u0633\u0627\u0641\u0629<\/h2>\n\n\n\n<p>After uploading the code:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Connect the Arduino to your computer.<\/li>\n\n\n\n<li>Open the Serial Monitor and set the baud rate to <strong>9600<\/strong>.<\/li>\n\n\n\n<li>Move an object closer or farther from the sensor and observe the displayed measurements.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"521\" src=\"https:\/\/meskernel.net\/wp-content\/uploads\/2024\/11\/Test-Software-Platform-1024x521.jpg\" alt=\"Test Software Platform\" class=\"wp-image-2964\" srcset=\"https:\/\/meskernel.net\/wp-content\/uploads\/2024\/11\/Test-Software-Platform-1024x521.jpg 1024w, https:\/\/meskernel.net\/wp-content\/uploads\/2024\/11\/Test-Software-Platform-300x153.jpg 300w, https:\/\/meskernel.net\/wp-content\/uploads\/2024\/11\/Test-Software-Platform-768x390.jpg 768w, https:\/\/meskernel.net\/wp-content\/uploads\/2024\/11\/Test-Software-Platform-1536x781.jpg 1536w, https:\/\/meskernel.net\/wp-content\/uploads\/2024\/11\/Test-Software-Platform-400x203.jpg 400w, https:\/\/meskernel.net\/wp-content\/uploads\/2024\/11\/Test-Software-Platform.jpg 1776w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Test Software Platform<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.1 Real-World Application: Robot Obstacle Avoidance<\/strong><\/h3>\n\n\n\n<p>A robotics <a href=\"https:\/\/meskernel.net\/ar\/navigation-distance-sensor\/\">\u0627\u0644\u0645\u0644\u0627\u062d\u0629<\/a> system implemented the LDK-50M laser sensor to detect obstacles dynamically, improving real-time navigation performance. <a href=\"https:\/\/meskernel.net\/ar\/%d8%a7%d9%84%d9%85%d9%86%d8%aa%d8%ac%d8%a7%d8%aa\/\">Learn more here<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>5. Practical Applications of Your Distance Measurement System<\/strong><\/h2>\n\n\n\n<p>Your Arduino + LDK laser sensor distance Measurement system supports a variety of real-world applications:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u0627\u0644\u0623\u062a\u0645\u062a\u0629 \u0627\u0644\u0635\u0646\u0627\u0639\u064a\u0629:<\/strong> Monitor equipment spacing to prevent collisions.<\/li>\n\n\n\n<li><strong>Smart Robotics:<\/strong> Enable accurate obstacle <a href=\"https:\/\/meskernel.net\/ar\/animal-detection\/\">\u0627\u0644\u0643\u0634\u0641<\/a> and avoidance.<\/li>\n\n\n\n<li><strong>Warehouse Management:<\/strong> Optimize storage space with precise distance measurements.<\/li>\n\n\n\n<li><strong>\u0627\u0644\u0631\u0635\u062f \u0627\u0644\u0628\u064a\u0626\u064a:<\/strong> Use laser sensors for 3D mapping and <a href=\"https:\/\/meskernel.net\/ar\/lidar\/\">\u0627\u0644\u0645\u0633\u062d<\/a>.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Next Step: Tailor Your Laser Distance<\/strong> <strong>Measurement Solution<\/strong><\/h3>\n\n\n\n<p>If you&#8217;re seeking high-precision, reliable <a href=\"https:\/\/meskernel.net\/ar\/laser-distance-sensors\/\">\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<\/a>, our LDK series offers the perfect solution. We also provide OEM\/ODM customization services to meet your specific project requirements.<\/p>\n\n\n\n<p>\ud83d\udc49 <a style=\"font-weight: bold;\" href=\"https:\/\/meskernel.net\/ar\/%d8%a7%d9%84%d8%a7%d8%aa%d8%b5%d8%a7%d9%84\/\">Contact us now for expert laser distance<\/a> <strong><a href=\"https:\/\/meskernel.net\/ar\/%d8%a7%d9%84%d8%a7%d8%aa%d8%b5%d8%a7%d9%84\/\">measurement solutions!<\/a><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-meskernel wp-block-embed-meskernel\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"iC5rM16Snd\"><a href=\"https:\/\/meskernel.net\/ar\/object-distance-measurement\/\">\u062f\u0644\u064a\u0644 \u0644\u0623\u062a\u0645\u062a\u0629 \u0642\u064a\u0627\u0633 \u0645\u0633\u0627\u0641\u0629 \u0627\u0644\u0623\u062c\u0633\u0627\u0645 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0645\u0633\u062a\u0634\u0639\u0631\u0627\u062a \u0648\u0643\u0627\u0645\u064a\u0631\u0627\u062a \u0627\u0644\u0644\u064a\u0632\u0631<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"\u300a Guide to Automating Object Distance Measurement with Laser Sensors &amp; Cameras \u300b\u2014Meskernel\" src=\"https:\/\/meskernel.net\/object-distance-measurement\/embed\/#?secret=t6lEQ4cL5C#?secret=iC5rM16Snd\" data-secret=\"iC5rM16Snd\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>","protected":false},"excerpt":{"rendered":"<p>Learn how to build a simple and accurate distance measurement system using an Arduino board and a laser distance sensor. This guide walks you through the hardware setup, wiring, and coding in 5 easy steps, making it perfect for beginners and DIY enthusiasts looking to explore laser sensing technology.<\/p>","protected":false},"author":1,"featured_media":3042,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","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":"","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":"default","ast-page-background-enabled":"default","ast-page-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":"","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-5)","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-5)","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-5)","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":[49],"tags":[],"class_list":["post-3041","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-solution"],"_links":{"self":[{"href":"https:\/\/meskernel.net\/ar\/wp-json\/wp\/v2\/posts\/3041","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meskernel.net\/ar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meskernel.net\/ar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meskernel.net\/ar\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/meskernel.net\/ar\/wp-json\/wp\/v2\/comments?post=3041"}],"version-history":[{"count":0,"href":"https:\/\/meskernel.net\/ar\/wp-json\/wp\/v2\/posts\/3041\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/meskernel.net\/ar\/wp-json\/wp\/v2\/media\/3042"}],"wp:attachment":[{"href":"https:\/\/meskernel.net\/ar\/wp-json\/wp\/v2\/media?parent=3041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meskernel.net\/ar\/wp-json\/wp\/v2\/categories?post=3041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meskernel.net\/ar\/wp-json\/wp\/v2\/tags?post=3041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}