Hello
Im trying to make earthquake alarm project. So my first step is reading sensor data. As sensor I took this device quake alarm
I cut off the speaker from the detector, pass the wires through a voltage regulator and then connect it to an analog port in the Arduino board. Then I tested. As result I got this:
926
926
925
925
925
925
925
925
924
924
924
924
924
1023
1023
1023
1023 // and this 1023 was repeated even shaking is stopped
The problem is when occurred shaking analogread=1023 (If I understood its max analogread value like 5 V) and when shaking is stopped I still had 1023 . In peace time value <990.
void setup(){
Serial.begin(9600);
Serial.println("Reading...");
}
void loop(){
int value;
int detectorValue=0;
detectorValue = analogRead(A1);
value=detectorValue;
Serial.println(value);
delay(1000);
}