กลับไปหน้ารวมไฟล์
gyro-mouse-06044f-en.md

Since the quarantine (covid-19) I decided to create something so I decided on mouse moved by rotation of my hand.

video:

Project Perspective

The Gyro-mouse project is an advanced Human Interface Device (HID) that allows you to control a computer's mouse cursor by physically tilting or moving the Arduino. This project is perfect for accessibility, VR controllers, or innovative gaming peripherals.

Hardware Core

  • Arduino Leonardo / Micro: These boards are essential because they feature the ATmega32U4 microcontroller, which has native USB communication built-in. This allows the computer to recognize the Arduino as a standard HID Mouse.
  • MPU6050 Sensor: A 6-axis Motion Tracking device that contains a 3-axis gyroscope and a 3-axis accelerometer. It detects even the slightest tilt or rotation.

Theory of Operation

The MPU6050 communicates with the Arduino over the I2C protocol (using Pin 2/SDA and Pin 3/SCL on the Leonardo). The Arduino then continuously reads the raw gyro data (X and Y axes).

  1. Motion to Pixels: The Arduino "maps" the angular velocity (rotation) from the gyroscope into pixels on the screen.
  2. Smoothing: Since raw gyro data can be noisy, the code often implements a simple filter or threshold to prevent the cursor from "drifting" when the mouse is still.
  3. Transmission: Using the Mouse library, the Arduino sends motion packets to the PC:
Mouse.move(x_val, y_val, 0);

Essential Wiring

  • VCC/GND: Connect to 5V and Ground.
  • SCL/SDA: Connect to the dedicated SCL and SDA pins on your Arduino (I2C).
  • INT: Optional, often used for hardware-level interrupts when data is ready.

Future Expansion

  • Buttons: Add physical push buttons to the Arduino to act as left and right mouse clicks.
  • Z-Axis Scroll: Use the Z-axis of the gyro to control the scroll wheel.
  • Wireless Unity: Use a Bluetooth module to send the HID data wirelessly for a truly cable-free mouse experience.

Building your own Gyro-mouse is an excellent way to understand HID communication and multi-axis sensor fusion.

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x Arduino IDE"
author: "shassandanish1"
category: "Sensors & Environment"
components:
  - "3x Tactile Switch, Top Actuated"
  - "15x Jumper wires (generic)"
  - "1x SparkFun Triple Axis Accelerometer and Gyro Breakout - MPU-6050"
  - "1x Arduino Micro"
description: "Moving your mouse with an gyroscope"
difficulty: "Advanced"
documentationLinks: []
downloadableFiles: []
encryptedPayload: "U2FsdGVkX1880F9uaw11UkZz87tccjhxbwijOTudUPxbhswchZq00/BAuVqPJxs0uO4XFltXF77eCge1U2Nwsx1Vkpt49v5/EstMB2HAG4o="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/gyro-mouse-06044f_cover.jpg"
lang: "en"
likes: 0
passwordHash: "26a56ca8cc89eb2803e9f17912055aab0e06ec217ba7312e73d82946ca2acdcd"
price: 1120
seoDescription: "Build a Gyro-mouse using Arduino and Gyroscope. Control your cursor with motion sensing technology in this simple project."
tags:
  - "gyroscope"
  - "arduino"
  - "mouse"
title: "Gyro-mouse"
tools: []
videoLinks:
  - "https://www.youtube.com/embed/yaS4W5yRMaw"
views: 2476