Skip to content

kylemath/LaserPointer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LaserPointer Mouse Control - Hackathon Project

A collection of experimental approaches to use a colored laser pointer as a mouse input device on macOS.

The Challenge

Create a laser-pointer-controlled mouse for a MacBook without external hardware (ideally), exploiting unconventional sensing methods.

Three Strategies

Strategy 1: Ambient Light Sensor Computational Imaging

Uses the MacBook's built-in ambient light sensor combined with display rastering patterns to detect laser position through single-pixel imaging techniques (inspired by MIT research on ALS privacy threats).

Strategy 2: FaceTime Camera Reflection Detection

Uses the built-in webcam to detect the laser dot on the screen through reflections or a small mirror placed to view the screen.

Strategy 3: External Photodiode Array (DIY Hardware)

A simple Arduino-based photodiode frame that uses trilateration to locate the laser position - most reliable but requires hardware.

Setup

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Research Findings

Why the Original Idea (LED Pixels as Sensors) Won't Work Directly

  • MacBook displays are LCD with LED backlighting, not LED pixels
  • LCD pixels modulate transmitted light using liquid crystals, not LEDs
  • The backlight LEDs are behind the display panel and not individually addressable
  • No known API exposes individual LED voltage readings

What DOES Work

  1. Ambient Light Sensor: MacBooks have an ALS (AppleLMUController) that reads ambient brightness. MIT researchers demonstrated computational imaging using ALS + known display patterns.

  2. LED Reverse Photovoltaic Effect: LEDs CAN sense light (~2V photovoltaic voltage when illuminated). Arduino projects exist that use this. Could be exploited with external LED arrays.

  3. Webcam Detection: Well-established technique using OpenCV to track laser dots in camera feed.

File Structure

  • strategy1_als_imaging.py - Ambient Light Sensor approach
  • strategy2_webcam_detect.py - FaceTime camera reflection approach
  • strategy3_arduino_photodiode/ - Hardware approach (Arduino code + Python interface)
  • utils/ - Shared utilities for mouse control

Requirements

  • macOS (tested on Apple Silicon)
  • Python 3.9+
  • For Strategy 2: Camera permissions
  • For Strategy 3: Arduino + photodiodes

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors