{"id":620,"date":"2026-06-11T13:29:19","date_gmt":"2026-06-11T05:29:19","guid":{"rendered":"https:\/\/projectleon.net\/make\/blog\/ugv-emergency-brake-tof-vl53l1x-obstacle-stop-farsi\/"},"modified":"2026-06-11T13:29:20","modified_gmt":"2026-06-11T05:29:20","slug":"ugv-emergency-brake-tof-vl53l1x-obstacle-stop-farsi","status":"publish","type":"post","link":"https:\/\/projectleon.net\/make\/blog\/ugv-emergency-brake-tof-vl53l1x-obstacle-stop-farsi\/","title":{"rendered":"\u0633\u0627\u062e\u062a \u0633\u06cc\u0633\u062a\u0645 \u062a\u0631\u0645\u0632 \u0627\u0636\u0637\u0631\u0627\u0631\u06cc \u0628\u0631\u0627\u06cc UGV \u0628\u0627 \u0633\u0646\u0633\u0648\u0631 \u0641\u0627\u0635\u0644\u0647 ToF VL53L1X (\u0641\u0627\u0631\u0633\u06cc)"},"content":{"rendered":"<div class='hero-image-container' style='margin-bottom:28px;border-radius:14px;overflow:hidden;box-shadow:0 4px 18px rgba(0,0,0,0.08)'>\n<img src='https:\/\/projectleon.net\/make\/wp-content\/uploads\/2026\/06\/post105-vl53l1x-ugv.jpg' alt='VL53L1X ToF UGV \u062a\u0631\u0645\u0632 \u0627\u0636\u0637\u0631\u0627\u0631\u06cc \u0645\u0627\u0646\u0639' style='width:100%;height:auto;display:block' loading='eager'\/>\n<\/div>\n<div class='beginner-intro' style='background:#f0f7ff;border-right:4px solid #2e5fb6;padding:16px 20px;border-radius:10px;margin-bottom:22px'>\n<h2 style='margin-top:0'>\u0633\u0646\u0633\u0648\u0631 ToF VL53L1X \u0686\u06cc\u0633\u062a\u061f (\u0645\u0628\u062a\u062f\u06cc)<\/h2>\n<p>\u0633\u0646\u0633\u0648\u0631 <strong>VL53L1X<\/strong> \u0627\u0632 STMicroelectronics \u06cc\u06a9 \u0633\u0646\u0633\u0648\u0631 <strong>ToF<\/strong> (Time of Flight \u2014 \u0632\u0645\u0627\u0646 \u067e\u0631\u0648\u0627\u0632 \u0646\u0648\u0631) \u0627\u0633\u062a \u06a9\u0647 \u0628\u0627 \u0627\u0631\u0633\u0627\u0644 \u067e\u0627\u0644\u0633 \u0644\u06cc\u0632\u0631 \u0646\u0627\u062f\u06cc\u062f\u0646\u06cc \u0648 \u0627\u0646\u062f\u0627\u0632\u0647\u200c\u06af\u06cc\u0631\u06cc \u0632\u0645\u0627\u0646 \u0628\u0627\u0632\u06af\u0634\u062a \u0622\u0646\u060c \u0641\u0627\u0635\u0644\u0647 \u0631\u0627 \u0628\u0627 \u062f\u0642\u062a <strong>\u00b1\u06f1 \u0645\u06cc\u0644\u06cc\u200c\u0645\u062a\u0631<\/strong> \u062f\u0631 \u0628\u0631\u062f \u062a\u0627 \u06f4 \u0645\u062a\u0631 \u0627\u0646\u062f\u0627\u0632\u0647 \u0645\u06cc\u200c\u06af\u06cc\u0631\u062f \u2014 \u06f1\u06f0 \u0628\u0631\u0627\u0628\u0631 \u062f\u0642\u06cc\u0642\u200c\u062a\u0631 \u0627\u0632 \u0633\u0648\u0646\u0627\u0631 HC-SR04!<\/p>\n<p>\u0627\u06cc\u0646 \u0633\u0646\u0633\u0648\u0631 \u0627\u0632 I2C \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 SparkFun \u062f\u0627\u0631\u062f. \u0628\u0627 \u0646\u0635\u0628 \u0622\u0646 \u0631\u0648\u06cc \u062c\u0644\u0648\u06cc UGV \u0648 \u062a\u0646\u0638\u06cc\u0645 \u0622\u0633\u062a\u0627\u0646\u0647 \u0641\u0627\u0635\u0644\u0647 (\u0645\u062b\u0644\u0627\u064b \u06f3\u06f0cm)\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u06cc\u06a9 \u0633\u06cc\u0633\u062a\u0645 \u062a\u0631\u0645\u0632 \u0627\u0636\u0637\u0631\u0627\u0631\u06cc \u0633\u0627\u062e\u062a \u06a9\u0647 \u0642\u0628\u0644 \u0627\u0632 \u0628\u0631\u062e\u0648\u0631\u062f \u0628\u0627 \u0645\u0627\u0646\u0639\u060c UGV \u0631\u0627 \u0645\u062a\u0648\u0642\u0641 \u06a9\u0646\u062f.<\/p>\n<\/div>\n<div style='border:1px solid #d8d8d8;padding:18px 20px;border-radius:12px;background:#fafafa;margin-bottom:22px'>\n<h2 style='margin-top:0'>\u0645\u062d\u0635\u0648\u0644\u06cc \u06a9\u0647 \u0645\u06cc\u200c\u0633\u0627\u0632\u06cc\u062f<\/h2>\n<p>\u0633\u06cc\u0633\u062a\u0645 \u062a\u0631\u0645\u0632 \u0627\u0636\u0637\u0631\u0627\u0631\u06cc UGV \u0628\u0627 VL53L1X \u2014 \u0627\u062a\u0648\u0645\u0627\u062a\u06cc\u06a9 \u0645\u062a\u0648\u0642\u0641 \u0645\u06cc\u200c\u0634\u0648\u062f.<\/p>\n<ul>\n<li><strong>\u0647\u0632\u06cc\u0646\u0647 \u0633\u0646\u0633\u0648\u0631:<\/strong> \u06f5-\u06f8 \u062f\u0644\u0627\u0631<\/li>\n<li><strong>\u062f\u0642\u062a \u0641\u0627\u0635\u0644\u0647:<\/strong> \u00b1\u06f1mm<\/li>\n<li><strong>\u0632\u0645\u0627\u0646 \u0648\u0627\u06a9\u0646\u0634:<\/strong> \u0632\u06cc\u0631 \u06f5\u06f0ms<\/li>\n<\/ul>\n<\/div>\n<p><svg viewBox='0 0 860 180' width='100%' xmlns='http:\/\/www.w3.org\/2000\/svg' style='background:#fff;border:1px solid #e0e0e0;border-radius:12px;margin-bottom:22px'>\n<rect x='40' y='60' width='200' height='80' rx='14' fill='#f7d794' stroke='#a06d00' stroke-width='2'\/>\n<text x='140' y='95' text-anchor='middle' font-size='12' font-family='Tahoma'>UGV<\/text>\n<text x='140' y='112' text-anchor='middle' font-size='10' font-family='Tahoma'>VL53L1X \u062c\u0644\u0648<\/text>\n<line x1='240' y1='100' x2='400' y2='100' stroke='#e53935' stroke-width='2' stroke-dasharray='5,3'\/>\n<text x='320' y='93' text-anchor='middle' font-size='11' font-family='Tahoma' fill='#e53935'>\u0644\u06cc\u0632\u0631 IR<\/text>\n<rect x='400' y='60' width='100' height='80' rx='10' fill='#8d6e63' stroke='#37474f' stroke-width='2'\/>\n<text x='450' y='100' text-anchor='middle' font-size='11' font-family='Tahoma' fill='#fff'>\u0645\u0627\u0646\u0639<\/text>\n<line x1='400' y1='100' x2='240' y2='100' stroke='#4caf50' stroke-width='2' stroke-dasharray='3,2'\/>\n<text x='580' y='93' text-anchor='middle' font-size='10' font-family='Tahoma' fill='#555'>dist=25cm<\/text>\n<text x='580' y='108' text-anchor='middle' font-size='10' font-family='Tahoma' fill='#e53935'>STOP!<\/text>\n<text x='430' y='165' text-anchor='middle' font-size='12' font-family='Tahoma' fill='#888'>VL53L1X \u2014 \u0644\u06cc\u0632\u0631 ToF\u060c \u06f4m \u0628\u0631\u062f\u060c \u00b1\u06f1mm\u060c \u062a\u0631\u0645\u0632 \u062f\u0631 \u06f3\u06f0cm<\/text>\n<\/svg><\/p>\n<h2>\u06a9\u062f \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u2014 \u062a\u0631\u0645\u0632 \u0627\u0636\u0637\u0631\u0627\u0631\u06cc<\/h2>\n<pre style='background:#1e1e1e;color:#d4d4d4;padding:14px;border-radius:10px;overflow-x:auto;font-size:13px'><code class='language-cpp'>\n#include &lt;Wire.h&gt;\n#include &lt;SparkFun_VL53L1X.h&gt;\n\nSFEVL53L1X distanceSensor;\n\nconst int L_F=6,L_B=7,R_F=8,R_B=9;\nconst int STOP_DIST = 300;   \/\/ mm \u2014 \u062a\u0648\u0642\u0641 \u062f\u0631 \u06f3\u06f0cm\nconst int SLOW_DIST = 600;   \/\/ mm \u2014 \u06a9\u0627\u0647\u0634 \u0633\u0631\u0639\u062a \u062f\u0631 \u06f6\u06f0cm\n\nvoid motors(int lf,int lb,int rf,int rb) {\n  digitalWrite(L_F,lf); digitalWrite(L_B,lb);\n  digitalWrite(R_F,rf); digitalWrite(R_B,rb);\n}\n\nvoid setup() {\n  Wire.begin();\n  distanceSensor.begin();\n  distanceSensor.setTimingBudgetInMs(20);  \/\/ 20ms \u2192 50Hz\n  distanceSensor.setIntermeasurementPeriod(22);\n  distanceSensor.startRanging();\n  int pins[]={L_F,L_B,R_F,R_B};\n  for(int p:pins) pinMode(p,OUTPUT);\n}\n\nvoid loop() {\n  if(distanceSensor.checkForDataReady()) {\n    int dist = distanceSensor.getDistance();\n    distanceSensor.clearInterrupt();\n\n    if(dist < STOP_DIST) {\n      motors(0,0,0,0);       \/\/ \u062a\u0648\u0642\u0641 \u0627\u0636\u0637\u0631\u0627\u0631\u06cc\n      Serial.println(\"EMERGENCY STOP: \" + String(dist) + \"mm\");\n    } else if(dist < SLOW_DIST) {\n      \/\/ \u06a9\u0627\u0647\u0634 \u0633\u0631\u0639\u062a (PWM analogWrite)\n      analogWrite(9,  map(dist,STOP_DIST,SLOW_DIST,100,255));\n      analogWrite(11, map(dist,STOP_DIST,SLOW_DIST,100,255));\n      motors(1,0,1,0);\n    } else {\n      motors(1,0,1,0);   \/\/ \u0633\u0631\u0639\u062a \u06a9\u0627\u0645\u0644\n    }\n  }\n}\n<\/code><\/pre>\n<h2>\u0645\u0642\u0627\u06cc\u0633\u0647 \u0633\u0646\u0633\u0648\u0631\u0647\u0627\u06cc \u0641\u0627\u0635\u0644\u0647 \u0628\u0631\u0627\u06cc UGV<\/h2>\n<table style='width:100%;border-collapse:collapse;margin-bottom:18px'>\n<thead>\n<tr style='background:#e8f0fe'>\n<th style='padding:9px;border:1px solid #ddd;text-align:right'>\u0633\u0646\u0633\u0648\u0631<\/th>\n<th style='padding:9px;border:1px solid #ddd;text-align:right'>\u062f\u0642\u062a<\/th>\n<th style='padding:9px;border:1px solid #ddd;text-align:right'>\u0628\u0631\u062f<\/th>\n<th style='padding:9px;border:1px solid #ddd;text-align:right'>\u0645\u0646\u0627\u0633\u0628<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>HC-SR04 (\u0633\u0648\u0646\u0627\u0631)<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u00b1\u06f3mm<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u06f2cm-\u06f4m<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0627\u0642\u062a\u0635\u0627\u062f\u06cc<\/td>\n<\/tr>\n<tr style='background:#fafafa'>\n<td style='padding:8px;border:1px solid #ddd'>VL53L0X<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u00b1\u06f3mm<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u062a\u0627 \u06f2m<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0645\u062d\u06cc\u0637 \u062f\u0627\u062e\u0644\u06cc<\/td>\n<\/tr>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>VL53L1X \u2713<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u00b1\u06f1mm<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u062a\u0627 \u06f4m<\/td>\n<td style='padding:8px;border:1px solid #ddd'>UGV \u0628\u0647\u062a\u0631\u06cc\u0646<\/td>\n<\/tr>\n<tr style='background:#fafafa'>\n<td style='padding:8px;border:1px solid #ddd'>TF-Mini LiDAR<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u00b1\u06f1cm<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u062a\u0627 \u06f1\u06f2m<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u062f\u0648\u0631\u0628\u0631\u062f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><svg viewBox='0 0 860 200' width='100%' xmlns='http:\/\/www.w3.org\/2000\/svg' style='background:#fff;border:1px solid #e0e0e0;border-radius:12px;margin-bottom:22px'>\n<rect x='40' y='75' width='155' height='60' rx='12' fill='#f7c6c6' stroke='#a03030' stroke-width='2'\/>\n<rect x='245' y='75' width='155' height='60' rx='12' fill='#f7d794' stroke='#a06d00' stroke-width='2'\/>\n<rect x='450' y='75' width='155' height='60' rx='12' fill='#b7e4a0' stroke='#3a7a1e' stroke-width='2'\/>\n<rect x='655' y='75' width='165' height='60' rx='12' fill='#e8f4ff' stroke='#3a60c0' stroke-width='2'\/>\n<line x1='195' y1='105' x2='245' y2='105' stroke='#555' stroke-width='2.5'\/>\n<line x1='400' y1='105' x2='450' y2='105' stroke='#555' stroke-width='2.5'\/>\n<line x1='605' y1='105' x2='655' y2='105' stroke='#555' stroke-width='2.5'\/>\n<text x='117' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>VL53L1X<\/text>\n<text x='117' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>I2C 50Hz<\/text>\n<text x='322' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>Arduino<\/text>\n<text x='322' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>Threshold Logic<\/text>\n<text x='527' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>L298N<\/text>\n<text x='527' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>PWM \u06a9\u0627\u0647\u0634<\/text>\n<text x='737' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>UGV \u062a\u0648\u0642\u0641<\/text>\n<text x='737' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>\u0627\u06cc\u0645\u0646 \u06f3\u06f0cm<\/text>\n<text x='430' y='175' text-anchor='middle' font-size='13' font-family='Tahoma' fill='#666'>VL53L1X \u2014 ToF \u00b1\u06f1mm \u2192 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u2192 \u062a\u0631\u0645\u0632 \u0627\u0636\u0637\u0631\u0627\u0631\u06cc UGV<\/text>\n<\/svg><\/p>\n<h2>\u0648\u06cc\u062f\u0626\u0648\u0647\u0627\u06cc \u0622\u0645\u0648\u0632\u0634\u06cc<\/h2>\n<div style='display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:18px;margin:20px 0'>\n<iframe width='100%' height='315' src='https:\/\/www.youtube.com\/embed\/REQPbMpgJLg' title='VL53L1X ToF Sensor Arduino Tutorial' frameborder='0' allow='accelerometer;autoplay;clipboard-write;encrypted-media;gyroscope;picture-in-picture' allowfullscreen><\/iframe><br \/>\n<iframe width='100%' height='315' src='https:\/\/www.youtube.com\/embed\/ANfTLbJhNeo' title='ToF Sensor UGV Obstacle Avoidance' frameborder='0' allow='accelerometer;autoplay;clipboard-write;encrypted-media;gyroscope;picture-in-picture' allowfullscreen><\/iframe>\n<\/div>\n<h2>\u0645\u0646\u0627\u0628\u0639 \u0628\u06cc\u0634\u062a\u0631<\/h2>\n<ul>\n<li><a href='https:\/\/www.aparat.com\/result\/VL53L1X_%D8%B3%D9%86%D8%B3%D9%88%D8%B1_%D9%81%D8%A7%D8%B5%D9%84%D9%87_%D8%A2%D8%B1%D8%AF%D9%88%DB%8C%D9%86%D9%88' target='_blank'>\u0622\u067e\u0627\u0631\u0627\u062a: VL53L1X \u0633\u0646\u0633\u0648\u0631 \u0641\u0627\u0635\u0644\u0647 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0641\u0627\u0631\u0633\u06cc<\/a><\/li>\n<li><a href='https:\/\/github.com\/sparkfun\/SparkFun_VL53L1X_Arduino_Library' target='_blank'>SparkFun: VL53L1X Arduino Library<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u0622\u0645\u0648\u0632\u0634 \u0646\u0635\u0628 \u0633\u0646\u0633\u0648\u0631 ToF VL53L1X (\u062f\u0642\u062a \u06f1mm\u060c \u06f4m \u0628\u0631\u062f) \u0631\u0648\u06cc UGV \u0628\u0631\u0627\u06cc \u062a\u0648\u0642\u0641 \u0627\u062a\u0648\u0645\u0627\u062a\u06cc\u06a9 \u062f\u0631 \u0646\u0632\u062f\u06cc\u06a9\u06cc \u0645\u0648\u0627\u0646\u0639\u061b \u062a\u0646\u0638\u06cc\u0645 Zone, Threshold\u060c \u0645\u0642\u0627\u06cc\u0633\u0647 \u0628\u0627 \u0633\u0648\u0646\u0627\u0631 HC-SR04.<\/p>\n","protected":false},"author":1,"featured_media":619,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[16,20],"tags":[409,48,408,21,50,411,410,412],"class_list":["post-620","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ugv","category-projects-2","tag-tof","tag-ugv","tag-vl53l1x","tag-arduino","tag-50","tag-411","tag-410","tag-412"],"_links":{"self":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/620","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/comments?post=620"}],"version-history":[{"count":1,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/620\/revisions"}],"predecessor-version":[{"id":621,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/620\/revisions\/621"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media\/619"}],"wp:attachment":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media?parent=620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/categories?post=620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/tags?post=620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}