Since half of South Carolina is under water, and the levels keep increasing each day, I decided to modify our fuel and cistern fluid level project to a flood level monitor. We start with a eTape level sensor from Milone Technologies. You could connect this to a ethernet or wifi shield, or even a gsm shield to notify you of water levels.
Their website lists up to 32″, but longer units are available.
Become the Maker you were born to be. Try Arduino Academy for FREE!
int sensorPin = 0; // select the analog input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
float h; // variable for height of liquid
void setup() {
Serial.begin(9600);
}
void loop() {
sensorValue = analogRead(sensorPin);
Serial.print(sensorValue); //actual adc value
Serial.println(” ADC”);
// Uncomment one of the lines below to match your sensor
//h = mapfloat(sensorValue, 215, 512, 8, 0) //8″
h = mapfloat(sensorValue, 170, 512, 12, 0); //12″
//h = mapfloat(sensorValue, 93, 512, 24, 0); //24″
//h = mapfloat(sensorValue, 75, 512, 32, 0); //32″
Serial.print(h, 2); // fluid height (inches)
Serial.println(” inches”);
delay(5000); //how long between measurements
}
float mapfloat(float x, float in_min, float in_max, float out_min, float out_max){
return (x – in_min) * (out_max – out_min) / (in_max – in_min) + out_min;
}