A smart solution for flooding, drought and water pollution