The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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.

Filter by
Sorted by
Tagged with
0
votes
1answer
33 views

Connecting MPU6050 to Arduino Lilypad

To preface, I am very new to Arduino and I watched this video on YouTube. It shows how you can build a motion controlled car with Arduino and I decided to make this for my school project. One thing ...
0
votes
0answers
19 views

How to calibrate an inclined MPU 6050 on Arduino?

I'm trying to use the MPU 6050 sensor (gyroscope + accelerometer) with my Arduino UNO to get some data when walking, running and making some other moves while carrying it. The problem is that my ...
1
vote
1answer
31 views

Why Wire.write twice?

I'm checking an example for the MPU6050 and got to this part Wire.beginTransmission(0x68); //begin, Send the slave adress (in this case 68) Wire.write(0x1B); //We ...
1
vote
0answers
38 views

How does this MPU6050 Example Code Work?

I'm trying to understand the logic for one of the example Arduino programs for the MPU6050 IMU module. The entire program can be found here. There is an if() statement inside a while() loop inside ...
0
votes
0answers
31 views

MPU-6050 showing all -1s

I am following this tutorial and have an MPU-6050 connected to an Arduino Micro with the following connections VCC - 5V/3.3V GND - GND SDA - A2 SCL - A3 I'm trying to run the short example ...
0
votes
0answers
19 views

How long should TinyMPU6050.h calibration run for?

I just found a lightweight library for the MPU6050 gyro. Example below. mpu.Calibrate() never seems to end. I'm keeping it very still. When I take this out, the rest of the code works fine. https://...
0
votes
0answers
37 views

SD delay in writing to file

I am using MPU6050 on an Arduino Mega 2560 with Data logging shield v1.0 and an 8Gb Kingston Micro-SD HC card.I am facing a problem in logging and successfully writing to a file 100 values/sec. Now in ...
0
votes
0answers
31 views

Rocket deploy system

I found a code from Astronomica Messier that allows to activate a servo from a Gyroscope MPU 6050 change in direction. I followed the wiring and uploading correctly. The thing is that the MPU is ...
0
votes
1answer
38 views

MPU6050 Gyroscope does not give reliable readings

It gives reliable readings for a couple of seconds and then it becomes unreliable. My arduino code is this: #include<Wire.h> const int MPU6050_addr=0x68; int16_t AccX,AccY,AccZ,Temp,GyroX,...
0
votes
1answer
106 views

Changing I2C address of MPU-6050

Is it possible to change I2C address of MPU-6050 ? I am trying to connect a bunch of MPU-6050 to my Arduino. Almost all of them are running on the same address. Few are running on different address. ...
0
votes
0answers
56 views

DMP of MPU6050 only shows zeros and fifo is overflown

I am trying to use the dmp of the mpu 6050 with jeff rowbergs libraries. Besides I am using an arduino nano and windows 10. Also I am using the sketch "MPU6050_DMP6.ino" from with almost no changes. ...
0
votes
1answer
40 views

Why is Arduino I2C so sensitive to RFI/EMI?

I have a 2-motor robot project that uses a MP6050 for relative heading (yaw) measurements, and I'm having problems with the I2C bus when the motors are running. I have done most of the things ...
0
votes
1answer
21 views

request for a member “X” in something not a structure or a union

i was programming a Self Balancing Robot, I am writing the code in vscode using platformio extension. when i put the code i need to get the angle out of the gyro in another file (named angle.c) ...
0
votes
1answer
39 views

MPU6050/DMP Intermittent bad data output?

I have a DFRobots MPU6050 module wired to SCL/SDA/Pin 2 on a Mega 2560 board, using Jeff Rowberg's I2CDev/MPU6050_6Axis_MotionApps libraries. I have 2.2K pullups on the MPU6050 module, tied to +5V, ...
0
votes
0answers
17 views

What is the unit of the output from dmpGetLinearAccelInWorld()

#ifdef OUTPUT_READABLE_WORLDACCEL #ifdef OUTPUT_READABLE_WORLDACCEL // display initial world-frame acceleration, adjusted to remove gravity // and rotated based on known ...
0
votes
0answers
56 views

using two mpu6050 to get more accurate and precise angles

i have been using this gyro for a while, now i am aware of all measures taken, to improve the outcome of this board. my question is: would using two at the same time improve the results? if yes how ...
0
votes
0answers
56 views

Adjusting Project Code

I am working on a project and I have such code that works perfectly making the car go back and forth, right and left but the car doesn't stop when I stop tilting the MPU6050. I need to adjust it by ...
-1
votes
2answers
51 views

Connect MPU6050 in pins other than A4 & A5

I need to use a MPU6050 gyro and a Ultrasonic sensor for my project. My Arduino Uno did not come with separate SDA and SCL pins, so I have to use the A4 and A5 pins for that purpose, and I have ...
0
votes
2answers
109 views

Using MPU-6050 without I2C

