ADXL 345 no reading with Mega ADK and UNO


I recently purchased an ADXL 345 breakout board from Sparkfun.

However, I failed to get a reading from the board. Tried the quickstart guide on Arduino Mega ADK and Uno. Mega reads 0,0,0 and Uno reads -1,-1,-1

Here is a link to the quickstart guide. ADXL345 Hookup Guide - It uses spi.

I tried some other code from the internet which uses i2c but the results were same. Here is the link to the sites: Live Fast - Code Young: ADXL345 accelerometer breakout board + Arduino and Processing

I am wondering what could be causing this. Could it be a soldering issue? I have attached an image of the chip. Its not too convincing but you guys might want to take a look.

Any idea would be much appreciated.

To Start with check your connections.

Second try the i2c ... i used it and its working fine with me.

Third try the tutorial below .... check the code !!!

The first order of business is to double-check all connections, but if you're using SPI, try a logic level shifter, or a 3.3V Arduino.

The maximum value for a LOW input on the ADXL345 is 0.3*Vdd, which is .99V. The maximum value for LOW output from the Atmega328P at 5V is 0.9V. Assuming the 5V and 3.3V sources you're using are perfect, then this isn't a problem, but are they perfect?

The minimum value for a HIGH output from the ADXL345 is 0.8Vdd, which is 2.64V. The minimum value for a HIGH input to the Atmega328P is 0.6Vcc, which is 3V. So the ADXL345 may be sending a HIGH value that is in the 'dead zone' for the input on the Atmega328P

The LOW signal from the ADXL345 to the Atmega328P, shouldn't be an issue, but the HIGH signal from the Atmega328P to the ADXL345 may be. The Atmega328P HIGH output is 4.2V minimum, and the datasheet for the ADXL345 lists the maximum input voltage to any pin as Vdd+0.3V, or 3.9V, whichever is less.

I would try using a 3.3V Arduino, or a logic level shifter similar to: You could also use the ADXL345 breakout board from Adafruit: ADXL345 - Triple-Axis Accelerometer (+-2g/4g/8g/16g) w/ I2C/SPI [STEMMA QT / Qwiic] : ID 1231 : $17.50 : Adafruit Industries, Unique & fun DIY electronics and kits, it has the level shifting hardware on the same board as the ADXL345.

Run the I2c_scanner sketch, to see if it detects the device connected to it.

Sorry if I'm hijacking this, but did it ever get resolved? I had some code working with multiple adxl345 breakout boards, connected over SPI a few weeks ago, picked it up again and now having the exact same symptoms as the original poster (tried a mega256 and uno).

Cheers in advance

To add I'm now trying to connect a single ADXL345 breakout in either I2C and SPI, using the sample code from ADXL345 Hookup Guide - and connections on the same page, and I2C code that I found a while back but can't find the source now, but did work when I used it a few weeks ago.