Arduino Nano-Based Landslide Detection System with GSM Alerts – Smart Disaster Monitoring Project

Arduino Nano Landslide Detection System with GSM Alerts | MakeMindz
⚠️ Safety Project — Always test in a controlled environment before deploying in the field.
Disaster Monitoring Arduino Nano GSM / SMS ADXL345 · SW-420 Intermediate

Arduino Nano Landslide Detection System with GSM Alerts

A multi-sensor early warning platform that fuses soil moisture, vibration, and tilt data to detect landslide precursors and fire instant SMS alerts — no internet required, ideal for remote hill stations and mining areas.

📅 Feb 2026 ⏱ ~60 min build 🔧 Nano · Soil · SW-420 · ADXL345 · SIM800L/SIM900
🟢 Normal — All sensors below threshold
🟡 Caution — Moderate risk detected
🔴 ALERT — Landslide risk! SMS sent
🏔️

Project Overview

The Arduino Nano Landslide Detection System is a smart environmental safety solution combining three complementary sensors to catch early warning signs of slope failure. Wet soil lowers shear strength, micro-vibrations signal unstable movement, and angle shifts confirm active displacement — monitoring all three together dramatically reduces false alarms while catching real events early.

🌧️
Soil Saturation
Detects excessive moisture — the primary trigger for slope instability.
📳
Vibration Detection
SW-420 catches ground micro-tremors before mass movement begins.
📐
Tilt / Acceleration
ADXL345 measures slope angle changes over time via I²C.
📲
Instant SMS Alert
GSM module pushes alerts over cellular — zero Wi-Fi dependency.
⚙️

How the System Works

1
Soil Moisture SensorContinuously reads analog soil saturation (A0). High water content = unstable ground.
2
Vibration Sensor SW-420Digital interrupt on D2. Detects abnormal ground movement and micro-seismic events.
3
ADXL345 Accelerometer (I²C)Reads X/Y/Z acceleration and computes tilt angle via atan2. Detects slope inclination change.
4
Arduino Nano Decision LogicFuses all three sensor values every second. Three-tier classification: Normal → Caution → Alert.
5
Buzzer + LED IndicatorGreen = safe, Yellow = caution, Red + Buzzer = emergency alert.
6
GSM SMS Alert (SIM800L / SIM900)AT commands trigger immediate SMS to registered emergency numbers via cellular network.
🔩

Components Required

#ComponentSpec / NotesQty
1Arduino NanoATmega328P, 5V, 14 digital + 8 analog pins1
2Soil Moisture SensorCapacitive or resistive, analog output (AO)1
3SW-420 Vibration SensorDigital output, adjustable sensitivity via pot1
4ADXL345 AccelerometerI²C interface, ±16g range, 3.3V supply1
5GSM Module (SIM800L or SIM900)SIM800L: 4V/2A peak · SIM900: 5V/2A peak1
6Regulated Power Supply5V/2A for Nano + sensors; separate 4V/2A for SIM800L1–2
7Active Buzzer5V, 85dB+1
8LEDs (Green / Yellow / Red)5mm, with 220Ω resistors each3
9Active SIM CardGSM carrier with SMS plan1
10Jumper Wires + BreadboardMale-to-male and male-to-female~20
11220Ω ResistorsFor each LED current limiting3
🔌

Circuit Diagram & Pinout

Arduino Nano A0 · D2 · D3 · D4–D6 D7(TX)→GSM · D8(RX)←GSM A4(SDA) · A5(SCL) · 3.3V · 5V Soil Moisture AO → A0 VCC=5V · GND SW-420 Vibration DO → D2 VCC=5V · GND ADXL345 (I²C) SDA→A4 · SCL→A5 VCC=3.3V · GND SIM800L / SIM900 TX→D7 · RX←D8 VCC=4V ext · GND SIM CARD ANT Buzzer + LEDs Buzzer → D3 🟢D4 🟡D5 🔴D6 (220Ω each LED) Regulated PSU (≥2A) 5V Nano/Sensors · 4V SIM800L Common GND essential AO→A0 DO→D2 I²C UART D3–D6 5V Arduino Nano Landslide Detection — Circuit Overview Analog + Digital + I²C + UART + GSM Soil→A0 Vib→D2 I²C UART Alerts PWR Dashed = power distribution rails

📌 Full Pin Connection Reference

ComponentComponent PinArduino NanoWire
Soil MoistureAOA0Orange
Soil MoistureVCC5VRed
Soil MoistureGNDGNDBlack
SW-420 VibrationDOD2Yellow
SW-420 VibrationVCC5VRed
SW-420 VibrationGNDGNDBlack
ADXL345SDAA4Purple
ADXL345SCLA5Blue
ADXL345VCC3.3V ⚠️Red
ADXL345GNDGNDBlack
SIM800L/SIM900TXD7 (SoftSerial RX)Green
SIM800L/SIM900RXD8 (SoftSerial TX)Teal
SIM800L/SIM900VCCExternal 4V/5V PSURed
SIM800L/SIM900GNDCommon GNDBlack
Buzzer+D3Red
Green LEDAnodeD4 (via 220Ω)Green
Yellow LEDAnodeD5 (via 220Ω)Yellow
Red LEDAnodeD6 (via 220Ω)Red
⚠️ Critical: ADXL345 runs on 3.3V — never connect to 5V. SIM800L needs a dedicated 4V/2A supply (it surges to 2A on TX burst). Always connect all module GNDs to a common ground.
🎚️

