Skip to main content
Associate II
January 8, 2025
Question

position detecting with mpu6050

  • January 8, 2025
  • 2 replies
  • 939 views

Hello, I want to control the position of my device with mpu6050. The logic is briefly as follows: I will mount my device somewhere, then with a command the device will save its current position. Afterwards, I want to know whether this device is in the initial position at certain intervals. How can I do this with mpu6050? Do I need to use both acceleration and gyro data? It seemed to me that just acceleration data would be sufficient, but I'm not sure.

2 replies

Peter BENSCH
Technical Moderator
January 8, 2025

As the MPU-6050 is not a component from STMicroelectronics, you should contact the manufacturer TDK.

Good luck!

Regards
/Peter

Andrew Neil
Super User
January 8, 2025

Neither an accelerometer nor a gyroscope gives you position - they just give you movement.

Specifically, they give you acceleration:

  • linear acceleration from an accelerometer;
  • angular acceleration from a gyroscope.

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
scotzapAuthor
Associate II
January 8, 2025

That's why I thought I can use an accelerometer. When I hold the module parallel to the ground, I read one of the x y and z axes as 1 g and the others as 0 g. When I hold it perpendicular to the ground, this time I read one of the axes, which is 0, as 1 g. If I keep it fixed somewhere between perpendicular and parallel, the value of these two axes is around 0.7 g.

Andrew Neil
Super User
January 8, 2025

That's telling you orientation - not position.

But is that what you want?

Your question is unclear.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.