ESP8266/IoT B.Tech/Diploma Beginner

IoT Based Water Level Control & Monitoring with ESP8266

Build an IoT Based Water Level Control & Monitoring System with ESP8266 & Waterproof Ultrasonic Sensor to monitor water level on Blynk App

  • Suitable forB.Tech/Diploma ESP8266/IoT students
  • Build time1-2 weeks
  • LevelBeginner
  • Available atAjvika Labs, Kakinada

About this project

Overview
In this project, we will build an
IoT Based Water Level Control & Monitoring System
with
ESP8266
and
Waterproof Ultrasonic Sensor
. We can monitor the
water level
on
Blynk
Dashboard. Earlier we built
Water level alert using 555
Timer IC.

An Internet of Things (IoT) water level control and monitoring system is a smart,
automated solution
to manage and maintain water levels in various applications such as tanks, reservoirs, and swimming pools. These systems use
IoT devices, sensors
, and cloud-based platforms to collect, process, and analyze data. This information is used to optimize water usage, prevent wastage, and provide
real-time monitoring of water levels
This project effectively addresses the issue of water wastage and maintains optimal water levels. Utilizing the
ESP8266 WiFi Module
as the primary controller, the system manages all electronic components and executes actions based on WiFi network connectivity. The
JSN-SR04T waterproof ultrasonic sensor
, positioned at the top of the tank, measures water levels. A
0.96″ I2C OLED
screen displays these water levels for easy monitoring.
The device can operate in either
manual or automatic mode
, with a relay included in the
circuit
to control the water pump’s on/off state. Users can observe and manage the water level and mode control functions through the
Blynk application
, ensuring efficient water usage and conservation.
You may check some water level projects we build earlier:
Inductive Water Level Indicator with Display
GSM Based Water Level Monitoring System with Arduino
Bill of Materials
We need the following components to build this
IoT based Water Level Monitoring and Control project
. You can purchase all the components from the given links.
S.N.
Components
Quantity
Purchase Link

NodeMCU ESP8266 WiFi Module

Amazon
AliExpress

JSN-SR04T Ultrasonic Sensor

Amazon
AliExpress

0.96" I2C OLED Display

Amazon
AliExpress

Hi-Link 220V AC to 5V DC Converter

Amazon
AliExpress

5V Relay Module

Amazon
AliExpress

Push Button Switch

Amazon
AliExpress

AC Water Pump

Amazon
AliExpress

Pipes 2 meter or more

Zero PCB Board

