Measuring Altitude and Deploying Parachute

Railroader:
Changes of several meters from one second to the other have been observed.

The height variation can easily be in the 10s of metres on ocaision .............

Is there any chance I could get it to be more accurate?...

If I have variations of 10 meters on occasion, my drone will probably hit the floor before it even triggers the servo.

What about using the accelerometer? What is the quality of those data?
Of course rapid descents will interfear.

If this is a college design project then why dont get more out of the project by checking for yourself how effective the various methods of determining height change are ?

Put the gear on the drone and have a beeper, one beep for an accelerometer detection, 2 beeps for a pressure sensor detection, 3 beeps for a GPS height chanmge detection etc .........

@Railroader,

Yeah, I'm going to give the accelerometer a go next week hopefully. Just getting it set up and strapping it to my drone and sending it up and having it come down then just using the differences in pressure (hPA) to detect 'fall' and trigger the servo.

What do you mean by rapid descents will interfere?

@srnet

Yeah - I'm trying to figure out how to get the GPS module to return altitude numbers before conducting tests on all three but unfortunately my Major Project is due in less than 37 days so I'm just going to focus on the accelerometer / pressure sensor (both failsafes), might have to ditch the GPS module if time doesn't permit!

If You deliberatly order Your drown to descend too rapidly Your safe guard might get triggered. Maybe You can handle that.

Well during my testing phase, I'm hoping to cut the power to the propellers in-flight at approximately 50 meters high to test the parachute release...

Obviously there will be a big net under to catch it.

Hum. Let's hope Your craft will not tumble and go down outside the net.

Hi all,

This is for my parachute drone deployment project and I was just wondering what code I would need to write to get the servo to read the numbers that I'm getting back from BME280 sensor?

I'm currently getting values in hPa and I would like the servo to be triggered swing 180 and back when detecting an anomaly in the value I'm receiving.

e.g. current altitude: 4.3, 4.2, 4.3, 4.3, 4.5, 3.7 (servo_trigger), 4.5, 4.4

I'm relatively new to coding and would love some assistance in the hardcoding process if possible.

thanks in advance!

if (altitude < THRESHOLD) doMoveServo();

where THRESHOLD is defined as your minimum value and the doMoveServo() function of course makes the servo do what you want it to do.

Yeah, hopefully not! :frowning:

I may drop it at 25m altitude to reduce the risk of it straying too far away from the net.

So currently this is the code I'm using to get pressure (hPa)...

#include <SPI.h>
#include "cactus_io_BME280_SPI.h"

#define BME_SCK 13;// Serial Clock
#define BME_MISO 12;// Serial Data Out
#define BME_MOSI 11;// Serial Data In
#define BME_CS 10;// Chip Select

// Create BME280 object
// BME280_SPI bme(BME_CS); // Using Hardware SPI
BME280_SPI bme(BME_CS,BME_MOSI,BME_MISO,BME_SCK); // Using Software SPI

void setup() {

Serial.begin(9600);
Serial.println("Bosch BME280 Pressure - Humidity - Temp Sensor | cactus.io");

if (!bme.begin()) {
Serial.println("Could not find a valid BME280 sensor, check wiring!");
while (1);
}

bme.setTempCal(-1);// Sensor was reading high so offset by 1 degree C

Serial.println("Pressure\tHumdity\t\tTemp\ttTemp");
}

void loop() {

bme.readSensor();

Serial.print(bme.getPressure_MB()); Serial.print(" mb\t"); // Pressure in millibars
Serial.print(bme.getHumidity()); Serial.print(" %\t\t");
Serial.print(bme.getTemperature_C()); Serial.print(" *C\t");
Serial.print(bme.getTemperature_F()); Serial.println(" *F");

// Add a 2 second delay.
delay(2000); //just here to slow down the output.
}

This is currently the code that I have to print pressure and other variables however, only focusing on the hPa pressure.

How would I incorporate your line of code into it?


@Delta_G

Thanks, is there a sort of solution I can code to account for the landing? I was thinking more of a sudden drop detected within a 1-2 second range that was continuous? I'm not too sure... :frowning:

Before posting code, please format it properly (ctrl-T in the IDE) to make it more readable, and post using code tags (as explained in the sticky).

As I expected already, there's a lot more to it than your original question... Way way more. To detect change over time, you have to record readings over time, then write the code that tells you what's happening: the rate of change in this case, and check whether it's higher than a certain number.

Not so long ago there was a thread about this, it came alive again the other day... here you go. Sounds like that is what you're also trying to do: detect drone dropping, deploy parachute.

Start reading that, lots of discussion there related to issues like landing, detecting failure, deploying the chute, drone tumbling when falling, etc.

@Delta_G

Thanks for the link, I'm just trying to figure out how to turn pressure into altitude now.

@wvmarie,

Hi, sorry about that. I'll have a look right away.

That post was about me but unfortunately I couldn't get back to it as it was buried under other posts!

Currently at this stage,

I'm moving back from the NEO-6M GPS and just focusing on the accelerometer and the BME/P280 sensor to use pressure (hPa) to detect altitude and move a servo arm when detecting a drop in variable out of the threshold.

Thanks @wvmarie for finding my post again... silly me.'

I've added the following to my to-do list and hopefully my teacher can assist me in hardcoding what you've said below.

'To detect change over time, you have to record readings over time, then write the code that tells you what's happening: the rate of change in this case, and check whether it's higher than a certain number.'

Any other discussion from others would be greatly appreciated!

You can quickly find all the threads you opened through your profile.

Here is the OP's other thread.

Thanks for merging it, and found out how to go back to my post(s).

So with my accelerometer and BME280 pressure sensor now giving me numbers, what code would I need to write to get it to talk with my servo?

I'm still unsure with all the coding itself and it's a steep learning curve for myself so I've found...

The BME doesn't have anything useful to say to the Servo. BME: "Hey, did you know the pressure is 1013 millibars right now?"

Servo says: "Just tell me the degrees OK?"

It is up to you to process the information from the BME (and any other sensors or commands) and use that to determine a useful angle to send to the servo. Write it down on paper. Try explaining it to a 5-year old. Write down more detail on exactly how you want it to work. Try explaining it to a 3-year old. When you think you can do that, then you might be able to tell the Arduino how to do it.

Hi,

currently writing down on paper and trying to explain it to myself first!

  1. if pressure drops x amount in under y amount of seconds, triggerServo.

  2. make sure to find way to ignore descent otherwise parachute will trigger...

thinking of maybe telling it that if it drops above a certain threshold then I'll trigger it.