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

Arduino Water Level Monitoring System

View and Edit Project In Cirkit DesignerImage of Arduino Water Level Monitoring System

Circuit Documentation

Summary

This circuit is designed to monitor water levels using a Water Level Sensor connected to an Arduino UNO. The sensor outputs an analog signal that corresponds to the water level, which the Arduino reads and processes. The Arduino then outputs the raw sensor data, voltage, and percentage of water level to the Serial Monitor for easy monitoring.


Component List

Water Level Sensor


Arduino UNO


Wiring Details

Water Level Sensor


Arduino UNO


Documented Code

const int SIG_PIN = A0;

// For Arduino Uno (10-bit ADC, 0..1023) with default AREF = Vcc (5.0V)
const float VREF = 5.0;
const int   ADC_MAX = 1023;

// Optional: simple averaging for a steadier reading
const int NUM_SAMPLES = 16;

void setup() {
  Serial.begin(115200);
  // Give time for Serial Monitor to open
  delay(500);
  Serial.println("Water Level Sensor - Serial Monitor");
  Serial.println("Raw | Voltage (V) | Level (%)");
}

void loop() {
  // Take several samples and average
  long sum = 0;
  for (int i = 0; i < NUM_SAMPLES; i++) {
    sum += analogRead(SIG_PIN);
  }
  float raw = sum / float(NUM_SAMPLES);

  // Convert to voltage and percentage
  float voltage = (raw * VREF) / ADC_MAX;
  int percent = (int)round((raw * 100.0) / ADC_MAX);

  // Clamp just in case
  if (percent < 0) percent = 0;
  if (percent > 100) percent = 100;

  // Print nicely formatted
  Serial.print((int)raw);
  Serial.print(" | ");
  Serial.print(voltage, 3);
  Serial.print(" V | ");
  Serial.print(percent);
  Serial.println(" %");

  delay(250); // update ~4 times per second
}

This documentation provides a comprehensive overview of the circuit, detailing the components used, their connections, and the code that drives the functionality of the water level monitoring system.