Using BMP280 to determine if an object is descending

Hi All,

I'm planning a high altitude balloon flight and would like to use the pressure/temp sensor (BMP280) to determine if the payload is descending and under 2,000 metres. I have flown this sensor before and it worked well up to it's maximum rated ceiling of 9,000m.

I'm developing a deployable parachute (rather than a pre-deployed canopy) and need a way of actuating a servo to withdraw a cable to release a small drogue which in turn will extract the main canopy. So, I need to write some code to determine if the altitude is consistently decreasing over a period of time.

The calculated descent rate is around 10m/s under the small drogue. My thinking is to take 3 readings, 15 seconds apart:

initial reading - 15 seconds - next reading - 15 seconds - final reading)

and then determine if the decrease in altitude is more than 200m - this takes into account a slightly slower fall rate (calculating terminal velocity is difficult) but is more than enough loss of altitude to indicate the payload is descending and not just 'dipping' a bit on the way up.

If the change in altitude is > minus 200m, and the altitude is less than 2,000m then actuate servo to withdraw cable from drogue loop.

I'm struggling with how to store each of the readings so I can do the maths to work out if the change in altitude is more than minus 200m - I think it might be a FOR loop but I'm not sure?

Any help or suggestions would be much appreciated. I'm not flying the deployable parachute on this occasion, just testing the code to make sure it works!

Best wishes

Phil

I'm struggling with how to store each of the readings so I can do the maths to work out if the change in altitude is more than minus 200m - I think it might be a FOR loop but I'm not sure?

Test in every loop if the pause is over (check millis()) and write the altitude into a cycling buffer, check the values in the buffer every time you write a new one.
I would check more often than 15 sec., what happens if the balloon gets damaged before it reaches it's target altitude? It might hit the ground before the 45 second checking windows is over.

With a pressure sensor you need to read often and average several readings to reduce the noise.

There is no need to calculate altitude. You can simply look at whether the pressure is increasing to determine if the module is descending, and from the current sea level pressure, you can estimate the current pressure at 2000 m.

Compare the current pressure to that pressure value and if greater, trigger some action.

The relation between altitude and pressure is described here among many other places.

Thanks very much for your suggestions, I will have a look at writing the code and may come back with queries.

Best wishes

Phil