You are on page 1of 23

"HEAVENS LIGHT IS OUR GUIDE"

RAJSHAHI UNIVERSITY OF ENGINEERING & TECHNOLOGY


DEPARTMENT OF
ELECTRONICS AND TELECOMMUNICATION ENGINEERING
COURSE NUMBER:-ETE 2200
COURSE NAME: Electronic Project Design AND Development.

Subject:-Project report.
SUBMITTED TO

NAME: Dr Md Kamal Hosain


Assistant Professor

Department Of Electronics and telecommunication engineering


SUBMITTED BY:
NAME: Mahdee Nafis
ROLL: 1604002
CLASS: 2nd YEAR even SEMESTER
SUBMISSION DATE:
27.10.2018

1
INDEX
1. Introduction

2. Problem Statement

3. Objective Of The Project.

4.Scope Of The Project and further implementation.

5.System Information.

6.Circuit Design, Construction and Fabrication.

7.PCB Design

8.Conclusion.

9.Reference.
Water Automation Project Using Ultrasonic Sensor
Mahdee Nafis (1604002)
Supervised by:-Dr Md kamal Hosain
Associate Professor
Department Of Electronics And Telecommunication Engineering
Rajshahi University Of Engineering And Technology.

1. INTRODUCTION

2
Water is the largest natural resource but only 3% of it is freshwater, of which just 1/3 is
accessible for use in agriculture and cities. Today, the main water source for over 2 billion
people are aquifers – underground stores of freshwater. As income levels have risen globally,
so has the demand for water-intensive goods such as manufactured, meat, and dairy products,
stressing global freshwater resources.

Such increase in global freshwater consumption has led to the depletion of over half of the
world's largest aquifers, and is a problem that will likely deteriorate as demand grows. At this
pace, available freshwater reserves needed to ensure basic water, food, and energy security are
predicted to drop by 40%.

The responsible use of water is one of the main challenge that is faced by many industries
which requires a huge supply of water nowadays.So to ensure the responsible use of water
water automation project can play a vital role.

The water automation project is basically a system to detect the water level available in the
tank of household,industry and other industry station requiring huge supply and storage of
water.The purpose of this project is to reduce the wastage of water by using automatic water
pump turn on/off system.This project will also be able to determine the watel level of the tank
by using a Ultrasonic sensor.So It will be beneficial for industry and household to reduce the
wastage of water and also reduce the amount of electricity wasted on water pump.

3
2.Problem Statement:-
Various type of water pumping system that available in market nowadays, but this
system alone with the traditional system can't overcome the intrusion problem. This project is
designed with the LCD monitoring system to make the users
easy to monitor the level of water on the tank. Water monitoring system is a safe option to
monitoring tank levels as it doesn't require climbing on top of the tank and reaching in to make
measurements. All it involvesis monitor the water level on the LCD display attached with the
PCB board.

3.Objective Of The Project:-

The objectives of this project are as follows:-


1. To develop the water monitoring system where the water level is automatically detected by
the ultrasonic sensor (HC SR-04)

2.To program the automatic pumping system using the microcontroller, where the
program simulates data from sensor using analogue to digital converter (ADC).

3.To ensure the efficient use of water and reduce the wastage of water as much as possible.

4.Scope Of The Project

The scope of this project is to create a user friendly water supply system that will ensure max
efficiency and minimum wastage of water. It will help the user to pump water from well
reservoir or river into the water tank using the automatic pumping system and monitor the
water level on the LCD screen attached with the system. It has a sensor that will be detect the
water level, and it will generate a signal to control by the microcontroller AVR 328p-u. The
microcontroller will process the data signal and control the motor pump to allow the amount of
water that will be flow into the tank. The processed data from microcontroller will be sent to
the LCD screen and will show percentage of water level in the tank.

5.System Information:-The water automation system consists of the following parts:-

1.16*2 LCD Screen.(1pc).2.AVR 328P-U Microcontroller.(1pc)

3.12V -350ma DC mini submersible water pump.(1pc)

4.LED (2PCS).

5.12V 350ma AC to DC variable Adapter.

