Early warning system to prevent flooding