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 ...
  • 926
5 votes
Accepted

What does “LSB per degree per second” mean?

Let us say we have a number, "4025". The "most significant digit" of the number is the 4 in the thousands position, since it tells us the most about the magnitude of the number ("in the four thousands"...
5 votes
Accepted

What is the difference between Accelerometer, Gyro, and Magnetometer Sensor?

The Accelerometer measures total acceleration on the vehicle, including the static acceleration from gravity it would experience even when its not moving. The magnetometer measures the magnetic ...
  • 4,361
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 ...
  • 39.6k
4 votes

What does “LSB per degree per second” mean?

With further elaboration on Ignacia's answer: A gyroscope itself is generally an analog device in the sense that in reality, it will have a continous output. This output is digitized using some form ...
  • 41
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. ...
  • 14.8k
4 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 ...
  • 1,300
4 votes

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 ...
  • 39.6k
3 votes
Accepted

Help with MPU-6050

I finally got this working after one sleepless night #include<Wire.h> const int MPU = 0x68; int t = 0,dt = 1; int AcX,AcY,AcZ,GyX,GyY,GyZ,tmp; int AcXo,AcYo,AcZo,GyXo,GyYo,GyZo; float roll = 0,...
3 votes

How to use Multiple MPU9250 to Arduino Lilypad

where should I put the pins for SDA and SCL? Same as on a Uno: SDA is on pin A4 SCL is on pin A5 Can you suggest me some links that can help me learn more about SPI? I have an SPI page and also ...
  • 36k
3 votes
Accepted

Smallest digital 3-axis gyroscope pcb for arduino?

smallest board is no board. pick a small BGA or LGA shaped accelerometer and superglue it face down to the arduino board then solder fine wires beween the chip terminals and arduino terminals. ...
  • 206
3 votes

Main Idea of Gyro

According to the datasheet of L3G4200D, x_lsb and x_msb (28h and 29h), y_lsb ,y_msb (2Ah and 2Bh), z_lsb , z_msb (2Ch and 2Dh) as shown in the picture 3. But according to code that in the picture ...
  • 104k
3 votes

What is the difference between Accelerometer, Gyro, and Magnetometer Sensor?

The main difference is the way they operate and what they sense. In other words, they are all very very different things. Yet they can all measure motion in some way. An accelerometer senses both ...
  • 104k
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.
  • 2,110
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....
  • 4,700
2 votes

SDA and SCL problem with MEMS

I2C is designed to have multiple devices connected. Assuming the gyro and accelerometer have different I2C addresses they can both be connected to the same SDA and SCL pins. For more information see ...
  • 36k
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 ...
  • 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 ...
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 ...
  • 3,923
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.
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, ...
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 ...
  • 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 ...
  • 51
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 ...
  • 21
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 ...
  • 39.6k
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 ...
  • 5,619
1 vote
Accepted

MPU6050 Sending Bad values for Angular Velocity

At last! I have discovered the solution. Quick Solution for those who don't like reading: Amend the previous rollRate formula to rollRate = (0.7 * rollRate) + (-0.3 * gx / 16.4);. Or, if you don't ...
  • 83
1 vote

Main Idea of Gyro

According to the datasheet, FS seems to be Measurement Range. Also, I think you will find useful information in the following discussions: Understanding the sensitivity of an L3G4200D gyroscope and in ...
  • 111
1 vote

ADXL345 accelerometer doesn't work

As far as my experience goes you donot have to connect it to pulldown resistors. If using a 5v Arduino, simply connect it like: VCC --> 5V (Arduino) GND --> GND (Arduino) SDA --> A4 or SDA (...
1 vote
Accepted

It seems like the math of arduino is off

If your program is basically working but gives you rounding errors, it can be that you are facing some problems related to conversion from floating-point to binary or reverse. It is a very common ...
  • 249

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