2025-01-08 06:58 AM
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.
2025-01-08 07:45 AM
2025-01-08 08:02 AM
Neither an accelerometer nor a gyroscope gives you position - they just give you movement.
Specifically, they give you acceleration:
2025-01-08 08:49 AM
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.
2025-01-08 08:51 AM
That's telling you orientation - not position.
But is that what you want?
Your question is unclear.