{"id":462,"date":"2026-06-11T10:43:16","date_gmt":"2026-06-11T02:43:16","guid":{"rendered":"https:\/\/projectleon.net\/make\/blog\/barometer-logger-bmp280-arduino-altitude-uav-farsi\/"},"modified":"2026-06-11T10:43:16","modified_gmt":"2026-06-11T02:43:16","slug":"barometer-logger-bmp280-arduino-altitude-uav-farsi","status":"publish","type":"post","link":"https:\/\/projectleon.net\/make\/blog\/barometer-logger-bmp280-arduino-altitude-uav-farsi\/","title":{"rendered":"\u0633\u0627\u062e\u062a Barometer Logger \u0628\u0627 BMP280 \u0648 Arduino: \u0627\u0646\u062f\u0627\u0632\u0647\u200c\u06af\u06cc\u0631\u06cc \u0627\u0631\u062a\u0641\u0627\u0639 \u067e\u0647\u067e\u0627\u062f (\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\/post51-bmp280-barometer.jpg' alt='\u0644\u0627\u06af\u0631 BMP280 \u0641\u0634\u0627\u0631\u0633\u0646\u062c \u0627\u0631\u062a\u0641\u0627\u0639 \u067e\u0647\u067e\u0627\u062f Arduino' 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'>BMP280 \u0648 \u0627\u0646\u062f\u0627\u0632\u0647\u200c\u06af\u06cc\u0631\u06cc \u0627\u0631\u062a\u0641\u0627\u0639 \u0628\u0627 \u0641\u0634\u0627\u0631 \u0647\u0648\u0627 \u0686\u06cc\u0633\u062a\u061f (\u0628\u0631\u0627\u06cc \u0645\u0628\u062a\u062f\u06cc)<\/h2>\n<p>\u0628\u0627 \u0628\u0627\u0644\u0627 \u0631\u0641\u062a\u0646 \u0627\u0631\u062a\u0641\u0627\u0639\u060c \u0641\u0634\u0627\u0631 \u0647\u0648\u0627 \u06a9\u0627\u0647\u0634 \u0645\u06cc\u200c\u06cc\u0627\u0628\u062f. \u0627\u06cc\u0646 \u0631\u0627\u0628\u0637\u0647 \u0641\u06cc\u0632\u06cc\u06a9\u06cc \u067e\u0627\u06cc\u0647 \u06a9\u0627\u0631 <strong>Barometer<\/strong> (\u0641\u0634\u0627\u0631\u0633\u0646\u062c) \u062f\u0631 \u067e\u0647\u067e\u0627\u062f\u0647\u0627 \u0627\u0633\u062a. \u0645\u0627\u0698\u0648\u0644 <strong>BMP280<\/strong> \u06cc\u06a9 \u0633\u0646\u0633\u0648\u0631 \u062f\u06cc\u062c\u06cc\u062a\u0627\u0644 \u0641\u0634\u0627\u0631 \u0648 \u062f\u0645\u0627 \u0628\u0627 \u062f\u0642\u062a \u0628\u0627\u0644\u0627 \u0627\u0633\u062a \u06a9\u0647 \u0627\u0632 \u0637\u0631\u06cc\u0642 I2C \u06cc\u0627 SPI \u0628\u0647 Arduino \u0645\u062a\u0635\u0644 \u0645\u06cc\u200c\u0634\u0648\u062f.<\/p>\n<p>\u0628\u0627 \u0641\u0631\u0645\u0648\u0644 <strong>Barometric Formula<\/strong>\u060c \u0627\u0632 \u0627\u062e\u062a\u0644\u0627\u0641 \u0641\u0634\u0627\u0631 \u0628\u06cc\u0646 \u0646\u0642\u0637\u0647 \u067e\u0631\u0648\u0627\u0632 \u0648 \u0632\u0645\u06cc\u0646 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u0627\u0631\u062a\u0641\u0627\u0639 \u0646\u0633\u0628\u06cc \u0631\u0627 \u0628\u0627 \u062f\u0642\u062a \u00b1\u06f1 \u0645\u062a\u0631 \u0645\u062d\u0627\u0633\u0628\u0647 \u06a9\u0631\u062f. \u0641\u0644\u0627\u06cc\u062a \u06a9\u0646\u062a\u0631\u0644\u0631\u0647\u0627\u06cc ArduPilot \u0648 iNAV \u0647\u0645 \u0627\u0632 \u0647\u0645\u06cc\u0646 \u0627\u0635\u0644 \u0628\u0631\u0627\u06cc Altitude Hold \u0648 Auto Landing \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u0646\u062f.<\/p>\n<p>\u06cc\u06a9 \u0644\u0627\u06af\u0631 Barometer \u0645\u0633\u062a\u0642\u0644 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u062f\u0631 \u062a\u062d\u0644\u06cc\u0644 \u067e\u0631\u0648\u0627\u0632\u060c \u0628\u0631\u0631\u0633\u06cc \u0628\u0627\u0632\u062f\u0647\u06cc PID Altitude\u060c \u0648 \u062a\u0646\u0638\u06cc\u0645 \u067e\u0627\u0631\u0627\u0645\u062a\u0631\u0647\u0627\u06cc \u0645\u0648\u062a\u0648\u0631 \u0628\u0633\u06cc\u0627\u0631 \u0645\u0641\u06cc\u062f \u0628\u0627\u0634\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>\u06cc\u06a9 \u0644\u0627\u06af\u0631 \u0641\u0634\u0627\u0631\/\u0627\u0631\u062a\u0641\u0627\u0639 \u0628\u0627 BMP280 \u06a9\u0647 \u062f\u0627\u062f\u0647 \u0631\u0627 \u0631\u0648\u06cc SD Card \u0630\u062e\u06cc\u0631\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u0627\u0631\u062a\u0641\u0627\u0639 \u0631\u0627 \u0631\u0648\u06cc OLED \u0646\u0645\u0627\u06cc\u0634 \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> \u06f3\u06f0\u06f0 \u062a\u0627 \u06f4\u06f5\u06f0 \u0647\u0632\u0627\u0631 \u062a\u0648\u0645\u0627\u0646<\/li>\n<li><strong>\u062f\u0642\u062a \u0627\u0631\u062a\u0641\u0627\u0639:<\/strong> \u00b1\u06f1 \u0645\u062a\u0631<\/li>\n<\/ul>\n<\/div>\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='#8bd3dd' stroke='#1f6f78' 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'>BMP280<\/text>\n<text x='117' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>I2C \u0641\u0634\u0627\u0631+\u062f\u0645\u0627<\/text>\n<text x='322' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>Arduino Nano<\/text>\n<text x='322' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>\u0645\u062d\u0627\u0633\u0628\u0647 \u0627\u0631\u062a\u0641\u0627\u0639<\/text>\n<text x='527' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>SD + OLED<\/text>\n<text x='527' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>\u0644\u0627\u06af + \u0646\u0645\u0627\u06cc\u0634<\/text>\n<text x='737' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>Excel\/Python<\/text>\n<text x='737' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>\u06af\u0631\u0627\u0641 \u0627\u0631\u062a\u0641\u0627\u0639<\/text>\n<text x='430' y='175' text-anchor='middle' font-size='13' font-family='Tahoma' fill='#666'>Barometer Logger \u2014 \u0641\u0634\u0627\u0631 \u2192 \u0627\u0631\u062a\u0641\u0627\u0639 \u0646\u0633\u0628\u06cc \u2192 CSV \u2192 \u062a\u062d\u0644\u06cc\u0644<\/text>\n<\/svg><\/p>\n<h2>\u06a9\u062f Arduino \u2014 BMP280 + SD Logger<\/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;Wire.h&gt;\n#include &lt;Adafruit_BMP280.h&gt;\n#include &lt;Adafruit_SSD1306.h&gt;\n#include &lt;SD.h&gt;\n\nAdafruit_BMP280 bmp;\nAdafruit_SSD1306 oled(128, 64, &Wire, -1);\nFile logFile;\n\nfloat groundPressure;  \/\/ \u0641\u0634\u0627\u0631 \u0633\u0637\u062d \u0632\u0645\u06cc\u0646\n\nfloat calcAltitude(float pressure) {\n  \/\/ \u0641\u0631\u0645\u0648\u0644 Barometric \u0628\u0631\u0627\u06cc \u0627\u0631\u062a\u0641\u0627\u0639 \u0646\u0633\u0628\u06cc\n  return 44330.0 * (1.0 - pow(pressure \/ groundPressure, 0.1903));\n}\n\nvoid setup() {\n  Serial.begin(115200);\n  bmp.begin(0x76);\n  bmp.setSampling(Adafruit_BMP280::MODE_NORMAL,\n                  Adafruit_BMP280::SAMPLING_X2,\n                  Adafruit_BMP280::SAMPLING_X16,\n                  Adafruit_BMP280::FILTER_X16,\n                  Adafruit_BMP280::STANDBY_MS_500);\n  oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);\n\n  \/\/ \u06a9\u0627\u0644\u06cc\u0628\u0631\u0627\u0633\u06cc\u0648\u0646: \u0645\u06cc\u0627\u0646\u06af\u06cc\u0646 \u06f3\u06f0 \u0646\u0645\u0648\u0646\u0647 \u0627\u0648\u0644\n  float pSum = 0;\n  for(int i=0; i<30; i++) { pSum += bmp.readPressure(); delay(50); }\n  groundPressure = pSum \/ 30.0;\n  Serial.print(\"Ground P: \"); Serial.println(groundPressure);\n\n  SD.begin(10);\n  logFile = SD.open(\"baro_log.csv\", FILE_WRITE);\n  if(logFile) logFile.println(\"ms,pressure,temp,altitude\");\n}\n\nvoid loop() {\n  float press = bmp.readPressure();\n  float temp  = bmp.readTemperature();\n  float alt   = calcAltitude(press);\n\n  oled.clearDisplay(); oled.setTextSize(2); oled.setCursor(0,0);\n  oled.print(alt, 1); oled.println(\"m\");\n  oled.setTextSize(1); oled.setCursor(0,20);\n  oled.print(press\/100.0, 2); oled.println(\" hPa\");\n  oled.print(temp, 1); oled.println(\" C\");\n  oled.display();\n\n  if(logFile) {\n    logFile.print(millis()); logFile.print(\",\");\n    logFile.print(press,2);  logFile.print(\",\");\n    logFile.print(temp,2);   logFile.print(\",\");\n    logFile.println(alt,3);\n    if(millis() % 5000 < 100) logFile.flush();\n  }\n  delay(200);\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'>\u062f\u0631 \u0633\u0637\u062d \u0632\u0645\u06cc\u0646 \u0627\u0631\u062a\u0641\u0627\u0639 \u2248 0m \u0627\u0633\u062a\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0628\u0644\u0647 \u2014 \u0628\u0639\u062f \u0627\u0632 \u06a9\u0627\u0644\u06cc\u0628\u0631\u0627\u0633\u06cc\u0648\u0646<\/td>\n<\/tr>\n<tr style='background:#fafafa'>\n<td style='padding:8px;border:1px solid #ddd'>\u0628\u0627\u0644\u0627 \u0628\u0631\u062f\u0646 \u06f1 \u0645\u062a\u0631 \u2192 \u0627\u0631\u062a\u0641\u0627\u0639 \u2248 1m\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0628\u0644\u0647<\/td>\n<\/tr>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>\u0641\u0627\u06cc\u0644 CSV \u0631\u0648\u06cc SD \u0627\u06cc\u062c\u0627\u062f \u0634\u062f\u0647\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\u0645\u0627\u06cc \u0633\u0646\u0633\u0648\u0631 \u0628\u0627 \u062f\u0645\u0627\u0633\u0646\u062c \u0645\u062d\u06cc\u0637 \u062a\u0637\u0627\u0628\u0642 \u062f\u0627\u0631\u062f\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u00b1\u06f2\u00b0C \u0642\u0627\u0628\u0644 \u0642\u0628\u0648\u0644<\/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:#1a1a2e;border:1px solid #444;border-radius:12px;margin-bottom:22px'>\n<polyline points='40,150 100,145 160,130 220,100 280,70 340,50 400,55 460,70 520,80 580,100 640,120 700,140 760,150 820,155' stroke='#4fc3f7' stroke-width='2.5' fill='none'\/>\n<text x='430' y='25' text-anchor='middle' font-size='13' font-family='Tahoma' fill='#aaa'>\u0646\u0645\u0648\u0646\u0647 \u06af\u0631\u0627\u0641 \u0627\u0631\u062a\u0641\u0627\u0639 \u2014 \u0631\u0641\u062a \u0648 \u0628\u0631\u06af\u0634\u062a \u067e\u0631\u0648\u0627\u0632<\/text>\n<text x='50' y='168' font-size='11' font-family='monospace' fill='#888'>0s<\/text>\n<text x='820' y='168' font-size='11' font-family='monospace' fill='#888'>60s<\/text>\n<text x='30' y='55' font-size='11' font-family='monospace' fill='#4fc3f7'>30m<\/text>\n<text x='30' y='155' font-size='11' font-family='monospace' fill='#4fc3f7'>0m<\/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\/G7pZSYILMhs' title='BMP280 Arduino Altitude Measurement' 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\/YCqhRhb8_J8' title='Arduino SD Card Data Logger' 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\/BMP280_%D8%A2%D8%B1%D8%AF%D9%88%DB%8C%D9%86%D9%88_%D8%A7%D8%B1%D8%AA%D9%81%D8%A7%D8%B9' target='_blank'>\u0622\u067e\u0627\u0631\u0627\u062a: BMP280 \u0627\u0631\u062a\u0641\u0627\u0639\u200c\u0633\u0646\u062c \u0641\u0627\u0631\u0633\u06cc<\/a><\/li>\n<li><a href='https:\/\/randomnerdtutorials.com\/bmp280-arduino-pressure-altitude\/' target='_blank'>Random Nerd: BMP280 Arduino Guide<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u0622\u0645\u0648\u0632\u0634 \u0633\u0627\u062e\u062a \u0644\u0627\u06af\u0631 \u0641\u0634\u0627\u0631 \u0648 \u0627\u0631\u062a\u0641\u0627\u0639 \u0628\u0627 BMP280 \u0648 Arduino Nano\u061b \u062e\u0648\u0627\u0646\u062f\u0646 \u0641\u0634\u0627\u0631 \u0647\u0648\u0627\u060c \u062f\u0645\u0627\u060c \u0645\u062d\u0627\u0633\u0628\u0647 \u0627\u0631\u062a\u0641\u0627\u0639 \u0646\u0633\u0628\u06cc \u0628\u0627 \u0641\u0631\u0645\u0648\u0644 Barometric \u0648 \u062b\u0628\u062a \u0631\u0648\u06cc SD Card.<\/p>\n","protected":false},"author":1,"featured_media":461,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[17,20],"tags":[229,226,83,21,50,228,227,40],"class_list":["post-462","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uav","category-projects-2","tag-barometer","tag-bmp280","tag-sd-card","tag-arduino","tag-50","tag-228","tag-227","tag-40"],"_links":{"self":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/462","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=462"}],"version-history":[{"count":1,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/462\/revisions"}],"predecessor-version":[{"id":463,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/462\/revisions\/463"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media\/461"}],"wp:attachment":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media?parent=462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/categories?post=462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/tags?post=462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}