Go Down

Topic: ADXL345 data rate & method to read it (Read 1 time) previous topic - next topic

fino1990

Hi michinyon, thanks for the suggestions

Your sample rate is limited by two things:

the rate at which the device samples it's own hardware
the rate at which the I2C operation to the arduino works.


Ohh I see, the ADXL345 data rate is the rate at which the I2C operation to the arduino works while its bandwidth is the rate at which the device samples it's own hardware. Is that right?
So if I set the ADXL345 data rate at 100 Hz, I have to set the Arduino to sample at 200 Hz?

@ robtillaart, I have test the code and measure the execution time. I found that when I set the serial rate at 9600, actually, the longest execution time was not when it did the read function but at the serial print. I think this is my problem and speed up the serial rate solved it.

michinyon

Quote
So if I set the ADXL345 data rate at 100 Hz, I have to set the Arduino to sample at 200 Hz?


No, thats not what I meant at all.   The point is,  your maximum possible data acqusition rate is limited
to whatever is the worst of the possible constraints.

For example,  if a GPS device only updates it's position once each second,    then there is not much point in
asking it for the position 100 times a second,   even if the communication method in use enables that to happen.

Conversely,  some device might generate millions of samples a second,  but if the communication process only
enables you to enquire and get a response 20 times a second,   then that is the sample rate which you
will get.

fino1990

Okay, I got it. Thanks a lot for the answers  :)

Go Up