Skip to content

marvelayush/Mouse_controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

19 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ–ฑ๏ธ Mouse_controller

Use your Android phone as a real-time wireless motion mouse โ€” tilt your phone to control your laptop cursor just like pointing a smart TV remote.

Mouse_controller is a full-stack motion-control platform built using Python, WebSockets, smartphone gyroscope sensors, Android integration, and a modern interactive frontend website.

The project combines:

  • Real-time motion tracking
  • Wireless cursor interaction
  • QR-based device pairing
  • WebSocket communication
  • Interactive frontend dashboard
  • Live telemetry visualization
  • Smartphone gyroscope control
  • you can check out the front end(ONLY) here:- https://mouse-controller-nine.vercel.app/

โœจ Features

  • ๐Ÿ“ฑ Control laptop cursor using phone motion
  • โšก Real-time low-latency communication
  • ๐Ÿ“ก WebSocket-based architecture
  • ๐ŸŽฏ Gyroscope and orientation tracking
  • ๐Ÿ–ฅ๏ธ Modern frontend interface
  • ๐Ÿ“Š Live telemetry dashboard
  • ๐Ÿ”’ HTTPS + WSS support
  • ๐Ÿ“ฒ QR-based instant connection
  • ๐ŸŒ Responsive web interface
  • ๐ŸŽจ Futuristic UI animations
  • ๐Ÿ“ถ Live connection monitoring
  • ๐Ÿง  Motion telemetry visualization

๐Ÿ“ธ Screenshots

Frontend Interface

Frontend


Live Dashboard

Dashboard


๐Ÿš€ Quick Start

Website Flow

  1. Open the frontend website
  2. Click on:
    Get Started
    
  3. The backend server starts the connection system
  4. A QR code is generated dynamically
  5. Scan the QR code using your phone
  6. Allow gyroscope permissions
  7. Tilt the phone to control the cursor in real time

โš™๏ธ Manual Backend Setup

If you want to run the backend manually:

1. Install Python Dependencies

cd AirMouse
pip install -r requirements.txt

2. Start the Python Server

python server.py

The terminal will display something similar to:

https://192.168.x.x:8443

3. Open Another Terminal

Open a new terminal while the backend server is still running.

cd main_website
npm install
npm run dev

4. Connect Your Phone

  1. Connect laptop and phone to the same WiFi network
  2. click on get started in the website , it will give you a qr code
  3. scan it on phone
  4. Open the generated HTTPS URL in Chrome on your phone
  5. If Chrome shows:
    Your connection is not private
    
    tap:
    Advanced โ†’ Proceed
    
  6. The motion controller interface opens
  7. Tap:
    Connect
    
  8. Allow motion sensor permissions
  9. Start controlling the cursor using phone motion

๐ŸŽฎ Controls

Action Function
Cursor Movement Tilt phone
Left Click Left Click button
Right Click Right Click button
Double Click Double button
Scroll Scroll Up / Down
Pause Tracking Tracking ON/OFF
Adjust Speed Sensitivity slider

๐Ÿ“Š Project Architecture

Phone Motion Sensors
        โ”‚
        โ–ผ
DeviceOrientation API
        โ”‚
        โ–ผ
WebSocket Communication
        โ”‚
        โ–ผ
Python Backend Server
        โ”‚
        โ–ผ
Cursor Processing Engine
        โ”‚
        โ–ผ
Desktop Cursor Control
        โ”‚
        โ–ผ
Frontend Dashboard Interface

๐Ÿง  Technologies Used

Frontend

  • Next.js
  • React
  • Tailwind CSS
  • Framer Motion
  • JavaScript

Backend

  • Python
  • FastAPI
  • WebSockets
  • pyautogui

Mobile

  • Android Motion Sensors
  • DeviceOrientation API

๐Ÿ“‚ Project Structure

Mouse_controller/
โ”‚
โ”œโ”€โ”€ AirMouse/               # Python motion backend
โ”œโ”€โ”€ main_website/           # Frontend website
โ”œโ”€โ”€ AirMouseClient/         # Android motion client
โ”œโ”€โ”€ CursorBrowser/          # Android browser integration
โ”œโ”€โ”€ gyroTCP/                # TCP communication experiments
โ”œโ”€โ”€ UDP/                    # UDP communication experiments
โ”œโ”€โ”€ 1st.png
โ”œโ”€โ”€ 2nd.png
โ””โ”€โ”€ README.md

๐ŸŒ Frontend Setup

cd main_website
npm install
npm run dev

๐Ÿ“ก Communication Flow

Smartphone
    โ†“
Motion Sensor Data
    โ†“
WebSocket Transmission
    โ†“
Python Backend Processing
    โ†“
Cursor Rendering
    โ†“
Frontend Telemetry Dashboard

๐Ÿ“ˆ Telemetry Features

The frontend dashboard visualizes:

  • Connection state
  • Motion sensor values
  • Alpha/Beta/Gamma data
  • Signal status
  • Device activity
  • Motion tracking state
  • Real-time interaction feedback

๐Ÿ’ก Tips & Tricks

  • Hold the phone parallel to the ground for smoother movement
  • Lower sensitivity for precise control
  • Increase sensitivity for faster movement
  • Use Tracking ON/OFF while repositioning your hand
  • Stable WiFi improves responsiveness
  • Small wrist movements give better accuracy

๐Ÿ› ๏ธ Troubleshooting

Problem Solution
Cannot connect Ensure both devices are on same WiFi
Cursor jumps Reduce sensitivity slider
Gyroscope not working Use HTTPS instead of HTTP
Phone permissions blocked Allow motion sensor permissions
Connection blocked Allow ports through firewall
Cursor too sensitive Lower sensitivity in controller
Delayed movement Check WiFi stability

๐Ÿ”’ Security Notes

  • HTTPS is used for motion sensor access
  • WSS is used for secure WebSocket communication
  • Local network communication keeps latency low
  • QR pairing helps simplify device connection

๐Ÿ”ฎ Future Improvements

  • AI-based motion smoothing
  • Gesture recognition
  • Multi-device support
  • Cloud-based pairing
  • Public deployment
  • Better motion calibration
  • Remote internet-based control
  • Voice command integration
  • Haptic feedback support

๐Ÿ‘จโ€๐Ÿ’ป Author

Ayush Narayan

BTech ISE โ€” BMS College of Engineering


๐Ÿ“œ License

This project is licensed under the MIT License.


โญ Project Goal

This project was developed to explore:

  • motion intelligence
  • real-time communication
  • wireless interaction systems
  • frontend/backend integration
  • sensor-based computing
  • interactive web technologies
  • real-time device communication

About

Real-time gyroscope-based wireless mouse controller using smartphone motion sensors, WebSockets, FastAPI, Android, and Next.js.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors