Arduino Projects

Arduino Water Pressure Sensor Project, Water Level Pressure Sensor

Arduino Water Pressure Sensor, Description:

 

Arduino Water Pressure Sensor Project, Water Level Pressure Sensor- Recently I got this water pressure sensor from DFRobot; which I am going to use with Arduino Nano. You can also use this sensor for measuring Gas pressure. In this tutorial, I will only use this sensor for water detection, and for measuring the water pressure, and for measuring the water level inside a water tank.  Using this Water Pressure Sensor you can build yourself a smart water control system using Arduino, Oled display Module, and some LEDs.

You can also watch my video on IoT based Water level monitoring and automatic water pump control system using the ESP32 WiFi + Bluetooth Module, Waterproof Ultrasonic Sensor, and the New Blynk V2.0 more…

allpcb circuit

It has happened to me and my family members many times that when we start the water pump, we often forget because we are busy with other work. And we don’t remember that we have turned the water pump ON, due to which a lot of water is wasted. And obviously, it makes a lot of difference on the electricity bill as well.

So, to avoid this type of situation, I have resorted to this water pressure sensor, by using which I can measure the water pressure inside the pipe. When the water level in the tank changes, then obviously the water pressure inside the pipe will also change. So, if I use Arduino to measure the water pressure, I can easily make a control system for myself, which will alert me when the water tank is empty, or when the water tank is full.

Arduino Water Pressure Sensor

To explain this idea, I have done this basic setup, you can see the water tap and I have also attached the Water pressure sensor. Here, this water storage drum is representing the water tank.

As I am using this Water pressure sensor for the first time, so this tutorial is going to be a kind of a getting started tutorial. And I will try my level best to explain the most basic things including technical specifications, Pinout, it’s interfacing with Arduino, its calibration, final circuit diagram, and final Arduino code. Anyway, first let me share with you the Final test results, and afterward, I will explain everything else.

read my article on Wireless water level indicator “communication range 1.5Km.


I have connected everything as per the circuit diagram, which I will explain in a minute. I have already calibrated the water pressure sensor. You guys don’t need to worry about it. I will explain in detail how you can calibrate this sensor. First, I am going to explain the working and then I will start practical demonstration.

Arduino Water Pressure Sensor

On the Oled display module, I will print the Water Pressure in Kpa “Kilo Pascal”. And the LEDs will show water level. If the first LED is ON it means 20%, similarly the 2nd LED means 40%, 60%, 80%, and the 5th LED represents 100% water level. So, when all the LEDs are ON, it means that the water tank is full. And when all the LEDs are OFF, it means that the water tank is empty. Now let us move ahead and start our practical demonstration.


 

I have powered up the Arduino. Right now All the LEDs are OFF as the water drum is completely empty. And on the Oled display module you can see value is around 0 Kpa.

Arduino Water Pressure Sensor

I am going to add water and you will see an increase in the pressure value and the LEDs will turn ON one by one as the water level increases.

Arduino Water Pressure Sensor

When the Water Drum completely filled, all the LEDs turn ON. For the practical demonstration watch video tutorial given at the end of this article. I am sure by now, you might have got an idea of how does this system work. So, without any further delay let’s get started!!!


 

Amazon Links:

Arduino Nano USB-C Type (Recommended)

Water Pressure Sensor from DFRobot

SSD1306 Oled Display Module

Water Storage Drum

*Disclosure: These are affiliate links. As an Amazon Associate I earn from qualifying purchases.

Water Pressure Sensor:

Arduino Water Pressure Sensor

This is the Water pressure sensor from DFRobot. The most important specs are already printed on the sensor itself. It adopts DFRobot Gravity 3-pin interface. The Yellow wire is the analog signal output wire, Red wire is the VCC, and the Black wire is the ground.

Label Name Description
Yellow Signal(Output:0.5~4.5V) Analog Signal
Red VCC(5VDC) +
Black GND



 

Water Pressure Sensor Specifications:

As I said earlier, you can use this sensor for measuring the Liquid or Gas pressure without corrosion. It supports standard 5V voltage input and 0.5 to 4.5V linear voltage output. The recommended pressure measurement range is 0 to 1Mpa but you can use it to measure pressure up to 1.5Mpa. As per the manufacturer, the normal operating pressure should be less than or equal to 2.0 Mpa. Pressure Greater than or equal to 3 Mpa will damage the sensor. The measure accuracy is 0.5% at around 55 degrees Celsius. The waterproofing level is IP68. The Operating temperature is from -20 to 85 degrees Celsius. The Sensor response time is less than 2ms.

  • Medium: liquid/gas without corrosion
  • Wiring: Gravity-3Pin (Signal-VCC-GND)
  • Pressure Measurement Range: 0~1 Mpa
  • Input Voltage: +5 VDC
  • Output Voltage: 0.5~4.5 V
  • Threadably: G1/4
  • Adapter: G1/2 to G1/4
  • Waterproof Level: IP68
  • Operating Temperature: -20~85°C
  • Response Time: <2.0 ms
  • Quiescent Current: 2.8 mA
  • Normal Operating Pressure: ≤2.0 Mpa
  • Damaged Pressure: ≥3.0 Mpa
  • Service Life: ≥10’000’000 times (10 million)

