Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO-Based Water Quality Monitoring System with LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Water Quality Monitoring System with LCD Display

Circuit Documentation

Summary

This circuit is designed to monitor water quality by measuring pH levels and turbidity. The system uses an Arduino UNO microcontroller to read sensor data and display the results on an LCD screen. The circuit includes various components such as resistors, potentiometers, a pH meter, a turbidity sensor, and an LCD display.

Component List

  1. Arduino UNO

    • Description: Microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. Resistor

    • Description: 200 Ohms resistor.
    • Pins: pin1, pin2
    • Properties: Resistance: 200 Ohms
  3. Potentiometer

    • Description: Variable resistor.
    • Pins: GND, Output, VCC
  4. LCD Display (16 pin)

    • Description: 16x2 character LCD display.
    • Pins: VSS, VDD, VO, RS, R_W, E, DB0, DB1, DB2, DB3, DB4, DB5, DB6, DB7, A, K
  5. Turbidity Sensor

    • Description: Sensor to measure water turbidity.
    • Pins: OUT, VCC, GND
  6. pH Meter V1.1

    • Description: Sensor to measure pH levels.
    • Pins: DATA, VCC, GND

Wiring Details

Arduino UNO

Resistor

Potentiometer

LCD Display (16 pin)

Turbidity Sensor

pH Meter V1.1

Code Documentation

#include <LiquidCrystal.h>

// LCD pin configuration
const int rs = 13, en = 12, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

// Sensor pin configuration
const int pH_PIN = A1;
const int TURBIDITY_PIN = A0;

// Thresholds for water quality
const float PH_MIN = 6.5;
const float PH_MAX = 8.5;
const int TURBIDITY_THRESHOLD = 300;

void setup() {
  // Initialize the LCD
  lcd.begin(16, 2);
  lcd.print("Water Quality:");
  delay(2000);
}

void loop() {
  // Read sensor values
  float pHValue = analogRead(pH_PIN) * (5.0 / 1023.0) * 3.5;
  int turbidityValue = analogRead(TURBIDITY_PIN);

  // Display pH value
  lcd.setCursor(0, 0);
  lcd.print("pH: ");
  lcd.print(pHValue);

  // Display turbidity value
  lcd.setCursor(0, 1);
  lcd.print("Turbidity: ");
  lcd.print(turbidityValue);

  // Determine water quality
  // Clear the second row before displaying water quality
  lcd.setCursor(0, 1);
  lcd.print("                "); // Clear the second row
  lcd.setCursor(0, 1);
  if (pHValue >= PH_MIN && pHValue <= PH_MAX && turbidityValue < TURBIDITY_THRESHOLD) {
    lcd.print(" Good to Drink ");
  } else {
    lcd.print(" Not Drinkable ");
  }

  delay(2000); // Update every 2 seconds
}

This code initializes the LCD and reads the pH and turbidity sensor values. It then displays the pH and turbidity values on the LCD and determines if the water is good to drink based on predefined thresholds. The display updates every 2 seconds.