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

Arduino UNO-Based Wi-Fi Controlled Water Dispensing System with Flow Sensor and LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Wi-Fi Controlled Water Dispensing System with Flow Sensor and LCD Display

Circuit Documentation

Summary

This circuit is designed to control a water dispensing system using an Arduino UNO microcontroller. The system includes an 8 push button board for selecting water volume, a water flow sensor to measure the dispensed water, a relay module to control a solenoid valve, an ESP8266-01 WiFi module for connectivity, and a 16x2 I2C LCD for displaying information. The system is powered by a 12V battery.

Component List

  1. 8 Push Button Board PCB

    • Pins: K1, K2, K3, K4, K5, K6, K7, K8, GROUND
    • Description: A board with 8 push buttons used to select the volume of water to be dispensed.
  2. Water Flow Sensor

    • Pins: Signal, Vcc, GND
    • Description: Measures the flow rate of water.
  3. Relay Module

    • Pins: NC, COM, INPUT, GND, VCC
    • Description: Controls the solenoid valve to start and stop water flow.
  4. Solenoid Valve 12V

    • Pins: GND, 12V
    • Description: Controls the flow of water.
  5. WiFi Module ESP8266-01

    • Pins: RX, GPIO0, GPIO2, GND, +3V3, Reset, CH-PD Chip power down, TX
    • Description: Provides WiFi connectivity.
  6. Arduino UNO

    • 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
    • Description: The main microcontroller used to control the system.
  7. 16x2 I2C LCD

    • Pins: GND, VCC, SDA, SCL
    • Description: Displays information to the user.
  8. Battery 12V

    • Pins: +, -
    • Description: Powers the circuit.
  9. Resistor

    • Pins: pin1, pin2
    • Description: Provides resistance in the circuit.
    • Properties: 200 Ohms

Wiring Details

8 Push Button Board PCB

Water Flow Sensor

Relay Module

Solenoid Valve 12V

WiFi Module ESP8266-01

Arduino UNO

16x2 I2C LCD

Battery 12V

Resistor

Code Documentation

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x3F, 16, 2);
const int relayPin = 4;
const int flowSensorPin = A0;
const int buttonPins[] = {5, 6, 7, 8, 9, 10, 11, 12};
int watervolume = 0;
int flowSensorValue = 0;

void setup() {
    Serial.begin(9600);
    lcd.begin(16, 2);
    lcd.print("Water Dispense");
    for (int i = 0; i < 8; i++) {
        pinMode(buttonPins[i], INPUT);
    }
    pinMode(relayPin, OUTPUT);
    digitalWrite(relayPin, LOW);
    pinMode(flowSensorPin, INPUT);
}

void loop() {
    for (int i = 0; i < 8; i++) {
        if (digitalRead(buttonPins[i]) == HIGH) {
            watervolume = (i + 1) * 100;
            lcd.clear();
            lcd.print("Dispensing:");
            lcd.print(watervolume);
            lcd.print("ml");
            break;
        }
    }
    digitalWrite(relayPin, HIGH);
    flowSensorValue = analogRead(flowSensorPin);
    delay(500);
    if (flowSensorValue >= watervolume) {
        digitalWrite(relayPin, LOW);
        lcd.clear();
        lcd.print("Water Dispensed");
    }
    delay(1000);
}

This code initializes the LCD, sets up the pins for the buttons, relay, and flow sensor, and continuously checks for button presses to determine the volume of water to dispense. The relay is activated to start the water flow, and the flow sensor value is monitored to stop the flow once the desired volume is reached.