kriswiner / MPU9250

Arduino sketches for MPU9250 9DoF with AHRS sensor fusion
1.04k stars 471 forks source link

MPU9250 Arduino Uno AK8693 0xFF #409

Closed MMIC01 closed 4 years ago

MMIC01 commented 4 years ago

Hi Kris, I am using the MPU9250BasicAHRS and connected the following:

VCC - 3.3V GND - GND SCL -10k RESISTOR - A5 SDA -10k RESISTOR - A4

I am getting the following error: image

Would greatly appreciate your help! New Text Document.txt

MMIC01 commented 4 years ago

I followed the other treads available but still getting this errror

kriswiner commented 4 years ago

When you perform an I2C scan, which devices show on the I2C bus? It is likely you have the wrong MPU9250 address.

On Sun, Mar 8, 2020 at 9:48 AM MMIC01 notifications@github.com wrote:

I followed the other treads available but still getting this errror

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/409?email_source=notifications&email_token=ABTDLKX7KSTTFIF7DUGRYZ3RGPD37A5CNFSM4LDZBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOE25DA#issuecomment-596225676, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKXMMYGG3HVVUWBMOH3RGPD37ANCNFSM4LDZBS5A .

kriswiner commented 4 years ago

Ah, I see...

You can talk with the MPU6500 but not the AK8963C. Then you need to put the MPU9250 I2C into bypass mode.

If you are using one of my sketches that already does this, then you probably are using a cheap Chinese board that doesn;t have an embedded. AK8963C

On Sun, Mar 8, 2020 at 10:00 AM Tlera Corporation tleracorp@gmail.com wrote:

When you perform an I2C scan, which devices show on the I2C bus? It is likely you have the wrong MPU9250 address.

On Sun, Mar 8, 2020 at 9:48 AM MMIC01 notifications@github.com wrote:

I followed the other treads available but still getting this errror

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/409?email_source=notifications&email_token=ABTDLKX7KSTTFIF7DUGRYZ3RGPD37A5CNFSM4LDZBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOE25DA#issuecomment-596225676, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKXMMYGG3HVVUWBMOH3RGPD37ANCNFSM4LDZBS5A .

kriswiner commented 4 years ago

Or the board is poorly designed and missing the connection to 3V3 on pin 1.

On Sun, Mar 8, 2020 at 10:02 AM Tlera Corporation tleracorp@gmail.com wrote:

Ah, I see...

You can talk with the MPU6500 but not the AK8963C. Then you need to put the MPU9250 I2C into bypass mode.

If you are using one of my sketches that already does this, then you probably are using a cheap Chinese board that doesn;t have an embedded. AK8963C

On Sun, Mar 8, 2020 at 10:00 AM Tlera Corporation tleracorp@gmail.com wrote:

When you perform an I2C scan, which devices show on the I2C bus? It is likely you have the wrong MPU9250 address.

On Sun, Mar 8, 2020 at 9:48 AM MMIC01 notifications@github.com wrote:

I followed the other treads available but still getting this errror

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/409?email_source=notifications&email_token=ABTDLKX7KSTTFIF7DUGRYZ3RGPD37A5CNFSM4LDZBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOE25DA#issuecomment-596225676, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKXMMYGG3HVVUWBMOH3RGPD37ANCNFSM4LDZBS5A .

MMIC01 commented 4 years ago

When you perform an I2C scan, which devices show on the I2C bus? It is likely you have the wrong MPU9250 address. On Sun, Mar 8, 2020 at 9:48 AM MMIC01 @.***> wrote: I followed the other treads available but still getting this errror — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#409?email_source=notifications&email_token=ABTDLKX7KSTTFIF7DUGRYZ3RGPD37A5CNFSM4LDZBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOE25DA#issuecomment-596225676>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKXMMYGG3HVVUWBMOH3RGPD37ANCNFSM4LDZBS5A .

Firstly thank you for your reply, I really appreciate! Basically a device is found at 0x68.... I think it is correct right? image

MMIC01 commented 4 years ago

