SparkFun Evaluation Board - ADXL345

This is an evaluation board for the ADXL345 three-axis MEMS accelerometer. The ADXL345 is an awesome little accelerometer, capable of measuring acceleration of up to ±16g at up to 13-bit resolution. The evaluation board includes everything you'll need to adjust the ADXL345's settings, and monitor and log its outputs. The on-board ATmega328 takes care of all the I2C/SPI communication with the ADXL345, and it will also log the x-, y-, and z-axis acceleration values onto a uSD card.

The board includes a USB interface, which allows you to read/write any of the ADXL345's registers using a terminal emulator. The default baud rate is 57600bps (8-N-1). The UART pins are also broken out allowing a direct TTL interface with the processor. Power can be supplied by 2xAA batteries, or with a 3.0-3.3VDC power supply at the VCC/GND pins.

The ADXL345 evaluation board does not include batteries, uSD card or a USB cable, check the related items section below for these products. The source code provided below is written in C and bundled with hex files ready to load, however we've also made an Arduino sketch available that returns values from the ADXL345 so that you can take advantage of the Bootloader. The Arduino sketch doesn't do anything with the on-board LEDs but it does operate the accelerometer.

  • ADXL345 triple-axis accelerometer installed
  • microSD card socket for FAT32/16 data logging
  • Arduino bootloader "Lilypad Arduino w/ ATmega328"
  • USB connector for serial communication
  • 2xAA battery sockets to power board
  • Pre-installed firmware logs ADXL345 outputs and allows you to read/write registers via USB
  • 2.75x2.70"

SparkFun Evaluation Board - ADXL345 Product Help and Resources

Core Skill: Soldering

This skill defines how difficult the soldering is on a particular product. It might be a couple simple solder joints, or require special reflow tools.

2 Soldering

Skill Level: Rookie - The number of pins increases, and you will have to determine polarity of components and some of the components might be a bit trickier or close together. You might need solder wick or flux.
See all skill levels


Core Skill: Programming

If a board needs code or communicates somehow, you're going to need to know how to program or interface with it. The programming skill is all about communication and code.

2 Programming

Skill Level: Rookie - You will need a better fundamental understand of what code is, and how it works. You will be using beginner-level software and development tools like Arduino. You will be dealing directly with code, but numerous examples and libraries are available. Sensors or shields will communicate with serial or TTL.
See all skill levels


Core Skill: Electrical Prototyping

If it requires power, you need to know how much, what all the pins do, and how to hook it up. You may need to reference datasheets, schematics, and know the ins and outs of electronics.

2 Electrical Prototyping

Skill Level: Rookie - You may be required to know a bit more about the component, such as orientation, or how to hook it up, in addition to power requirements. You will need to understand polarized components.
See all skill levels


