Skip to content

rbtrrnss/autoBright

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autoBright

Mobile devices actively control their display brightness by adjusting to ambient light levels.
For a desktop setting there are (expensive) monitors that have integrated ambient light sensors.
Even cheap monitors can be controlled via DDC from any operating system.

This project combines a microcontroller based USB HID ambient light sensor with python based DDC control on Windows.

 Ambient Light ☀️/🪟/☁️/💡
        ↓    ↓    ↓
[ Light Sensor (1250 lux) ]
        ↓   USB   ↓
    [ PC / autoBright ]
        ↓ DDC/CI  ↓
   [ Monitor (72%) 🖥️ ]

For Linux there is also a well documented project with the same approach: xythobuz/AutoBrightness

Overview

To adjuist the monitor brightness main.py uses:

  • Windows Sensor API (LightSensor) for lux input via winsdk
  • Windows DXVA2 DDC/CI APIs for monitor brightness output via ctypes
  • a system tray icon with manual offset controls via pystray

Further development/integration:

  • add the USB HID light sensor function to TwinkleTray or similar software.

Dependencies

Dependencies for main.py:

  • python 3.12
  • winsdk
  • pystray
  • Pillow

Install required packages:

pip install pystray pillow winsdk

Autostart on Windows

Win+R, shell:startup, create shortcut with python3.12.exe "path\to\autoBright\main.py" (if path variables are set correctly)

Hardware

Reading ambient brightness is done with an USB-C ATtiny85 and a I2C BH1750 (GY-302/GY-30) brightness sensor. See MatejKocourek/spark-als. The folder housing includes a 3D printable enclosure.

hardware

About

Windows (desktop) monitor brightness control from ambient light sensor

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages