MPU6050 Gyro Sensor not connecting


#1

I have connected an MPU6050 Gyro sensor to my Mbot like this
Image 1
Image 2

I am using a Dupont to RJ25 Cable

However, when I try to read this Gyro angle, whether through Mblock or through Arduino IDE, The X,Y,andZ angles always show zero… Also when I use Mblock or Arduino IDE to move the motors, it works, it only doesn’t work with the Gyro.

Arduino Code:
Arduino Code

Mblock:
Mblock code

When I move the gyro sensor around after running this code still nothing changes, not sure why.


#2

Hey @Best_codes, do you have anything about this? I do not see anything wrong it you connecting the gryo to the mbot, and your code looks correct, but then again, my arduino code knowledge is not very great, so thanks for listing what the code is supposed to do. The mBlock code code looks fine, so it may be a compatibility issue?


#3

I’m ruling this as a compatibility issue. Your code looks fine, and there is nothing wrong with the way you installed it, so there you go.


#4

@spirixsabr and @Rosco

The issue is likely that the mBot has a special way to communicate through the RJ25 cables (a special protocol). The MPU6050 sensor likely does not use the same protocol, so the sensor won’t work with the mBot (unless the MPU6050 has a library available and somebody has created an extension for it).

Basically, there isn’t much you can do. If you want a Gyro Sensor, use the one made for mBot here:
https://support.makeblock.com/hc/en-us/articles/12880946059159-About-Me-3-Axis-Accelerometer-and-Gyro-Sensor-for-Ultimate-2-0

Which you can buy here: