Using wireless sensor networks (WSN) for detecting leakage in water pipes