My Grove - Barometer (High-Accuracy) displays always the same pressure value

Hi!Can you please help me with my school project?
I’m using as sensor the Grove - Barometer (High-Accuracy)http://wiki.seeedstudio.com/Grove-Barometer-High-Accuracy/ connected to the arduino MEGA2560(more precisely to the IIC pin) to measure the pressure between 30 and 100 kPa and with a precision of ±1%.
My task in the project is to measure the level of fuel using the barometric module in order to get the pressure.
The problem that i’m having with the code or either the sensor,i don’t understand,is that it always displays the same pressure value since i started the project which is: 1028 hPa.
As aked, i have download the libraryhttps://github.com/Seeed-Studio/Grove_Barometer_HP20x and add it to arduino, and then i have uploaded the code from Example.
Here is my code:

#include <HP20x_dev.h>
#include "Arduino.h"
#include "Wire.h" 
#include <KalmanFilter.h>
unsigned char ret = 0;

/* Instance */
KalmanFilter t_filter;    //temperature filter
KalmanFilter p_filter;    //pressure filter
KalmanFilter a_filter;    //altitude filter


void setup()
{  
  Serial.begin(9600);        // start serial for output
  
  Serial.println("****HP20x_dev demo by seeed studio****\n");
  Serial.println("Calculation formula: H = [8.5(101325-P)]/100 \n");
  /* Power up,delay 150ms,until voltage is stable */
  delay(150);
  /* Reset HP20x_dev */
  HP20x.begin();
  delay(100);
}
 

void loop()
{
	Serial.println("------------------\n");
	long Temper = HP20x.ReadTemperature();
	Serial.println("Temper:");
	float t = Temper/100.0;
	Serial.print(t);	  
	Serial.println("C.\n");
	Serial.println("Filter:");
	Serial.print(t_filter.Filter(t));
	Serial.println("C.\n");

	long Pressure = HP20x.ReadPressure();
	Serial.println("Pressure:");
	t = Pressure/100.0;
	Serial.print(t);
	Serial.println("hPa.\n");
	Serial.println("Filter:");
	Serial.print(p_filter.Filter(t));
	Serial.println("hPa\n");
	
	long Altitude = HP20x.ReadAltitude();
	Serial.println("Altitude:");
	t = Altitude/100.0;
	Serial.print(t);
	Serial.println("m.\n");
	Serial.println("Filter:");
	Serial.print(a_filter.Filter(t));
	Serial.println("m.\n");
	Serial.println("------------------\n");
	
	delay(1000);
}

I would like to mention something else that i have noticed (if it can help you) there is something missing in the code that i have uploaded from examples, which was on the code on their website page.
It’s this part:

 /* Determine HP20x_dev is available or not*/
    ret = HP20x.isAvailable();
    if(OK_HP20X_DEV == ret)
    {
        Serial.println("HP20x_dev is available.\n");
    }
    else
    {
        Serial.println("HP20x_dev isn't available.\n");
    }

It’s this part.
Any help appreciated please.Thankyou very much.
I have one more weekend to finish the project.
I live in France, if it can help you with mains voltages, local suppliers, and other local issues.

ums:
…connected to the arduino MEGA2560(more precisely to the IIC pin)…

So to pin 20,21.
You should have included a connection diagram.
A common mistake with a Mega is to use pin A4,A5 for I2C.
Leo…

IF you are measuring the gas pressure in an enclosed container of a liquid fuel, then your sensor is working perfectly. If you disagree, then you missed a class session or two.

Paul

If you want to measure fluid level by measuring pressure, you have to measure pressure at the BOTTOM of the container.

JCA79B:
If you want to measure fluid level by measuring pressure, you have to measure pressure at the BOTTOM of the container.

No. In a sealed container with a volatile liquid, the gas pressure is only a function of temperature of the liquid, not quantity of liquid.

Paul

Paul_KD7HB:
No. In a sealed container with a volatile liquid, the gas pressure is only a function of temperature of the liquid, not quantity of liquid.

Paul

True, I was talking about a ventilated container and head pressure from weight of the fluid.
9.81 kPa per meter of water depth.

@ums, what kind of container and where is the sensor located?

Test your sensor out in the open, subjected to atmospheric pressure, until you understand how it works.

If you want to compare your air pressure readings with those reported locally, keep in mind that almost all reports of air pressure are corrected to sea level, for use in airports and by pilots.

So, if you are at some elevation significantly above at sea level, the pressure you measure will be lower than values reported by local weather services.

It would seem that the problem may not be the sensor or the code, but the application.

please offer some details of how you are using the sensor, if possible hand sketch your sensor and fuel and attatch that to your post.

the AIR pressure sensor should never come in contact with a liquid.

I know that some folks suggest a bubbler to be used for fluid levels.
Please offer more details of where and how this sensor is being used.

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Looking at your description of what you are doing, you have.
The pressure sensor at the end of a tube.
The other end of the tube is placed in the vessel of liquid.
The pressure of the liquid pushing up into the air filled tube causes a pressure proportional to the depth of the liquid.
Is the tube ONLY open at the deep end, the tube should not fill with liquid.

Tom… :slight_smile:
Have you calculated what the pressure should read for the depth of the tube in the liquid?
Pressure = liquid density * g * h.