Water Quality System

Student: Negulescu Irina
Video:
Project archive: Project Arhive
Web app URL: Water Quality System Web Application

1. Objective

You might think of water quality as a factual declaration of how healthy and suitable a waterbody is for serving its designated function, whether that goal is drainage, enjoyment, or both. The term “water quality” refers to a wide range of data measurements, or “key water health indicators,” that take into account a waterbody's physical, chemical, and biological qualities based on its use as well as any direct or indirect effects on flora and fauna. It serves as the standard against which water management strategies are evaluated and their effectiveness is measured. The following factors are determined by the water quality and related water health indicators:

  • Health of ecosystems
  • Extent of pollution
  • Safety of human contact
  • Condition of drinking water

With the help of an ESP32 WiFi module, a TDS/EC sensor, and a temperature sensor, we will create an IoT-based drinking water quality monitoring system in this project. This entire system can be used to keep track of the water's electrical conductivity, also known as EC, and temperature. On an IoT server called Thingspeak, the EC & temperature values may be checked online from any location in the world.

Why do we need to know our water quality

  • Human Health: The WHO reports that over 80% of diseases are due to drinking contaminated water. Effective water quality monitoring and management ensure that drinking water is safe and not contaminated.
  • Wildlife Protection: Monitoring water quality helps in identifying pollutants and sources of pollution. That way, stressors to aquatic life can be identified and addressed.
  • Sustainability: Waterbodies that have been impacted by heavy development and land usage may be negatively impacted and water quality left impaired. Monitoring and management can be an effective tool to increase water quality and maintain a healthy waterbody.
  • Public Health: Good water monitoring and management ensure that water is clean and safe and that aquatic ecosystems are functioning optimally. It protects public health.

2. Hardware description & implementation

ESP32 Board
  • This is the main harware component of the project. It is used to aquire data from the senosrs and upload them via WiFi to the Real Time Database

Water resistant sensor DS18B20
  • The DS18B20 uses a single wire to communicate with a central microcontroller and gives 9- to 12-bit (adjustable) temperature readings.
  • Requires a 4.7kOhm resistor to connect to the GPIO port

Arduino compatible analog TDS meter
  • The amount of soluble solids that are dissolved in one liter of water is measured by TDS (Total Dissolved Solids). Generally speaking, the more soluble solids that are dissolved in water and the higher the TDS value, the less pure the water is. As a result, one benchmark for measuring the water's cleanliness is the TDS value.

2.1 Implementation:

Project Connection Diagram

Real Life Connection

3. Software description & implementation

Arduino IDE

The IoT-based drinking water quality monitoring software with ESP32's source code was created using the Arduino IDE and C/C++. In this project, the code makes extensive use of the following libraries:

  • Arduino: used for accessing ESP32's feature such as GPIO. Because the preprocessor takes care of it before compilation, we do not come across the Arduino.h file while creating the code for the Arduino board. However the ESP32 board is used in this project, hence it is necessary to include this library.
  • OneWire: provides access to 1-wire temperature sensors, memory and other chips.
  • DallasTemperature: Arduino Library for Dallas Temperature ICs. Supports DS18B20, DS18S20, DS1822, DS1820. Used to get temperature readings from DS18B20.
  • Wire: This library allows you to communicate with I2C/TWI devices. This is a setup for the addition of an I2C LCD as an upgrade.
  • WiFi: ESP32 library is used to enable the board's wifi. At least one access point must be registered with an SSID and password to accomplish this.
  • Firebase_ESP_Client: Data updates to the real time database from the ESP32 are supported by this controlled, comprehensive, quick, and secure library.
  • time: A header file that is part of the C Standard Library and contains declarations for time and date functions to offer standardized access to time/date manipulation and formatting.
Visual Studio Code

Used for this project's front-end development. Used coding languages include HTML, JavaScript, and CSS.

  • Incorporates many more advanced language capabilities inherent to the language itself, including built-in debugging, formatting and code navigation.
  • The inability to test-run the code when utilizing Firebase is a drawback. To see the code changes, the website must be deployed. Additionally, the lack of basic syntax verification and code compilation makes the work of development more difficult.
Firebase Web Console

Is a backend platform for creating Web, Android, and iOS applications. It provides a hosting platform, many APIs, a real-time database, and various methods of authentication.

Why was Firebase chosen

  • It is simple and user friendly. No need for complicated configuration.
  • The data is real-time, which means that every change will automatically update connected clients.
  • Firebase offers simple control dashboard.

Features used

  • Real-time Database − Firebase supports JSON data and all users connected to it receive live updates after every change.
  • Authentication − We can use anonymous, password or different social authentications.
  • Hosting − The applications can be deployed over secured connection to Firebase servers.

4. Challenges

During the elaboration of this project I've encountered some challenges:

  1. ESP32 / Wifi ADC GPIO limitation: The GPIO ports linked to the ADC2 does not function when the board's WiFi is active. It was crucial to connect the TDS meter to an ADC in order to interpret the data.
    Solution: discovered a GPIO port connected to ADC1 that functioned with WiFi turned on.
  2. Firebase / JSON: In order to rewrite the JavaScript template code to meet the objectives of the project, the majority of the debugging time in this project was devoted to understanding how it operated.

5. Conclusions

This project gives a brief overview of the challenges facing the IoT sector. These are only a few challenges faced in creating these little initiatives with enormous impact, such as choosing the best hardware, making sure all of its components work, and working out how to communicate the acquired data to a large user base.

6. Resources

Arduino Code

Web app

iothings/proiecte/2022/water_quality_system.txt · Last modified: 2023/01/19 20:21 by irina.negulescu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0