FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

projects/accelerometer at develop · ammolytics/projects · GitHub

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Ammolytics Project: Inexpensive Firearm Accelerometer

This project was first featured in an article which investigated the effects Recoil has on Muzzle Velocity, and was described in more detail in a later article. I also gave an update on the progress that's been made since the first release.

Software

The Arduino software for this project is in the sensor_logger.ino file. It's based on the example code from Adafruit for the LIS3DH sensor.

Hardware

Instructions

There are excellent guides available from both Adafruit and Sparkfun which explain how to wire the sensor correctly.

And another for how to setup the RTC date/time and write to the SD card.

After assembling the hardware, you'll need to install the software in this repo onto the Feather board. For use at the range, I recommend disabling the DEBUG flag by commenting out the following line:

// Enable debug logger.
// Note: Comment out before running in real-world.
#define DEBUG

Data Output

When the unit is powered up, it will create a new file based on the date/time in this format:

YYYYMMDDHHmm.csv

While it's running, it stores a few seconds of acceleration data in memory before writing to disk. The write opertation can take around 10ms, which is too slow to do constantly. It does write often enough that you should not lose much data at all when powering down.

Acceleration values are in Gs, which can easily be converted to metric or imperial units.

Here's an example of the resulting data set.

timestamp (s) start (µs) accel x (G) accel y (G) accel z (G)
1547749706 123593 0.750 1.194 -0.191
1547749706 125917 0.801 1.191 -0.222
1547749706 126979 0.853 1.112 -0.212
1547749706 128040 0.852 1.092 -0.263
1547749706 129097 0.944 1.054 -0.223
1547749706 130158 0.973 1.021 -0.201

Configuration

There are a few variables which can be changed according to your needs.

  • ACCEL_RANGE: Can be set to 2G, 4G, 8G, 16G (default: 8G)
    Greater acceleration ranges have lower sensitivity.
  • ACCEL_PRECISION: Defines the number of decimal places for the acceleration output (default: 3)
  • SEP: Defines the separator character for the output (default: ,)

Back | FazBrowse Home | New Git URL