Hi guys, so I've gotten a lot of help here for my arduino and accelerometer project which has been really amazing, I just had another question, so I'm planning to use the ADXL345B accelerometer supplemented to my arduino, now I know I can get accelerometer values at 20 samples per second, but what I'm a little confused about is whether me asking for samples by the arduino is the same as the sampling rate for the accelerometer. For example checking out the data sheet http://www.analog.com/static/imported-files/data_sheets/ADXL345.pdf the output data rate of 25 Hz will use 60 micro amps of power, so does the accelerometer always sample for a specific Hz and then my coding would only obtain the value of that sample, or does for example the 25Hz mean if I obtain accelerometer values at 25 samples per second that's how much power will be used?
From Data Sheet:
Output Data Rate Hz 25Power Consumption60uA
Looks like you set the Output Data Rate (ODR) in Register 44: "Data rate and power mode control". I don't think the power use goes down if you don't read the data as fast as it is generated.
Looks like there are lots of power saving features if you want to save power.
johnwasser:
Looks like you set the Output Data Rate (ODR) in Register 44: "Data rate and power mode control". I don't think the power use goes down if you don't read the data as fast as it is generated.
Looks like there are lots of power saving features if you want to save power.
Oh thanks heaps mate, that cleared things up soo much, there's so many pages in a data sheet I always have trouble finding what I'm looking for. So from what I understand setting the data rate would be done by placing the correct data rate code into register 0x2C register 44 and basically that determines my power usage. From what I understand as well the output data rate will obtain data at whatever rate I put it at, but all the ones I don't measure will essentially be discarded.
Also definitely been checking out those power saving features as well, tells me I can get it as low as 23uA which would be amazing!! Thanks mate really appreciate it.
trustnoone:
From what I understand as well the output data rate will obtain data at whatever rate I put it at, but all the ones I don't measure will essentially be discarded.
That is my understanding as well. There is a FIFO buffer to hold on to some readings until you can red them but if you expect to not use as many readings as you are generating you should probably turn the FIFO feature off. If you want to use every reading you can use an interrupt to tell you when new reading is available.and use the overflow flag to let you know if your code is running too slow to process all the readings.
Oh thanks heaps for the heads up man, definitely don't want the FIFO feature, and I can see it as one of those things that I will accidentally have on, and yet never be able to figure out why my sampling isn't being done properly. You also cleared up heaps of stuff about how the accelerometer worked as well, very much appreciated mate, thanks heaps!!