MPU6050 for Mouse movement

Hi everyone!

I currently trying to use a MPU6050 to control the mouse pointer.
It works fine if i use a rotational movement of the device but i'm wondering if its possible to get a behaviour like a real mouse by just sliding the device over a table.

I was unable to get useful values for movement in x,y direction. I'm using this library GitHub - gabriel-milan/TinyMPU6050: Tiny implementation for MPU6050 focusing on performance and accuracy

Every example i found on the internet also uses rotational movement to create an air mouse.


If you are not getting answers to your question you may want to read the guidelines for posting on the forum and provide the information that is advised for a 'good post'.

We can not really help you since you did not provide any information about your circuit or your sketch. However, I can recommend this library:

Just open the MPU6050_6Axis_MotionApps20 example and run the sketch.

Important note: This library uses interrupts so the INT pin of your MPU6050 should be connected to one of your ardunio's interupt pins. This example uses pin 2 as default.

About controlling your mouse marker position, you can basically use your preferred programming language to create a script that just does that. You can find more information online.

If you are planning on using the Arduino directly plugged in your computer, you can read the serial in your script and navigate the marker. If you are planning on using it wirelessly, how you do it depends on which technology you will use, Bluetooth, radio, or wifi. As I said you can find more information on the internet.

You must share a lot more information about your intentions, hardware, and software if you want to get clear answers


the mpu6050 is connected via I2C to a teensy board ( SCL Pin 5 and SDA Pin 6). I'm able to get values out of it and i have no problems using a rotational movement to control the mouse.

Now i'm trying to get it working like a real mouse. So without rotational movement but linear movement in x,y direction. And i don't know which values or calculations i have to use to make it work.

I'm not sure what extra informationen is needed, or maybe if my intention is unclear. It also might be possible that a mpu6050 is the wrong choice for linear movement.