{"id":413,"date":"2026-06-11T10:15:34","date_gmt":"2026-06-11T02:15:34","guid":{"rendered":"https:\/\/projectleon.net\/make\/blog\/fpv-lap-timer-ir-sensor-arduino-farsi\/"},"modified":"2026-06-11T10:15:34","modified_gmt":"2026-06-11T02:15:34","slug":"fpv-lap-timer-ir-sensor-arduino-farsi","status":"publish","type":"post","link":"https:\/\/projectleon.net\/make\/blog\/fpv-lap-timer-ir-sensor-arduino-farsi\/","title":{"rendered":"\u0633\u0627\u062e\u062a Lap Timer FPV \u0628\u0627 IR Sensor \u0648 Arduino: \u0627\u0646\u062f\u0627\u0632\u0647\u200c\u06af\u06cc\u0631\u06cc \u062f\u0648\u0631 \u067e\u0631\u0648\u0627\u0632 (\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\/post34-lap-timer.jpg' alt='\u062a\u0627\u06cc\u0645\u0631 \u062f\u0648\u0631 FPV \u0628\u0627 IR \u0648 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648' 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'>Lap Timer \u06cc\u0639\u0646\u06cc \u0686\u0647\u061f (\u0628\u0631\u0627\u06cc \u0645\u0628\u062a\u062f\u06cc)<\/h2>\n<p>\u062f\u0631 \u0645\u0633\u0627\u0628\u0642\u0627\u062a <strong>FPV Drone Racing<\/strong>\u060c \u062e\u0644\u0628\u0627\u0646\u0627\u0646 \u0628\u0627\u06cc\u062f \u062a\u0627 \u062c\u0627\u06cc \u0645\u0645\u06a9\u0646 \u0633\u0631\u06cc\u0639 \u0627\u0632 \u06cc\u06a9 \u0645\u0633\u06cc\u0631 (\u062f\u0631\u0648\u0627\u0632\u0647\u200c\u0647\u0627) \u0639\u0628\u0648\u0631 \u06a9\u0646\u0646\u062f. <strong>Lap Timer<\/strong> \u062f\u0633\u062a\u06af\u0627\u0647\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0632\u0645\u0627\u0646 \u0639\u0628\u0648\u0631 \u067e\u0647\u067e\u0627\u062f \u0627\u0632 \u06cc\u06a9 \u062e\u0637 \u06cc\u0627 \u062f\u0631\u0648\u0627\u0632\u0647 \u0631\u0627 \u0627\u0646\u062f\u0627\u0632\u0647 \u0645\u06cc\u200c\u06af\u06cc\u0631\u062f. \u0633\u06cc\u0633\u062a\u0645\u200c\u0647\u0627\u06cc \u062a\u062c\u0627\u0631\u06cc (\u0645\u062b\u0644 ImmersionRC LapRF) \u06af\u0631\u0627\u0646 \u0647\u0633\u062a\u0646\u062f \u2014 \u0627\u0645\u0627 \u0628\u0627 \u06cc\u06a9 \u0633\u0646\u0633\u0648\u0631 IR \u0633\u0627\u062f\u0647 \u0648 Arduino \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u06cc\u06a9 Lap Timer \u062f\u0642\u06cc\u0642 \u0628\u0627 \u0647\u0632\u06cc\u0646\u0647 \u0628\u0633\u06cc\u0627\u0631 \u06a9\u0645 \u0628\u0633\u0627\u0632\u06cc\u062f.<\/p>\n<p>\u0633\u0646\u0633\u0648\u0631 <strong>IR<\/strong> (\u0645\u0627\u062f\u0648\u0646 \u0642\u0631\u0645\u0632) \u06cc\u06a9 \u067e\u0631\u062a\u0648 \u0646\u0627\u0645\u0631\u0626\u06cc \u0627\u0631\u0633\u0627\u0644 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u0648\u0642\u062a\u06cc \u067e\u0647\u067e\u0627\u062f \u0627\u0632 \u062c\u0644\u0648\u06cc \u0622\u0646 \u0631\u062f \u0645\u06cc\u200c\u0634\u0648\u062f\u060c \u067e\u0631\u062a\u0648 \u0642\u0637\u0639 \u0645\u06cc\u200c\u0634\u0648\u062f \u0648 \u06cc\u06a9 \u062a\u0631\u06cc\u06af\u0631 \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc\u200c\u0634\u0648\u062f. Arduino \u0632\u0645\u0627\u0646 \u0628\u06cc\u0646 \u062f\u0648 \u062a\u0631\u06cc\u06af\u0631 \u0645\u062a\u0648\u0627\u0644\u06cc \u0631\u0627 \u0627\u0646\u062f\u0627\u0632\u0647 \u0645\u06cc\u200c\u06af\u06cc\u0631\u062f \u2014 \u0627\u06cc\u0646 \u0632\u0645\u0627\u0646 \u06cc\u06a9 \u062f\u0648\u0631 \u0627\u0633\u062a.<\/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>\u06cc\u06a9 Lap Timer \u0628\u0627 \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 LCD \u06a9\u0647 \u0632\u0645\u0627\u0646 \u062f\u0648\u0631\u060c \u0628\u0647\u062a\u0631\u06cc\u0646 \u0631\u06a9\u0648\u0631\u062f \u0648 \u062a\u0639\u062f\u0627\u062f \u062f\u0648\u0631 \u0631\u0627 \u0646\u0634\u0627\u0646 \u0645\u06cc\u200c\u062f\u0647\u062f.<\/p>\n<ul>\n<li><strong>\u0632\u0645\u0627\u0646 \u0633\u0627\u062e\u062a:<\/strong> \u06f2 \u062a\u0627 \u06f3 \u0633\u0627\u0639\u062a<\/li>\n<li><strong>\u0647\u0632\u06cc\u0646\u0647:<\/strong> \u06f4\u06f0\u06f0 \u062a\u0627 \u06f6\u06f0\u06f0 \u0647\u0632\u0627\u0631 \u062a\u0648\u0645\u0627\u0646<\/li>\n<li><strong>\u062f\u0642\u062a:<\/strong> \u0645\u06cc\u0644\u06cc\u200c\u062b\u0627\u0646\u06cc\u0647<\/li>\n<\/ul>\n<\/div>\n<p><svg viewBox='0 0 860 220' 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='100' y='80' width='30' height='80' rx='6' fill='#f7d794' stroke='#a06d00' stroke-width='2'\/>\n<rect x='730' y='80' width='30' height='80' rx='6' fill='#8bd3dd' stroke='#1f6f78' stroke-width='2'\/>\n<line x1='130' y1='120' x2='730' y2='120' stroke='#e53935' stroke-width='2.5' stroke-dasharray='8,4'\/>\n<text x='115' y='75' text-anchor='middle' font-size='11' font-family='Tahoma'>IR TX<\/text>\n<text x='745' y='75' text-anchor='middle' font-size='11' font-family='Tahoma'>IR RX<\/text>\n<ellipse cx='430' cy='60' rx='35' ry='20' fill='#f7c6c6' stroke='#a03030' stroke-width='2'\/>\n<text x='430' y='64' text-anchor='middle' font-size='12' font-family='Tahoma'>\u067e\u0647\u067e\u0627\u062f<\/text>\n<line x1='430' y1='80' x2='430' y2='120' stroke='#555' stroke-width='2' stroke-dasharray='4,2'\/>\n<text x='430' y='150' text-anchor='middle' font-size='13' font-family='Tahoma' fill='#e53935'>\u2190 \u067e\u0631\u062a\u0648 IR \u0642\u0637\u0639 \u0634\u062f \u2192 \u062a\u0631\u06cc\u06af\u0631!<\/text>\n<rect x='320' y='165' width='220' height='40' rx='8' fill='#b7e4a0' stroke='#3a7a1e' stroke-width='2'\/>\n<text x='430' y='183' text-anchor='middle' font-size='13' font-family='Tahoma'>Arduino: Lap Time = 12.34s<\/text>\n<text x='430' y='200' text-anchor='middle' font-size='11' font-family='Tahoma' fill='#888'>\u0646\u0645\u0627\u06cc\u0634 \u0631\u0648\u06cc LCD 16&#215;2<\/text>\n<\/svg><\/p>\n<h2>\u0642\u0637\u0639\u0627\u062a \u0644\u0627\u0632\u0645 (BOM)<\/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'>\u0642\u0637\u0639\u0647<\/th>\n<th style='padding:9px;border:1px solid #ddd;text-align:right'>\u0646\u0642\u0634<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>Arduino Nano<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u06a9\u0646\u062a\u0631\u0644\u0631 \u0627\u0635\u0644\u06cc<\/td>\n<\/tr>\n<tr style='background:#fafafa'>\n<td style='padding:8px;border:1px solid #ddd'>\u0633\u0646\u0633\u0648\u0631 IR \u0641\u0639\u0627\u0644 (TCRT5000 \u06cc\u0627 IR Barrier)<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u062a\u0634\u062e\u06cc\u0635 \u0639\u0628\u0648\u0631 \u067e\u0647\u067e\u0627\u062f<\/td>\n<\/tr>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>\u0646\u0645\u0627\u06cc\u0634\u06af\u0631 LCD 16&#215;2 \u0628\u0627 I2C<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0646\u0645\u0627\u06cc\u0634 \u0632\u0645\u0627\u0646<\/td>\n<\/tr>\n<tr style='background:#fafafa'>\n<td style='padding:8px;border:1px solid #ddd'>\u0628\u0627\u0632\u0631 \u067e\u06cc\u0632\u0648<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0647\u0634\u062f\u0627\u0631 \u0635\u0648\u062a\u06cc<\/td>\n<\/tr>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>\u062f\u06a9\u0645\u0647 Reset<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0634\u0631\u0648\u0639 \u062f\u0648\u0631\u0647 \u062c\u062f\u06cc\u062f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u06a9\u062f Arduino Lap Timer<\/h2>\n<pre style='background:#1e1e1e;color:#d4d4d4;padding:18px;border-radius:10px;overflow-x:auto;font-size:13px'><code class='language-cpp'>\n#include &lt;LiquidCrystal_I2C.h&gt;\n\nLiquidCrystal_I2C lcd(0x27, 16, 2);\n\nconst int IR_PIN   = 2;  \/\/ INT0 \u2014 \u0633\u0646\u0633\u0648\u0631 IR\nconst int BUZZ_PIN = 8;\nconst int RST_BTN  = 9;\n\nvolatile bool triggered = false;\nunsigned long lastTrigger = 0;\nunsigned long lapTime = 0;\nunsigned long bestLap = 999999;\nint lapCount = 0;\nbool armed = false;\n\nvoid IRAM_ATTR onIR() {\n  if (millis() - lastTrigger > 1000) {  \/\/ debounce 1s\n    triggered = true;\n  }\n}\n\nvoid setup() {\n  pinMode(IR_PIN, INPUT_PULLUP);\n  pinMode(BUZZ_PIN, OUTPUT);\n  pinMode(RST_BTN, INPUT_PULLUP);\n  attachInterrupt(digitalPinToInterrupt(IR_PIN), onIR, FALLING);\n  lcd.init(); lcd.backlight();\n  lcd.setCursor(0,0); lcd.print(\"FPV Lap Timer\");\n  lcd.setCursor(0,1); lcd.print(\"Ready!\");\n  delay(2000);\n}\n\nvoid loop() {\n  if (digitalRead(RST_BTN) == LOW) {\n    lapCount = 0; bestLap = 999999; armed = false;\n    lcd.clear(); lcd.print(\"Reset!\"); delay(1000);\n  }\n\n  if (triggered) {\n    triggered = false;\n    unsigned long now = millis();\n    if (!armed) {\n      armed = true; lastTrigger = now;\n      lcd.clear(); lcd.print(\"GO!\");\n    } else {\n      lapTime = now - lastTrigger;\n      lastTrigger = now; lapCount++;\n      if (lapTime < bestLap) bestLap = lapTime;\n      tone(BUZZ_PIN, 2000, 200);\n      lcd.clear();\n      lcd.setCursor(0,0);\n      lcd.print(\"Lap\"); lcd.print(lapCount);\n      lcd.print(\": \"); lcd.print(lapTime\/1000.0, 2); lcd.print(\"s\");\n      lcd.setCursor(0,1);\n      lcd.print(\"Best:\"); lcd.print(bestLap\/1000.0, 2); lcd.print(\"s\");\n    }\n  }\n}\n<\/code><\/pre>\n<h2>\u0686\u06a9\u200c\u0644\u06cc\u0633\u062a \u062a\u0633\u062a<\/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'>\u062a\u0633\u062a<\/th>\n<th style='padding:9px;border:1px solid #ddd;text-align:right'>\u0646\u062a\u06cc\u062c\u0647<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>LCD \u0645\u062a\u0646 \u0646\u0645\u0627\u06cc\u0634 \u0645\u06cc\u200c\u062f\u0647\u062f\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0628\u0644\u0647<\/td>\n<\/tr>\n<tr style='background:#fafafa'>\n<td style='padding:8px;border:1px solid #ddd'>\u062f\u0633\u062a \u062c\u0644\u0648\u06cc IR \u0639\u0628\u0648\u0631 \u062f\u0627\u062f\u0646 \u2192 \u062a\u0631\u06cc\u06af\u0631\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0628\u0644\u0647 \u2014 \u0628\u0627\u0632\u0631 \u0635\u062f\u0627 \u0645\u06cc\u200c\u062f\u0647\u062f<\/td>\n<\/tr>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>\u0632\u0645\u0627\u0646 \u0627\u0648\u0644 \u062b\u0628\u062a \u0645\u06cc\u200c\u0634\u0648\u062f (Armed)?<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0639\u0628\u0648\u0631 \u0627\u0648\u0644 = \u0634\u0631\u0648\u0639<\/td>\n<\/tr>\n<tr style='background:#fafafa'>\n<td style='padding:8px;border:1px solid #ddd'>Best Lap \u0628\u0647\u062a\u0631 \u0627\u0632 \u0644\u067e \u0642\u0628\u0644\u06cc \u0646\u0645\u0627\u06cc\u0634 \u062f\u0627\u062f\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0628\u0644\u0647<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><svg viewBox='0 0 860 180' width='100%' xmlns='http:\/\/www.w3.org\/2000\/svg' style='background:#111;border:1px solid #333;border-radius:12px;margin-bottom:22px'>\n<rect x='50' y='50' width='760' height='80' rx='10' fill='#1e1e1e' stroke='#444'\/>\n<text x='90' y='88' font-size='18' font-family='monospace' fill='#0f0'>Lap 3: 12.45s<\/text>\n<text x='90' y='115' font-size='16' font-family='monospace' fill='#ffeb3b'>Best:  11.92s \u2605<\/text>\n<text x='430' y='155' text-anchor='middle' font-size='12' font-family='Tahoma' fill='#888'>\u0646\u0645\u0627\u06cc\u0634\u06af\u0631 LCD 16\u00d72 \u2014 \u0632\u0645\u0627\u0646 \u062f\u0648\u0631 \u0648 \u0631\u06a9\u0648\u0631\u062f<\/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\/fFDRUmMtDns' title='DIY FPV Lap Timer Arduino IR' 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\/F0mNRVsljcA' title='Arduino LCD I2C Basics' 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\/FPV_%D8%AA%D8%A7%DB%8C%D9%85%D8%B1_%D9%85%D8%B3%D8%A7%D8%A8%D9%82%D9%87' target='_blank'>\u0622\u067e\u0627\u0631\u0627\u062a: FPV Lap Timer \u0641\u0627\u0631\u0633\u06cc<\/a><\/li>\n<li><a href='https:\/\/oscarliang.com\/lap-timer-fpv-racing\/' target='_blank'>Oscar Liang: Lap Timer FPV Guide<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u0633\u0627\u062e\u062a \u062a\u0627\u06cc\u0645\u0631 \u062f\u0648\u0631 \u067e\u0631\u0648\u0627\u0632 FPV \u0628\u0627 \u0633\u0646\u0633\u0648\u0631 IR \u0648 Arduino Nano\u061b \u0646\u0645\u0627\u06cc\u0634 \u0632\u0645\u0627\u0646 \u0631\u0648\u06cc LCD\u060c \u0630\u062e\u06cc\u0631\u0647 \u0631\u06a9\u0648\u0631\u062f \u0648 \u0647\u0634\u062f\u0627\u0631 \u0635\u0648\u062a\u06cc. \u0628\u0631\u0627\u06cc \u062a\u0645\u0631\u06cc\u0646 \u0645\u0633\u0627\u0628\u0642\u0647 FPV Freestyle.<\/p>\n","protected":false},"author":1,"featured_media":412,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[17],"tags":[24,93,172,173,21,50,32,174],"class_list":["post-413","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uav","tag-fpv","tag-ir-sensor","tag-lap-timer","tag-lcd","tag-arduino","tag-50","tag-beginner","tag-174"],"_links":{"self":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/413","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=413"}],"version-history":[{"count":1,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/413\/revisions"}],"predecessor-version":[{"id":414,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/413\/revisions\/414"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media\/412"}],"wp:attachment":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media?parent=413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/categories?post=413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/tags?post=413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}