xsw2_2wsx
Posts: 11
Joined: Fri Apr 20, 2018 2:17 pm

rpi 2b doesnt detect i2c accelerometer

Fri Aug 23, 2019 6:59 pm

Hi,

I2cdetect doesnt detect my accelerometer (ADXL345). My wiring is :

5v from pin 2 (i have also tried 3.3v)
ground from pin 6
SDA from pin 3
SCL from pin 5

i2cdetect -y 1 displays all "-" and -y 0 says device not found.

I2C is enabled in raspi-config.

I ordered two of ADXL345, both do not work, so it might be something on the rpi side.

I've swaped sd card to one with new raspbian, didnt help.

Also tried to run the command as root, no results.

It's also worth noting that the accelerometer makes noises and LED is blinking when rpi is booting up, it stops when it asks for username.

Any ideas?

trejan
Posts: 526
Joined: Tue Jul 02, 2019 2:28 pm

Re: rpi 2b doesnt detect i2c accelerometer

Fri Aug 23, 2019 7:36 pm

xsw2_2wsx wrote:
Fri Aug 23, 2019 6:59 pm
It's also worth noting that the accelerometer makes noises and LED is blinking when rpi is booting up, it stops when it asks for username.
What? Makes noises and has a LED? Is this a flight controller module? The common ADXL345 breakout boards don't have anything that can create a noise or have an LED. You need to link to the specific module you're using.

Also you should be using 3.3V not 5V.

xsw2_2wsx
Posts: 11
Joined: Fri Apr 20, 2018 2:17 pm

Re: rpi 2b doesnt detect i2c accelerometer

Fri Aug 23, 2019 8:16 pm

trejan wrote:
Fri Aug 23, 2019 7:36 pm
xsw2_2wsx wrote:
Fri Aug 23, 2019 6:59 pm
It's also worth noting that the accelerometer makes noises and LED is blinking when rpi is booting up, it stops when it asks for username.
What? Makes noises and has a LED? Is this a flight controller module? The common ADXL345 breakout boards don't have anything that can create a noise or have an LED. You need to link to the specific module you're using.

Also you should be using 3.3V not 5V.
Thanks for your response,

Im actually not sure what exact model is it, its the cheapest i could find. The title says: "ADXL345 3-axis accelerometer - AVR, Arduino, STM32"

and the description is :

Power consumption scales automatically with bandwidth
User-selectable resolution
Single tap / Double tap detection
Activity / Inactivity monitoring
Free-Fall detection
Full resolution, where resolution increases with g range, up to 13-bit resolution at ±16 g (maintaining 4 mg/LSB scale factor in all g ranges)
SPI (3- and 4-wire) and I2C digital interfaces
Flexible interrupt modes mappable to either interrupt pin
Measurement ranges selectable via serial command
Bandwidth selectable via serial command
10,000 g shock survival
Specyfications:

Current: Ultralow as low as 23 µA in measurement mode and 0.1 µA in standby mode at VS = 2.5 V (typical)
Patent pending, embedded memory management system with FIFO technology minimizes host processor load
Supply voltage: 4.0 to 6 VDC
I/O voltage range: 1.7 V to 3.6V
Working temperature: −40°C to +85°C
Size: 3 mm × 5 mm × 1 mm

(end of description)

The seller also states that for the i2c interface to be enabled a CS pin needs to be high, so i hooked it up to 3.3v (same as power).
He also states that I2C address of the device can be changed between 0x1D and 0x53, also with a special pin (SDO).

The LED is clearly there and its clearly the device that makes the noise.

Just to make sure that the accelerometer is making that sound, i disconected power and rebooted pi. No sound, but LED was on for a short period of time. (The CS pin was also disconected, only pins left were ground, SCL and SDA)

Would a picture/recording help?

Thanks again.

User avatar
joan
Posts: 14200
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: rpi 2b doesnt detect i2c accelerometer

Fri Aug 23, 2019 8:44 pm

A clear photo showing the Pi and device and the wiring are almost essential.

xsw2_2wsx
Posts: 11
Joined: Fri Apr 20, 2018 2:17 pm

Re: rpi 2b doesnt detect i2c accelerometer

Fri Aug 23, 2019 8:45 pm

The issue solved, it was a bad cable!

Return to “Troubleshooting”