Skip to main content
9 votes
Accepted

MPU-6050 - angle drift

Is this a common problem? Yes it is. The drift is a common problem. Why is this happening? The drift results, in general, from the fact that to calculate the angles it is made an integration. The ...
brtiberio's user avatar
  • 926
5 votes
Accepted

A proper way to get the roll, pitch and yaw values

In some sources there is something going on as the importance of order of the application of roll,pitch and yaw. But I cannot understand why this is related. Take your right hand: point your thumb ...
tttapa's user avatar
  • 1,320
5 votes

What does this notation stands for? Wire.read() <<8 | Wire.read()

Just adding a couple of points to Michel Keijzers's answer. The expression Wire.read() << 8 takes the value returned by Wire.read(), which is an int, and shifts it 8 bits to the left, which is ...
Edgar Bonet's user avatar
  • 44.3k
4 votes
Accepted

Does the position in which you mount an IMU matter?

If the axes of measurement don't line up with the axes of motion, then comparing the IMU outputs to vehicle-relative (VR) coordinates will require some vector arithmetic to convert one to the other. ...
JRobert's user avatar
  • 15.3k
4 votes
Accepted

Stabilize data from four gyros/accelerometer

Looking at your code, I see the only place where gyro_1_angle_x is updated is here: gyro_1_angle_x = gyro_1_angle_x + (gyro_1.gyro.x - mpu_1_gyro_err_x) * elapsedTime; This is adding to ...
Edgar Bonet's user avatar
  • 44.3k
3 votes
Accepted

Shutdown the LED of my GY-85 sensor

According to this schematic, no. The LED is connected directly to power. You will need to physically remove the LED to turn it off.
Craig's user avatar
  • 2,120
3 votes
Accepted

Wire.endTransmission(false) hanging the program after running once when using MPU6050

In the comments below, @chrisl makes something explicit that I hadn't in previous edits. Reading it first may make the below easier to interpret: Useful fact about I2C on Arduino: Wire....
timemage's user avatar
  • 5,414
3 votes

Do I connect multiple I2C units to the microcontroler in series or parallel?

Use the Wikipedia page on the protocol as an introduction to your learning curve on I2C. I may cite: At the physical layer, both SCL and SDA lines are [a ...] bus design, [...] This means that all ...
the busybee's user avatar
  • 2,200
2 votes
Accepted

Arduino rc plane logger

It is not an Arduino answer but a Raspberry Pi with a Sense hat will record most of what you need with little coding. Add a Pi camera and you have all this for about $100. The Sense Hat temperature ...
GBG's user avatar
  • 178
2 votes

What does this notation stands for? Wire.read() <<8 | Wire.read()

