{"id":696,"date":"2026-06-11T13:57:54","date_gmt":"2026-06-11T05:57:54","guid":{"rendered":"https:\/\/projectleon.net\/make\/blog\/earthquake-alert-adxl345-lora-subghz-farsi\/"},"modified":"2026-06-11T13:57:54","modified_gmt":"2026-06-11T05:57:54","slug":"earthquake-alert-adxl345-lora-subghz-farsi","status":"publish","type":"post","link":"https:\/\/projectleon.net\/make\/blog\/earthquake-alert-adxl345-lora-subghz-farsi\/","title":{"rendered":"\u0633\u0627\u062e\u062a \u0633\u06cc\u0633\u062a\u0645 \u0647\u0634\u062f\u0627\u0631 \u0632\u0644\u0632\u0644\u0647 \u0628\u0627 \u0633\u0646\u0633\u0648\u0631 \u0644\u0631\u0632\u0634 ADXL345 \u0648 LoRa Sub-GHz (\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\/post122-earthquake-lora-1.jpg' alt='\u0633\u06cc\u0633\u062a\u0645 \u0647\u0634\u062f\u0627\u0631 \u0632\u0644\u0632\u0644\u0647 ADXL345 LoRa SX1278' 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\u06cc\u0633\u062a\u0645 \u0647\u0634\u062f\u0627\u0631 \u0632\u0644\u0632\u0644\u0647 DIY \u0686\u06cc\u0633\u062a\u061f (\u0645\u0628\u062a\u062f\u06cc)<\/h2>\n<p>\u062f\u0631 \u0627\u06cc\u0646 \u067e\u0631\u0648\u0698\u0647 \u0628\u0627 \u0633\u0646\u0633\u0648\u0631 <strong>ADXL345<\/strong> (\u0634\u062a\u0627\u0628\u200c\u0633\u0646\u062c \u0633\u0647 \u0645\u062d\u0648\u0631\u0647 \u062f\u06cc\u062c\u06cc\u062a\u0627\u0644 \u0627\u0632 Analog Devices\u060c \u0632\u06cc\u0631 \u06f5 \u062f\u0644\u0627\u0631) \u0644\u0631\u0632\u0634\u200c\u0647\u0627\u06cc \u0632\u0645\u06cc\u0646 \u0631\u0627 \u0627\u0646\u062f\u0627\u0632\u0647 \u0645\u06cc\u200c\u06af\u06cc\u0631\u06cc\u0645. ADXL345 \u062f\u0627\u0631\u0627\u06cc \u0642\u0627\u0628\u0644\u06cc\u062a <strong>Free Fall Detection<\/strong> \u0648 <strong>Activity Interrupt<\/strong> \u0627\u0633\u062a \u2014 \u0648\u0642\u062a\u06cc \u0634\u062a\u0627\u0628 \u0627\u0632 \u0622\u0633\u062a\u0627\u0646\u0647 \u062a\u0646\u0638\u06cc\u0645 \u0634\u062f\u0647 \u0628\u06cc\u0634\u062a\u0631 \u0634\u0648\u062f\u060c \u06cc\u06a9 Interrupt \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/p>\n<p>\u0627\u06cc\u0646 \u0647\u0634\u062f\u0627\u0631 \u0628\u0627 <strong>LoRa SX1278 433MHz<\/strong> (\u0628\u0631\u062f \u06f5km) \u0628\u0647 \u06cc\u06a9 \u06af\u06cc\u0631\u0646\u062f\u0647 \u0645\u0631\u06a9\u0632\u06cc \u0627\u0631\u0633\u0627\u0644 \u0645\u06cc\u200c\u0634\u0648\u062f. \u0633\u06cc\u0633\u062a\u0645 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u0686\u0646\u062f \u0646\u0648\u062f \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f \u2014 \u0647\u0631 \u0633\u0627\u062e\u062a\u0645\u0627\u0646 \u06cc\u06a9 \u0646\u0648\u062f \u2014 \u0648 \u062f\u0631 \u06cc\u06a9 \u0634\u0628\u06a9\u0647 \u0647\u0634\u062f\u0627\u0631 \u0627\u0648\u0644\u06cc\u0647 \u0632\u0644\u0632\u0644\u0647 (Early Warning) \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0634\u0648\u062f. \u0627\u06cc\u0646 \u0645\u0641\u0647\u0648\u0645 \u0645\u0633\u062a\u0642\u06cc\u0645\u0627\u064b \u062f\u0631 \u062a\u0644\u0647\u200c\u0645\u062a\u0631\u06cc UGV\/UAV \u0647\u0645 \u0642\u0627\u0628\u0644 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \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 \u0646\u0648\u062f \u0647\u0634\u062f\u0627\u0631 \u0632\u0644\u0632\u0644\u0647 LoRa \u0628\u0627 ADXL345 \u0648 \u0628\u0627\u062a\u0631\u06cc \u06f6 \u0645\u0627\u0647\u0647.<\/p>\n<ul>\n<li><strong>\u0647\u0632\u06cc\u0646\u0647:<\/strong> ADXL345+Arduino+SX1278 = \u06f1\u06f5 \u062f\u0644\u0627\u0631<\/li>\n<li><strong>\u0628\u0631\u062f \u0647\u0634\u062f\u0627\u0631:<\/strong> \u062a\u0627 \u06f5km<\/li>\n<li><strong>\u0628\u0627\u062a\u0631\u06cc:<\/strong> \u06f6 \u0645\u0627\u0647 \u062f\u0631 Deep Sleep<\/li>\n<\/ul>\n<\/div>\n<p><svg viewBox='0 0 860 200' width='100%' xmlns='http:\/\/www.w3.org\/2000\/svg' style='background:#fff3e0;border:1px solid #ff9800;border-radius:12px;margin-bottom:22px'>\n<rect x='0' y='0' width='860' height='200' rx='12' fill='#fff3e0'\/>\n<!-- \u0633\u0627\u062e\u062a\u0645\u0627\u0646\u200c\u0647\u0627 -->\n<rect x='60' y='80' width='60' height='100' fill='#8d6e63' stroke='#5d4037' stroke-width='2'\/><text x='90' y='120' text-anchor='middle' font-size='9' font-family='Tahoma' fill='#fff'>\u0628\u0644\u062fA<\/text>\n<rect x='60' y='72' width='12' height='12' rx='2' fill='#e53935'\/><text x='66' y='82' text-anchor='middle' font-size='7' font-family='Tahoma' fill='#fff'>!<\/text>\n<rect x='200' y='60' width='60' height='120' fill='#78909c' stroke='#546e7a' stroke-width='2'\/><text x='230' y='105' text-anchor='middle' font-size='9' font-family='Tahoma' fill='#fff'>\u0628\u0644\u062fB<\/text>\n<rect x='200' y='52' width='12' height='12' rx='2' fill='#4caf50'\/><text x='206' y='62' text-anchor='middle' font-size='7' font-family='Tahoma' fill='#fff'>\u2713<\/text>\n<!-- \u0644\u0631\u0632\u0634 -->\n<path d='M0,180 Q50,150 90,180 Q130,210 170,180 Q210,150 250,180' fill='none' stroke='#e53935' stroke-width='2'\/>\n<!-- Gateway \u0645\u0631\u06a9\u0632\u06cc -->\n<rect x='620' y='80' width='180' height='80' rx='14' fill='#1a237e' stroke='#3a60c0' stroke-width='2'\/>\n<text x='710' y='115' text-anchor='middle' font-size='11' font-family='Tahoma' fill='#fff'>Gateway \u0645\u0631\u06a9\u0632\u06cc<\/text>\n<text x='710' y='133' text-anchor='middle' font-size='10' font-family='Tahoma' fill='#aaa'>\u0647\u0634\u062f\u0627\u0631 \u2192 SMS\/LoRa<\/text>\n<line x1='130' y1='90' x2='580' y2='115' stroke='#ff9800' stroke-width='1.5' stroke-dasharray='6,3'\/>\n<text x='430' y='185' text-anchor='middle' font-size='12' font-family='Tahoma' fill='#e65100'>ADXL345 \u2014 \u0647\u0634\u062f\u0627\u0631 \u0632\u0644\u0632\u0644\u0647 LoRa\u060c \u06f5km\u060c \u0628\u0627\u062a\u0631\u06cc \u06f6 \u0645\u0627\u0647<\/text>\n<\/svg><\/p>\n<h2>\u06a9\u062f ADXL345 \u0628\u0627 Interrupt \u0648 LoRa<\/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;Adafruit_ADXL345_U.h&gt;\n#include &lt;LoRa.h&gt;\n#include &lt;avr\/sleep.h&gt;\n\nAdafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);\nvolatile bool quakeDetected = false;\n\n\/\/ INT1 \u2192 Arduino Pin 2 (External Interrupt 0)\nvoid onInterrupt() { quakeDetected = true; }\n\nvoid setup() {\n  accel.begin();\n\n  \/\/ \u062a\u0646\u0638\u06cc\u0645 \u0622\u0633\u062a\u0627\u0646\u0647 Activity Detection:\n  accel.writeRegister(ADXL345_REG_THRESH_ACT, 20);  \/\/ 20 \u00d7 62.5mg = 1.25g\n  accel.writeRegister(ADXL345_REG_THRESH_INACT, 5);\n  accel.writeRegister(ADXL345_REG_TIME_INACT, 3);    \/\/ 3 \u062b\u0627\u0646\u06cc\u0647\n\n  \/\/ Activity\/Inactivity \u0641\u0639\u0627\u0644 \u0631\u0648\u06cc X,Y,Z:\n  accel.writeRegister(ADXL345_REG_ACT_INACT_CTL, 0x77);\n\n  \/\/ Map Activity Interrupt \u0628\u0647 INT1:\n  accel.writeRegister(ADXL345_REG_INT_MAP, 0x00);    \/\/ \u0647\u0645\u0647 \u0628\u0647 INT1\n  accel.writeRegister(ADXL345_REG_INT_ENABLE, 0x10); \/\/ Activity bit\n\n  \/\/ \u0627\u062a\u0635\u0627\u0644 INT1:\n  attachInterrupt(digitalPinToInterrupt(2), onInterrupt, RISING);\n\n  LoRa.begin(433.175E6);\n  LoRa.setSpreadingFactor(10);\n  LoRa.setTxPower(17);\n\n  \/\/ \u0634\u0646\u0627\u0633\u0647 \u0627\u06cc\u0646 \u0633\u0627\u062e\u062a\u0645\u0627\u0646 (\u0628\u0627 jumper \u06cc\u0627 EEPROM \u062a\u0646\u0638\u06cc\u0645 \u06a9\u0646\u06cc\u062f):\n  uint8_t buildingID = 1;\n\n  \/\/ \u0634\u0628\u200c\u0631\u0648 Deep Sleep \u062a\u0627 Interrupt:\n  set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n}\n\nvoid loop() {\n  if(quakeDetected) {\n    quakeDetected = false;\n\n    \/\/ \u0627\u0646\u062f\u0627\u0632\u0647\u200c\u06af\u06cc\u0631\u06cc \u062f\u0642\u06cc\u0642 \u0634\u062a\u0627\u0628:\n    sensors_event_t event;\n    accel.getEvent(&event);\n    float magnitude = sqrt(event.acceleration.x*event.acceleration.x +\n                           event.acceleration.y*event.acceleration.y +\n                           event.acceleration.z*event.acceleration.z);\n\n    \/\/ \u0627\u0631\u0633\u0627\u0644 \u0647\u0634\u062f\u0627\u0631 LoRa:\n    LoRa.beginPacket();\n    LoRa.print(\"EQ,ID:1,MAG:\");\n    LoRa.print(magnitude, 2);\n    LoRa.print(\",T:\");\n    LoRa.print(millis()\/1000);\n    LoRa.endPacket();\n\n    delay(100);\n  }\n  \/\/ \u0628\u0631\u06af\u0634\u062a \u0628\u0647 Sleep:\n  sleep_enable(); sleep_mode(); sleep_disable();\n}\n<\/code><\/pre>\n<h2>\u0686\u06a9\u200c\u0644\u06cc\u0633\u062a \u0646\u0635\u0628 \u0633\u0646\u0633\u0648\u0631 \u0631\u0648\u06cc \u0633\u0627\u062e\u062a\u0645\u0627\u0646<\/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'>\u0628\u0631\u0631\u0633\u06cc<\/th>\n<th style='padding:9px;border:1px solid #ddd;text-align:right'>\u0631\u0648\u0634<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>ADXL345 \u0645\u062d\u06a9\u0645 \u0628\u0647 \u062f\u06cc\u0648\u0627\u0631\/\u0633\u062a\u0648\u0646 \u0628\u0633\u062a\u0647\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0628\u0627 \u067e\u06cc\u0686 (\u0646\u0647 \u0686\u0633\u0628)<\/td>\n<\/tr>\n<tr style='background:#fafafa'>\n<td style='padding:8px;border:1px solid #ddd'>\u0622\u0633\u062a\u0627\u0646\u0647 \u0628\u0627 \u062a\u06a9\u0627\u0646 \u062f\u0627\u062f\u0646 \u062f\u0633\u062a\u06cc \u062a\u0646\u0638\u06cc\u0645\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>threshold \u0628\u062f\u0648\u0646 \u0641\u0639\u0627\u0644 \u0634\u062f\u0646<\/td>\n<\/tr>\n<tr>\n<td style='padding:8px;border:1px solid #ddd'>LoRa \u0647\u0634\u062f\u0627\u0631 \u062f\u0631 \u06f1km \u062f\u0631\u06cc\u0627\u0641\u062a \u0645\u06cc\u200c\u0634\u0648\u062f\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u2610<\/td>\n<\/tr>\n<tr style='background:#fafafa'>\n<td style='padding:8px;border:1px solid #ddd'>\u0628\u0627\u062a\u0631\u06cc \u0686\u0646\u062f \u0645\u0627\u0647 \u062f\u0648\u0627\u0645 \u0645\u06cc\u200c\u0622\u0648\u0631\u062f\u061f<\/td>\n<td style='padding:8px;border:1px solid #ddd'>\u0645\u0635\u0631\u0641 Sleep \u0632\u06cc\u0631 \u06f5\u03bcA<\/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' stroke-dasharray='6,3'\/>\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'>ADXL345<\/text>\n<text x='117' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>\u0644\u0631\u0632\u0634\u200c\u0633\u0646\u062c<\/text>\n<text x='322' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>Pro Mini<\/text>\n<text x='322' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>Interrupt<\/text>\n<text x='527' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>SX1278 LoRa<\/text>\n<text x='527' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>433MHz 5km<\/text>\n<text x='737' y='100' text-anchor='middle' font-size='12' font-family='Tahoma'>Gateway<\/text>\n<text x='737' y='115' text-anchor='middle' font-size='11' font-family='Tahoma'>\u0647\u0634\u062f\u0627\u0631 \u0632\u0644\u0632\u0644\u0647<\/text>\n<text x='430' y='175' text-anchor='middle' font-size='13' font-family='Tahoma' fill='#666'>ADXL345 \u2192 LoRa 433 \u2192 \u0647\u0634\u062f\u0627\u0631 \u0632\u0644\u0632\u0644\u0647 \u06f5km\u060c \u0628\u0627\u062a\u0631\u06cc \u06f6 \u0645\u0627\u0647<\/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\/9TomUc6HmFM' title='ADXL345 Accelerometer 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\/VXSoH0kJDd0' title='LoRa Seismic Sensor Alert Network' 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\/ADXL345_%D9%84%D8%B1%D8%B2%D8%B4_%D8%B3%D9%86%D8%AC_%D8%B2%D9%84%D8%B2%D9%84%D9%87' target='_blank'>\u0622\u067e\u0627\u0631\u0627\u062a: ADXL345 \u0644\u0631\u0632\u0634 \u0633\u0646\u062c \u0632\u0644\u0632\u0644\u0647 \u0641\u0627\u0631\u0633\u06cc<\/a><\/li>\n<li><a href='https:\/\/learn.adafruit.com\/adxl345-digital-accelerometer' target='_blank'>Adafruit: ADXL345 Learning Guide<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u0622\u0645\u0648\u0632\u0634 \u0633\u0627\u062e\u062a \u0633\u06cc\u0633\u062a\u0645 \u0647\u0634\u062f\u0627\u0631 \u0632\u0644\u0632\u0644\u0647 \u0628\u0627 \u0633\u0646\u0633\u0648\u0631 ADXL345 \u0648 LoRa SX1278 433MHz\u061b \u062a\u0634\u062e\u06cc\u0635 \u0644\u0631\u0632\u0634\u200c\u0647\u0627\u06cc \u0628\u0627\u0644\u0627\u06cc \u0622\u0633\u062a\u0627\u0646\u0647\u060c \u0627\u0631\u0633\u0627\u0644 \u0647\u0634\u062f\u0627\u0631 \u0628\u0647 \u06f5km\u060c \u0646\u0635\u0628 \u0631\u0648\u06cc \u0633\u0627\u062e\u062a\u0645\u0627\u0646.<\/p>\n","protected":false},"author":1,"featured_media":695,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[19,20],"tags":[124,456,44,234,50,457,491,149],"class_list":["post-696","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials-2","category-projects-2","tag-433mhz","tag-adxl345","tag-lora","tag-sx1278","tag-50","tag-457","tag-491","tag-149"],"_links":{"self":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/696","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=696"}],"version-history":[{"count":1,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/696\/revisions"}],"predecessor-version":[{"id":697,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/posts\/696\/revisions\/697"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media\/695"}],"wp:attachment":[{"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/media?parent=696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/categories?post=696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/projectleon.net\/make\/wp-json\/wp\/v2\/tags?post=696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}