Home > Ideas > Interfacing(USB – RS232 – I2c -ISP) Project Ideas > Arduino datalogging accelerometer with Micro-SD storage

Arduino datalogging accelerometer with Micro-SD storage

Summary of Arduino datalogging accelerometer with Micro-SD storage


This article details a functional Arduino datalogger utilizing the Fat16 library for µSD card storage. The project records accelerometer data, offering configurable options for saving raw or converted values, software-defined gain, and flexible collection durations. It supports up to 100 files per card and includes a debug mode. While limited by the 8MHz ATMega168 chip's speed for high-frequency sampling, it performs well for slower data collection tasks.

Parts used in the Arduino Datalogger:

  • Arduino board with ATMega168
  • Fat16 library
  • µSD card
  • Accelerometer sensor
  • Serial line interface

Thanks to Will Greiman’s Fat16 library for the Arduino, I finally got a useful version of this datalogger working! Here’s the schematic:

Arduino datalogging accelerometer with µ-SD storage schematic
And here’s the code.

The code is highly configurable: it can save raw A/D values or converted values, it allows software-defined gain, it can collect for a set time or until user input, and of course the collection interval is user-defined. It also includes a “DEBUG” mode, in which it tells the serial line everything that’s happening. It can collect multiple data files (up to 100) per card, and will tell you about any errors it encounters.

Arduino datalogging accelerometer with µ-SD storage

All this in a small enough program to fit on an ATMega168! The data collection rate is not as high as I’d like on this 8MHz chip, and the sync() calls to the µSD card cause missed data intervals when the sample period is below 100ms, but for slower data-collection situations it works great. (Does anyone make a 32MHz 3.3V Arduino? That would be nice, here…)

 

For more detail: Arduino datalogging accelerometer with µ-SD storage

Quick Solutions to Questions related to Arduino Datalogger:

  • How does the code handle data storage?
    The code can save either raw A/D values or converted values to the µSD card.
  • Can the user define the gain settings?
    Yes, the system allows for software-defined gain configuration.
  • What determines when data collection stops?
    Collection can be set to run for a specific time duration or until user input is received.
  • Does the system support multiple data files?
    Yes, it can collect up to 100 data files per card.
  • Is there a way to monitor system activity?
    A DEBUG mode exists that reports all activities on the serial line.
  • Why might data intervals be missed?
    Sync calls to the µSD card cause missed intervals when the sample period drops below 100ms on an 8MHz chip.
  • What processor limitation affects data rates?
    The 8MHz ATMega168 chip limits the data collection rate compared to faster processors.
  • What would improve performance for this project?
    A 32MHz 3.3V Arduino would provide better performance for higher data rates.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top