In the last blog, I gave a brief description of the project and the block diagram for the electronics. In this blog, I'll describe the mechanism to detect landslides and test the sensors.
I'll be using a vibration sensor interfaced with an Arduino for landslide detection. The data from the vibration sensor will be transferred wirelessly using RF modules to another Arduino, which will alert the vehicles at a far-off distance from the landslide site. I'm planning to use an audio-visual alarm (buzzer and LED) to alert the drivers at the day and night time.
In this blog, I will interface the vibration sensor with Arduino and test it. The idea behind this is that, while the enclosure is at rest in a fixed position the vibration sensor will be off or in a stable position. However, when a landslide occurs, the enclosure box will topple or roll and the vibration sensor will detect this. The signal from the vibration sensor will be monitored by the Arduino and will send an alert to the other enclosure which has an audio-visual alarm. Along with the alarm, the GPS coordinates of the location will also be wirelessly transmitted.
Testing the vibration sensor-
The vibration sensor consists of a simple reed switch. When the metallic ball inside the reed switch makes a connection between the two terminals it switches On. Upon external vibrations, this metallic ball makes contact with the terminals and this is how it can detect the vibrations.
Here's the sensor in OFF position.
Both LEDs glow for the sensor in ON position or upon detecting vibration.
The limitation of this sensor is that it can detect the vibrations only momentarily and does not remain in ON position upon detecting vibration or in other words, it does not latch it's last state.
For this purpose, an Arduino code is written to detect the ON state of the vibration sensor and do further processing as required without reading the states of the switch once it has been triggered.
The code for Arduino is as follows -
int a;
void setup() {
// put your setup code here, to run once:
pinMode(5,INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
a = digitalRead(5);
if(a==0)
Serial.println("Vibration detected");
delay(1000);
}
The vibration sensor gives a 0 when it is ON, hence, I'm using an if statement to detect when the digital pin 5 goes LOW in the code and print it on the serial monitor.
In the next blog, I will send this vibration detected signal from one Arduino to another using RF module and print it on the LCD as well as sound an audio-visual alarm.