[PLEASE HELP] Bmp180 oscilate to much

Guy good afternoon,

I bought a bmp180 and i am testing it with the code i attached.

My problem is that the samples i am getting oscilate a lot.

Any advice?

Thanks in advance,
Marco

BMP180.ino (6.55 KB)

Please provide sample output of that sketch.

Your variables are not initialized. Don't expect them to be always 0 when you enter the loop for the first time.

The pressure at sea level is not always 1013.25hPa! That value is changing from hour to hour sometimes even from minute to minute.

pylon:
Please provide sample output of that sketch.

Your variables are not initialized. Don't expect them to be always 0 when you enter the loop for the first time.

The pressure at sea level is not always 1013.25hPa! That value is changing from hour to hour sometimes even from minute to minute.

Thanks for the answer.

I will initialize all the variables.

How do i deal with the pressure issue. Should i use other kind of sensor to get the altitude of a device?

Thanks,
Marco

Here is the output of my bme280 sensor. You can see there is constant variation. This sensor is in a fixed position.

What is your project? You may need to use two sensors, one in a fixed, low position.

PaulRB:
Here is the output of my bme280 sensor. You can see there is constant variation. This sensor is in a fixed position.

What is your project? You may need to use two sensors, one in a fixed, low position.

I need a quadcopter to keep a particular altitude. How i should do that if the values oscilate so much?

I am not an expert on quadcopters, I am sorry. Perhaps you could use an ultrasonic distance sensor to sense the ground?

I need a quadcopter to keep a particular altitude. How i should do that if the values oscilate so much?

A quadrocopter usually flies for 10-30 minutes. During that periode the pressure in the flying area should be constant enough to enable an accuracy of about 1m in altitude. Is that enough for your project? What did you expect? How much does your sensor vary over time?

Thanks for the answer. 1 m is a lot i am planning to flight it at 2m from the ground. i think i should go with the ultrasonic idea