WilliamR
Posts: 2
Joined: Wed Jun 16, 2021 2:49 am

Raspberry pi does not detect gyroscope

Wed Jun 16, 2021 2:56 am

Hi, I have a raspberry pi 4 model B, I have connected a gy-521 to pins 2 and 3, and when I run i2cdetect -y 1, nothing appears
This is what shows when I run i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

this is my config.txt file:

disable_overscan=1
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=i2c-gpio,i2c_gpio_sda=2,i2c_gpio_scl=3


this is my modules file:

i2c-dev

what am I doing wrong?

User avatar
thagrol
Posts: 5262
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Raspberry pi does not detect gyroscope

Wed Jun 16, 2021 11:20 am

WilliamR wrote:
Wed Jun 16, 2021 2:56 am
Hi, I have a raspberry pi 4 model B, I have connected a gy-521 to pins 2 and 3, and when I run i2cdetect -y 1, nothing appears
Did you also connect power (3.3v) and ground?
This is what shows when I run i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

this is my config.txt file:

disable_overscan=1
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=i2c-gpio,i2c_gpio_sda=2,i2c_gpio_scl=3
  • According to /boot/overlays/README on my Pi, there is no "dtparam=i2c1=on"
  • Code: Select all

    dtparam=i2c_arm=on
    dtoverlay=i2c-gpio,i2c_gpio_sda=2,i2c_gpio_scl=3
    confilct. Use one of the other not boh.
The safest option would be to remove all i2c related lines from your config.txt then enable it through

Code: Select all

sudo raspi-config
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

WilliamR
Posts: 2
Joined: Wed Jun 16, 2021 2:49 am

Re: Raspberry pi does not detect gyroscope

Wed Jun 16, 2021 6:49 pm

I will try that, thanks.

Return to “Interfacing (DSI, CSI, I2C, etc.)”