5.3 Water TDS Measurement Using PIC16F17146 Microccontroller

The conductivity of water changes if its Total Dissolved Solids (TDS) value increases or decreases. A higher value of TDS means more conductivity and vice versa. Also, the conductivity of water is directly proportional to its temperature. Therefore, along with the conductivity, it is required to measure temperature for determining the correct TDS value of water.

A TDS probe can be interfaced to a PIC16F17146, as shown in the Figure 5-3.

Figure 5-3. TDS Probe Interfaced with PIC16F17146 Microcontroller

OPA: Configured as relaxation oscillator for converting voltage to frequency, where the output frequency is a function of TDS (i.e., water conductivity). Refer to section Voltage-to-Frequency Converter for more details.

ADCC: Reads water temperature.

CCP: Configured Capture/Compare/PWM (CCP) module in Capture mode to measure the output frequency of OPA as a relaxation oscillator.

TMR1: Used along with the CCP module for frequency measurement.