1 << 3 means the value 1 shifted 3 times to the left. So 1 in binary is 0000001, shifted left 3 places is 00001000. And 0001101 << 3 will be 1101000. The | command is a logic or (where ...
Michel Keijzers's user avatar
2 votes

'import' does not name type ERROR

Processing code is intended to be run on a computer. You would use the Processing IDE to run this code. The Arduino IDE is used to write, compile, and upload code to a microcontroller that you might ...
per1234's user avatar
  • 4,248
2 votes

Problem connecting Android app to Arduino

In the loop function you have a line If (Serial.available() < 1) return; This prevents further code to be processed if there is nothing in the hardware serial buffer. Think about that.
Mert Gülsoy's user avatar
2 votes
Accepted

Help reading orientation from gyroscope

Take a look at this example. #include <Wire.h> const int MPU = 0x68; // MPU6050 I2C address float AccX, AccY, AccZ; float GyroX, GyroY, GyroZ; float accAngleX, accAngleY, gyroAngleX, ...
RedDogAlpha's user avatar
2 votes

Arduino Nano 33 IoT LSM6DS3: get gyro angle in degrees

You are supposed to use a filter library on top of the output of the gyro as well as the accelerometer data (both is used!) to get angles ... https://www.arduinolibraries.info/libraries/madgwick Here ...
camel's user avatar
  • 21
2 votes

Can I use an accelerometer to measure the velocity of a car in a curve?

I found out the answer to the question in the following article SenSpeed: Sensing Driving Conditions to Estimate Vehicle Speed in Urban Environments According to the article When a vehicle makes a ...
Geisterfahrer's user avatar
2 votes

Stabilize data from four gyros/accelerometer

You have the right idea fusing data from both gyro and accelerometer. However, I would strongly advise against doing the fusion yourself since there is a dedicated Digital Motion Processor (DMP) on ...
Dimples's user avatar
  • 31
2 votes
Accepted

Gyro reading of MPU6050 drifts too much on fast changes only

In his answer, st2000 recommends you use quaternions, rather than Euler angles, for tracking the orientation of your vehicle. I will give the exact same recommendation, but for a different reason: the ...
Edgar Bonet's user avatar
  • 44.3k
2 votes
Accepted

Difficulties acquiring angle values from MPU6050

The formulas you are using look plain wrong. There are a few issues that stick out: Rotating along z has no effect on the accelerometers. Any formula that pretends to give you the three Euler angles ...
Edgar Bonet's user avatar
  • 44.3k
1 vote

SparkFun BasicAHRS_I2C giving unstable readings

The values seem fine to me. Generally these MPU chips are really noisy, that is totally normal. Ti really use the data to the the current orientation, you have to use a filter to combine the data from ...
chrisl's user avatar
  • 16.5k
1 vote

SparkFun BasicAHRS_I2C giving unstable readings

If you haven’t noticed the difference in the two is minuscule. For example, the change in degree is <1. Also the acceleration is measured in g’s which is acceleration due to gravity. The data says ...
Aaron's user avatar
  • 121
1 vote

How to get location of the hand indoors

The only way to check the relative position is, first to define, what is the absolute position of a person, is it his other hand, his heart, his head, his foot? When you defined the absolute ...
Michel Keijzers's user avatar
1 vote

Should I use an accelerometer or gyroscope in my project?

Use both. Accelerometer measure movement in direction of axes when gyroscope measure rotational movement. Being very delicate you can spin accelerometer and sensor won't see any changes, and you can ...
smajli's user avatar
  • 472
1 vote
Accepted

HMC5883L not working in continuous mode!

The problem stems from this function: void HMC5883L_init (void) { I2C_start(HMC5883L_write); I2C_tx(Configuration_Register_A); I2C_tx(0x07); I2C_tx(Configuration_Register_B); I2C_tx(0x01); ...
Majenko's user avatar
  • 106k
1 vote
Accepted

Reading HMC5883L hex values in 2's compliment C code

2's complement is the normal signed values in any modern system, including Arduino. Just place the bytes into a signed variable of the right size in the right positions and there is your value. In ...
Majenko's user avatar
  • 106k
1 vote

How can I identify, debug or fix a faulty IMU?

In theory you must use a level shifter for SDA and SCL. The Arduino Mega 2560 board has internal pullup resistors of about 50k for SDA and SCL and extra 10k pullup resistors of 10k to 5V and according ...
Jot's user avatar
  • 3,246
1 vote

Accessing two MPU-9250 DMP

Sorry, but I'm not 100% sure of what you are trying to do, I don't understand 'both imu the' in your question. I think you are trying to use two identical boards at the same time. (If not tell me so ...
Code Gorilla's user avatar
  • 5,637
1 vote

LSM9DS1 breakout - How to increase speed

Here is a link to the LSM9DS1 datasheet. In Chapter 3 it describes how to put the device in Accelerometer-only mode. At a quick scan of it, I believe there was timing information also, but at least ...
JRobert's user avatar
  • 15.3k
1 vote
Accepted

LSM9DS1 breakout - How to increase speed

Check the header of the library, you will find readAccel readMag readGyro and readTemp in separate public functions and looking at the implementation of read it just calls those 4 in sequence. ...
ratchet freak's user avatar
1 vote

Using MPU-6050 without I2C

As you can read in the MPU-6050's datasheet, it uses the I2C address 0b110100X, where X is the state of the pin AD0. If you wire AD0 to ground, the address will be 0b1101000, whereas if you wire it to ...
chrisl's user avatar
  • 16.5k
1 vote
Accepted

Remove gravity from accelerometer of MPU-6050

I may have come to a solution : Vector minusGravity(Vector vec) { float x = vec.XAxis, y = vec.YAxis, z = 0; vec.XAxis -= x * cos(yawRad) - y * sin(yawRad) ; vec.YAxis -= x * sin(yawRad) - y * ...
Maifee Ul Asad's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible