Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mpu6050]

The MPU-6050 is a 6DOF. In other words it has 6 Degrees Of Freedom, 3 axes of acceleration (x, y, z) and 3 axes of rotational movement (yaw, pitch, roll). It uses the I2C protocol.

-1
votes
1answer
20 views

Interfacing MPU6050 with Arduino uno [closed]

What is the meaning of "volatile bool mpuInterrupt = false; " in Arduino Program interfacing MPU6050?
0
votes
1answer
34 views

MPU6050 Calibration [closed]

Why does the MPU6050 IMU sensor not require calibration? I've used other gyro sensors on RC helicopters that required calibration at boot. Also, how does it know what its neutral position is ...
0
votes
2answers
58 views

What could cause data to be printed correctly, then incorrectly and then repeated? CAN bus / general transmission

I am attempting to send data from an MPU6050 connected to an arduino uno to another uno via CAN bus, however i don't think this is a CAN bus specific issue. In short, i am sending two packets of 8 ...
0
votes
1answer
34 views

Regarding turning exact 180 degrees using an MPU6050

I want to turn robot exact 180 degrees by using an MPU6050. This is the code I tried. Can anyone help me? #include <MPU6050_tockn.h> #include <Wire.h> #define enA 9 #define in1 4 #...
0
votes
1answer
55 views

Is there something wrong in my sketch?

I've been working on a project that need two sensors(mq2 and mpu6050), I got each sketches from the internet and I managed to work the mq2 but for the mpu6050, I'm still not sure if its working. The ...
0
votes
1answer
29 views

How to retain the on state of the LED and buzzer if the sensor is triggered?

I'm working on a project which is likely an earthquake alarm. The sketch that I got from the internet does not retain the "on" state of the indicators(LED and buzzer)when it is triggered. I want to ...
1
vote
1answer
33 views

How to remove the sketch for the LCD and retaining the sketch for the MPU6050?

I just got this from the internet and I only want to use the sketch for the MPU6050. Can someone help me to remove the code for the LCD? I'm sorry, I'm just noob when it comes to programming. Here ...
0
votes
2answers
41 views

Out of two logically similar sketches, one works while the other does not

I am currently making a project involving a self balancing bot & found this code online: #include "PID_v1.h" #include "LMotorController.h" #include "I2Cdev.h" #include "...
0
votes
2answers
62 views

How to connect a MPU-6050 to an Arduino that already has a CNC Shield V3 on top of it?

I have a CNC Shield on top of an Arduino Uno (GRBL pinout) that controls 2 stepper motors through a4988 drivers and it is working like a charm. Now I want to add an accelerometer to it. From my ...
1
vote
2answers
201 views

How to prevent interference between dc motor and arduino?

It may be already asked question in somewhere but I am struggling! I have a four wheel robot which I want to drive it to perform 90-degree left/right turn, I am using the MPU6050 3dof to get angles, ...
-1
votes
0answers
35 views

Moving two servos from one accelerometer

I'm trying to make two servos move independently based on the angle of an accelorometer (One servo for X axis and one for Y axis) I'm fairly new to arduino and I'm not completely sure of the purpose ...
2
votes
1answer
102 views

Arduino Mega and gyroscope erroneous values

I have Arduino mega2560 and MPU6050. I connected to Vcc pin of the gyro to +5V on the mega, the SDA to SDA pin, SDL to SDL pin, AD0 and GND to 2 GND pins. I used this code: #include<Wire.h> ...
2
votes
1answer
77 views

Why the MPU6050 gyroscope read write register value is 0x08 for a full scale of 500 degrees per second?

I am trying to connect a gyroscope MPU6050 to arduino ATmega2560 and read its raw values from its 6DOF (gyro and acc). I found the following code: //Activate the MPU-6050 Wire.beginTransmission(...
0
votes
0answers
73 views

How to read and change value of registers of MPU6050 to change the default scale range of gyroscope and accelerometer?

I want to read the value of I2C register of MPU6050, and other registers like the scale range selected of a gyro. The I2C address according to MPU6050 datasheet is 0x68. I wrote this code: #include ...
0
votes
0answers
17 views

Arduino Mega and MPU6050: Reducing the code [duplicate]

I am trying to work Arduino Mega AT2560mega and gyroscope MPU6050. There is a premade code on Arduino forums, where all registers of MPU605 are defined and the code is about 800 lines. I can't find ...
0
votes
0answers
101 views

Reading raw values from MPU6050 using Arduino Mega

I am trying to connect Arduino Mega with a gyroscope/accelerometer with 6DOF, using MPU6050 micro ship. While searhing online, I found lots of codes with more than 200 lines, to just read raw values ...
0
votes
0answers
136 views

How to correct MPU6050 gyro GY-521 module 90 degree deviation