Sensor Thresholds & Alert Logic

Thresholds below are starting points — calibrate for your specific soil type, sensor model, and geographic conditions.

SensorSafe (🟢)Caution (🟡)Alert (🔴)Variable
Soil Moisture (0–1023)< 250250–500> 500MOISTURE_THRESHOLD 500
Vibration (digital)LOWIntermittentHIGH (sustained)VIBRATION_THRESHOLD
Tilt Angle (degrees)< 7.5°7.5°–15°> 15°TILT_THRESHOLD 15.0
ℹ️ The alert fires when any one threshold is breached (OR logic). For reduced false alarms in production, consider requiring at least two sensors to exceed thresholds simultaneously (AND logic).
🛠️

Step-by-Step Build Instructions

1

Install Required Arduino Libraries

Open Arduino IDE → Sketch → Include Library → Manage Libraries. Search for and install:

  • Adafruit ADXL345 by Adafruit
  • Adafruit Unified Sensor by Adafruit
  • Wire (built-in — no install needed)
  • SoftwareSerial (built-in — no install needed)
ℹ️ Use Arduino IDE 2.x for best library management. The Adafruit ADXL345 library automatically pulls in Adafruit Unified Sensor as a dependency.
2

Wire the Soil Moisture Sensor

  • AO → Arduino A0 (orange wire)
  • VCC → Arduino 5V
  • GND → Arduino GND
⚠️ Resistive soil probes corrode over time in wet soil. For long-term deployment, use a capacitive soil moisture sensor (no exposed metal contacts).
3

Wire the SW-420 Vibration Sensor

  • DO → Arduino D2 (yellow wire)
  • VCC → Arduino 5V
  • GND → Arduino GND

Use the onboard potentiometer to adjust sensitivity. Turn clockwise to increase sensitivity (triggers on smaller vibrations).

4

Wire the ADXL345 Accelerometer (I²C)

  • SDA → Arduino A4 (purple wire)
  • SCL → Arduino A5 (blue wire)
  • VCC → Arduino 3.3V ⚠️ (NOT 5V)
  • GND → Arduino GND
⚠️ The ADXL345 is a 3.3V device. Connecting to 5V will permanently damage it. The Nano's A4/A5 I²C pins are 5V tolerant, so no level shifting is needed for the data lines.
5

Wire the GSM Module (SIM800L / SIM900)

  • Insert active SIM card into the module
  • GSM TX → Arduino D7 (SoftwareSerial RX)
  • GSM RX → Arduino D8 (SoftwareSerial TX)
  • VCC → External regulated power (4V for SIM800L, 5V for SIM900)
  • GND → Common GND
⚠️ SIM800L requires exactly 3.4–4.4V. Use a dedicated LiPo cell or a 5V-to-4V buck converter. Power it from the Nano's 5V pin only if using SIM900 — never for SIM800L.
6

Wire the Buzzer & Status LEDs

  • Buzzer (+) → D3 · Buzzer (−) → GND
  • Green LED anode → 220Ω resistor → D4
  • Yellow LED anode → 220Ω resistor → D5
  • Red LED anode → 220Ω resistor → D6
  • All LED cathodes → GND
7

Calibrate Sensor Thresholds

Before uploading the final sketch, upload a calibration sketch to read raw sensor values in Serial Monitor:

Arduino C++ — calibration
void setup() { Serial.begin(9600); }
void loop() {
  Serial.print("Moisture: "); Serial.println(analogRead(A0));
  Serial.print("Vibration: "); Serial.println(digitalRead(2));
  delay(500);
}

Record normal readings, then simulate wet soil / tapping the sensor to determine your real thresholds. Update MOISTURE_THRESHOLD and TILT_THRESHOLD accordingly.

8

Upload Main Sketch & Test

Replace the phone number in the code with your own +91XXXXXXXXXX. Select Arduino Nano and the correct COM port, then Upload. Open Serial Monitor at 9600 baud to watch live sensor readings.

ℹ️ Watch for the SIM800L status LED: slow blink every ~3s = registered on network. Fast blink = no signal. No blink = power issue.
💻

Full Source Code

Complete Arduino sketch with three-level alert logic, ADXL345 tilt calculation, and GSM SMS sending:

Arduino C++ — landslide_detection.ino
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL345_U.h>
#include <SoftwareSerial.h>

// ─── Pin Definitions ──────────────────────────────────────────────────────────
#define SOIL_PIN          A0
#define VIBRATION_PIN      2
#define BUZZER_PIN         3
#define GREEN_LED          4
#define YELLOW_LED         5
#define RED_LED            6

