Thumbnail

MPU6050 Tilt Angle Sensor

The MPU-6050 sensor contains a MEMS accelerometer and a MEMS gyro in a single chip. It is very accurate, as it contains a 16-bits analog to digital conversion hardware for each channel. Therefor it captures the x, y, and z channel at the same time. The sensor uses the I2C-bus to interface with the Arduino. This plugin uses the MPU6050 sensor to measure the angular position of X, Y Z-axis.

Requires ARC v2 (Updated 8/19/2021)

How to add the MPU6050 Tilt Angle Sensor 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 Tilt Angle Sensor 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 Tilt Angle Sensor robot skill.


How to use the MPU6050 Tilt Angle Sensor robot skill

You need to flash the firmware to the Arduino. With this firmware you can use both the DHT11 and the MPU6050 sensors at the same time. EZ-Genuino_DTH11_MPU6050_Uno.zip For the DTH11 wiring help go Here. For the MPU connect like pic. The variables $AngleX, $AngleY and $AngleZ are created. Have Fun!

User-inserted image


ARC Pro

Upgrade to ARC Pro

Join the ARC Pro community and gain access to a wealth of resources and support, ensuring your robot's success.

PRO
Synthiam
#1  

Oh man this is a gooder. I like playing with accelerometers. Thanks!

PRO
Portugal
#2  

Thanks DJ! Hope the community finds it useful.

#3  

Hello.

Do you mind giving an example using a script to auto move the X, Y, Z controling the servos to keep the robot up-right.  I hope I'm asking the right question.

Thanks in advance, merne

#4  

@proteusy,

I not sure bit I think this needs more work.  the script does not assign a port number that I can tell, also does it use USB on the to communicate on the Arduino.  It would also be nice if you could use the Tx and Rx on the Arduino to connect to the EZB4 1/2 digetal port freeing up a USB port.

I also had issues applying the Arduino firmware regarding the DHT11. I had to use the double // makes to apply the firmware.  I tested the MUP-6050 and I'm not sure it was working.

Please let me know what you think.  Thank you for your time making this skill.  I do not have the knowledge making a skill or writing scripts for Arduino.

Let me know if I left anything out.

Thank you proteusy! Cheers, merne

PRO
Portugal
#5   — Edited

Hi merne,

Quote:

I not sure bit I think this needs more work. the script does not assign a port number that I can tell, also does it use USB on the to communicate on the Arduino.
What port number are you referring to? It assumes it is EZB#0 at 57600 baud.

Quote:

It would also be nice if you could use the Tx and Rx on the Arduino to connect to the EZB4 1/2 digetal port freeing up a USB port.
Sorry but I do not use the EZB. I use an sbc connected to arduinos.

Quote:

I also had issues applying the Arduino firmware regarding the DHT11. I had to use the double // makes to apply the firmware. I tested the MUP-6050 and I'm not sure it was working.
The firmware loads fine. Where did you put the comment slashes to apply the firmware? Did you get any values in the x, y and z variables?

Quote:

Thank you for your time making this skill. I do not have the knowledge making a skill or writing scripts for Arduino.
Thank you merne, it is a skill I use in my robot and I am happy to share with the community. All I have done is modify a created skill (Wheel encoder) by DJ to suit my needs.

#6  

Hi proteusy,

I currently have the Arduino USB connected to my PC's USB port to test the 6050.

I opened the firmware "EZ-Genuino_DTH11_MPU6050" Then pressed the button on the Arduino and then pressed the upload button on the Arfuino IDE.

That's when it stopped at the... "rduino: 1.8.3 (Windows 10), Board: "Arduino/Genuino Uno" C:\Users\Limitedtime\Downloads\lbaltr1a(1)\EZ-Genuino_DTH11_MPU6050\EZ-Genuino_DTH11_MPU6050.ino:6:17: fatal error: DHT.h: No such file or directory #include "DHT.h" ^ compilation terminated. exit status 1 Error compiling for board Arduino/Genuino Uno. "

So I put the comment slashes anytime I got the error.  Like I said I am very new at this Arduino stuff.  Should I have loaded the ARC firmware on the Arduino Uno first?  I did not get any XYZ info in your MPU6050 Tilt Angle box.

If you have the time and would not mind hand walking me through how tp load your firmware that would be great. I thought this 6050 was for auto correcting X, Y, Z position to help keep the robot upright.

Also, I can not figure out how to use this new text format to add quotes, ect.  I like the old ez robot format better, but I'm not the guy in charge.:p

PRO
Portugal
#7  

You must download the DHT library in Arduino IDE.

PRO
Portugal
#8   — Edited

In arduino ide program goto: Tools-Manage libraries and search for dht sensor library and install.

To make a robot balanced is not an easy task. You must use PID algorithm.

Loading...