Amazon
AliExpress
The main controller used in this project is NodeMCU ESP8266 WiFi Module. For detecting the Water level of the tank, we can use Ultrasonic Sensor HC-SR04. But in this case, JSN-SR04T Waterproof Ultrasonic Sensor is a better choice.
The
JSN-SR04T
is an
ultrasonic distance sensor
which is a waterproof version of the popular
HC-SR04
sensor. It is designed to work in harsher environmental conditions where water or moisture might be present. The module uses ultrasonic sound waves to determine the
distance
to an object by emitting a sound wave, and then measuring the time it takes for the echo to return.
For displaying Water level, we can use
0.96″ SSD1306 OLED Display
. The SSD1306 0.96″ OLED Display is a popular and compact display module used in many DIY electronics projects. It is based on the SSD1306 driver chip, which is designed to drive monochrome OLED screens.
The display has a resolution of
128×64 pixels
and provides a crisp, high-contrast image, making it suitable for various applications, such as displaying text, graphics, and icons. The module typically communicates with microcontrollers like Arduino, ESP8266, or Raspberry Pi using the I2C (Inter-Integrated Circuit) protocol.
For supplying power and controlling the relay, we used
HLK-PM01
AC to 5V DC converter Module. The Hi-Link
AC to 5V DC converter
is a compact and efficient power supply module that converts AC mains voltage (typically 90V-264V AC) to a stable 5V DC output.
These modules are widely used in various electronics and IoT projects that require a 5V DC supply from the main power.
Circuit Design & Connection
The following is the IoT Based Water Level Control & Monitoring System circuit designed using Waterproof Ultrasonic Sensor & NodeMCU ESP8266 Board. I used Fritzing Software to design the Schematic.
The Waterproof Ultrasonic Sensor has 4 pins. The ECHO & TRIG Pin is connected to the D7 & D6 pin of ESP8266. It is powered by 5V from ESP8266. The OLED Display is an I2C Module, therefore its I2C Pins SDA & SCL is connected to D2 & D1 of NodeMCU ESP8266.
There are 3 push buttons used in this project. They are used as Mode Selection, Buzzer, and Relay operation. The Push Buttons are connected to D0, D3 & D4 pins respectively.
For the supply unit, HLK-PM01 AC to 5V DC converter Module can be used here. The 220V AC is fed as input and the 5V DC output is fed to the Vin pin of ESP8266. The Relay is controlled via Digital Pin D5 of ESP8266. To control the AC Motor Pump, the Relay plays a crucial role. When the Relay turns on, the Motor also turns on and when it goes off, the Motor turns off as well.
I used Zero PCB to assemble the circuit. All components fit perfectly on the board.
For my project I am only using 2 push buttons as I am not using the Buzzer on my board. You may use a buzzer in the PCB and activate via Push Button.
The Ultrasonic Sensor can be placed at the top of the tank and the motor can be placed inside the tank. Here in my project, I used two buckets. One bucket is like a tank and the other is a water source from where the motor pulls water.
You may use any AC Water Pump or just a 12V Output pump and connect at the output terminal of the Relay.
Setting up Blynk 2.0 Application
To control & monitor the Water Level, you need to create a Blynk project and set up a dashboard in the mobile or web application. Here’s how you can set up the dashboard:
Visit
blynk.cloud
and create a Blynk account on the Blynk website. Or you can simply sign in using the registered Email ID.
Click on
+New Template
. Then give any name to the Hardware. Choose the Hardware type as ESP8266 and the connection type as WiFi. The template is created successfully.
Now we need to add New Devices here.
Select the device from a template that you created earlier. Give any name and click on Create. A device authentication token is generated now. Copy this token as this will be used in the code.
Now go to the Web Dashboard. In the Web Dashboard, drag and drop 3 widgets as Gauge and 2 switches on the dashboard. Then set the Dashboard as per following Screenshots.
The Blynk Dashboard setup is successfully completed now.
Source Code/Program
The follow is the complete code for IoT ESP8266 Based Ultrasonic Water Level Monitoring System. The code is written in Arduino IDE.
There are few changes that you need to make before uploading this code to the Esp8266 Board.
From the following lines change the Blynk Authentication Token.

#define BLYNK_TEMPLATE_ID "***************"
#define BLYNK_TEMPLATE_NAME "**********************"
#define BLYNK_AUTH_TOKEN "*************************"
Replace the WiFi SSID and Password from the following lines.

char
ssid
[
]
=
"****************"
;
char
pass
[
]
=
"**************"
;
After making these changes, you can now upload the code to the ESP8266 Board.

#include <Adafruit_SSD1306.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <A

Technologies used

ESP8266ArduinoRaspberry PiBlynkWiFiBLEGSMHC-SR04SSD1306OLEDRelayServo

Hardware components

  • ESP8266
  • Arduino
  • Raspberry Pi
  • HC-SR04
  • SSD1306
  • OLED
  • Relay
  • Servo

Software & tools

  • Arduino IDE
  • Blynk
  • Fritzing

What you get

  • Working project / hardware kit, tested before delivery
  • Complete source code with explanation
  • Project demo and guidance for your viva
  • Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed. Payment is in two parts: • 50% advance to start the project • Remaining 50% before delivery Note: • Documentation and PPT are not included by default • If you need documentation/PPT, it can be arranged for extra time and cost We'll confirm the exact timeline and cost with you after reviewing your requirements.