Library for Mpu 6050 (gy-521)

Hello, can I use some node for mpu6050 (board gy521)? I try to use this https://xod.io/libs/gabbapeople/mbot-lib/ , but it doesn’t work. I can’t find and do this step : “To add an Arduino library open the place where XOD is installed and copy the library folder to packages/xod-client-electron folder.” I think, now i have library (via gabbapeople/mbot-lib ) in my XOD, but I can’t upload it upload to arduino, there is some error. Can you help my please?
I will by very glad. Thx

Hi!
Could you please describe the error that occurs during the upload in detail. Even better to attach the upload log with the error or to attach a screenshot.
Thank you.

I really don’t know what is wrong.

I’ve updated the mbot-lib =)
Ok, here are things for you to do:

  1. Make sure you have the latest IDE version, if it is not latest then update.

  2. Update the lib. Go to $HOME/xod/__lib__ and delete the gabbapeople/mbot-lib library. Add the new version 1.2.3 of the gabbapeople/mbot-lib using the XOD IDE client.

  3. Now you need to require a third-party Arduino-library, but at this moment requiring third-party libraries possible only from master branches of GitHub repositories
    Make a new project then a patch. Put the mpu6050-calibrate or the mpu6050-yrp-linear-accel node onto the patch and upload it.
    XOD will ask you to download two third-party libraries (PinChangeInt and i2cdevlib) to the workspace folder $HOME/xod/__ardulib__ . So, Download it.

  4. Go to the $HOME/xod/__ardulib__/i2cdevlib/Arduino folder.

  5. Move two Arduino libraries I2Cdev and MPU6050 from the
    $HOME/xod/__ardulib__/i2cdevlib/Arduino folder
    to the $HOME/xod/__ardulib__/ folder.

  6. Test your patch.

Pls reply if you succeeded or not.

2 Likes

Thank you, now it works great. It’s good information for others. My problem was, that i didn’t copy the I2Cdev and MPU6050 to ardulib.
I have another question: is it possible to use this library (mbot-lib) without Mbot board (I using A. UNO)? Just for reading the sensor? Because, primary I am looking for a way to use this sensor, for my project. Sorry if it’s stupid question, I am beginner :wink:
Thx

Mcore Board is almost analogy of Arduino Uno. So Yes, you can use Uno.

Note:
In this library, for the proper “MPU6050” node operation, it is better to use the INT pin.
A “gy521” board that you have has this pin, so don’t forget to attach it.
Also, calibrate the sensor before use as it is written in the article.

1 Like

Great, now with INT it works perfectly. For calibrating I have used this (I hope, that it is correct):V%C3%BDst%C5%99i%C5%BEek

Hello ! How did you connect the Gy-521 with the Arduino ? And how do you tell to the node which port you used ? INT pin is the only port showed in the node.

EDIT : I suppose you have to plug the SDA and SCL in the corresponding Arduino port, but I have no output on watch node, any idee ? (I’m on 0.26.1):

I’ve done some test and apparently, the mpu6050-calibrate node and the mpu6050-yrp-linear-accel node break XOD IDE. Nothing in the code works when they’re used (test led does’t receive input, console log and watch nodes don’t work, …).

Any idee how to solve the problem ?

Hi Vanilord,

if You ask about hardware I did it last night with
1 x RJ25 6p6C female connector
1 x flat 6 wire x 0.25mm2 cable (only 5 cm long)
1x GY-521.

Some schematic and one photo may be enough to get a clue how to make it.

Regarding XOD I am real rocky but it is clear that there is a need of some trigger at “MPU6050 yrp …” that is J1 S1 pin at mCore to initialize MPU6050 processor to send data and there is no no need of any external “trigger” for “MPU6050 calibrator” module only once at begining of program
regards,
Radovan

Thanks for the reply.

My setup is quite basic. I’ve added the AD0 pin, but I still have no result.

Hello Vanilord,
You must “feed” Arduino pin S1 , that is RJ25 yellow at XOD, or D11 at UNO board,

with INTerrupt “data” from GY521.

Hello Radovan,

It works when I connect Int pin to Pin D11, D12, (Arduino Mega). Thanks !

Weird it didn’t work with pin < D10.

Hello, I don’t know what is causing it, but when i try to upload the code to my arduino Uno it gives me this error. Could someone help me please.

You need to scroll up to see what the actual (first) error was.

could this be

1 Like

Hi, I had a problem and thought it was the board, but it turns out that it does not have ADDR pin .

In my case I use Rich UNO R3 that incorporates an LM75a with address 68h the same default address of the MPU6050.

It is easier to change the address in the MPU than to reform the arduino board.

Maybe I should add an address pin to the library.

Cheers
image

Does your MPU6050 have an AD0 pin?
It seems that both sensors cannot change the address programmatically, only by the ADDR pin.

hi, if it has pin AD0, and in HI it goes to 69h, but the node has a predefined 68h.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.