ArduinoArduino Projects

IOT Water Quality monitoring using Arduino, pH Sensor, ESP8266 & Blynk

water quality monitoring


water quality monitoring- In this tutorial, you will learn how to use Arduino, pH sensor, Nodemcu esp8266 wifi module and Blynk Framework to build an IoT based water quality monitoring system. As this is a project based on the IoT “Internet of Things,” you can track water quality from anywhere in the world.

In this episode, I will explain how to calculate the Well Water’s pH level, and I will also clarify whether the water being checked is good or bad for safety. In this tutorial, in the blynk software, you will also learn how to use the16x2  LCD widget.

In this tutorial, we will cover

  1. Complete Circuit Diagram of water quality monitoring
  2. pH Sensor Pinout information.
  3. Nodemcu wifi module and pH sensor interfacing with Arduino and programming.
  4. Arduino and Nodemcu Programming and finally
  5. Testing

The Amazon Purchase links are given below:

Nodemcu esp8266 wifi module: Best price
Gravity: Analog pH Sensor / Meter Kit For Arduino by DFrobot:
Arduino Uno:
Mega 2560:
lm7805 Voltage Regulator:
330-ohm resistors pack:
female DC power jack socket:
470uf capacitors:
5×7 cm Vero board:
female headers:
connection wires:
Super Starter kit for Beginners:
Jumper Wires:
Bread Board:
12v Adaptor:
PCB plate:
Variable Supply:
Digital Multimeter:
Vero Board / stripboard:
Soldering iron kit: “best” You guys should definitely purchase this:
Solder wire:
Wire Stripper:
PCB small portable drill machine:


Please Note: these are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

Circuit Diagram of  the water quality monitoring:

water quality monitoring

This is the nodemcu esp8266 power supply circuit diagram. This circuit is designed in the version 9.1.0 of the cadsoft Eagle. This is a 5v regulated power supply that is used to power the wifi module Nodemcu esp8266. The famous voltage regulator lm7805 is used in the circuit. J1 is the female power jack and this is where we connect a 12v adapter, battery or solar panel, two 470uf capacitors are attached to the voltage regulator r input and output side. In series, a 330 ohm resistor is connected to a led of 2.5v.  This is a resistor that is inherently restricting.The voltage regulator output is connected to the Nodemcu esp8266 wireless module’s Vin pin and the input is connected to the ground SV1 and SV2 are the headers for women.

water quality monitoring

This is the Final Power Supply Board to power the wifi unit Nodemcu ESP8266.

water quality monitoring

pH Sensor Kit Interfacing with Arduino:

Attach the red wire to the 5v of the Arduino…

Connect the black wire to the ground of the Arduino…

Connect the blue wire to the analog pin A0 of the Arduino…

Link the Nodemcu ESP8266 wifi module TX and RX pins with Arduino’s Pin number2 and Pin number3.

The ground of Arduino is connected to the ground pin of nodemcu module

Blynk Application for the Water Quality Monitoring System:

  • First of all, open the application for blynk.
  • Set the name of the plan to the pH meter.
  • Tap on the selected computer to select nodemcu. Make sure that you set the type of connection to wifi and then
  • tap on the build key, an authentication token will be sent to your email I d and used in programming, simply copy and paste it into programming.
  • Now tap on the screen to scan for and add the LCD overlay.
  • Now pick Advanced by clicking on the LCD.
  • Tap on the button for the virtual pin and pick the virtual v2

water quality monitoring

Our application is ready and let’s talk about programming now.


Two programs are used in this project, one is written for the Arduino while the other is written for the wifi module Nodemcu ESP8266. Let’s start with Arduino Programming first of all.

Arduino Programming for the Water Quality Monitoring System:

This is the same software that I used in the pH sensor pH monitoring system for water quality. I’ve made some changes this time, including these two libraries. The stdlib.h library has a basic function to convert the float value to the string, while the code serial.h library is used to create multiple serial ports.

As I always say, to communicate with other devices, never use the default serial port of Arduino. We only have one Serial port, as you know in Arduino, on pin number 0 and pin number 1. The default Serial Port of Arduino should be used for debugging purposes only. Now the question is whether we use the default Serial port of Arduino for debugging purposes then how do we connect the Nodemcu module to the Arduino? … Okay, we can use the serial library software to create multiple Serial Ports at all.So that’s why I added the serial library of the program and specified a serial port on Pin number 2 and  Pin number 3 with the name Nodemcu. So the TX and RX Pins Nodemcu module will be attached to Pin number 2 and Pin number 3 of the  Arduino …

Another adjustment I made to the program is that I added this feature to convert a float value to the value of the sequence. Then, along with the comma that is used as the delimiter, I inserted this String value. The String message is eventually sent to the Nodemcu module and we delete the String for the new day at the end.

Nodemcu Programming for the Water Quality Monitoring System:


water quality monitoring

The maximum water’s pH is 7. Water with a range of pH below 7 is considered acidic and is considered basic with a pH greater than 7. Waters from natural sources that have not been filtered or altered in any way will have a pH between 7.2 and 7.8, which is the optimum range for good health.

I will upgrade this project in my next project and use the pH sensor with a waterproof temperature sensor “DS18B20.” It helps us to track the consistency and temperature of the air. I’m basically going to do some river water tests. So sign up now so you’ll never miss any of my forthcoming tutorials.

Watch Video Tutorial

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button