Can I use a PIR sensor rather than an accelerometer module in an earthquake detector

i am making an earthquake detector

// C++ code
//
#include <Adafruit_LiquidCrystal.h>

int input = 0;

Adafruit_LiquidCrystal lcd_1(0);

void setup()
{
  lcd_1.begin(16, 2);
  pinMode(4, INPUT);
  Serial.begin(9600);
}

void loop()
{
  input = digitalRead(4);
  Serial.println(input);
  if (input > 0) {
    lcd_1.setBacklight(1);
    lcd_1.display();
    lcd_1.print("watch out!");
  }
  delay(1000); // Wait for 1000 millisecond(s)
  lcd_1.clear();
  lcd_1.setBacklight(0);
  lcd_1.noDisplay();
}

Try it and let us know if you do detect an earthquake.

The PIR sensor should do a great job of detecting the approaching wave of molten lava that comes after the earthquake.

@ohioya perhaps you should start by identifying the tell tale signs of an earthquake. Once you have a list, then you could look at what sensor would be needed to detect it.

Accelerometers measure acceleration and therefore can be used to detect some vibrations.

A PIR - Passive Infra Red - sensor detects infra red radiation. Often used to detect movement of a warm body.

what about a TOF (time of Flight) sensor - Resolution: 1 mm

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.