Water Level and Temperature Detection System
Water Level and Temperature Detection System
System
EE34-Microprocessor Project
Presented By:
Sean Ben G. Kadusale
Adcil Vic B. Tagulo
Pat Roa
Presented to:
Engr. George Bernard Carlos
Description/Design Objectives
The water level and temperature sensor project aim to develop a reliable and
accurate system for monitoring water levels and temperatures in various applications.
The system will utilize sensor technology to gather data, which will be processed and
transmitted for real-time monitoring and analysis. The purpose of this project is to
• Water Level Monitoring: The system will accurately measure and track water
interface, enabling users to easily interpret and analyze water level and
• ESP 32
• Breadboard
• Jumper Wires
• Ultrasonic Sensor
• DS18B20 Temperature sensor
Schematic Diagram
Firmware
main.cpp
#include <Arduino.h>
#include <WiFi.h>
#include <WebServer.h>
#include <OneWire.h>
#include <DallasTemperature.h>
// Wi-Fi settings
const char* ssid = "AdvilVicks";
const char* password = "12345678";
// Ultrasonic Sensor
const int trigPin = GPIO_NUM_22;
const int echoPin = GPIO_NUM_23;
WiFiServer server(80);
OneWire oneWire(temperaturePin);
DallasTemperature sensors(&oneWire);
// Function declarations
float readWaterLevel();
float readTemperature();
void handleRoot();
WebServer webServer(80);
void setup() {
// Initialize Serial communication
Serial.begin(115200);
// Connect to Wi-Fi
WiFi.begin(ssid, password);
Serial.println("Connected to WiFi");
Serial.print("Local IP address: ");
Serial.println(WiFi.localIP());
// Initialize sensors
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
sensors.begin();
// Route definitions
webServer.on("/", handleRoot);
void loop() {
webServer.handleClient();
}
void handleRoot() {
float waterLevel = readWaterLevel();
float temperature = readTemperature();
float readWaterLevel() {
// Send ultrasonic sensor pulse
digitalWrite(trigPin, LOW);
delayMicroseconds(1);
digitalWrite(trigPin, HIGH);
delayMicroseconds(1);
digitalWrite(trigPin, LOW);
// Read the pulse duration
float duration = pulseIn(echoPin, HIGH);
return distance;
}
float readTemperature() {
// Request temperature from DS18B20 sensor
sensors.requestTemperatures();
return temperature;
}
platformio.ini
[env:nodemcu-32s]
platform = espressif32
board = nodemcu-32s
framework = arduino
monitor_speed = 115200
lib_deps =
adafruit/DHT sensor library@^1.4.4
adafruit/Adafruit Unified Sensor@^1.1.9
milesburton/DallasTemperature@^3.11.0
paulstoffregen/OneWire@^2.3.7
Conclusion
In conclusion, the water level and temperature sensor project aims to provide a
comprehensive and reliable solution for monitoring water levels and temperatures in
the ESP32 platform, the project offers numerous benefits and features.
The use of the ESP32 enables wireless connectivity, allowing seamless communication
and integration into IoT networks. Real-time data monitoring and remote access provide
optimal operation and extended battery life. The ESP32's data logging capabilities
facilitate historical data analysis and trend identification, contributing to effective water
environmental sensitivity ensure the system's reliability and adaptability across diverse
settings. Cost-effectiveness, data security, and sustainability considerations further
By combining the water level and temperature sensors with the ESP32 platform, the
project offers an efficient, connected, and cost-effective solution for monitoring water
professionals, industrial facilities, and individuals with accurate data, real-time insights,
Overall, the water level and temperature sensor project demonstrates a commitment to
enhancing safety, efficiency, and sustainability in water resource management. It sets the
foundation for smarter and more informed water management practices, contributing to
To maximize the effectiveness of the water level and temperature detection project,
the product should be conducted to a thorough field testing, implement data analytics for
valuable insights, enhance the user interface, explore integration with external systems,
challenges or issues that may arise. In addition, prioritize usability and accessibility by
designing the system with a user-friendly interface and intuitive data visualization. This
will ensure that users, regardless of their technical background, can easily interpret and
interact with the collected data. Continuously explore opportunities for integrating the
from users, addressing any issues or challenges promptly, and staying updated with
https://esp32io.com/tutorials/esp32-water-sensor
• Ahmad, F. (2021, February 14). IoT contactless water level monitoring with ESP32
https://microcontrollerslab.com/iot-contactless-water-level-monitoring-esp32hc-
sr04/
• Tullock, I. (2022, January 18). How to Build a Water Level Sensor Using Ultrasonic
https://www.makeuseof.com/build-water-level-sensor-using-ultrasonic-
sensorand-home-assistant/
• IoT Design Pro. (n.d.). IoT-Based Water Level Indicator Using Ultrasonic Sensor.
basedwater-level-indicator-using-ultrasonic-sensor
• Santana, R. (2021, March 17). ESP32 DS18B20 Temperature Sensor with Arduino
https://randomnerdtutorials.com/esp32-ds18b20-temperature-arduino-ide/
https://www.electronicwings.com/esp32/ds18b20-sensor-interfacing-withesp32