// ─── Thresholds (calibrate for your environment) ──────────────────────────────
#define MOISTURE_THRESHOLD 500   // 0–1023 ADC range
#define TILT_THRESHOLD     15.0  // degrees — full alert
// SW-420 is digital: HIGH = vibration detected

// ─── GSM Configuration ────────────────────────────────────────────────────────
#define PHONE_NUMBER  "+91XXXXXXXXXX"  // ← your number here
SoftwareSerial gsm(7, 8);            // RX=D7, TX=D8

// ─── Objects ──────────────────────────────────────────────────────────────────
Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);

// ─── State ────────────────────────────────────────────────────────────────────
unsigned long lastAlertTime = 0;
const unsigned long ALERT_COOLDOWN_MS = 60000;  // 1 min between SMS

void setup() {
  pinMode(SOIL_PIN,      INPUT);
  pinMode(VIBRATION_PIN, INPUT);
  pinMode(BUZZER_PIN,    OUTPUT);
  pinMode(GREEN_LED,     OUTPUT);
  pinMode(YELLOW_LED,    OUTPUT);
  pinMode(RED_LED,       OUTPUT);

  Serial.begin(9600);
  gsm.begin(9600);

  if (!accel.begin()) {
    Serial.println("ADXL345 not found – check wiring!");
    while (1);
  }
  accel.setRange(ADXL345_RANGE_16_G);
  Serial.println("Landslide Detection System Ready");
  setLED("green");
}

void loop() {
  int   moisture  = analogRead(SOIL_PIN);
  bool  vibration = digitalRead(VIBRATION_PIN);

  sensors_event_t event;
  accel.getEvent(&event);
  float tilt = atan2(event.acceleration.y,
                      event.acceleration.x) * 180.0 / PI;

  Serial.print("Moisture:"); Serial.print(moisture);
  Serial.print("  Vibration:"); Serial.print(vibration);
  Serial.print("  Tilt:"); Serial.println(tilt, 1);

  bool criticalAlert = (moisture  > MOISTURE_THRESHOLD  ||
                         vibration == HIGH                ||
                         abs(tilt) > TILT_THRESHOLD);
  bool warningAlert  = (moisture  > MOISTURE_THRESHOLD/2 ||
                         abs(tilt) > TILT_THRESHOLD/2);

  if (criticalAlert) {
    setLED("red");
    unsigned long now = millis();
    if (now - lastAlertTime > ALERT_COOLDOWN_MS) {
      String msg = "⚠ LANDSLIDE ALERT!\n"
                   "Moisture: " + String(moisture) + "\n"
                   "Tilt: "     + String(tilt,1) + "deg\n"
                   "Vibration: " + String(vibration ? "YES" : "NO");
      sendSMS(msg);
      lastAlertTime = now;
    }
    delay(2000);

  } else if (warningAlert) {
    setLED("yellow");

  } else {
    setLED("green");
  }

  delay(1000);
}

// ─── Helper: set LED + buzzer state ───────────────────────────────────────────
void setLED(String state) {
  digitalWrite(BUZZER_PIN, state == "red" ? HIGH : LOW);
  digitalWrite(RED_LED,    state == "red"    ? HIGH : LOW);
  digitalWrite(YELLOW_LED, state == "yellow" ? HIGH : LOW);
  digitalWrite(GREEN_LED,  state == "green"  ? HIGH : LOW);
}

// ─── Helper: send GSM SMS ─────────────────────────────────────────────────────
void sendSMS(String message) {
  gsm.println("AT+CMGF=1");      // Text mode
  delay(1000);
  gsm.println("AT+CMGS=\"" + String(PHONE_NUMBER) + "\"");
  delay(1000);
  gsm.println(message);
  delay(100);
  gsm.println((char)26);          // CTRL+Z = send
  delay(3000);
  Serial.println("SMS sent.");
}
ℹ️ The ALERT_COOLDOWN_MS variable (default 60s) prevents SMS flooding during a sustained alert. Adjust to suit your deployment requirements.
🔬

Simulation & Testing Tools

Prototype and validate this project online before soldering anything:

📦

Applications & Benefits

🏔️
Hill Stations
Early warning for residents in landslide-prone mountain communities.
🚂
Railway Slopes
Monitor embankments along rail and highway corridors for slope instability.
⛏️
Mining Safety
Detect tailings dam movement and open-pit wall micro-displacements.
🌊
Flood & Soil Monitoring
Detect water-saturated ground conditions before slope failure occurs.
🏗️
Construction Sites
Monitor excavation walls and temporary embankments during active work.
🌾
Smart Village Safety
Low-cost deployment for rural communities without infrastructure support.

✅ Key Benefits

Works without internet (GSM-only) · Multi-sensor fusion reduces false alarms · Three-tier alert system (normal / caution / critical) · Low-cost open-source hardware · Expandable to IoT cloud platforms (ThingSpeak, Blynk) · Scalable to multi-node network deployments · Learning platform for I²C, UART, and sensor fusion

Comments

try for free