6.Resistors=10kohm,220ohm,1kohm(4p7.Connecting /jumper wires (20 pc minimum).

4
8.5V 10Amp single channel relay module.

9.1o kohm potentiometer.

10.Push button (1pc).

11.Capacitors.(22pico faraday,10 microfaraday,0.1 microfaraday).

12.16 mhz crystal.

13.LM7805 voltage regulator.

14. Ultrasonic sensor HCSR-04(1PC).

Block diagram Of the circuit:-

LCD DISPLAY
WATER Source

Voltage
Water pump 9V DC
control
Microcontroller regulator
LM7805
BATTERY

Relay
Module.

Ultrasonic sensor

WATER Reserve tank 5


6.Circuit Design ,construction and fabrication:-The Circuit diagram of the water automation
system is given Below:-

The connections are:-


Circuit connections
1.LCD DISPLAY:-
VSS=GROUND
VDD=POSITIVE 5 V
VE=MIDDLE PIN OF 10K POTENTIOMETER
RS=GROUND
E=PIN 24 ATMEGA 328P
D4=PIN 25

6
D5=PIN 26
D6=PIN 27
D7=PIN28
A=POSITIVE 5V
CATHODE=GROUND
RELAY
VCC=5V
GND =GROUND
IN=PIN 14
COM=POSITIVE TERMINAL OF BATTERY
N0=POSITIVE TERMINAL OF MOTOR
NEGATIVE TERMINAL OF MOTOR WITH THE NEGATIVE TERMINAL OF
BATTERY.

SONAR
VCC=5V
GND=GROUND
ECHO=PIN 5
TRIG=PIN 6

10K POT
LEG1=POSITIVE 5V
LEG 2 (MIDDLE)=VE OF LCD DISPLAY
LEG 3=GROUND.

CRYSTAL=9,10 PIN OF ATMEGA 328P

RESET PIN
LEG 1= PIN 1
LEG 2= 10K RESISTOR(OTHER SIDE OF RESISTOR CONNECTED TO 5V)

LM7805
TERMINAL 1=5V,AND GROUND(100 UF CAPACITOR)
TERMINAL 2=GROUND
TERMINAL 3=5V
LED=LEG1 5V 220OHM RESISTOR TO PIN 13.

7
Circuit Element descriptions:-The description of the circuit elements are described below:-

AVR 328P U Microcontroller:-

he ATMEGA328-PU from Microchip Technology is the famed through-hole MCU behind the
brilliance of the Arduino UNO. This 20MHz, 1.8 - 5.5V microcontroller has enabled fast
prototyping all over the world, and is now being designed in to a variety of products given its
design cycle flexibility. The ATMEGA328-PU comes in a 28-lead, 0.300" wide, PDIP package
and has an industrial temperature operation range from -40C to 85C. The ATmega328pu is
supported with a full suite of program and system development tools. Microchip uses high
density nonvolatile memory technology in manufacturing this device. Features include
32kbytes of in-system programmable Flash with readwhile-write capabilities.

PIN Description:-
1.VCC
Digital supply voltage.
2.GND
Ground
3.Port B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2 Port B is an 8-bit bi-directional I/O port
with internal pull-up resistors (selected for each bit). The Port B output buffers have
symmetrical drive characteristics with both high sink and source capability. As inputs, Port B
pins that are externally pulled low will source current if the pull-up resistors are activated. The
Port B pins are tristated when a reset condition becomes active, even if the clock is not
running. Depending on the clock selection fuse settings, PB6 can be used as input to the
inverting Oscillator amplifier and input to the internal clock operating circuit. Depending on
the clock selection fuse settings, PB7 can be used as output from the inverting Oscillator

8
amplifier. If the Internal Calibrated RC Oscillator is used as chip clock source, PB7...6 is used
as TOSC2...1 input for the Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set.

4.Port C (PC5:0)
Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for each bit).
The PC5...0 output buffers have symmetrical drive characteristics with both high sink and
source capability. As inputs, Port C pins that are externally pulled low will source current if the
pull-up resistors are activated. The Port C pins are tristated when a reset condition becomes
active, even if the clock is not running.

PC6/RESET
If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the electrical
characteristics of PC6 differ from those of the other pins of Port C. If the RSTDISBL Fuse is
unprogrammed, PC6 is used as a Reset input. A low level on this pin for longer than the
minimum pulse length will generate a Reset, even if the clock is not running. The minimum
pulse length is given in Table 29-11 on page 305. Shorter pulses are not guaranteed to generate
a Reset.

