Thumbnail

MPU6050 Accelerometer Gyro Temperature

How to add the MPU6050 Accelerometer Gyro Temperature robot skill

  1. Load the most recent release of ARC (Get ARC).
  2. Press the Project tab from the top menu bar in ARC.
  3. Press Add Robot Skill from the button ribbon bar in ARC.
  4. Choose the I2C category tab.
  5. Press the MPU6050 Accelerometer Gyro Temperature icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the MPU6050 Accelerometer Gyro Temperature robot skill.


How to use the MPU6050 Accelerometer Gyro Temperature robot skill

The MPU6050 EZ-Bit module is an all-in-one Gyro/Accelerometer/Temperature sensor over an i2c connection. This ARC control will read data from the sensor and set EZ-Script Variables, respectively. The control will require an Initialization (INIT) before the sensor will return data. If the sensor is not connected, the EZ-B v4 will lock up. This control will not read data automatically. We have provided a ControlCommand() for querying the device and setting the variables. Each time you wish to receive data from the MPU6050, you must ask the control to RUN ONCE with ControlCommand().

Here is an example code for looping every 100 milliseconds to request data from the MPU6050. The data from the MPU6050 will be stored in EZ-Script Variables. You may press the CONFIG button on the control to see what variables are being set with data. Ensure you have an MPU6050 ARC control added and an MPU6050 connected to the i2c of the EZ-B, and paste this code into an EZ-Script control. When this script runs, the MPU6050 will continually update the specified variables with data every 100ms... Check the Variable Watcher to view the data from the sensor.
ControlCommand("MPU6050", Init)

:loop

ControlCommand("MPU6050", RunOnce)
  
sleep(100)

goto(loop)


In this video below, I am using the JD project with MPU. The project can be found on the EZ-Cloud as JD With MPU6050 Accelerometer.

How It Works

Interested in how the IMU Sensor works? Find out by reading this fantastic article HERE.

Video


ARC Pro

Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

#9   — Edited

Quote:

strong pull-up resistors on the SDA and SCL lines
You would place separate pull up resistors from the SDA and SCL lines to the VCC Power In.

What size? The short and easy answer is that you want a resistor value on the order of 10k for the pull-up. A low resistor value is called a strong pull-up (more current flows), a high resistor value is called a weak pull-up (less current flows). You may have to play around with different values to get it right. I've always ended up using 10k though.

Quote:

What is any kind of distance?
I think he's saying any length of wire you have attached to the unit.

Quote:

Does EZ Robot still sell these I don't see them on your website? Also can you use a standard MPU6050 board?
It's been my experience that if it's not listed on their website that they have discontinued or stopped selling the part.  These boards sell dirt cheap on Amazon. You could probably buy a couple different brands and try them out. Return the ones that don't work or keep a back up.

Have FUN!!! It sounds like you are elbow deep in something very interesting.

#10  

@Dave,  Well I am trying to get into something interesting but the skill for the MPU6050 running on a EZB Arduino UNO firmware does not work or at least I can't get it to work for me.  Jeremie made I comment in that post I may want to use a EZB4 in my project so then I looked at this skill and the part they show being used with it is no longer for sale by EZ-Robot so this skill has not been updated with more current information.  I am working on trying to build a 4 foot tall walking robot and I wanted to try and use the Auto Position skill in ARC but I also need to be able to leverage a MPU 6050 in ARC also.

On the distance question above: the wire run would be about 15" tops.

It would be nice to know how this works in more detail but I guess it is another trial and error type of exercise.

#11  

I understand, trial and error is my middle name. Lol. Good luck I hope you find your results.Usually I have to try different things in different combinations before I am happy. Do you have an ezb You can start out with. Maybe you get it to work on that first?

#12  

Yep I do.  I need to strip it from another project to try it and see if I can make it work.

PRO
Canada
#13  

Hello @smiller29

This board above was prototyped but never sold. I believe I had to use pull-ups as strong as 330ohms on the SDA and SCL lines. You can use off the shelf MPU-6050s but you may have to replace the pull-ups that the board comes with.

#14  

Jeremie not sure what to parts to replace on a standard MPU 6050. Do you have a picture of what components on the board needs to be replaced.

User-inserted image

PRO
Canada
#15  

You’ll have to trace back the resistors that are connected to the SDA and SCL lines. It looks like they are the 2.2kohm (222) resistors in this case but you’ll need a ohmmeter to confirm.

#16  

Thanks guy but at my age I am not sure I can change those out LOL!  Eyes and hands not as good they’d use to be.

So now I am really thinking I am screwed.  Leaving me my only option doing it all with arduino’s and custom arduino code and not using ARC.   This was not my plan but it sounds like it is my only option.