Export Restrictions

This product has some level of export control/restriction, so may be delayed when shipping outside the US. Contact us with questions, or we will contact you after you place your order.

Creative Commons images are CC BY-NC-SA 3.0


added to your
shopping cart

In stock 202 in stock
17.95 1+ units
16.16 10+ units
14.36 100+ units

Description: This new version adds 2 standoff holes as well as an extra decoupling capacitor. The ADXL345 is a small, thin, low power, 3-axis MEMS 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 degrees;.

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.

Not sure which accelerometer is right for you? Our Accelerometer and Gyro Buying Guide might help!


  • 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


Replaces: SEN-09156

Comments 40 comments

  • I just finished a rich, interactive register map on the I2Cdevlib project device page for the ADXL345 here:


    My goal is to provide an easy, intuitive reference for working with this and other devices, and ultimately to make it easy to port (or generate) device control code across multiple platforms. Right now there is Arduino library and example code, but others are not far away.

  • Im confused, which is more sensitive 250g or 2g? Sorry if the question sounds dumb!

  • hello, my name is Luis. I have a problem with arduino. I like to know if there is an ADXL345 updated library for the current version of Arduino. because i used the ADXL345 library for the arduino 022, but it does not function with a program that it was done in Arduino 022.

  • Hi I was wondering if someone managed to connect the sensor in 3 wire spi mode. I tryed to set the SPI pin on the 0x31 register (0x28). And it works in 4 wire only. Btw, what is that big capacitor for?


  • i accidently connected my adxl345 to 5V and now all I get is 0,0,0 readings.. Does this mean I burnt the board? Is there any way to check?

  • So I’m looking at potentially using this to monitor vibration on something being machined but I’m concerned about the output. The max frequency I expect to see on my part is 1500 Hz and the ADXL can go up to 3200 Hz so I’m covered on Nyquist Rate there but I’m concerned about the Arduino. Given that the processor is 16 MHz and it takes a good number of instructions to poll all the registers and write them to an SD-Card or something, I’m thinking the controller won’t be fast any.

    Without going through the math of operations/cycle, does anyone think this is a reasonable frequency to use this application at?

  • Could anyone help me understand a bit what is coming out of the sensor when you read the interrupt register? Looking at the advanced code I see this line: if(values[0] & (1<<5))tapType=2; which I don’t fully understand. Is it shifting the values variable 5 bits left? For example 10001000 becomes 1000000 and if that is nonzero the statement is true? Still trying to wrap my head around this kind of stuff so any help would be much appreciated, thanks!

    • Yay bitwise logic! It’s great for setting and testing bits, but until you get used to it, it can look pretty opaque.

      The & operator is AND. It takes two one-bit inputs (1 or 0). The result will be 1 (true) only if both inputs are 1. The whole truth table is:

      0&0=0, 0&1=0, 1&0=0, 1&1=1

      The above operations are on single bits. You can do the same thing with bytes (8 bits), by doing the above single-bit operations on the columns. Here we’ll AND “01011010” and “00010000”


      The result, “00010000”, has a one ONLY in the column(s) where the inputs were BOTH 1 in the SAME column.

      So now we have an easy way to test whether there is a 1 at a certain spot in a byte! The code you posted makes “00010000” by shifting “00000001” left by five (they could have just as easily specified the resulting number), then ANDs that against the register you’re checking. If the register has a 1 in that spot, the result will be “00010000”, if there’s a 0 in that spot, the result will be “00000000”. The final thing to know is that if() will evaluate to true if ANY of the bits are 1, and will return false if all the bits are 0. And there you are!

      We’ve got a tutorial that covers this, and you can find lots of material on the web. Hope this helps, ask if you have any questions!

      • Sorry to just be getting back to you on this (I didn’t see I had a reply…) but this explains it perfectly! Thanks for all the help!

  • What do the capacitors on here do? I’m looking to use the ADXL345 on its own, and I want to wire it similar to the breakout board.

    • In electronics, capacitors are really useful to remove “electronics noise” on your circuit. They are call decoupling capacitors. Please open page 19 of the datasheet and read the paragraph.

      A 1 μF tantalum capacitor (CS) at VS and a 0.1 μF ceramic capacitor (CIO) at VDD I/O placed close to the ADXL345 supply pins is used for testing and is recommended to adequately decouple the accelerometer from noise on the power supply.

      Sparkfun followed the recommendations of the datasheet.

  • What the differences if i used this ADXL345 with ATmega328 or ADXL345 with PIC16F877A? what the best choice? with ATmega328 or PIC16F877A? (p/s: sorry for the stupid question. But I really need help. =p )

    Thank you.

    • You should use the MPU that you have more experience with. But if you have no clear winner, I’ll mention that if you set up the ATmega with the Arduino bootloader (or use an Arduino board), you’ll be able to use the Arduino “Wire” (I2C) library, which makes communicating with I2C sensors fairly painless.

  • How do I measure both the static and dynamic acceleration ? I can see that there is only one function which returns the acceleration. What does this function return? Static or dynamic acceleration ?

  • You should really add this github link to the documents of this page https://github.com/jenschr/Arduino-libraries/blob/master/ADXL345/examples/ADXL345_no_library/BareBones_ADXL345.pde

    Works for me, remember to set the baud rate people ^^

  • Its been two months and i’ve had zero help on the problems regarding the arduino sample code… Why is it throwing out errors when i try to compile the script?

    • The “Example code” above is not Arduino code, it is straight C meant for WinAVR or other C compilers.

      For Arduino code, try the link to the Bildr tutorial, or the Quickstart guide.

      • Correction: the quickstart guide code has some syntax problems, sorry about that. The Bildr code does work, but first drag the “ADXL345” folder in the example zip to the/a “libraries” folder in your Arduino code directory. Then open Arduino and you should be able to run the “ADXL345_Example” code.

        • Additional: the Quickstart guide code does compile, but you need to download it directly from the link near the top of the guide, rather than cutting and pasting from the scroll-boxes further down in the guide.

  • I’m having a problem with this? in arduino it says:

    class ADXL345 has no member names read_accel class ADXL345 has no member named set_bw

    even though it’s plainly obvious it’s there in the cpp boolean ADXL345::set_bw(byte bw_code)

    Can anyone shed any light as to why these arduino tutorials don’t work as they’re supposed to?

  • Has anyone had trouble getting this to work on their Arduino Mega 2560?

    I’ve hooked it up to a duemilanove and an Uno using the Bildr tutorial and printing the x, y, z values to the Serial interface no problem.

    When I hook it up to my Mega it just gives me 0’s, locks up the board or etc.

    • The SPI and I2C pins are in different locations on the Mega; check the Arduino library reference pages for the proper locations.

      • Yeah, on the Mega, the SDA and SCL pins are labeled very well as opposed to the analog pins on the Uno and older versions. That doesn’t seem to be my problem unfortunately :(

        I’m getting a 0 reading for all of the axis on the mega while on the Uno I’m getting what appear to be the correct readings. Almost as if the I2C isn’t working well.

  • If you just need a “bare bones” i2c example, check this out http://flashgamer.com/arduino/comments/updated-adxl345-library-for-arduino-1.0

  • I am using this sensor for my project. I wish to ask how many ohm of pull-up resistor I should use if my design is for I2C with 3Vdd supply and alt address/SDO had been solder to the ground.

  • Hi. I’m new to this but I have to build a device which can measure Impact en Temperature. I would like to know if I can combine this device with a transmitter to send wireless data to a receiver and if I can also combine this device with a temperaturemeter.
    Help would be welcome. Thanks you

  • 1) When connecting a 3V device to a 5V I2C bus, is it necessary to use a level-shifting device such as a PCA9306?
    2) Pardon my noob question, but is there a footprint for this breakout board other than the Eagle file that I can’t read? I’d like to know where the mounting holes are so I can design a carrier board before buying one.

    • To answer your first question, many times it’s OK to connect a 3.3V I2C device to a 5V system. If you do it right, the I2C part will never see 5V. The important notes are:
      A. The 5V system should be able to properly read 3.3V logic levels as H and L (most can).
      B. Power the I2C board with 3.3V.
      C. Tie your I2C bus pullup resistors to 3.3V.
      D. Make sure your 5V system is properly configured. The I2C pins should be floating or grounded, never H (5V). The Arduino does this properly, with the small exception of turning on the internal pullups to 5V by default. In practice this isn’t a huge problem as the internal pullups are very weak (20K) and will be overpowered by your ~5K pullups to 3.3V.
      As for the location of the mounting holes, we highly recommend EAGLE (the free version will open all our files), but here’s a dimensioned image that should help.

      • Thanks for the diagram, I had actually guessed within .05 from the helpful rulers in the product photo. I will give Eagle a try for my next round of designs.
        The PicAxe-based system I’m designing will have other 5V I2C devices on the same bus, so the lines are tied to 5V with 10K resistors. A 75 cent PCA9306 seems like an easy solution from my hobbyist perspective.
        BTW I’d buy PicAxe 28x2’s from you if you stocked the SMD version.

  • Accelerometer or Gyro? I’m kinda new but have read the details on both and still not sure which is better for my project. I’m mounting the sensor on top of a tripod detect whether or not the top is swaying. I don’t need direction indication, just raw movement detection, but the movement may be slight and smooth (swaying, not knocks). Which would be best or is there another type of sensor better suited for it? Thanks for any suggestions!

  • hey im pretty new to all this stuff… i need to just read a binary value of activity or inactivity off the chip… i know the chip has the option for set points by setting the max and min values for activity in the register as well as the sample time… but i am confused as to what they mean by register… does the sensor have any memory where i can hard set these and connect it directly to a transmitter, or do i need to keep the micro controller in the loop and reset the registers every time i power down the device?

  • does anyone know of a way to get more than two of these on just one i2c bus?
    Thank you,

  • Nice improvement with the mounting holes, and putting the silk screen on the top. Just so everyone knows, the old one was ~1/2in wide, so this one is only a tiny bit bigger.

  • Why is there a via included between the IC and INT1 and INT2?

    • I believe it ties the ground at pin 10, 2, 4 and 5 to the ground plane on the back of the board. You can’t see the rest because it’s under the chip.

Related Products