Features

  • Support water pressure detection of living environmental water systems, such as houses, gardens and farms.
  • Support water pressure detection of outdoor environment, such as rivers, lakes and sea.
  • Support water pressure detection of tanks.
  • Support liquid level detection in special situation.

Now, let’s take a look at the circuit diagram.


 

Pressure Sensor Interfacing with Arduino:

Arduino Water Pressure Sensor

On the Left side is the regulated 5 volts power supply based on the 7805 linear voltage regulator. I am using this regulated 5 volts power supply to power up the Arduino and all the other electronics.

The VDD and GND pins of the SSD1306 Oled display module are connected with the Arduino 3.3V and GND pins. While the SCK or SCL and SDA pins of the Oled display module are connected with the Arduino A5 and A4 pins.

5 LEDs are connected with the digital pins D2, D3, D4, D5, and D6. As these are 2.5V LEDs that’s why I am using 330-ohm current limiting resistors.

The Signal wire which is the Yellow wire on the Water pressure sensor is connected with the A0 pin, the Red wire is connected with 5 volts, and the GND wire is connected with the Arduino ground.

Water Pressure Sensor Calibration:

This water pressure sensor is not Factory calibrated. So, first you will have to calibrate this sensor. Before you start the calibration process, first of all, make sure there is no water or any other liquid inside the Drum or Barrel or Water tank etc.

Next, all you need to do is to download the code given below and upload it to your Arduino. This is the code for the calibration.

Download the following Libraries:

Download: Adafruit_GFX.h

Download: Adafruit_SSD1306.h


 

Water Pressure Sensor Calibration Code:

On the Oled display, you can see the pressure in Kpa and the voltage.

Arduino Water Pressure Sensor

Arduino Water Pressure Sensor

As per the table when the voltage is 0.5V the pressure should be 0.0Kpa. But as you can see on the display, the pressure value is wrong, which means we will have to adjust the Offset value in the Arduino code. Keep on changing the offset value until you get a value that is around 0.0 Kpa. Don’t worry if you see very small fluctuations, you can see the voltage is not perfectly 0.5 volts and also this sensor has 0.5% accuracy.

Arduino Water Pressure Sensor

In my case, I am happy with this offset value of 0.545. So I will use this value in my final code.

Now, I am going to fill the Drum with water so that I can find the maximum value of Water pressure, as I will need this for the programming to define the range. So, when I filled the drum the Kpa value was around 112.


 

Water Pressure Sensor Arduino Programming:

If you are planning on using the SSD1306 Oled display module then you will need Adafruit_GFX and Adafruit_SS1306 libraries. The download links I have already shared above.

Here is the offset value which I found using the hit and trail technique.

The water pressure sensor is connected with the Analog pin A0.

5 LEDs are connected with Arduino pins 2, 3, 4, 5, and 6.

I also defined two variables for storing the Voltage and Pressure values.

Rest of the code is self-explanatory, we are reading the voltage on the Analog pin A0.

Next, we find the pressure and then display the corresponding values on the Oled display module.

Next, as per the minimum and maximum pressure values I am controlling all the 5 LEDs. So, that’s all about the programming.

Consider subscribing my YouTube channel, if you want to see Long Range wireless and IoT versions of the same project.



 

Watch Video Tutorial:

Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Related Articles

3 Comments

  1. hi what hight in water was yor tank in yor example 112kpa would equal 1142 cms of water this doesnt seem right
    1mpa of pressure wouuld equal 10197.2cms of water

  2. This water pressure sensor Arduino project looks interesting. DIY fans will appreciate the clear directions and available code that make recreating the project a breeze. Sensing water pressure and levels has a number of useful real-world applications. We appreciate you providing us with this in-depth, practical guide.

  3. This Arduino water pressure sensor project is a great solution for monitoring water levels and controlling water pumps efficiently. The tutorial provides clear instructions on using the sensor for water detection, measuring water pressure, and monitoring water levels in a tank. The addition of an OLED display module and LEDs allows for a smart water control system. This project is not only practical but also helps conserve water and reduce electricity bills.

Leave a Reply

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

Back to top button