PhilNav DIY infrared head-mouse in Python using Raspberry Pi w/ NoIR camera
PhilNav is a very good infrared head mouse. PhilNav allows you to use your computer hands-free by tracking a reflective sticker on your head, and then moving the mouse accordingly. It runs at 75 FPS for buttery smooth mouse movements and pixel perfect accuracy.
*** It's free and open source on GitHub, runs on a Raspberry Pi, and is written 100% from scratch in Python3 by Philip Brocoum. You are paying for the materials and labor for me to assemble it for you.
My website: https://phils.app
PhilNav has exceeded all my expectations:
- Pixel perfect accuracy
- ~5 ms latency, at 75 FPS
- Cross-platform on Windows, Mac, & Linux
- Configurable, with keyboard shortcuts
- <1% CPU/RAM on client
The trade-offs I made include:
- No graphical user interface
- Not Plug-and-Play Over USB, uses the network (Wi-Fi, ethernet)
- Difficult to assemble and install (knowledge of building Raspberry Pi computers and Python required)
- No clicking. You'll have to use a switch, pedal, or other dwell clicking software.
Watch Phil's YouTube video here: https://www.youtube.com/watch?v=JTLs7z0PO-k
Although it ships fully assembled, a good knowledge of the Raspberry PI and Python programming language will make troubleshooting easier. Be sure to watch the YouTube video above so that you know what you're getting into.
It uses a client/server model; the server runs on a Raspberry Pi with a Picam 3 NoIR camera, and the client runs on your Windows, Apple macOS, or Linux PC. They communicate over Wi-Fi or ethernet via UDP multicast.
SETUP
Download the software from GitHub: https://github.com/stedwick/PhilNav-Python-RaspberryPi
Start by running the following Python scripts on the client and server. You may have to `pip install` a bunch of things first. I put my reflective sticker on my headset mic boom.
# server
sudo apt install python3-opencv
# client
pip install ...
Server - Raspberry Pi
python3 server_raspberrypi/main.py --help # [--verbose --preview]
Client PC - Win/Mac/Nix
python3 client_win-mac-nix/main.py --help # [--verbose]
On the Raspberry Pi you should see a preview of the camera, and on the client machine the mouse should start to move. Use `--help` to change your settings to your liking.
Here are my own settings:
# server
python3 server_raspberrypi/main.py
# client
python3 client_win-mac-nix/main.py --speed 21 --smooth 3 --deadzone 0.04 --keepawake 56 --timeout $((60*60*8))
(If you have a firewall, ports 4245 & 4246 must be open to send/recv UDP.)
What's in the box
Parts:
- Raspberry Pi 5 - https://www.canakit.com/canakit-raspberry-pi-5-starter-kit-turbine-black.html
- Pi Breadboard kit - https://www.canakit.com/raspberry-pi-gpio-breakout-bundle.html
- Pi Camera Module 3 NoIR - https://www.canakit.com/raspberry-pi-camera-module-3.html
- Pi 5 Camera Cable - https://www.canakit.com/raspberry-pi-5-camera-cable.html
- Infrared LEDs - https://www.amazon.com/gp/product/B01BVGIZIU
- Visible light filter - https://www.amazon.com/dp/B0CL2652X9
- Reflective tape - https://www.amazon.com/dp/B06VTTV6PR
- Selfie Stick - https://www.amazon.com/dp/B09W99QJBP
* Some parts might be slightly different, like the selfie stick. I'll use whatever works.
🐁 With this open source project, disabled folks are not at the mercy of a private company that might discontinue products, and we are not stuck on Windows =)
PhilNav is a very good infrared head mouse 🖱️