Introductions

Water is the essence of life, the fundamental resource that sustains all living creatures on Earth. Since the beginning of time, water has been the cradle of existence, shaping ecosystems and nurturing civilizations. The quality of drinking water is paramount—it must contain essential minerals in proper amounts, maintain safe levels of dissolved solids, and remain free from harmful contaminants to support health and well-being.

There is an important distinction between pure water and distilled water. Pure water, typically used for drinking, retains beneficial minerals and ions that contribute to its taste and nutritional value. In contrast, distilled water undergoes a process that removes all impurities, resulting in the purest form of water—devoid of minerals and other dissolved substances, making it unsuitable for regular consumption.

Interestingly, while water in its purest form is tasteless, the presence of dissolved solids—known as Total Dissolved Solids (TDS)—gives it distinct characteristics. Purified drinking water often has a subtle bitter note due to added minerals, while natural sources like borewell water may taste slightly sweet because of its mineral content. Distilled water, however, lacks any discernible taste since all dissolved substances have been removed. This variation in taste underscores the critical role TDS plays in determining water quality and its suitability for drinking.

The Total Dissolved Solids (TDS) content in water can be accurately measured using specialized sensors. These devices detect water conductivity and process the signal into a digital TDS reading. The fundamental principle involves a two-electrode system powered by a voltage source, where dissolved ions create measurable current flow between the electrodes.

Modern TDS sensors significantly improve upon this basic method by incorporating advanced features. These integrated modules automatically regulate the electric field strength and include built-in temperature compensation for greater accuracy. Many models now feature auto-zeroing capabilities and digital signal processing, eliminating the need for manual calibration in most applications. While traditional methods required calibration using buffer solutions, most contemporary sensors arrive factory-calibrated and ready for immediate use, though verification with reference solutions remains recommended for precision-critical applications.

The evolution from basic electrode systems to smart digital sensors has greatly simplified water quality testing while improving reliability and repeatability of measurements.

The TDS sensor operates across a wide voltage range of 3.3V to 5.5V, producing a 0-2.3V analog output signal, ensuring full compatibility with both 5V and 3.3V control systems. Its innovative AC excitation source design prevents electrode polarization, significantly enhancing probe longevity while maintaining stable output signal quality.

The waterproof probe construction allows for continuous immersion during long-term water quality monitoring. For accurate measurements in non-standard conditions, note that when testing water significantly above room temperature (25°C), an external temperature sensor must be integrated to provide proper temperature compensation.

Requirements for this lab

  • Arduino IDE | PlatformIO | Visual Studio Code
  • ARDUINO BOARDS & OTHER COMPATIBLE BOARDS
  • TDS Sensor Module Board with Probe
  • OLED Display Module
  • DS18B20 Temperature Sensor (Optional)
  • Resistors (See below required values)
  • Others (See below diagram for other requirements)

i2C Address Finder

This I2C address finder tool quickly identifies your OLED display’s communication address – simply upload the provided code to your Arduino board and open the Serial Monitor (found under Tools → Serial Monitor) to view the detected address. The scanner works seamlessly with common OLED displays including 128×64 and 128×32 pixel models, requiring only basic I2C connections (typically SDA to pin A4 and SCL to pin A5 on standard Arduino boards) for reliable detection. This straightforward solution eliminates guesswork when setting up your display interface, providing instant confirmation of your device’s correct I2C address through a simple upload-and-check process.

Test Code TDS (Arduino Code)

Test Code Version 2

This Arduino code creates a water quality monitoring system that measures Total Dissolved Solids (TDS) using a specialized sensor. The system consists of three main components: a TDS sensor that connects to analog pin A1, an I2C-connected OLED display for showing results, and the Arduino board that processes the data. At startup, the code initializes serial communication at 115200 baud for debugging and sets up the TDS sensor with important parameters including the 5V reference voltage (matching Arduino UNO’s specification) and 10-bit analog resolution. The OLED display is prepared with a 128×64 pixel resolution and checked for proper connection – if initialization fails, the system halts to prevent incorrect readings.

The core measurement process runs continuously in the main loop. Every cycle, it takes a new TDS reading while applying automatic temperature compensation (using either a default 25°C value or an actual temperature reading if a sensor is connected). The GravityTDS library handles the complex calculations, converting the raw analog signal into a meaningful parts-per-million (ppm) value that represents water purity. Results are output both to the Serial Monitor for debugging and prominently displayed on the OLED screen with large, readable numbers. The display updates every second, showing the current TDS value in ppm along with a clear label. For accuracy, the system automatically compensates for water temperature variations, as TDS readings are temperature-dependent. The code structure allows for easy integration of additional sensors, with clear markers showing where to add temperature sensor functionality if needed.

This implementation provides a reliable, user-friendly water quality monitoring solution that’s particularly useful for applications like drinking water analysis, aquarium maintenance, hydroponic systems, and industrial water treatment processes. The combination of immediate visual feedback through the OLED and detailed serial output makes it versatile for both standalone use and connected systems.

Downloads

Download TDS GravityTDS Code Library
Download DallasTemperature Code Library for DS18B20
Download TDS SENSOR / Water Quality Sensor Module Datasheet / Schematics
Download CD4060BM Datasheet
Download LMV324 Datasheet
Download TPS60400DBR Datasheet
Download ME6206A30M3G Datasheet

How to wire The TDS (Total Dissolved Solids) Water Quality Monitoring Sensor Module Board
Facebooktwitterredditpinterestmail
Tagged on:                 

JLCPCBPCBgogoPCBway4pcb

Leave a Reply

Your email address will not be published. Required fields are marked *