Making a parachute deployment system for rocket

Hey guys!
I finished my code for the Arduino Nano that will analyze to see when the rocket has passed apogee and then deploys a servo that would release the parachute. The issue arises when I attempt to see the Code it's supposed to print. It only prints "REBOOT" and stops there.

Here's the code

// Your sketch must #include this library, and the Wire library.
// (Wire is a standard library included with Arduino.):

#include <SFE_BMP180.h>
#include <Wire.h>
#include <Servo.h>

// You will need to create an SFE_BMP180 object, here called "pressure":

SFE_BMP180 pressure;

Servo servo;

int Check_downs = 0;

double baseline; // baseline pressure

void setup()
{
  Serial.begin(9600);
  Serial.println("REBOOT");

  // Initialize the sensor (it is important to get calibration values stored on the device).

  if (pressure.begin()){
    Serial.println("BMP180 init success");
  }
  else
  {
    // Oops, something went wrong, this is usually a connection problem,
    // see the comments at the top of this sketch for the proper connections.

    Serial.println("BMP180 init fail (disconnected?)\n\n");
    while(1); // Pause forever.
  }

  // Get the baseline pressure:
  
  baseline = getPressure();
  
  Serial.print("baseline pressure: ");
  Serial.print(baseline);
  Serial.println(" mb");
  Serial.print("baseline pressure: ");
  Serial.print(baseline/33.864,0);
  Serial.println(" Inhg");  
  
  servo.attach(2); 
  servo.write(90); //sets servo to its midpoint
}

void loop()
{
  double a,P,a1,a2,P2,Difference;
  
  // Get a new pressure reading:
  
  // Show the relative altitude difference between
  // the new reading and the baseline reading:
  
  //a = pressure.altitude(P,baseline);

  //Serial.print("relative altitude: ");
  //if (a >= 0.0) Serial.print(" "); // add a space for positive numbers
  //Serial.print(a,1);
  //Serial.print(" meters, ");
  //if (a >= 0.0) Serial.print(" "); // add a space for positive numbers
  
  P = getPressure();
  
  a1 = pressure.altitude(P,baseline);

  delay(3000);
  
  P2 = getPressure();
  
  a2 = pressure.altitude(P2,baseline);

  Difference = a2 - a1;
  if (abs(Difference) > 1) {
    if (Difference < 0 ) Check_downs =+ 1;  
    if (Difference > 0 ) Check_downs = 0;  
  }
  
  Serial.print("Start >");
  Serial.print(a1);
  Serial.print(" meter >");
  Serial.println(a2);
 
  Serial.print("Difference: ");
  Serial.print(a1 - a2);
  Serial.println("meters");
  Serial.print("Check downs : ");
  Serial.print(Check_downs);
  Serial.println();

  if (Check_downs == 3) {
    servo.write(90);
  }
  
  delay(1000);

}


double getPressure()
{
  char status;
  double T,P,p0,a;

  // You must first get a temperature measurement to perform a pressure reading.
  
  // Start a temperature measurement:
  // If request is successful, the number of ms to wait is returned.
  // If request is unsuccessful, 0 is returned.

  status = pressure.startTemperature();
  if (status != 0)
  {
    // Wait for the measurement to complete:

    delay(status);

    // Retrieve the completed temperature measurement:
    // Note that the measurement is stored in the variable T.
    // Use '&T' to provide the address of T to the function.
    // Function returns 1 if successful, 0 if failure.

    status = pressure.getTemperature(T);
    if (status != 0)
    {
      // Start a pressure measurement:
      // The parameter is the oversampling setting, from 0 to 3 (highest res, longest wait).
      // If request is successful, the number of ms to wait is returned.
      // If request is unsuccessful, 0 is returned.

      status = pressure.startPressure(3);
      if (status != 0)
      {
        // Wait for the measurement to complete:
        delay(status);

        // Retrieve the completed pressure measurement:
        // Note that the measurement is stored in the variable P.
        // Use '&P' to provide the address of P.
        // Note also that the function requires the previous temperature measurement (T).
        // (If temperature is stable, you can do one temperature measurement for a number of pressure measurements.)
        // Function returns 1 if successful, 0 if failure.

        status = pressure.getPressure(P,T);
        if (status != 0)
        {
          return(P);
        }
        else Serial.println("error retrieving pressure measurement\n");
      }
      else Serial.println("error starting pressure measurement\n");
    }
    else Serial.println("error retrieving temperature measurement\n");
  }
  else Serial.println("error starting temperature measurement\n");
}

It used to be able to print but idk what changed...

Can anyone help?

So there's something going wrong in SFE_BMP180.begin(). Drop a Serial.print("got here!") into the library's ::begin() function and see if that prints. Move it down in the function to see where it gets stuck.

It's unlikely to really be a problem in the library. Maybe you have a loose wire?

Hate to be smartie here - but could you not just use a tilt switch , so when the rocket starts to fall, you detect the change in orientation ( ie nose down , not nose up) and deploy the cute ?
I can foresee changes in pressure due to the rockets movement (Bernoulli ) , wind etc causing problems .

Use an IMU with an immediate "free fall" (zero g) output.

Since you have the pressure sensor already it should be doable. Just make sure it is indeed tucked away so no direct airflow going over it.

hammy:
Hate to be smartie here - but could you not just use a tilt switch , so when the rocket starts to fall, you detect the change in orientation ( ie nose down , not nose up) and deploy the cute ?
I can foresee changes in pressure due to the rockets movement (Bernoulli ) , wind etc causing problems .

This is problematic because (ignoring drag) the rocket will see zero-G after engine cutoff and on a ballistic trajectory until it hits the ground. Realistically (not ignoring drag) the rocket will see negative-G immediately after engine cutoff.

Don't think the tilt switch will be a problem (upright switch closed, upside down open )this problem you describing is more for the imu?

Apogee detection for a model rocket is more difficult than you think. It is rocket science after all.

Pressure is one of the best methods, until you get near the top of the atmosphere. But that is a much bigger and more complex rocket.

if (pressure.begin()){

Oops

Why is that an oops? If it can successfully connect to the I2C sensor it reports that success?

I must admit that I didn't open the library to look.

Ok, update. I ran the code on my Uno instead and it worked out, although i did reset my computer. I tried it one more time to see if it would work with my Nano and yep it worked. I think the compiler kinda glitched out and didn't send the whole code to Arduino.