IMU LSM9DS1 with SD Card logger

IMU LSM9DS1 with SD Card logger
« on: March 12, 2017, 02:22:02 PM »
Hello, I wonder if anyone successfully integrated the 9axis IMU with a SD card logger? I have been struggling to fit in the 32K code space (everything about 80% utilization crashes). The SD Card Arduino library by itself is ~47%, the RTIMU lib is 41% so I surely need more lightweight libs to make it work :( If anyone has done anything like this I would really appreciate any tips or custom libraries?

(Note: there is an older lightweight SD card lib using FAT16 only but windows wouldn't allow me to format SD Card with anything other than FAT32).

Re: IMU LSM9DS1 with SD Card logger
« Reply #1 on: March 22, 2017, 04:13:04 PM »
Have you checked out SdFat? It may be the 'older lightweight' library you are mentioning, but now it's a bit less lightweight but fully supports FAT32 etc.

You should be able to utilize the 32K flash space fully, what typically causes crashes is too many global variables in the 2K memory. Especially when using an SD card, which often needs a 512 byte buffer.

What may make it much easier is to log the raw 9 axis data rather than the calculated fusion data, if it fits your application- then you can focus on actually logging the data.


  • ****
  • 54
  • Still downloading...
    • View Profile
Re: IMU LSM9DS1 with SD Card logger
« Reply #2 on: March 23, 2017, 10:48:42 AM »
I got them to work together, but did not use a standard TinyDuino. I used the Tinyscreen+ which gives 256Kb Flash. The reason was not more memory, but rather I wanted data on display as well as logged. It allowed me to create a clear rubberized softball that tracks all flight data from throws/strikes. If you are stuck from memory size, maybe consider the Tinyscreen+.