Comments

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • Member #584920 / about 10 years ago / 1

    I recorded a lot of data using this accelerometer.I have around 750,000 data points. I did set the Accelerometer to +/-4G before i started recording. Can anyone tell me "In 1 second, how many data points get recorded" ? That way i can correlate the Acceleration vs Time.

  • Member #600178 / about 10 years ago / 1

    Is there a way to communicate with multiple ADXL345 on the same I2C bus?

    Thanks!

  • Member #584920 / about 10 years ago / 1

    Hello All, I am planning to use this Accelerometer on a device to measure Vibration. The question i have is "Can i put the Accelerometer inside a Ziplock bag ? By any chance, if the batteries heatup, is there a chance that the Ziplock bag can catch fire ?

    • M-Short / about 10 years ago / 1

      Nope, mostly because plastic bags just melt and don't catch fire. But why would the batteries heat up to the point of melting plastic? The accelerometer and/or SD card won't pull that much power. If you shorted the batteries its possible (so don't short the batteries). In other words when working with electricity you should always be careful, but as long as always a few precautions should prevent problems.

  • Member #584920 / about 10 years ago / 1

    Hello All, I used this Accelerometer to capture Vibration Data. For example, in X-Axis the value is fef6, in Y-Axis the value is 22 and in Z-Axis the value is fff6. Now i have converted this data as per "nuFcrapS - The simplest way i found". After converting, how i do i get meaningful Acceleration G values. Can someone please explain this in detail ?

  • Member #578656 / about 10 years ago / 1

    Hello, hoping someone can help me out here.

    I'm trying to set the accelerometer into 3200 Hz, right now I have the BW_RATE register set to 00001111, which according to the datasheet is 3200 Hz. I've tried other frequencies, which have all worked. My baud rate is 57600.

    Am I missing something? Is it possible the board will not allow 3200 Hz?

    Any help would be greatly appreciated,

    Thanks

  • Member #564014 / about 11 years ago / 1

    Guess what happens when you accidentally short the batteries whilst the circuit is plugged in...fried eggs! Note to anyone who has purchased this: when not in use, remove the batteries and SD card, save you destroying 4GB worth of data and $50 worth of circuitry big sigh

  • BitPilot / about 11 years ago / 1

    I am trying to change the firmware so the accelerometer is in the +/-16G range. I am having problems compiling the code into a hex file. How do you create a new project in AVR Studio, import all the code, and then write to hex. I can load the Hex and EEprom to the device no problem with a STK500. I am not that familiar with makefiles, but I did modify a makefile to work with the stk500 programmer, and then used cygwin to try and compile, but I just get lots of errors. Any help?

    • Member #564014 / about 11 years ago / 1

      If you're on windows, and you've installed AVR Studio, the install should have given you a command prompt option. If not, you need to add the path to you gcc-avr compiler to your system path. once that's all up and running, you should be able to go to the folder in cygwin and type "make clean" to get rid of any previous hex files, then "make all" to compile your new hex file. Hope this helps

  • Member #560085 / about 11 years ago / 1

    Hello,

    i want to operate 3 of those evaluation board in different locations. Is there a easy way to simultaneously start and stop these? For example with a trigger pulse through a wire?

  • Member #547076 / about 11 years ago / 1

    Why am I getting FFFF (65536) values? Isn´t it supposed to be just 10-13 bits? Thanks

    • Member #547076 / about 11 years ago * / 1

      Ok I got it. The Ev. Board came configured with a 10 bits resolution and +-2g acc range. If the acceleration values are in the FFFF range it means it is working on the negative direction (For example in the X axis: FF = - & FF = 255 => -255). So I created a Matlab script that handles this, if the value starts with FF just consider the second two letters and add multiply by -1, if it doesn't start with FF just consider the whole value, then multiply this values by (4)/2^10 to get it in gravity values (g's), where 4 = +-2g and 2^10 is the resolution of the data. Good luck!

      • Member #548552 / about 11 years ago / 1

        The negative numbers are probably in a format called Two's complement, which is a convention for storing negative numbers as binary. In two's complement, if the most significant bit is set, the number is negative. To get the magnitude of the negative number, you invert it and add one. e.g.:

        if(value & 0x8000) {
            negative = true;
            value = (~value) + 1;
        }
        

  • Member #463573 / about 11 years ago / 1

    i bought this evaluation board, and i have a serious problem... after running board, state LEDs turn on and off two times, then 3rd STAT light (yellow light) turned on continuously and does not turn off... SD cards being failed ! and when connect board to computer, commands run and board react normally, but no logging data appeared.... Help me please..... so thanks.

    • Member #389598 / about 11 years ago / 1

      I don't know if this is the solution to your problem but I ordered a card and SD chips from here and they didn't record any data. I am running a Mac and I reformated the SD chips using the disk utility and everything worked correctly. It appears the SD chips sold here have some strange formating that doesn't work with the software. I have chips from another source but haven't tried them yet so they are an unknown.

  • MRTR / about 12 years ago * / 1

    I'm looking for an Arduino software implementation of SPI, specifically for this evaluation board using Pins Analog 0 through to Analog 3. Any thoughts or links? (or better still example code, the Arduino sample above does not work with this board as the ADXL345 is connected via a different pins)

  • Member #432277 / about 12 years ago / 1

    at what time does the logger record data, every second?

    • nuFcrapS / about 12 years ago / 1

      User Guide http://www.sparkfun.com/datasheets/Sensors/Accelerometer/ADXLEvalBoard%20User_Guide2009-09-14.pdf Page 2 "The accelerometer is initialized to log data at 100 Hz with +/- 2g range."

  • Member #431466 / about 12 years ago / 1

    Hey Everybody,

    I'm having trouble getting the data from my ADXL345 into a meaningful format. Currently, whenever I try to open the output .csv file with excel I get three columns of gibberish like, 'ff0a, 00f5, ffaa, etc.' Any help y'all have would be g r e a t l y appreciated!!

    Have a good one, D

    • nuFcrapS / about 12 years ago / 1

      Each column is data from one of the three axes and each word is a hexadecimal ascii representation of the acceleration value. To decode this, capture the data into a text file and then read it into Excel. Refer to the post above that starts with "The simplest way I found" and write back if that's not clear enough.

  • Member #209121 / about 12 years ago / 1

    What version of AVR studio was used to build ADXL345_Eval_v16.hex? Is all of the code needed to build ADXL345_Eval_v16.hex in the file ADXL345_Eval_v16.zip (or included with AVR Studio)?

  • gabryponte / about 12 years ago / 1

    other times uploading HEX fiel gives:

    avrdude.exe: AVR device initialized and ready to accept instructions

    Reading | | 0% 0.00s avrdude.exe: arduino_read_sig_bytes(): (a) protocol error, expect=0x10, resp=0x90 avrdude.exe: error reading signature data for part "ATMEGA328P", rc=-3 avrdude.exe: error reading signature data, rc=-1

    the response is always the same: resp=0x90 what should it be?

    thanks to all kind of help

  • gabryponte / about 12 years ago / 1

    dear all, I have a lot of problem with this demo board: - serial connection won't work properly: seems that the board TX data at 57600, 7,N,1 but it accept command at 8,N,1! So command "R 00" return "Invalid Command" - if I reply in 8N1, it responds, but it's almost unreadable: "Reg. Addòå󳺠Š¢µ·ž®±´½±ž±™…„ž" the board seems to be BROKEN !!!!

    So I decided to upload the HEX file. but upload won't work, too: it stops each time in different position. SEEMS ARDUINO BOOTLOADER NOT PRESENT! But I am new with arduino. Should it be?

    avrdude.exe -C ..\etc\avrdude.conf -carduino -patmega 328p -P com5 -b57600 -v -Uflash:w:ADXL345_Eval_v16.hex [....] Programmer Type : Arduino Description : Arduino Hardware Version: 2 Firmware Version: 1.16

    avrdude.exe: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x90 Vtarget : 0.0 V Varef : 127350018.7 V Oscillator : Off SCK period : 0.1 us

    avrdude.exe: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% 0.02s

    avrdude.exe: Device signature = 0x1e950f avrdude.exe: safemode: lfuse reads as 0 avrdude.exe: safemode: hfuse reads as 0 avrdude.exe: safemode: efuse reads as 0 avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be perfo rmed To disable this feature, specify the -D option. avrdude.exe: stk500_cmd(): protocol error

  • heathkid / about 12 years ago / 1

    I would like to actually use this as a 3-axis accelerometer data logger. Obviously it won't do this out of the box. Any suggestions?

    • nuFcrapS / about 12 years ago / 1

      From the description "The evaluation board includes everything you'll need to adjust the ADXL345's settings, and monitor and log its outputs. The on-board ATmega328 ... will also log the x-, y-, and z-axis acceleration values onto a uSD card."

      What is it you're missing?

  • Member #343408 / about 12 years ago / 1

    Hello, I am a researcher, I bought a card ADXL345 Evaluation. The software loaded is lost. You can send me a copy of the software and directions on how to upload? thanks Giuseppe Morello

    • Member #343408 / about 12 years ago / 1

      Hi, I run the processed described by you, and it says it "system wide configuration files - avrdude.exe: can not open config file" ": Invalid argument - avrdude.exe: error reading system wide configuration file "" How can I fix it? thanks

  • Zeb / about 13 years ago * / 1

    For those that have overwritten the factory software image, here is a simple walkthru to get the factory image back on the eval board using Windows xp/7:

    • Download the Arduino software
    • Extract the zip of the installation to somewhere you will remember (like desktop or temp)
    • Download the above source code for the eval board and unzip it
    • Open the unzipped source code and look for a file called ADXL345_Eval_v16.hex.
      • Copy this file to the following location:
      • Locate the location where you unzipped the Arduino software and open the "hardware" folder.
      • Then open the "tools" folder.
      • Then open the "avr" folder.
      • Then open the "bin" folder.
      • Paste the file here.
    • Now open cmd.exe (as administrator in windows 7)
    • Change directory "cd" into where you extracted the Arduino software (my example - "cd \Users\whitezw\Desktop\arduino-1.0.1-windows\arduino-1.0.1\hardware\tools\avr\bin")
    • Type the following command "avrdude.exe -C ..\etc\avrdude.conf -carduino -patmega328p -P com8 -b57600 -v -Uflash:w:ADXL345_Eval_v16.hex" ** Note that my Arduino is using COM8 on my computer. You will need to change this to match whatever port you Arduino is using. **

    That's it... Now you should be back to the factory image and able to record accel values to the sd card.

    Thanks, Zeb

  • jbh2phd / about 13 years ago / 1

    I have my board spewing data through CoolTerm on my Mac. Read the UserMan... I can stop the data stream by pressing any button, as the doc explains, but I cannot restart the stream by pressing 's' (as the doc explains). I also can't execute read and write commands. I type a command in, and I get a carriage return in the terminal, but nothing happens. I'm running the correct comm's setup and have FTDI drivers installed.

    Has anyone else encountered this problem? Thx.

    • jbh2phd / about 13 years ago / 1

      OK, I figured it out. I added a 3ms Transmit delay and made sure Terminal Key Emulation was CR only (not CR+LF, not LF). Now it works through the terminal emulator as described in UserMan (aka doc).

  • stefandz / about 13 years ago * / 1

    For those wanting some Arduino code for this board based on the breakout board tutorial, check out this.

    • Member #317510 / about 13 years ago / 1

      Hi i am just wondering. Since the board is using USb. How to connect it to arduino board and used the arduino code?May i get the circuit schematic connection between arduino and evalboard from you?thanks

      • stefandz / about 13 years ago / 1

        The eval board is an Arduino! :-) It runs the Arduino bootloader and has an onboard USB-Serial connection implemented using an FTDI chip. In addition, it has the accelerometer and all associated circuitry mounted on the board, along with AA battery contacts and a micro SD card slot.

        All you have to do is make sure you have the Arduino IDE installed and then plug in the board via USB to your computer. You should then see a new serial port available to upload to in the IDE. Select "Arduino Duemilanove w/ATmega 328" as the target board, paste the code from my pastebin into a new sketch and hit upload. Voila! If you now open a serial monitor window set to 9600 baud using the same serial port you just uploaded to, you should see acceleration values being reported back.

  • Member #278996 / about 13 years ago / 1

    I buy the Evaluation Board recently, and i can change the ODR by burning BW_rate of register.I have a trouble that the ODR couldn't modify over 200Hz, but i need use it to measure mechanical vibration for 3200Hz. Do you have any idea to change the ODR for 3200Hz?

  • foresightyj / about 13 years ago / 1

    Hello. I don't know where I could ask this question.
    I am investigating ADXL346 as I really like the orientation functionality. However, the interface level is 2.75 volt max. Does anyone know why they would design something like that? I have never seen any MCU works at that voltage. My chip works at 3.3V and that makes it really hard to interface.
    Thanks in advance.

    • MikeGrusin / about 13 years ago / 1

      Lower voltage equals lower power consumption, so VCCs are headed in that direction (many Atmel chips work down to 1.8V). You can use voltage translation circuitry to interface anything to anything else, but given the extra hardware, it might be easier to just change the orientation in software.

  • Member #237291 / about 13 years ago / 1

    Nice little board.
    But how do you use the data>??? OK, it logs to an uSD and there is tons of available data in 2's compl. form. I need to draw a graph of that... and changing each value at a time is not an option.
    Any suggestion on how to create the graphs for each axis?
    Thanks a lot!!!

    • nuFcrapS / about 13 years ago * / 3

      The simplest way I found was to use a spreadsheet program like Excel and use the built-in function hex2dec(). You may need to follow that up with an if() to do the two's complement adjustment, as my Excel didn't seem to recognize negatives.
      e.g.
      A1 contains fffd
      A2 contains =hex2dec(A1)
      A2 shows 65533
      A3 contains =if(A2>32767;A2-65536;A2)
      A3 shows -3
      When plotting, you may also want to calculate the absolute magnitude of the three channels by squaring the signed decimal value of each channel using =power(), summing all the squared values and then taking the square root using =sqrt().
      nuF

      • Member #364451 / about 12 years ago / 1

        Thanks...this is a very helpful post, which explains how to quickly interpret the data, and is not found in any of the docs. Had a plot in 10min.

  • nuFcrapS / about 14 years ago / 1

    Thanks for a great board and especially for sharing the schematics and code. I'd like to share some novice gotchas:
    1. Beware of the Pocket Programmer and its 'Power Target' switch which will apply 5V to the board. While the '328 doesn't mind, the ADXL345 has an absolute maximum rating of 3.9V. I feel lucky.
    2. Beware of the labels on the header socket JP1 - the signals labelled 'PC6' and 'PC7' go to ADC6 and ADC7 on the 328P and not to PORTC. Although there is a PC6, it does not come out on the header (you can't use it anyway because it's shared with !RESET) and there's no such thing as PC7.
    nuF

  • Member #145682 / about 14 years ago / 1

    Beware that the ADXL345 is interfaced as an SPI device, SPI is bit banged because the hardware SPI is dedicated to the micro-SD care. No idea why they did it this way, but whatever...
    I added I2C support by tapping into the traces off the mcu and running two jumper wires over to the .1" port output. Just make sure PORTC bits 1:2 are set to input mode!

  • kingklanman / about 14 years ago / 1

    I have finally started communicating with my board. But, my data coming out many times is in the 65,000 range. I can have 2 axes working fine, and the 3rd is saturated (like FFF4 and other nonsensical numbers). Any thoughts? Am I reducing the data wrong?

  • pizza2 / about 14 years ago / 1

    Does anyone know the clock speed of the atmega328p on this board? I can't seem to find it in the documentation.

    • Member #145682 / about 14 years ago / 1

      i believe the STK500V1 boot loader is set for 8mhz clock. So, it should be 8mhz.

  • kingklanman / about 14 years ago / 1

    I have a problem communicating with the board.<br />
    <br />
    I am working w/ Windows XP. I have loaded numberous Virt com port drivers. I loaded teraterm. <br />
    <br />
    I can't figure out how to get the board to be recognized<br />
    <br />
    What virtual com port drivers should I use (free hopefully)<br />
    <br />
    Any help is appreciated

  • kingklanman / about 14 years ago / 1

    I got data off the board, but it looks like it is hex. I thought the units were voltage. Where am I wrong? Please help, I'm just a dumb mechanical guy

    • "dumb mechanical guy" is an oxymoron.<br />
      <br />
      The output is the raw 10-bit data from the accelerometer. You'll want to check out the datasheet for the ADXL345 (follow the link to the related product). You'll find out that the raw data is output as a 2's compliment number; basically a number that can represent positive and negative numbers. Depending on the range you've selected for the ADXL345, you'll have to scale this number appropriately to come up with the number of g's.

  • kingklanman / about 14 years ago / 1

    I jsut plugged mine in and looked at the data. It looks like a combo of hex and decimal output. Any thoughts?

  • kingklanman / about 14 years ago / 1

    I just pulled my board out and it has no reset button as advertised. Any help?

  • nhunsperger / about 14 years ago / 1

    Pin 1 on the ISP header is marked with a little bar. It is closest to the LEDs.<br />
    <br />
    To write the .hex file included in the source code zip, you can use this (assuming your board comes up as /dev/ttyUSB0):<br />
    avrdude -carduino -patmega328p -P/dev/ttyUSB0 -b57600 -v -Uflash:w:ADXL345_Eval_v16.hex<br />
    <br />
    Please note that the above avrdude cmdline does the programming over the USB connector, not the ISP connector with an external programmer.

  • foresightyj / about 14 years ago / 1

    Anyone coded in Arduino for this board? I appreciate if you can share.

  • foresightyj / about 14 years ago / 1

    Thanks for the reply. I am just curious. Why didn't you guys code it in Arduino in the first place? <br />
    <br />
    I suggest you put a caution in the user guide. I just read the user guide, got excited, downloaded Arduino IDE, and erased it right away before I realize how catastrophic that was. Since I don't have an ISP. I have to figure out how to port the c code into Arduino. Communication with ADXL345 is no big deal but microSD and FAT32 are big problems.<br />
    <br />
    <br />

    • Member #145682 / about 14 years ago / 1

      I for one am glad it's not programmed in arduino.

  • thealias / about 15 years ago / 1

    Can you please provide an arduino template for this board?
    As it is now I can program the board with arduino but I am having troubles accessing the accelerometer and the sd card.
    Thanks

  • KD / about 15 years ago / 1

    Can you give a brief description on how to use the pocket avr programmer to upload a script on the board. The board doesnot say which end is the first pin of the 6 pin header, can you put some light on it. If possible can you give the command line to be written for avrdude to write the source code (the one provided on this page) to the board. I tried a number of things but it keeps saying initialization failed.
    ( Sorry if any of the above is too obvious... I am a newbie)

    • nhunsperger / about 14 years ago / 1

      KD, please see my separate comment that answers your questions.

  • Ace! / about 15 years ago / 1

    I didn't see a low-pass, anti-aliasing filter on the schematic or a place on the board to put one in. Did I miss it or is it built in, somehow, to the accelerometer?

    • KevinC / about 15 years ago / 1

      The ADXL345 is a digital accelerometer that does not have the option of adding any analog filtering for anti-aliasing. You could add your own digital filtering, the application note AN-1025 describes using the FIFO Buffer to reduce the u-controller poling rate while maintaining the advantages of having a higher sampling rates in the device.

  • KD / about 15 years ago / 1

    The source code doesnot seem to have code for Arduino ( I think its for avrdude). Can you please post the code using Arduino.

Customer Reviews

No reviews yet.