By any chance do you know if any scanners for the magnetometer only exist ?

MMIC01 commented 4 years ago

The MPU i'm using, I bought it locally it is the ACCELERATION, GYRO & MAGNETIC SENSOR MODULE MPU9250 - HAITRONIC Product Code: HR0402 Module Model GY-9250

kriswiner commented 4 years ago

Yes. 0x68.

Did you enable bypass mode in the MPU9250 initialization?

Could be defective sensor or poor circuit design.

On Sun, Mar 8, 2020 at 2:00 PM MMIC01 notifications@github.com wrote:

When you perform an I2C scan, which devices show on the I2C bus? It is likely you have the wrong MPU9250 address. … <#m-7285275343693684457> On Sun, Mar 8, 2020 at 9:48 AM MMIC01 @.***> wrote: I followed the other treads available but still getting this errror — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#409 https://github.com/kriswiner/MPU9250/issues/409?email_source=notifications&email_token=ABTDLKX7KSTTFIF7DUGRYZ3RGPD37A5CNFSM4LDZBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOE25DA#issuecomment-596225676>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKXMMYGG3HVVUWBMOH3RGPD37ANCNFSM4LDZBS5A .

Firstly thank you for your reply, I really appreciate! Basically a device is found at 0x68.... I think it is correct right? [image: image] https://user-images.githubusercontent.com/61932346/76171104-155bb680-6188-11ea-9b9c-a90c993c67e8.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/409?email_source=notifications&email_token=ABTDLKT4TT6HQZRY3YLISMDRGQBOBA5CNFSM4LDZBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOFBK6I#issuecomment-596252025, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKX752MGLYTK5SDKO3LRGQBOBANCNFSM4LDZBS5A .

kriswiner commented 4 years ago

Usually GY-9250 will work.

So likely a software problem. Check bypass mode enable.

On Sun, Mar 8, 2020 at 2:14 PM Tlera Corporation tleracorp@gmail.com wrote:

Yes. 0x68.

Did you enable bypass mode in the MPU9250 initialization?

Could be defective sensor or poor circuit design.

On Sun, Mar 8, 2020 at 2:00 PM MMIC01 notifications@github.com wrote:

When you perform an I2C scan, which devices show on the I2C bus? It is likely you have the wrong MPU9250 address. … <#m_-6952008309967509062m-7285275343693684457_> On Sun, Mar 8, 2020 at 9:48 AM MMIC01 @.***> wrote: I followed the other treads available but still getting this errror — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#409 https://github.com/kriswiner/MPU9250/issues/409?email_source=notifications&email_token=ABTDLKX7KSTTFIF7DUGRYZ3RGPD37A5CNFSM4LDZBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOE25DA#issuecomment-596225676>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKXMMYGG3HVVUWBMOH3RGPD37ANCNFSM4LDZBS5A .

Firstly thank you for your reply, I really appreciate! Basically a device is found at 0x68.... I think it is correct right? [image: image] https://user-images.githubusercontent.com/61932346/76171104-155bb680-6188-11ea-9b9c-a90c993c67e8.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/409?email_source=notifications&email_token=ABTDLKT4TT6HQZRY3YLISMDRGQBOBA5CNFSM4LDZBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOFBK6I#issuecomment-596252025, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKX752MGLYTK5SDKO3LRGQBOBANCNFSM4LDZBS5A .

MMIC01 commented 4 years ago

I believe that the bypass mode is enabled through these lines;

writeByte(MPU9250_ADDRESS, INT_PIN_CFG, 0x12); // INT is 50 microsecondpulse and any read to clear writeByte(MPU9250_ADDRESS, INT_ENABLE, 0x01); // Enable data ready (bit0) interrupt delay(100);

kriswiner commented 4 years ago

You should be able to see the AK8963C on the I2C bus then. Did you try simply reading the WHO_AM_I register of the AK8963C?

Could be that you have a faulty board. Try another.

On Sun, Mar 8, 2020 at 11:33 PM MMIC01 notifications@github.com wrote:

I believe that the bypass mode is enabled through these lines;

writeByte(MPU9250_ADDRESS, INT_PIN_CFG, 0x12); // INT is 50 microsecondpulse and any read to clear writeByte(MPU9250_ADDRESS, INT_ENABLE, 0x01); // Enable data ready (bit0) interrupt delay(100);

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/409?email_source=notifications&email_token=ABTDLKWGD2Q7QKEE7PB3MVLRGSESLA5CNFSM4LDZBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOF2CYI#issuecomment-596353377, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKX5CYMCIP354FQJX33RGSESLANCNFSM4LDZBS5A .

MMIC01 commented 4 years ago

Sorry for asking... I am new to this and have minimal experience but this is part a university project I was given as a student. How do you read the WHO_AM_I register for the AK8963 please? Thanks again!

If I will not manage to resolve the problem then I'll buy another board

MMIC01 commented 4 years ago

On another note, for this line writeByte(MPU9250_ADDRESS, INT_PIN_CFG, 0x12); there is a commented line //writeByte(MPU9250_ADDRESS, INT_PIN_CFG, 0x22);

Would it be possible to explain the difference please ?

kriswiner commented 4 years ago

Consult the register map.

On Mon, Mar 9, 2020 at 9:33 AM MMIC01 notifications@github.com wrote:

Sorry for asking... I am new to this and have minimal experience but this is part a university project I was given as a student. How do you read the WHO_AM_I register for the AK8963 please? Thanks again!

If I will not manage to resolve the problem then I'll buy another board

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/409?email_source=notifications&email_token=ABTDLKUSCHFH3TKPCVEPL23RGUK7JA5CNFSM4LDZBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOH7MWI#issuecomment-596637273, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKRAKDU2YNBIE5XOKBDRGUK7JANCNFSM4LDZBS5A .

kriswiner commented 4 years ago

Look at the register map.

On Mon, Mar 9, 2020 at 9:35 AM MMIC01 notifications@github.com wrote:

On another note, for this line writeByte(MPU9250_ADDRESS, INT_PIN_CFG, 0x12); there is a commented line //writeByte(MPU9250_ADDRESS, INT_PIN_CFG, 0x22);

Would it be possible to explain the difference please ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/409?email_source=notifications&email_token=ABTDLKR4VDJFGVDO3TLH55DRGULETA5CNFSM4LDZBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOH7ZEY#issuecomment-596638867, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKURMD5YSJJQH5YRQPTRGULETANCNFSM4LDZBS5A .

MMIC01 commented 4 years ago

Consult the register map. …

WHO_AM_I register is returning 0xFF

kriswiner commented 4 years ago

Try a known good board then...

On Mon, Mar 9, 2020 at 10:03 AM MMIC01 notifications@github.com wrote:

Consult the register map. …

WHO_AM_I register is returning 0xFF

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/409?email_source=notifications&email_token=ABTDLKTWK5DJBIT5IN7CFDLRGUOOXA5CNFSM4LDZBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOIDU7A#issuecomment-596654716, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKSIDPBQGJZ74DNTF5TRGUOOXANCNFSM4LDZBS5A .

MMIC01 commented 4 years ago

Do you recommend any other brands please?

MMIC01 commented 4 years ago

I found SparkFun 9DoF Sensor Stick SEN-13944

kriswiner commented 4 years ago

https://www.notwired.co/products/detail/nwmotmpu9250-notwired-co/605716/

On Mon, Mar 9, 2020 at 10:11 AM MMIC01 notifications@github.com wrote:

I found SparkFun 9DoF Sensor Stick SEN-13944

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/409?email_source=notifications&email_token=ABTDLKRKKCUV5P4QLWA53CLRGUPLBA5CNFSM4LDZBS5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOIEYLI#issuecomment-596659245, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKTC2ALYKN5MLIHIIX3RGUPLBANCNFSM4LDZBS5A .

MMIC01 commented 4 years ago

Thanks a lot :)

MMIC01 commented 4 years ago

Problem was with the model. replaced it with a GY91, worked fine.