A wireless sensor network (WSN) with deployed field servers, which collect information on the water quality from a wide target area, is designed to detect water pollution in streams, rivers and coastal areas. The water pollution data, such as dissolved oxygen (DO), hydrogen ion exponent (pH), conductivity, turbidity, depth of water, and temperature, are transmitted between the field servers, and finally, to the base station (BS) in a self-organizing wireless sensor network using water quality sensor modules. A data averaging process is designed on the field servers to reduce the communication traffic and achieve consequential reliable data communication between the field servers and the BS in WSN. The measured sequential water quality data from the field servers are stored in a buffer for a fixed time duration and the stored water quality data are transmitted to the neighbor sensor node after performing the data averaging calculation at the node for data compression. A query-based flooding routing protocol is designed and used to transfer the measured water quality data efficiently. A query system is implemented using Java installed on a server PC connected serially via the RS-232 protocol to the BS. The sensor node is programmed using the nesC language on the TinyOS platform for small-scale WSN monitoring.