Close

Phase 1 Continued Work + Goals

A project log for Accelerometer Data Logger

A headless data logger based around H3LIS331DL accelerometers and Teensy 3.0

emach00Emach00 07/08/2015 at 22:550 Comments

After managing to set the output data rate to 1000 Hz and the measurement range to 400G's, I made some mods to the Arduino sketch so I would poll the accelerometers every second and timestamp the readings down to the microsecond using the micros() function. In the interest of speeding up the code, I used a single Serial.println() statement to pass the accelerometer data back to the PC via the serial monitor. When it was all said and done, it was taking 1.0065 seconds between serial line prints.... So I guess that means my software loop was taking ~6.5 ms. My code was passing the accelerometer data out as "G's" in float format. The library can return the data as signed integers, reducing the overhead for the serial transfer and I can always get the data back into g's during post processing.

Further goals for Phase 1:

1) Implement I2C_TC3 library by Brian Nox that runs much more efficiently than the default Arduino Wire library on the Teensy 3 and 3.1.

2) Rewrite the read data function or create a dedicated function to take advantage of the accelerometer's ability to do multiple byte reads.

3) Write code to store raw accelerometer values into an array for transfer later to the PC via the Serial Monitor.

4) The accelerometers have configurable digital output pins that can serve as interrupts. One of the supported interrupts is "new data ready." Work interrupts into the code, so it only reads accelerometer data when it is available.

5) Work on implementing external Flash storage via SPI.

Discussions