Manual  and Automatic water level controller
2100 12
uday kiran

Manual and Automatic water level controller

This project is based on a water tank management system. The project name is a Manual And Automatic...

Description:-

This project is based on a water tank management system. The project name is a Manual And Automatic Water Level Controller. In the project setup, the motor is controlled by two modes

these are:-

1.auto mode and

2.Manual mode.

In auto mode When the water level is very low the water pump will automatically be ON, When the water level will reach a very height then the water pump will automatically be OFF and  manual mode, you can  ON and OFF the water pump. if you ON the water pump in the manual mode and you forgot after some time  no problem the device automatically turn OFF the water pump This project can help to save water. We can apply this whole setup in our home.

 

Hardware Used In Project

arduino Nano  (Atmega328P Microcontroller IC )  

LCD display(16*2)

ultrasonic sensor(HC SR04)

Transformer(0-12)

diodes(1n4007)

capacitor(470uf and 25v)

voltage regulator(7805)

indicator light(green color)

switch

push button

bluetooth module(HC-05)

5v relay

Transistor(BC457)

Resistance

I2C module

 

Project Used Software

Arduino IDE

MIT app inventor

Tinkercad

Ultimaker Software

Fritzing Software

 

Project Hardware Software Selection

Atmega328P Microcontroller IC: -

ATmega328P Microcontroller is the most widely used standalone Atmega IC for electronics projects. Here I used this microcontroller IC instead of Arduino Uno to save some space.

Ultrasonic Sensor: -

An ultrasonic sensor is an electronic device that measures the distance of a target object by emitting ultrasonic sound waves, and converts the reflected sound into an electrical signal. Ultrasonic waves travel faster than the speed of audible sound (i.e. the sound that humans can hear). Ultrasonic sensors have two main components: the transmitter (which emits the sound using piezoelectric crystals) and the receiver (which encounters the sound after it has travelled to and from the target).

Relay Module(single channel):-

Relay is an electromechanical device that uses an electric current to open or close the contacts of a switch. The single-channel relay module is much more than just a plain relay, it comprises of components that make switching and connection easier and act as indicators to show if the module is powered and if the relay is active or not.

LCD display(16*2):-

A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix.

Bluetooth Module(HC-05):-

HC-05 Bluetooth Module is an easy to use Bluetooth SPP (Serial Port Protocol) module, designed for transparent wireless serial connection setup. Its communication is via serial communication which makes an easy way to interface with controller or PC.

Transformer(0-12):-

The transformer in the simplest way can be described as a thing that steps up or steps down voltage. In a step-up transformer, the output voltage is increased and in a step-down transformer, the output voltage is decreased. The step-up transformer will decrease the output current and the step-down transformer will increase the output current for keeping the input and the output power of the system equal.

voltage regulator(7805):-

voltage regulator, any electrical or electronic device that maintains the voltage of a power source within acceptable limits. ... Such a device is widely used in motor vehicles of all types to match the output voltage of the generator to the electrical load and to the charging requirements of the battery.

 

Circuit Diagram

Circuit Diagram

APP design in MIT app inventor

MIT App Inventor

APP blocks in MIT app inventor

MIT App Inventor

3D model design in Tinkercad  

3D Model Design

3D model design in Ultimaker Software

3D Design

circuit diagram design Fritzing Software

Circuit Design

Code in Arduino IDE

Arduino Code

Water Level Controller

Code

#include <EEPROM.h>

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

int Trig_Pin = 2;

int Echo_Pin = 3;

int Push_Button =10;

int Switch_pin =11;

int Motor_Pin =13;

int oldValue = 0 , newValue = 0;

long duration, cm;

int set_val,percentage;

bool state,pump;

void setup() {

  Serial.begin(9600);

  lcd.begin();

  lcd.print("WATER LEVEL:");

  lcd.setCursor(0, 1);

  lcd.print("PUMP:OFF MANUAL");

   pinMode(Trig_Pin, OUTPUT);

  pinMode(Echo_Pin, INPUT);

  pinMode(Push_Button, INPUT_PULLUP);

  pinMode(Switch_pin, INPUT_PULLUP);

  pinMode(Motor_Pin, OUTPUT);

  set_val=EEPROM.read(0);

   if(set_val>30)set_val=30;

}

void loop() {

  digitalWrite(Trig_Pin, HIGH);

   delayMicroseconds(10);

   digitalWrite(Trig_Pin, LOW);

   duration = pulseIn(Echo_Pin, HIGH);

   cm = microsecondsToCentimeters(duration);

    percentage=(set_val-cm)*100/set_val;

    lcd.setCursor(12, 0);

   if(percentage<0)percentage=0;

   lcd.print(percentage);

   lcd.print("% ");

   newValue = percentage;

  if(newValue != oldValue)

  {

    Serial.print(percentage);

    Serial.println("%");

    oldValue = newValue;

  }

  delay(500);

 

   if(percentage<20&digitalRead(Switch_pin))pump=1;

   if(percentage>90)pump=0;

   digitalWrite(Motor_Pin,!pump);

   lcd.setCursor(5, 1);

   if(pump==1)lcd.print("ON ");

   else if(pump==0) lcd.print("OFF");

   lcd.setCursor(9, 1);

   if(!digitalRead(Switch_pin))lcd.print("MANUAL");

   else lcd.print("AUTO   ");

    if(!digitalRead(Push_Button)&!state&digitalRead(Switch_pin)){

      state=1;

      set_val=cm;

      EEPROM.write(0, set_val);

      }

     if(!digitalRead(Push_Button)&!state&!digitalRead(Switch_pin)){

        state=1;

        pump=!pump;

     }

    if(digitalRead(Push_Button))state=0;

  delay(500);

}

long microsecondsToCentimeters(long microseconds) {

  return microseconds / 29 / 2;

}