Real-Time Smart Water Quality Monitoring in Factories