Sheekar Banerjee
Published © CC0

Water Level Sensor with Arduino | Sheekar Banerjee

The Water Level Depth Detection Sensor for Arduino has Operating voltage DC3-5V and Operating current less than 20mA.

IntermediateShowcase (no instructions)834
Water Level Sensor with Arduino | Sheekar Banerjee

Things used in this project

Hardware components

Water Level Sensor Depth of Detection Water Sensor for Arduino
×1
Arduino UNO
Arduino UNO
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Circuit Diagram of Water Level Sensor with Arduino UNO R3

Code

Program of Water Level Sensor with Arduino UNO R3

Arduino
//Coded and Tested By:
//Sheekar Banerjee, AI-ML-IOT Solution Engineer and Researcher

int value = 0;  // holds the value
int data = A0; // sensor data pin used
  
void setup() { 
  
  pinMode(data, INPUT);
  Serial.begin(9600); //start the serial console
} 
  
void loop() { 
   
  value = analogRead(data); //Read data from analog pin and store it to value variable
   
  if (value<=100)
  { 
    Serial.println("Water Level: Empty"); 
  } 
  else if (value>100 && value<=400)
  { 
    Serial.println("Water Level: Low"); 
  } 
  else if (value>400 && value<=450)
  { 
    Serial.println("Water Level: Medium"); 
  } 
  else if (value>450){ 
    Serial.println("Water Level: High"); 
  }
  delay(1000); 
}

Program of Water level Sensor (Plotter) with Arduino UNO R3

Arduino
//Coded and Tested By:
//Sheekar Banerjee, AI-ML-IOT Solution Engineer and Researcher

const int sensorPin= A0; //sensor pin connected to analog pin A0
int liquid_level;

void setup() {
  Serial.begin(9600); //sets the baud rate for data transfer in bits per second
  pinMode(sensorPin, INPUT);//the liquid level sensor will be an input to the arduino
}

void loop() {
  liquid_level= analogRead(sensorPin); //arduino reads the value from the liquid level sensor
  Serial.println(liquid_level);//prints out liquid level sensor reading
  delay(3000);//delays 3 Seconds
}

Credits

Sheekar Banerjee
0 projects • 6 followers
A motivated Computer Scientist & Engineer with years of experience over IoT, Robotic Systems, Machine Learning Algorithms and Software.
Contact

Comments

Please log in or sign up to comment.