Skip to content
pHcursor

pHcursor

Turn your phone into an air mouse and presentation

Created on 24th October 2026

•

pHcursor

pHcursor

Turn your phone into an air mouse and presentation

The problem pHcursor solves

When you present in a group, the laptop usually ties you to one spot. To change a slide, scroll, or point at something, you either walk back to the laptop or ask whoever is sitting there to click for you. In group projects it's a bit worse, because everyone has ideas to show but only one person has the mouse.

This project turns a phone into a wireless air mouse. You scan a QR code shown on the laptop and open the page in the phone's browser, so there is no app to install. The phone's gyroscope and accelerometer then move the laptop's cursor as you tilt and turn the phone.

What it can do

  • Power button: turns motion control on or off, so the cursor only moves when you want it to and doesn't drift while you're just holding the phone.
  • Clicking: tapping anywhere on the screen is a left click, and there are also separate left and right click buttons.
  • Scroll mode: slide your fingers on the phone to scroll the laptop, like scrolling on a phone.
  • Mirror mode: shows the laptop's screen on the phone, sized to fit the phone's height by default. You can zoom in and out around the cursor and hide the controls for a cleaner view.
  • Drawing: in mirror mode you can draw with your finger on the phone and it appears on the laptop. There are different brush sizes and colors, so you can underline or circle things while presenting.

Where it could be useful

  • Presenting from anywhere in the room instead of standing next to the laptop
  • Group projects, where anyone can use their own phone to point at something while explaining it
  • Controlling a laptop that is connected to a projector from a distance
  • Highlighting or annotating a slide or diagram live while explaining it

Challenges I ran into

Phone sensors didn't work over plain HTTP. Chrome only gives web pages access to the gyroscope on secure (HTTPS) pages. At first I had to change a Chrome flag on the phone to get around it. To fix it properly, the Python script now generates a self-signed certificate at startup and serves the page over HTTPS. The page and the WebSocket share one port, so the phone only has to accept the certificate warning once.

The cursor was stuttering at roughly 20 fps. My first version rounded every small movement to a whole pixel, and most small movements rounded to zero and got thrown away. I changed it to track the phone's rotation speed instead of its angle, and to keep the leftover fractions of a pixel so nothing is lost.

The cursor still jumped in places, and I didn't know why. Instead of guessing, I added a debug mode that measures each stage separately: phone sensor rate, network delay, server timing and cursor output. It showed the sensor and the Python code were fine, but packets were arriving in bursts over WiFi, so several movements landed at once. I fixed that by timestamping each movement on the phone and replaying it on the laptop with a small delay, so the bursts get smoothed out. Using the phone's own hotspot made the network part better as well.

Finding the laptop's IP address. The phone needs the laptop's IP on the current network, and it changes whenever the network changes. I had to learn the difference between private, public and local addresses. I also saw Windows keep showing an old address after I turned WiFi off, so I confirmed what was going on with ipconfig and a small test script.

Touch gestures getting in each other's way. Hold to move, tap to click, a second finger to click and a second finger to scroll all use the same touch area. I had to keep track of which finger is which, so that scrolling doesn't turn off cursor movement.

Tracks Applied (1)

Freshman Track

I'm a first-year student at IIT Roorkee, and this is one of the first bigger projects I've built. When I started, I only...Read More

Technologies used

Discussion

Builders also viewed

See more projects on Devfolio