When I use the GY-521 MPU-6050 module, I get (0) ok values on the pitch axis and it goes to positive or negative values when I move it up or down. However, on the roll axis, I get (18000) max. value ...
0
votes
0answers
425 views

understanding the data reading of the MPU6050

In the MPU6050 example code: // MPU-6050 Short Example Sketch // By Arduino User JohnChi // August 17, 2014 // Public Domain #include<Wire.h> const int MPU_addr=0x68; // I2C address of the MPU-...
0
votes
0answers
60 views

Getting Yaw, Pitch, and Roll from 2 MPU6050 sensors, based off of Jeff's code?

I was able to find an edited version of Jeff's mpu6050 DMP code that basically just duplicates all variables to get ypr from 2 sensors (where their addresses are manually set at 0x68 and 0x69): //...
0
votes
1answer
360 views

Wiring for Arduino Mega and multiple MPU 6050/Gy 521?

I have an Arduino Mega 2560 that I need to connect 4 MPU 6050/Gy 521's to. I found some resources on the Mega and Uno, however I'm having trouble piecing them together. This resource gives great ...
0
votes
1answer
60 views

Decreasing a functions programming size

I have Arduino Code that utilizes the I2CDev library to control an MPU-6050. I am pretty new to coding and copied and pasted most of the code from examples I have found around. I am starting to run ...
1
vote
0answers
637 views

Interfacing MPU6050 with Arduino through Simulink S-function

I am interfacing MPU6050 with Arduino using Simulink S-function builder. I'm implementing MPU6050_DMP6 code in Simulink s-function builder by following this video. By following this tutorial I ...
0
votes
0answers
110 views

MPU6050 stops work after restart again

I am using an Arduino Pro Micro with MPU6050 accelerometer sensor. Connections are: MPU6050 >> Pro Micro VCC >> 5V GND >> GND SCL >> 3 SDA >> 2 INT >> 7 I wrote code to read X, Y, and Z axes. My ...
0
votes
0answers
58 views

Baud rate dependency

I am currently trying to write (obtain) a code for getting raw acceleration values and yaw, pitch and roll angles using these Jeff Rowberg's examples. I have used MPU6050_DMP example to get this code: ...
0
votes
1answer
119 views

Code compatibility with Arduino Due

I am currently working on a quadcopter project that involves an MPU6050 accelerometer+gyroscope module, an ultrasonic sensor and control of electronic speed controllers. I have used existing examples ...
2
votes
1answer
3k views

How to generate hardware interrupt in mpu6050 to wakeup arduino from SLEEP_MODE_PWR_DOWN mode?

I am using Arduino UNO and has kept in SLEEP_MODE_PWR_DOWN mode & want it to wakeup using MPU6050 hardware INT pin (which should send a signal when MPU is in motion). I have used the article https:...
0
votes
1answer
219 views

MPU6050 accelerometer giving output as -1 -1. Can anyone tell the issue in the code?

// MPU-6050 Short Example Sketch // By Arduino User JohnChi // August 17, 2014 // Public Domain #include<Wire.h> const int MPU_addr=0x68; // I2C address of the MPU-6050 int16_t AcX,AcY,AcZ,Tmp,...
1
vote
0answers
300 views

ATtiny85 and MPU-6050 Gyroscope

I'm doing a project that involves sending MPU-6050 gyroscope data via serial communication to the laptop. Is ATtiny85 micro-controller suitable for this job? Is it powerful enough to do it? I was ...
1
vote
2answers
138 views

Arduino Micro Interrupt

I have built a custom Arduino Micro PCB, but I have made a mistake, I accidentally attached an interrupt pin for a Gyro sensor to pin 12 of the Micro, not realizing it wasn't an external interrupt pin....
0
votes
1answer
5k views

How important is the INT pin of the MPU6050 (GY-521)?

I want to wire multiple MPU6050 (at least 16 of them) to an arduino UNO for development (then nano for production). So I first started wiring one MPU6050 to an arduino like shown on the diyhacking ...
0
votes
0answers
134 views

transfer mpu6050 readings through nrf24l01

I want to transfer mpu6050 yaw pitch roll readings via nrf24l01. but every time values transmitted are equal zero. here is my code that I am using. please help me out. transmitter code #include <...
0
votes
1answer
245 views

Using 2 GY521(mpu6050)s with Arduino Uno R3

I am working on creating a motion sensor based on an Arduino and MPU6050 interface. I'd like to retorfit my code to be able to read 2 mpu6050 devices. Besides defining a 0x69 address and setting AD0 ...
0
votes
0answers
441 views

Arduino reading wrong values from MPU6050 when motors are running

I am making a quadcopter. I'm using: Arduino Uno 1000kv brushless motor HC05 Bluetooth module MPU6050 gyro sensor In my code, I started reading values from the gyro sensor and connected a battery ...
1
vote
1answer
131 views