Port D (PD7:0)
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit).
The Port D output buffers have symmetrical drive characteristics with both high sink and
source capability. As inputs, Port D pins that are externally pulled low will source current if the
pull-up resistors are activated. The Port D pins are tristated when a reset condition becomes
active, even if the clock is not running.

AVCC
AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7:6. It should be
externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be
connected to VCC through a low-pass filter. Note that PC6...4 use digital supply voltage, VCC.

ADC7:6 (TQFP and QFN/MLF Package Only)


In the TQFP and QFN/MLF package, ADC7:6 serve as analog inputs to the A/D converter.
These pins are powered from the analog supply and serve as 10-bit ADC channels.

Data Retention
Reliability Qualification results show that the projected data retention failure rate is much less
than 1 PPM over 20 years at 85°C or 100 years at 25°C

BLOCK DIAGRAM

9
16*2 LCD DISPLAY:- LCD(Liquid Crystal Display) screen is an electronic display module
and find a wide range of applications. A 16x2 LCD display is very basic module and is very
commonly used in various devices and circuits. These modules are preferred over seven
segments and other multi segment LEDs. The reasons being: LCDs are economical; easily
programmable; have no limitation of displaying special & even custom characters (unlike in
seven segments), animations and so on.

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. This LCD has two registers, namely, Command
and Data.
The command register stores the command instructions given to the LCD. A command is an
instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting
the cursor position, controlling display etc. The data register stores the data to be displayed on

10
the LCD. The data is the ASCII value of the character to be displayed on the LCD. Click to
learn more about internal structure of a LCD.

OUTLINEDimension:-

11
5V 10AMP Relay Module:-

Description
The relay module is an electrically operated switch that allows you to turn on or off a circuit
using voltage and/or current much higher than a microcontroller could handle. There is no
connection between the low voltage circuit operated by the microcontroller and the high power
circuit. The relay protects each circuit from each other.
The each channel in the module has three connections named NC, COM, and NO. Depending
on the input signal trigger mode, the jumper cap can be placed at high level effective mode
which 'closes' the normally open (NO) switch at high level input and at low level effective
mode which operates the same but at low level input.
Specifications
 On-board EL817 photoelectric coupler with photoelectric isolating anti-interference ability
strong
 On-board 5V, 10A / 250VAC, 10A / 30VDC relays
 Relay long life can absorb 100000 times in a row
 Module can be directly and MCU I/O link, with the output signal indicator
 Module with diode current protection, short response time
 PCB Size: 45.8mm x 32.4mm

PIN Configuration:-

1. VCC: 5V DC
2. COM: 5V DC
3. IN1: high/low output
4. IN2: high/low output
5. GND: ground

12
13
Schematic Diagram

Ultrasonic Sensor HC SR 04:-

Description:-
The HC-SR04 ultrasonic sensor uses sonar to determine distance to an object like bats or
dolphins do.It offers excellent range accuracy and stable readings in an easy-to-use package. It
operation is not affected by sunlight or black material like Sharp rangefinders are (although
acoustically soft materials like cloth can be difficult to detect).Ultrasonic Ranging Module HC-
SR04 provides 2cm-300cm non-contact distance sensing capabilities,Ranging accuracy up to
3mm; module comprises an ultrasonic transmitter, a receiver and a control circuit.
Timing diagram
The Timing diagram is shown below. You only need to supply a short 10uS pulse to the trigger
input to start the ranging, and then the module will send out an 8 cycle burst of ultrasound at 40
kHz and raise its echo. The Echo is a distance object that is pulse width and the range in
proportion .You can calculate the range through the time interval between sending trigger signal
and receiving echo signal. Formula: uS / 58 = centimeters or uS / 148 =inch; or: the range = high
level time * velocity (340M/S) / 2; we suggest to use over 60ms measurement cycle, in order to
prevent trigger signal to the echo signal.
12V DC Water mini Submersible Pump:- This immersible pump can be used to water your
plants, make a fountain or waterfall, even change your fish tank water. It comes with an inlet
valve, you can adjust the water inflow manually. Ang it works quietly with the sound level under
40db. The pump has a filter inside as well as a suction cup which can help stick it to smooth
surfaces tightly.

Description:- Product information:

1. Voltage: DC 12V

2. Head: 100cm

