Arduino Sampling rate

Hello,

I need to find the actual sampling rate for my Arduino Uno. I am reading 9 values from the 9DOF sensor stick. I found some theoretical data on the sampling rate of my Arduino here:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1208715493/11

The relevant quote in the forum is: "The ADC clock is 16 MHz divided by a prescale factor. The prescale is set to 128 (16MHz/128 = 125 KHz) in wiring.c. Since a conversion takes 13 ADC clocks, the sample rate is about 125KHz/13 or 9600 Hz."

While my sampling rate may be set to 9600Hz, I know I'm not reading 9600 bits per second. How can I find how many actual bits I am actually reading per second?

Cheers.

Put some counters in your code that update whenever a conversion is commanded. Keep track of how many times in 1 second the counter is updated.

one adc reading is 10 bits, I can get roughly 8200 analog reads making it 82000 bits.

search the forum for fastAnanlogRead() - it is about 10x faster when used with compiletime known pins.

There is the Nyquist thing to consider if you are sampling a repetitive or periodic signal and that might well explain why you are receiving what appears to be noise. I would think that the Max measurable period to be equal to 1/2 the sampling rate for a sinusoidal signal that is 4800 Hz.. if there is other non periodic noise then it might be 'smoothed' or simply averaged out but some kind of conditioning might well be needed as well to compensate for sampling that will measure all the time/freq spectrum of interest.

Doc