Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

ESP32-Based Smart Water Quality Monitoring System with pH, TDS, and Turbidity Sensors

Image of ESP32-Based Smart Water Quality Monitoring System with pH, TDS, and Turbidity Sensors

Circuit Documentation

Summary

This circuit is designed to interface various sensors with an ESP32 microcontroller. The sensors include a pH meter, a turbidity sensor, a TDS sensor, an RTD PT100, and a DS18B20 1-Wire temperature sensor. The circuit is powered by a 5V adapter connected to an AC wall plug point. The ESP32 microcontroller reads data from these sensors and can be programmed to process and transmit this data.

Component List

PH Meter

  • Description: Measures the pH level of a solution.
  • Pins: Signal, VCC, GND

ESP32-WROOM-32UE

  • Description: A powerful microcontroller with Wi-Fi and Bluetooth capabilities.
  • Pins: 3v3, EN, VP, VN, 34, 35, 32, 33, 25, 26, 27, 14, 12, GND, 13, D2, D3, 5V, 23, 22, TX, RX, 21, 19, 18, 5, 17, 16, 4, 0, 2, 15, D1, D0, CKL

TDS Sensor

  • Description: Measures the total dissolved solids in a solution.
  • Pins: P1, P2, +, -, A

Turbidity Sensor

  • Description: Measures the turbidity (cloudiness) of a solution.
  • Pins: OUT, VCC, GND

RTD PT100

  • Description: Measures temperature using a resistance temperature detector.
  • Pins: 1, 2

DS18B20 1-Wire Temperature Sensor Probe Cable

  • Description: Measures temperature using a 1-Wire interface.
  • Pins: shield, GND, DQ, VDD

5V Adapter

  • Description: Converts AC power to 5V DC power.
  • Pins: AC In 1, AC In 2, 5V, GND

AC Wall Plug Point

  • Description: Provides AC power from a wall outlet.
  • Pins: E, N, L

Wiring Details

PH Meter

  • Signal: Connected to ESP32 pin 12
  • VCC: Connected to 5V Adapter pin 5V
  • GND: Connected to 5V Adapter pin GND

ESP32-WROOM-32UE

  • 5V: Connected to 5V Adapter pin 5V
  • GND: Connected to 5V Adapter pin GND
  • Pin 12: Connected to PH Meter pin Signal
  • Pin 27: Connected to DS18B20 pin DQ
  • Pin 14: Connected to TDS Sensor pin A
  • Pin 13: Connected to Turbidity Sensor pin OUT

TDS Sensor

  • P1: Connected to RTD PT100 pin 1
  • P2: Connected to RTD PT100 pin 2
  • +: Connected to 5V Adapter pin 5V
  • -: Connected to 5V Adapter pin GND
  • A: Connected to ESP32 pin 14

Turbidity Sensor

  • OUT: Connected to ESP32 pin 13
  • VCC: Connected to 5V Adapter pin 5V
  • GND: Connected to 5V Adapter pin GND

RTD PT100

  • Pin 1: Connected to TDS Sensor pin P1
  • Pin 2: Connected to TDS Sensor pin P2

DS18B20 1-Wire Temperature Sensor Probe Cable

  • shield: Not connected
  • GND: Connected to 5V Adapter pin GND
  • DQ: Connected to ESP32 pin 27
  • VDD: Connected to 5V Adapter pin 5V

5V Adapter

  • AC In 1: Connected to AC Wall Plug Point pin N
  • AC In 2: Connected to AC Wall Plug Point pin L
  • 5V: Connected to ESP32 pin 5V, PH Meter pin VCC, Turbidity Sensor pin VCC, DS18B20 pin VDD, TDS Sensor pin +
  • GND: Connected to ESP32 pin GND, PH Meter pin GND, Turbidity Sensor pin GND, DS18B20 pin GND, TDS Sensor pin -

AC Wall Plug Point

  • N: Connected to 5V Adapter pin AC In 1
  • L: Connected to 5V Adapter pin AC In 2

Documented Code

ESP32-WROOM-32UE Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

This code is a basic template for the ESP32 microcontroller. The setup function is called once when the microcontroller starts, and the loop function is called repeatedly. You can add your sensor initialization and data processing code in these functions.