A headless data logger based around H3LIS331DL accelerometers and Teensy 3.0
8-bit or 32-bit microcontroller for the brains?
ESP8226 module as both the uC and data transfer mechanism?
Batteries versus super caps?
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.
I purchased 2 STEVAL-MKI153V1 eval boards from Mouser and used an old Teensy 3.0 I had bought for personal use a while back for another project. I slapped everything onto a prototype board and wired everything up with some hookup wire. Now onto software! After some Goggling I found the Seed Studio Arduino library for the H3LIS331DL accelerometer. Github Link Here. The library communicates via I2C to the chip but unfortunately only supports 1 accelerometer at a time. The I2C slave address for the accelerometer is hard coded. So after getting the demo sketch to work with a single accelerometer, the next step was to delve into the library and dig into adding functionality to declare the accelerometer's I2C address when initializing the accelerometer.
After a lot of poking and prodding at the code, I managed to get the demo running with 2 accelerometers and configured for the measurement range and output data rate I was looking for. It was a huge help that I could save changes to the library's source and header files and then simply recompile the Arduino sketch and see the impact. If I can get my act together, there will be links to my Git with the modified library.
[this comment has been deleted]