WATER DEPTH MEASUREMENT WITH MPX5010DP

This is an example of measuring water depth using the MPX5010DP sensor. This method can be applied to monitor water levels in the river to monitor the possibility of flooding. Water depth data also can be displayed on LCD, see  https://arduinoproyek.wordpress.com/water-depth-measurement-mpx5010dp-with-lcd/

 

water depth meas MPX5010DP

float h;
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
h = (sensorValue-48.0403278832)/7.6673168807;
/*from calibration sensor value vs depth cm*/
Serial.print(“depth “);
Serial.print(h);
Serial.println(” cm”);
delay(100); // delay in between reads for stability
}