Detecting apogee with the bmp 180

Hello.

I am currently working on creating a vector controlled rocket based around the Arduino platform. I have completed most of the code, but I am having trouble creating a reliable code to detect apogee (the point at which the rocket begins to fall). I am using the bmp180 sensor. This sensors is kind of noisy because it measures air temperature, so I need a reliable way for it to detect apogee so that I can deploy the parachutes at the correct time. I was thinking that I would compare the data from past loops to make sure the measurement is very accurate. I know how to save code from the previous loop, but does anyone know a way to save an integer from several past loops? If anyone has a better way that is not to complicated to detect apogee please let me know.

Thank you. :slight_smile:

Wouldn't it be easier and more reliable to use a timer?

There are many parameters that will influence the pressure measurement like temperature, movement trough air and height. This all happens very fast, so you do not get a lot of data points to detect and calculate the apogee.

That is a great idea, I just need to get an accurate time. Do I use a millis timer if I want it to run in the background?

Thank you!

You could use delay(...) or millis() but millis() will be better for doing other things at the same time.

See Using millis() for timing. A beginners guide

If you do not use delays (Please don’t.) and your loop is written without anything that keeps the loop from running fast you should get a really good resolution using the millis timer.

Thank you so much! That should work great.

Try here