Gravity: Water Pressure Sensor SKU: SEN0257

From DFRobot Electronic Product Wiki and Tutorial: Arduino and Robot Wiki-DFRobot.com

Category.png Home > Sensors & Modules > Sensors > Pressure Sensors>Gravity: Analog Water Pressure Sensor

Introduction

This is a water pressure sensor that adopts DFRobot Gravity 3-pin interface. It supports standard 5V voltage input and 0.5~4.5V linear voltage output. It is compatible with multiple Arduino controllers. Coordinate with a DFRobot Gravity IO Expansion Shield, the water pressure sensor can be plugged into an Arduino board, wiring-free. Put it with a Solenoid Valve , a Water Turbine Generator and other sensors, you can build a smart water control system. Briefly speaking, this water pressure sensor is a stethoscope to a water pipe. It will help you to diagnose whether there is water, how strong the water pressure is. It can be widely applied to smart home control systems (SCS),  Internet of Things (IoT) and device detection.

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.

Specification

  • Medium: liquid/gas without corrosion
  • Wiring: Gravity-3Pin (Signal-VCC-GND)
  • Pressure Measurement Range: 0~1.6 Mpa
  • Input Voltage: +5 VDC
  • Output Voltage: 0.5~4.5 V
  • Measurement Accuracy: 0.5%~1%FS (0.5%, 0~55°C)
  • 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)

PinOut

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


Input & Output

The monocrystallinesilicon is one interior material of the sensor. When monocrystallinesilicon material suffers force, it makes an infinitesimal change and an electronic level change of internal atom structure, which will also lead to a great change in resistivity (Factor H Mutation), so as the resistance. This physical effect is piezoresistive effect.

Based on the piezoresistive effect, a strain gauge is also a work of IC (integrated circuit) engineering technology. Its production process contains doping, diffusion and a crystal  orientation of the substrate. A strain gauge makes a Wheatstone Bridge. Taking advantage of elasticity properties of special silicon material and heterosexual micro-machining the same silicon material in different directions, then a diffused silicon sensor comes into being. The sensor is force-sensitive and mechanical-electrical detective.

Equipped with an amplify circuit and other parts in need, enable the circuit to output a standard signal, the diffused silicon sensor makes a pressure transmitter.

Signal Production Process
Signal Input & Output

Tutorial

In this section, we'll show the basic sensor usage and a simple demo about pressure detector.

Demo: Read Water Pressure Value

Requirements

  • Hardware
    • DFRduino UNO R3 (or similar) x 1
    • Gravity: Analog Water Pressure Sensor
    • Dupont wires

Connection Diagram(Arduino)

Analog Module Connection Diagram


Sample Code

Read Data by Serial Port.
/************************************************************
   Water pressure sensor demo(Computer serial port)
   - Obtain the water pressure through the output voltage
     of the sensor.
**************************************************************/
                         
/************************************************************
  Water Sensor Key Parameter
  - Parts No.:KY-3-5
  - Sensing range: 0 - 1.6 MPa
  - Input Voltage: 5VDC
  - Output Voltage: 0.5 - 4.5 VDC
    (Linearly corresponding to 0 - 1.6 MPa)
  - Accuary: 0.5% - 1% FS
**************************************************************/

/************************************************************
  Water Sensor Calibration

  The output voltage offset of the sensor is 0.5V (norminal).
  However, due to the zero-drifting of the internal circuit, the
  no-load output voltage is not exactly 0.5V. Calibration needs to
  be carried out as follow.

  Calibration: connect the 3 pin wire to the Arduio UNO (VCC, GND and Signal)
  without connecting the sensor to the water pipe and run the program
  for once. Mark down the LOWEST voltage value through the serial
  monitor and revise the "OffSet" value to complete the calibration.

  After the calibration the sensor is ready for measuring!
**************************************************************/

const float  OffSet = 0.483 ;

float V, P;