3. Flow rate: 240L/H

4. Power: 4.8W

5. Caliber: Outer diameter 8mm

6. Volume: 55*52*41mm

SPECIFICATION   Power supply: 6~12V DC,65mA‐500mA   Interface: DC 5.5‐2.1


  Pumping head: 0‐200cm   Capacity: 0~550L/H   Power range: 4~5W   Dimensions:
45x43x30mm(1.77x1.69x1.18")   Weight: 300g   Cable length: 1m (39.37").
The vertical lifting height is 100cm; no water pipe: the direct water spray height of the water
outlet is about 10cm.

Adapter Ac Dc Variable 1.5V to 12V 350mA:-The adpater will be used to supply current to the
motor.As the max current rating of the motor is 350ma so the current will be maintained
carefully.

Diagram:-
Description

Adapter Ac Dc Variable 1.5V to 12V 350mA

 Variable Ac Dc Voltage Adapter


 Model Number:NA380S
 Brand Name: NEW STAR
 1.5V to 12V
 350mah Variable Ac Dc Voltage Adapter
Microcontroller code For the water automation Porject:-
#include<LiquidCrystal.h>
LiquidCrystal lcd(A0,A1,A2,A3,A4,A5);
#define echopin 3
#define trigpin 4
int maximumRange = 50;
long duration, distance,waterlev;
float percent;
void setup()
{
lcd.begin(16,2);
pinMode (trigpin, OUTPUT);
pinMode (echopin, INPUT );
pinMode (7, OUTPUT);
pinMode (8,OUTPUT);
}

void loop ()
{
{
digitalWrite(trigpin,LOW);
delayMicroseconds(2);

digitalWrite(trigpin,HIGH);
delayMicroseconds(10);

duration=pulseIn (echopin,HIGH);

distance= duration/58.2;
waterlev=23-distance;
percent=map(waterlev,0,23,0,100);

delay (50);

lcd.clear();
lcd.setCursor(0,0);
lcd.print("water :");
lcd.print(percent);
lcd.print(" %");

delay(0);

if (distance <= 5 )
{
digitalWrite (8,HIGH);
digitalWrite (7,HIGH);
lcd.setCursor(0,1);
lcd.print("Tank is Full");
delay(0);
}
else if (distance >=15)
{
digitalWrite (7,LOW);
digitalWrite (8,LOW);
lcd.setCursor(0,1);
lcd.print("Motor Started");

}
delay(1000);
}

7.PCB Design:-The PCB(printed circuit board) is designed using the software express pcb.The
design is given below:-

Fig:-designed PCB.
FIG:-TOP Layer
FIG:-Bottom Copper Layer
Project Diagram

Future Implementation and Development:-


In this sytem further implementation can be done by adding a wattmeter to calculate the amount
of electricity cosumed by the water pump and the total system.The data from the wattmeter can
also be used to calculate the Electric bill monthly/ weekly that will generate by the use of the
system
8.Conclusion:-Water automation project allows to detect the percentage of water level in the
water container and also reduces the wastage of water to a great extent.The system is controlled
by the microcontroller avr 328p u which enables to detect the water level and also automatically
turns on/off the water pump with the help of a relay module.The use of the ultrasonic sensor HC
SR04 eases the determination of water level without any direct contact with the water.In
conclusion the system can be of great use in industrial and household purpose for ensuring
maximum efficient use of water and also minimizes the wastage of water.

9.References:-
1. https://www.microchip.com/
2. www.sparkfun.com/datasheets/LCD/ADM1602K-NSW-FBS-3.3v.pdf
3. /www.electronicshub.org/water-level-controller-using-8051-microcontroller/
4. https://components101.com/5v-relay-pinout-working-datasheet
5. www.youtube.com/watch?v=25aWTpxfh00&t=358s
6. . www.itead.cc/wiki/Ultrasonic_Ranging_Module_HC-SR04
7. www.expresspcb.com/expresspcb/
8. www.electronicshub.org/electronics-projects-ideas/
9. https://nevonprojects.com/project-ideas/electronics-ideas/
10. http://bdspeedytech.com/index.php?route=checkout/cart

Supervisor's Comment:-

Signature Of Supervisor:-

Dr. Md. Kamal Hosain


Associate Professor
Department Of Electronics And TeleCommunication Engineering

You might also like