Water pollution occurs when harmful substances such as toxic chemicals, pathogenic microorganisms, or heavy metals contaminate freshwater sources, threatening both public health and ecosystem stability. Reliable monitoring of water quality is therefore essential for early detection and prevention of contamination. Conventional surveillance systems relying on large-scale Internet of Things (IoT) sensor networks are often costly to implement, complex to maintain, and may deliver inconsistent real-time data. This study presents a data-driven framework that combines IoT enabled sensing with machine learning techniques to improve the accuracy and efficiency of water quality assessment. During preliminary testing, publicly available datasets are used to simulate sensor readings, reducing dependence on physical hardware and lowering operational costs. Two classification algorithms, Extreme Gradient Boosting (XGBoost) and Naïve Bayes (XGB-NB) are employed to categorize water samples as either potable or polluted. Using the pond_iot_2023 dataset, which contains diverse physicochemical parameters, the proposed system demonstrates a robust, scalable, and cost-effective approach to intelligent water contamination detection.