void setup()
{
  Serial.begin(9600);        // open serial port, set the baud rate to 9600 bps
  Serial.println("/** Water pressure sensor demo **/");
}
void loop()
{
  //Connect sensor to Analog 0
  V = analogRead(0) * 5.00 / 1024;     //Sensor output voltage
  P = (V - OffSet) * 400;             //Calculate water pressure

  Serial.print("Voltage:");
  Serial.print(V, 3);
  Serial.println("V");

  Serial.print(" Pressure:");
  Serial.print(P, 1);
  Serial.println(" KPa");
  Serial.println();
  
  delay(500);
}

Demo: DIY a Simple Water Pressure Detector

Requirements

Connection Diagram

Water Pressure Detector

Sample Code

Please download the LCD library: DFRobot RGB LCD. How to install Libraries in Arduino IDE

Read Data by LCD1602 Display.
/************************************************************
   Water pressure sensor demoB(LCD1602)
   - Obtain the water pressure through the output voltage
     of the sensor.
**************************************************************/

/************************************************************
  Water Sensor Key Parameter
  - Parts No.:KY-3-5
  - Sensing range: 0 - 1.6 MPa
  - Input Voltage: 5VDC
  - Output Voltage: 0.5 - 4.5 VDC
    (Linearly corresponding to 0 - 1.6 MPa)
  - Accuary: 0.5% - 1% FS
**************************************************************/

/************************************************************
  Water Sensor Calibration

  The output voltage offset of the sensor is 0.5V (norminal).
  However, due to the zero-drifting of the internal circuit, the
  no-load output voltage is not exactly 0.5V. Calibration needs to
  be carried out as follow.

  Calibration: connect the 3 pin wire to the Arduio UNO (VCC, GND and Signal)
  without connecting the sensor to the water pipe and run the program
  for once. Mark down the LOWEST voltage value through the serial
  monitor and revise the "OffSet" value to complete the calibration.

  After the calibration the sensor is ready for measuring!
**************************************************************/

#include <Wire.h>
#include <DFRobot_RGBLCD.h>                          //LCD header file
const float  OffSet = 0.483 ;
float V;
int P;
unsigned int lcd_r = 0, lcd_g = 0, lcd_b = 0;  
unsigned long delaytime = 0, lighttime = 0;

DFRobot_RGBLCD lcd(16, 2); 
void setup()
{lcd.init();  
  delay(5000);
  Serial.begin(115200);
  Serial.println("hello start");
  lighttime = millis();  
  lcd.setCursor(0, 0);
  lcd.print("Water Pressure:");
  lcd.setRGB(255, 255, 000);
}
void loop() {
 lcd_r = random(256);  
  delayMicroseconds(10);  
  lcd_g = random(256);  
  delayMicroseconds(10); 
  lcd_b = random(256); 
  if (millis() - lighttime > 3000)  
  {
    lcd.setRGB(lcd_r, lcd_g, lcd_b);  
    lighttime = millis();   
  }
  //delay(100);
 
    V = analogRead(0)* 5.00 / 1024;                     //Sensor output voltage
    P = (V - OffSet) * 400*10;                          //Calculate water pressure
    lcd.setCursor(3, 1); 

    lcd.print(  P/ 10000% 10);                         //LCD display              
    lcd.print(  P/ 1000% 10);     
    lcd.print(   P/ 100 % 10); 
    lcd.print(   P/ 10 % 10);
    lcd.print('.');
    lcd.print(  P  % 10);
    lcd.print(" kPa");
    
}

Expected Results

Water Pressure Display

Installation

Mario.jpg
  • Installation Scenes
Tube Water Pressure Detection
Bottom Water Pressure Detection
Warning yellow.png

NOTE:

  • 1.To guarantee the interface tightness, you need to install a waterproof nut and bind PTFE tape.
  • 2.Please take necessary measures to avoid large pressure involved during usage.

FAQ

Q1. Some general Arduino Problems/FAQ/Tips

A. Click the topic link on DFRobot Forum.


For any questions, advice or cool ideas to share, please visit the DFRobot Forum.


More Documents

SEN0257 Dimension.png



DFshopping car1.png Get Gravity: Analog Water Pressure Sensor from DFRobot Store or DFRobot Distributor.