This circuit is designed to detect potential landslides by monitoring soil moisture, vibrations, and tilt. It uses an Arduino Nano microcontroller to process sensor data and trigger alerts via a buzzer and LEDs. Additionally, a GSM module is used to send SMS alerts in case of a detected landslide.
Arduino Nano
SW-420 Vibration Sensor
Buzzer
LED: Two Pin (red)
SIM800L GSM Module
Soil Moisture Sensor
ADXL345 Accelerometer (keystudio)
Resistor (220 Ohms)
LED: Two Pin (yellow)
LED: Two Pin (green)
9V Battery
GND connected to:
D2 connected to:
D3 connected to:
D4 connected to:
D5 connected to:
D6 connected to:
D7 connected to:
D8 connected to:
VIN connected to:
5V connected to:
A5 connected to:
A4 connected to:
A0 connected to:
vcc connected to:
Ground connected to:
Digital output connected to:
PIN connected to:
GND connected to:
cathode connected to:
anode connected to:
5V connected to:
GND connected to:
SIM_TXD connected to:
SIM_RXD connected to:
VCC connected to:
GND connected to:
SIG connected to:
5V connected to:
GND connected to:
SCL connected to:
SDA connected to:
pin1 connected to:
pin2 connected to:
cathode connected to:
anode connected to:
cathode connected to:
anode connected to:
+ connected to:
- connected to:
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL345_U.h>
#include <SoftwareSerial.h>
// Pin definitions
#define SOIL_SENSOR_PIN A0
#define VIBRATION_SENSOR_PIN 2
#define BUZZER_PIN 3
#define GREEN_LED 4
#define YELLOW_LED 5
#define RED_LED 6
// Threshold values
#define MOISTURE_THRESHOLD 500 // Soil moisture threshold
#define VIBRATION_THRESHOLD 100 // Vibration sensor threshold
#define TILT_THRESHOLD 15.0 // Tilt threshold (degrees)
// Initialize accelerometer
Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);
// GSM module connected to pins D7 (TX) and D8 (RX)
SoftwareSerial gsm(7, 8);
void setup() {
// Pin Modes
pinMode(SOIL_SENSOR_PIN, INPUT);
pinMode(VIBRATION_SENSOR_PIN, INPUT);
pinMode(BUZZER_PIN, OUTPUT);
pinMode(GREEN_LED, OUTPUT);
pinMode(YELLOW_LED, OUTPUT);
pinMode(RED_LED, OUTPUT);
// Initialize Serial and GSM
Serial.begin(9600);
gsm.begin(9600);
// Initialize Accelerometer
if (!accel.begin()) {
Serial.println("No ADXL345 detected, check wiring.");
while (1);
}
accel.setRange(ADXL345_RANGE_16_G); // Set range for the accelerometer
}
void loop() {
int moistureLevel = analogRead(SOIL_SENSOR_PIN);
int vibration = digitalRead(VIBRATION_SENSOR_PIN);
sensors_event_t event;
accel.getEvent(&event);
float tilt = atan2(event.acceleration.y, event.acceleration.x) * 180 / PI;
// Print sensor readings
Serial.print("Soil Moisture: ");
Serial.println(moistureLevel);
Serial.print("Vibration: ");
Serial.println(vibration);
Serial.print("Tilt: ");
Serial.println(tilt);
// Landslide detection logic
if (moistureLevel > MOISTURE_THRESHOLD || vibration > VIBRATION_THRESHOLD || abs(tilt) > TILT_THRESHOLD) {
// Trigger alert
digitalWrite(BUZZER_PIN, HIGH);
digitalWrite(RED_LED, HIGH);
digitalWrite(YELLOW_LED, LOW);
digitalWrite(GREEN_LED, LOW);
sendSMS("Warning: Possible landslide detected!");
delay(2000);
} else if (