Rudra Lad
Published © GPL3+

Free Fall Detection Using 3-Axis Accelerometer

The easy method to determine free fall detection with the help of a simple 3-axis accelerometer.

BeginnerProtip26,304
Free Fall Detection Using 3-Axis Accelerometer

Things used in this project

Hardware components

Arduino Esplora
Arduino Esplora
×1

Software apps and online services

Android Sensors
Available for android as free app. The free version contains ads but it is fully functional. Please buy an ads-free version if you find it helpfull.

Story

Read more

Schematics

Esplora Sensors

The locations of various sensors on Arduino Esplora.

Accelerometer Data

Complete Annotations to easily understand the free fall.

Code

Esplora_free_fall.ino

Arduino
The main code to sense free fall
#include <Esplora.h>

void setup()
{
  Serial.begin(9600);        
}

void loop()
{
  long int xa = Esplora.readAccelerometer(X_AXIS);   
  long int ya = Esplora.readAccelerometer(Y_AXIS);
  long int za = Esplora.readAccelerometer(Z_AXIS);
  float at = sqrt(xa*xa + ya*ya + za*za);           // total acceleration
  Serial.print(xa);
  Serial.print('\t');
  Serial.print(ya);
  Serial.print('\t');
  Serial.print(za);
  Serial.print('\t');
  Serial.print(at);
  Serial.println();  
    
    // since esplora accelerometer output is in 0 to 1023 range, we can assume that the acceleration during free fall will drop below value 50.
    
    if (at < 50) {
        Esplora.writeRGB(255,0,0);
    }
    else {
        Esplora.writeRGB(0,0,0);
    }


  delay(10);         
}

Credits

Rudra Lad

Rudra Lad

7 projects • 14 followers

Comments