Water Level Monitoring System with Motor Control
The Water Level Monitoring System is an Arduino-based project designed to efficiently manage liquid levels in a tank or container. Using an ultrasonic sensor, the system accurately measures the distance to the water surface, providing real-time data for effective monitoring.
The Arduino board processes this information and decides whether to activate or deactivate a motor based on predefined thresholds. In this implementation, the motor controls the water flow, ensuring the tank remains within specified limits.
The circuit comprises an Arduino board, an ultrasonic sensor, an LCD display, and a motor. Pins on the Arduino are connected to corresponding components, establishing communication.
The ultrasonic sensor sends pulses and receives echoes to determine distances, while the motor is controlled by an output pin based on liquid level conditions. The LCD display provides visual feedback, indicating the motor’s state.
Name | Quantity | Component |
---|---|---|
U1 | 1 | Arduino Uno R3 |
PING1 | 1 | Ultrasonic Distance Sensor |
T1 | 1 | NPN Transistor (BJT) |
D2 | 1 | Diode |
M1 | 1 | DC Motor |
BAT1 | 1 | 9V Battery |
R2 | 1 | 1 kΩ Resistor |
U4 | 1 | LCD 16 x 2 |
Rpot2 | 1 | 250 kΩ Potentiometer |
R4 | 1 | 220 Ω Resistor |
Arduino Code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
long duration, cm, inches;
void setup() {
Serial.begin (9600);
pinMode(9, OUTPUT);
lcd.setCursor(0, 1);
lcd.print(millis() / 1000);
lcd.begin(11, 1);
}
void loop() {
pinMode(10, OUTPUT);
digitalWrite(10, LOW);
delayMicroseconds(5);
digitalWrite(10, HIGH);
delayMicroseconds(10);
digitalWrite(10, LOW);
pinMode(10, INPUT);
duration = pulseIn(10, HIGH);
cm = (duration / 2) / 29.1;
inches = (duration / 2) / 74;
if (inches > 57) {
digitalWrite(9, HIGH);
lcd.clear();
lcd.print("Motor Turn ON!!!");
} else if (inches < 20) {
digitalWrite(9, LOW);
lcd.clear();
lcd.print("Motor Turn OFF!!");
}
Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();
delay(250);
}
This project offers a cost-effective and reliable solution for liquid level management. The real-time monitoring capabilities enhance precision in controlling liquid levels, preventing overflow or depletion. The simplicity of the circuit, coupled with the versatility of Arduino, makes it an accessible and effective tool for various applications where maintaining optimal liquid levels is critical.