Search
Product Info
Triple Axis Accelerometer Breakout - ADXL345
sku: SEN-09156
Description: Breakout board for the Analog Device ADXL345. The ADXL345 is a small, thin, low power, 3-axis accelerometer with high resolution (13-bit) measurement at up to ±16 g. Digital output data is formatted as 16-bit twos complement and is accessible through either a SPI (3- or 4-wire) or I2C digital interface.
The ADXL345 is well suited to measures the static acceleration of gravity in tilt-sensing applications, as well as dynamic acceleration resulting from motion or shock. Its high resolution (4 mg/LSB) enables measurement of inclination changes less than 1.0°.
Several special sensing functions are provided. Activity and inactivity sensing detect the presence or lack of motion and if the acceleration on any axis exceeds a user-set level. Tap sensing detects single and double taps. Free-fall sensing detects if the device is falling. These functions can be mapped to one of two interrupt output pins. An integrated, patent pending 32-level first in, first out (FIFO) buffer can be used to store data to minimize host processor intervention. Low power modes enable intelligent motion-based power management with threshold sensing and active acceleration measurement at extremely low power dissipation.
Features:
- 2.0-3.6VDC Supply Voltage
- Ultra Low Power: 40uA in measurement mode, 0.1uA in standby@ 2.5V
- Tap/Double Tap Detection
- Free-Fall Detection
- SPI and I2C interfaces
Documents:
- Schematic
- Datasheet
- Example Code (ATmega328)
Pricing
Comments
22 comments
Feeds
Currency
Display prices in
Feedback
If you would like to tell us more, you can fill out our form if you need some psycho-suggestive questions. Go to the form.






















I've verified the timing (as far as I can without a scope - all the registers are working and the code is derived from some 2 wire eeprom code known to work).
Any idea if the chip is defective or is it my wiring that is wrong?
Since I don't have an example of known good code (for clock rate) I can't really tell if the part is broken or if I'm just doing something wrong which is specific to this part or something subtle. I can't find any code examples specific to this part. Does anyone have this working (using the I2C, but I'll probably try the SPI just to verify it works if I must)
It uses the "pull to ground" address of 0x1d. I.e. CS and AD are grounded, SCK goes to A5, SDA to A4, with 3.3 and ground to the arduino pins.
(I originally missed a few things including apparently you need to turn on pullups on the AVR - A checklist would help)
This board limits comment length so I can't upload it here.
Does it work with 16bit resolution @+-2g ?
(The data sheet says it is a bad idea)
It could fit the standard 0.7 inch breadboarding, sockets, etc.and have 4 pins each side and be much more stable.
(Also if you could add some unpopulated SMD resistor pads to pull up the I2C, and/or have solder jumpers to pull up CS and SA so I could do I2C by just running 4 wires).
http://harleyhacking.blogspot.com/2009/10/adxl345-at-full-speed-32khz-on-arduino.html
I am having also problems with it. In I2C mode, sometimes is working, sending data, and stops, later continue. Other times it doesn't work nothing (this breakout). An EEPROM in the same bus work without problems...
The same in two boards:
- ArduinoNANO 5v + ShiftLevel
- ATmega328p 3.3v + FT232RL Breakout
Internals pull-ups disabled. External: 4k7, 1k, 10k and nothing.
Any idea?
A desesperted try and... works. The problem (in my case) seems to be the SCK pin. It seems to be "not_soldered_as_must" and after a fe minutes of work, went to fail. Giving heat with the soldier and pushing a bit in that area can work.
If some one try this, be careful. The board pad can disappear easy (in my case, with several times over the same area, happened, and it is no easy make a bridge over).
tHNKS
//Dave Vondle, 11/16/09
#include
#define X0 0x32
#define X1 0x33
#define Y0 0x34
#define Y1 0x35
#define Z0 0x36
#define Z1 0x37
void setup()
{
Wire.begin(); // join i2c bus
Serial.begin(19200); // start serial for output
Wire.beginTransmission(0x1D); // transmit to ADXL345
Wire.send(0x2D);// POWER_CTL
Wire.send(0x09);// measurement mode, 4hz wakeup
Wire.endTransmission(); // stop transmitting
}
void loop()
{
Serial.print(getDir('x'), DEC); // print as an ASCII-encoded decimal
Serial.print("t"); // prints a tab
Serial.print(getDir('y'), DEC);
Serial.print("t");
Serial.print(getDir('z'), DEC);
Serial.print("t");
Serial.println(""); // prints a newline
delay(300);
}
byte requestByte(char dir){
Wire.beginTransmission(0x1D); // transmit to ADXL345
Wire.send(dir);
Wire.endTransmission(); // stop transmitting
Wire.requestFrom(0x1D, 1); // request 1 byte from ADXL345
while(Wire.available()){
return(Wire.receive()); //
}
}
int getDir(char dir){
int var;
if(dir=='x'){
var=requestByte(X0);
var=var+(requestByte(X1)<<8);
}else if(dir=='y'){
var=requestByte(Y0);
var=var+(requestByte(Y1)<<8);
}else if(dir=='z'){
var=requestByte(Z0);
var=var+(requestByte(Z1)<<8);
}
return(var);
}
(less than sign)wire.h(greater than sign)
Do you think that I can use Two axes ( x and y ) to mesures the tilling of a mobile and the third axe to mesure the acceleration o f this mobile?
Thanks a lot !
Turns out AD is not kidding. I had terrible problems with inconsistent behavior until adding 10 uF decoupling and inserting a 27-ohm resistor in series with the 2.8V power supply I was using.
I am still having trouble talking to the blasted thing via SPI, can't get the expected device-id value out, but at least the behavior is now consistent.
Those having trouble with this breakout board might want to try adding this heavy-duty decoupling/isolation in accordance with AD recommendations! Wow what a finicky part.
It would appear that the ADXL345 SDO line -- at least when configured for 4-wire SPI, the only configuration I'm testing -- is VERY SENSITIVE TO RINGING.
I STRONGLY RECOMMEND applications insert a damping resistor in series with the ADXL345 SDO line. I used 27 ohms here to solve the problem.
Before this fix, I could not get the correct device ID response. Pressing my thumb all over the breakout board changed the device ID response and sometimes made it OK. After much gnashing of teeth I finally discovered this issue.
This really is the most finicky part I have ever used. It doesn't take much to make it misbehave by not receiving and/or sending SPI data as expected. But with the extra power filtering, the damping resistor on the SPI output line, and a solid ground with limited RFI pickup, it finally seems to be happy.