My target is to use multiple MPU-6050 at once, I searched on the internet and found that they can be hooked up really simply. Just connect in parallel and use I2C-Scanner. Then get those addresses and ...
0
votes
0answers
74 views

MPU-6050 Interrupt Sample Code

does anyone know where I could find some working code the demonstrates how to use the interrupt pin on the MPU-6050? My goal is to be able to shake the sensor in order to trigger an interrupt which ...
0
votes
2answers
34 views

Cannot make LCD & Gyro work together

I'm new to this so there are some poor methods in my code when I try to introduce the LCD into the loop. My issue is that the LCD delay and the servo delay are interfering with each other. How can I ...
0
votes
0answers
123 views

SOLVED Accelerometer/gyro MPU6050 is freezing after random time

SOLVED: I "solved" the problem by cycling my Arduino's power and I haven't had an issue since. I would still like to figure out what was going on. I still think it's something in that MPU6050 library ...
1
vote
1answer
151 views

How do I know if GY-521 MPU6050 has been calibrated properly?

I am planning to use the accelerometer of MPU6050 for a project. I know that before using module (I am using GY-521 MPU6050), one needs to calibrate it. I am using code by Luis Rodenas for ...
0
votes
1answer
437 views

Remove gravity from accelerometer of MPU-6050

I am currently working with MPU-6050. Now I want to minus gravity from my accelerometer's value as we minus the offset. Here is the code: #include <Wire.h> #include <MPU6050.h> //read as ...
0
votes
1answer
58 views

Changing Baud Rate not working

I have copied this code from Github : #include <Wire.h> #include <MPU6050.h> MPU6050 mpu; // Timers unsigned long timer = 0; float timeStep = 0.01; // Pitch, Roll and Yaw values ...
0
votes
2answers
107 views

MPU-6050 with Arduino - postmortem

I'm working with MPU-6050 with Arduino Uno. I copied the code below from Arduino Playground - MPU6050. Code : // MPU-6050 Short Example Sketch // By Arduino User JohnChi // August 17, 2014 ...
0
votes
1answer
41 views

Arduino help adding a second mpu 6050 sensor my working code

Background information: I currently have this arduino code that uses one mpu 6050 sensor to get angles in the x, y, and z directions and then display them to the user nicely. Code can be found here ...
-1
votes
1answer
47 views

Is it possible to send data from device (e.g. MPU6050) to Arduino through cut/hacked USB cable?

So I understand the USB cable consists of VCC, GND and Data+, Data-. Is it possible to connect an MPU-6050 gyro to these 4 pins, especially data+/-, and still receive them normally through the SCL/...
0
votes
0answers
155 views

MPU9250 Arduino code for tilt angle code

I want code for MPU9250 to check if it is tilted. If so, it should blink led. Please help me with code. I'm using following code to check the xyz-axis. #include "MPU9250.h" MPU9250 mpu; void setup() ...
0
votes
2answers
498 views

How to connect MPU9250 with NodeMCU using SPI or I2C Slave?

I want to connect 3 MPU9250 sensors, but since there is just one I2C bus, so there are another 2 sensors I want to connect through SPI. Library used - https://github.com/bolderflight/MPU9250/blob/...
0
votes
1answer
48 views

Not able to convert String to Integer when receiving data from pubnub?

I did managed to upload mpu9250 sensor data on PubNub and nodeMcu but not able to use the received data to control servo Look at the Port reading and see that servo angle is still showing '0' Code:-...
0
votes
0answers
137 views

MPU9250 and ESP8266 are not working together with Arduino Uno

I am trying to send IMU sensor data via WiFi using ESP8266. Both MPU9250 and ESP8266 worked individually with 3.3 V when tested, but are not working when interfaced together. I am not sure what the ...
1
vote
0answers
47 views

Help with code for changing motor speed depending on MPU6050 angles read

I have been trying to create code where my MPU6050 is constantly reading the angle it is at and based on that angle, increase or decrease the motor speed. For example the motor will be off when the ...
1
vote
0answers
78 views

MPU6050 Acc and Gyro readings swapped

I have been trying to figure out this MPU6050 for a bit but the RAW readings are confusing me. It seems to me that the accelerometer readings and the gyro readings are getting swapped... and I don't ...
0
votes
1answer
178 views

Not able to find right library for MPU9250

I am using an Arduino Uno and learning to use the motion sensor. Currently I was not able to find the library which looks simple and would like to get your suggestion. I found this https://github.com/...
-1
votes
1answer
151 views

Interfacing MPU6050 with Arduino uno [closed]

What is the meaning of "volatile bool mpuInterrupt = false; " in Arduino Program interfacing MPU6050?
0
votes
1answer
377 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
104 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
101 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
58 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 ...
-1
votes
1answer
37 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
70 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
77 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
124 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
551 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, ...
2
votes
1answer
298 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
212 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
3answers
1k 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
68 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
1answer
2k 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 ...