accelerometer (BMA180) sampling rate issue + adding SD card to capture data.

Hi Guys. First post here, so let me know if I am missing something basic.
My current setup uses the pieces of hardware following (Please see attached schematic):

  • BMA 180
  • Arduino Uno
  • 12v Solenoid

The idea of what I’m trying to accomplish is have the solenoid be activated by a push button and solenoid tap a surface and the vibrations are sensed by the accelerometer and analyzed by the Arduino Uno. I found that if the Arduino does this, then the data captured by the Arduino is incredibly slow. The data that should come out from the BMA180 should be @1200hz (8*10^-4 secs per sample) sample rate, but the data I captured was coming out 10ms increments(~100hz) when connected to Arduino software on PC. I believe this massive discrepancy is due to the serial interface between UNO and BMA180, and also the usb interface from UNO to Arduino software on my computer.

My questions are:

  1. Am I correct in thinking the discrepancy is due to the reasons stated above? If not then what is the true reason?
  2. How can I get the sampling rate to be as close as possible to the 1200hz that is specified by the BMA180? …
  3. Since UNO only has 2kb of SRAM on the chip to hold data, I need to add an SD card to the circuit to hold the data dump from the BMA180 of about 32-64 kb so that I can use and manipulate the data obtained w/o a connection to the computer. However, SD card communicates via serial communication (I2C) which may be the reason for slow sampling rate, so I am no better off than I am now. How can I make the Arduino write to the SD card @1200hz+ via any means possible so that I have no loss in data acquisition by BMA180 AND storage capacity of SD card in my circuit?
  4. Not related to this post: Why does changing batteries that power my solenoid cause different readings from the BMA180 when the solenoid strike a surface being analyzed? What kind of portable power supply can I use to have a consistent strike force and therefore reading from BMA180?


Circuit for first prototype.pdf (35.8 KB)

Accoustic Tester Initial Prototype Code.txt (5.55 KB)

Are you using the serial monitor to receive measurements? If so, have you tried increasing the baud rate? I2C should be able to transfer accelerometer data at 1200Hz.

Regarding question 4, each battery will probably have a slightly different power due to age and usage. A regulated power supply can supply a consistent voltage, but I'm not sure how portable they are. You could make one using some batteries and a voltage regulator, probably.

Thank you for the reply Q12. I am using the serial monitor and did not think to change baud rate because I have no idea what baud rate represents in terms of sampling rates, but after changing it I am receiving readings roughly every millisecond, but I will have to output the timer in nanoseconds to truly see if indeed the reading is @1200hz. If for some reason I am limited to receiving data below 1200Hz, is there something else than can be done?

Regarding the voltage regulator, I am choosing the L7812 based on your comments and going with figure #4 as my setup from the datasheet obtained here Is that the correct regulating circuit for my project?

I don't know about your first question, but that circuit looks about right.