Sidestep one second log rate with NeoGPS when another sensor on the board need to log faster

The sample rate of an accelerometer, like an MPU6050, is much faster than the GPS log rate, different technology, different issues. A common GPS Reciver has, approximatly, one second log rate. In my ...
0
votes
1answer
167 views

What is importance of the reflow profile? [closed]

I was reading the MPU6050 datasheet to understand all the type of errors that affect the accelerometer, after finding information on the Reflow Profile i look up on wikipedia the Reflow Soldering ...
3
votes
2answers
410 views

Problem with measuring vibrations (Arduino UNO + step motor + accelerometer)

I'm trying to measure vibrations of the motor's shaft that is oscillating due to an eccentric load. For that, I am using the MPU 6050 6 axis accelerometer. The motor is a NEMA 17 stepper, connected to ...
0
votes
0answers
426 views

How to change MPU 6050 Interrupt Pin number?

I'm working with MPU6050 and I want to use a different Interrupt pin(Pin18) in Arduino mega2560. How to use attachInterrupt() here? #include<Wire.h> const int MPU_addr=0x68; int16_t AcX,AcY,...
1
vote
1answer
785 views

Accessing two MPU-9250 DMP

I want to use both IMU at the same time using the Sparkfun Library on a SAMD21 mini breakout board. Can anyone help? The begin function is : inv_error_t MPU9250_DMP::begin(void) { inv_error_t ...
0
votes
1answer
491 views

Arduino MPU6050 not working due to LED PWM

I'm having some problem with the MPU6050 example sketch. I added a few bits of code of my own, so that my LEDs change color based on the yaw-pitch-roll. However when I try to run it, the values of the ...
0
votes
1answer
2k views

MPU6050 doesn't work

I am trying to do a self-balancing bot as a school project, but I got stuck with the MPU6050. I tried using the code by Jeff Rowberg (MPU_6050_raw) but it's reading only zeros. I tried the ...
4
votes
1answer
508 views

Crash when datalogging MPU-6050 to SD card

On an Arduino Pro Mini, I'm using Jeff Rowberg's stuff in i2cdevlib to read from the MPU6050, and using SdFat to write data to an SD card. Each part in isolation is fine, but when both DAQ and logging ...
1
vote
0answers
412 views

MPU6050: Setting Gyro Output Range Throws of Positional Reading

I am using the MPU6050 in conjunction with an Arduino and Jeff Rowberg's i2cdev library, and my project requires that the gyro rate outputs be more precise than the default setting, which is 1/16.4 of ...
0
votes
0answers
55 views

Mount an MPU with the y-axis parallel to the gravity vector instead of the z-axis?

normally one would calibrate an MPU6050 lying on a flat surface, this way the z-axis is parallel to the gravity vector. But for various reasons I can't mount it in a flat position to my final device, ...
1
vote
2answers
763 views

Why does this sketch give MPU FIFO overflows?

I'm transmitting this program over an NRF24l01, data from mpu, and I'm getting a FIFO overflow. Im not sure what the problem is but it gives me a lag when I put it on processing so I know the problem ...
0
votes
0answers
159 views

arduino + mpu6050 + nrf24l01 >>>>>>>>>>>>nrf24l01 + arduino ( Not running fluently)

this is my setup: I have an arduino uno + mpu-6050 + nrf24l01 all attached together and am transmitting data from that mpu-6050 to another arduino with an nrf24l01 attached to it. I got the arduinos ...
4
votes
5answers
3k views

Understanding why should avoid “String” and alternative solutions

Why “Strings” are bad for Arduino? Which is the most efficient and fastest solution to read and store the data from Accelerometer and GPS? Stings are evil for Arduino An Uno or other ATmega328-...
0
votes
1answer
440 views

Serial not displaying sketch for MPU6050

I followed this tutorial on youtube: https://www.youtube.com/watch?v=M9lZ5Qy5S2s Where he provided the code below. The problem I'm having is the serial monitor shows nothing. I tried changing the ...
0
votes
1answer
2k views

MPU-9250 IMU on SPI, external sensor or magnetometer using I2C master

I'm trying (for sport...) to use an MPU-9250 in SPI mode as it should be faster, and wasn't able to talk to the embedded magnetometer in my code. I've gone through the documentation (RM-MPU-9250A-00 ...
1
vote
1answer
773 views

MPU6050 Sending Bad values for Angular Velocity

The mpu gives me perfectly fine values for the yaw, pitch, and roll position of the chip, but when I use mpu.getRotation(&gx, &gy, &gz) to obtain the current angular velocity of the chip, ...
0
votes
1answer
66 views

Arduino randomly does incorrect addition

I've been trying to make an accelerometer calibration tool for my Arduino Nano and MPU6050, but the arduino seems to randomly do incorrect addition. If you look at the output of the console, it works ...