An Arduino-based automatic brightness control system that adjusts monitor brightness based on ambient light sensor readings.
20251113_192941-00.00.00.000-00.00.14.891.mp4
- Used NirSoft's ControlMyMonitor to find feature codes for monitors:
- XG27AQDMG
- KG241Q P
- Tool: https://www.nirsoft.net/utils/control_my_monitor.html
- Compiled winddcutil for Windows from their GitHub repository
- Repository: https://github.com/scottaxcell/winddcutil
- Uses Windows' SetVCP function to control monitor brightness via DDC/CI protocol
- Run Ino with given code (autobrightness.ino)
- Run brightnesscontrol.py - should be changing brightness now
- Python 3.9.3
- Arduino with light sensor (I used an Uno R4 Wifi)
- Windows OS with DDC/CI capable monitors
- Arduino reads ambient light sensor values
- Python script collects sensor data over 1.5 second intervals
- There is a lag between requesting brightness to bet set, and it being set. Large enough to warrant buffering data and using it. Thus:
- Calculates median sensor value to provide a well-representive value every interval
- Maps sensor values (0-1023) to brightness percentage (0-100%) with an offset added for a brighter bias preference.
- Uses winddcutil to set monitor brightness via DDC/CI
autobrightness.ino- Arduino sensor codebrightnesscontrol.py- Main brightness control scriptwinddcutil.exe- DDC/CI utility for Windows