Dear all,
I am working on a project, where I want to use a MPU9250 motion sensor and have problems to connect it.
In my project I want to analyze the data with a neuronal network to detect a specific gesture.
I uploaded the sketch "Connection Check" out of the Library. You can see the result of the serial monitor in the attached jpg. My arduino finds the sensor at 0x68. So I think I didn't make a mistake during soldering.
Could somebody help me to fix the problem? Thanks for your support.
Jens
PS: This is my first request in this forum. If I forgot to mention some details of my problem or project / hardware, software, please tell me.
The Uno is a 5V board and the sensor is a 3.3V sensor. Depending on the pullup resistors of the MPU-9250 modules it might work, but I prefer to use a I2C level shifter.
The sensor is at 0x68. You can run a I2C Scanner sketch for a few hours. If it never fails then it is okay.
I think the MPU-9250 should return 0x75 according to the datasheet, so the library is according to the datasheet.
It seems that some have a MPU_9255 chip which has 0x73.
Can you print that WHO_AM_I byte ? to see what value your sensor returns.
byte c = readByte(addrs[i], WHO_AM_I_MPU9250);
Serial.print( "The WHO_AM_I byte is: 0x"); // <- added
Serial.println( (int) c, HEX); // <- added
if (c == MPU9250_WHOAMI_DEFAULT_VALUE) {
thanks for the fast reply. I already checked it with the 3.3 V, but same result. How can I use a level shifter?
The I2C Scanner runs without failing (adress 0x68).
Yes I use the connection check example from your link.
Find attached the result from the modified connection check. The who am I byte is 0x70.
Why is the I2C address 0x68 and the who am I byte 0x70? I am confussed.
The problem is: I would like to ignore that the connection check sketch answers that I am not using an MPU, but all the other sketches (measuring, calibration,...) answer that they have problems with the connection and I should use the "connection check" example.
The Arduino Uno has a 5V I2C bus and the MPU-6050 has a 3.3V I2C. If you connect those together, then there is a voltage mismatch of the signal. A I2C level shifter can connect those busses (SDA and SCL) with different voltage levels.
If you power the sensor module with 3.3V, then you still have a 5V I2C bus connected to a 3.3V I2C bus.
The temperature, gyro and accelerometer are registers inside the sensor.
The WHO_AM_I is also a register inside the sensor. It has a fixed value.
Try to get your money back, or toss it away, or use it as a MPU-6500, or whatever.
Good sellers are Adafruit, Sparkfun, Pololu. They only sell real chips.