Windows laptops do not expose automatic brightness adjustment as consistently as phones do. This project bridges that gap by turning an Android phone into a wireless ambient-light sensor for a Windows laptop. The phone streams lux readings over the local network, and a Windows tray agent maps those readings into display brightness changes.
How it works
- The Android app runs a foreground service that reads
TYPE_LIGHTsensor events. - The service throttles updates and sends small JSON packets such as
{"lux":312.5}over UDP. - The Windows tray app listens on a configurable port, parses valid lux readings, and applies a brightness curve.
- Brightness is updated through Windows WMI using
WmiMonitorBrightnessMethods.
Implementation details
The mapping is logarithmic, which better matches how people perceive light than a linear lux-to-percent conversion. I also added exponential moving average smoothing and a dead-zone, so the laptop does not flicker between brightness levels when sensor readings fluctuate slightly.
The Windows side runs as a tray app with pause/resume, current status, settings, and an optional "Start with Windows" toggle. The Android side keeps streaming in the background through a foreground service and shows live lux feedback in the app.
Everything stays on the local network. There is no cloud service, no account, and no hardware modification - just a phone sensor, UDP, and a small Windows agent.