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

Arduino UNO-Based Intelligent Water Dispensing System with LCD Display and Keypad Control

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Intelligent Water Dispensing System with LCD Display and Keypad Control

Intelligent Water Dispensing System Documentation

Summary

This document provides a detailed overview of the Intelligent Water Dispensing System. The system is designed to dispense a specified amount of water using an Arduino UNO microcontroller, a solenoid valve, a relay module, and various sensors and indicators. The system allows users to input the desired amount of water to be dispensed via a serial interface, and it controls the water flow accordingly. The system also monitors the water level and displays relevant information on an LCD screen.

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. 4x4 Keypad (Simulator)

    • Description: 4x4 matrix keypad for user input.
    • Pins: R1, C4, R2, C2, R3, R4, C1, C3
  3. Solenoid Valve 12V

    • Description: Valve that controls the flow of water.
    • Pins: GND, 12V
  4. 1 Channel 5V Relay Module

    • Description: Relay module to control high voltage devices.
    • Pins: VCC+, VCC- (GND), IN, N.O., COM, N.C.
  5. Water Flow Sensor

    • Description: Sensor to measure the flow rate of water.
    • Pins: Signal, Vcc, GND
  6. Water Level Sensor

    • Description: Sensor to measure the water level.
    • Pins: SIG, VCC, GND
  7. LED: Two Pin (green)

    • Description: Green LED indicator.
    • Pins: cathode, anode
  8. LED: Two Pin (red)

    • Description: Red LED indicator.
    • Pins: cathode, anode
  9. LED: Two Pin (yellow)

    • Description: Yellow LED indicator.
    • Pins: cathode, anode
  10. Buzzer

    • Description: Buzzer for audio alerts.
    • Pins: POSITIVE, NEGATIVE
  11. 12V Power Supply

    • Description: Power supply for the circuit.
    • Pins: +, -
  12. Resistor (200 Ohms)

    • Description: Resistor to limit current.
    • Pins: pin1, pin2
  13. LCD Screen 16x2 I2C

    • Description: LCD screen for displaying information.
    • Pins: SCL, SDA, VCC, GND

Wiring Details

Arduino UNO

4x4 Keypad (Simulator)

Solenoid Valve 12V

1 Channel 5V Relay Module

Water Flow Sensor

Water Level Sensor

LED: Two Pin (green)

LED: Two Pin (red)

LED: Two Pin (yellow)

Buzzer

12V Power Supply

Resistor (200 Ohms)

LCD Screen 16x2 I2C

Code Documentation

// Pin Definitions
const int relayPin = 8;           // Relay connected to pin 8 (to control water flow)
float maxTankVolume = 100.0;       // Maximum volume of the supply tank in liters (e.g., 10 liters)
float remainingVolume = maxTankVolume;  // Remaining volume in the supply tank (starts with maxTankVolume in liters)
float waterDispenseAmount = 0;    // Amount of water to be dispensed (in liters)
bool dispensingInProgress = false;  // Flag to check if dispensing is in progress

void setup() {
  // Initialize Serial communication
  Serial.begin(9600);
  
  // Set relay pin as output
  pinMode(relayPin, OUTPUT);
  digitalWrite(relayPin, LOW);  // Start with the relay off

  // Initial message
  Serial.println("Intelligent Water Dispensing System");
  Serial.println("Enter the desired water amount in liters and press enter:");
}

void loop() {
  // Check if data is available on Serial Monitor
  if (!dispensingInProgress && Serial.available() > 0) {
    // Read the input water amount in liters
    float inputLiters = Serial.parseFloat();
    if (inputLiters > 0) {
      waterDispenseAmount = inputLiters;  // Store the input in liters
      Serial.print("Water Dispense Amount: ");
      Serial.print(inputLiters);
      Serial.println(" liters");

      // Start dispensing water
      dispensingInProgress = true;
      dispenseWater(waterDispenseAmount);
    } else {
      Serial.println("Please enter a valid number greater than 0.");
    }