Close

Accelerometer Evaluation (Success)

A project log for Peril-Sensitive Sunglasses

A version of the Peril-Sensitive Sunglasses (as described by Douglas Adams in The Hitchhiker's Guide to the Galaxy)

minimum-effective-doseMinimum Effective Dose 04/10/2014 at 16:240 Comments

Tested the Accelerometer for usefulness, and things look good!  

A basic software framework is taking shape as well.  

In this case, when too much movement at once (like a jerk or a jolt) in any direction is detected, the system considers that to be an indication of Peril.

The Arduino calculates a rolling average of each sensor (in this case, each of the 3 axes of the accelerometer).  The rolled average is used as the basis to calculate a dynamic threshold.

When the read value of any axis exceeds that axis' rolling average value by at least 50%, that is considered to be too jerky, too sudden, or otherwise abnormal.  The software then sets the Peril Detected flag.

The Accelerometer is a 3-axis analog output unit from Modern Devices which I had on hand: http://moderndevice.com/product/3-axis-accelerometer-module/.  The jumper visible is a simple hardware method of adjusting the sensitivity (6g - installed, or 1.5g - not installed)

This unit also provides a digital output if 0g (freefall) is detected.  This is automatically considered Perilous.

Discussions