Skip to content

lenyaz/brightness

Repository files navigation

Brightness Control for Raspberry Pi MIPI-connected Display ☀️

A somewhat quick-and-dirty automatic/manual display brightness solution for Raspberry Pi. Works with VEML7700 ambient light sensors and displays that cooperate with sysfs.

Feature Overview

This project offers next brightness controls:

  • Auto-Brightness Mode ./brightness --auto - adjusts based on ambient light
  • Manual Control ./brightness <0-255> - for when you want to take charge
  • Lux Monitoring ./brightness --showlux - troubleshooting or just because data is fun
  • Systemd Preset Integration systemctl enable brightness-auto.service - runs reliably in the background

Hardware Requirements

Software Requirements

Installation ⚡

  1. Clone repository:

    git clone https://github.com/lenyaz/brightness.git
    cd brightness
  2. Build project 🤞:

    make

Hint: you can install and enable systemd service using this line:

make install
  1. Optional systemd setup (./add-systemd-service.sh):
    sudo cp brightness-auto.service /etc/systemd/system/
    sudo systemctl daemon-reload
    sudo systemctl enable brightness-auto.service
    sudo systemctl start brightness-auto.service

Usage

Manual Brightness Control

./brightness 128  # middle of 0-255 range
./brightness max  # maximum brightness possible (255)
./brightness min  # minimum brightness possible (1)
./brightness off  # display off (0)

Automatic Mode

./brightness --auto  # "Ambient Light: 20.22 lux, Setting brightness to: 6" 

Monitoring Mode

./brightness --showlux  # "Ambient Light: 20.00 lux"

TODO List 📝

  • Optimization: Make it less memory and CPU hungry (types optimization etc.)
  • Direct display brightness via GPIO: For speed (wiringpi?)
  • Config file: Stop hardcoding like it's 1979
  • Error handling: Because shit happens

Licensed under BSD 3-Clause License, Leanid "lenyaz" Veraksa, 2025

About

Brightness Control for Raspberry Pi MIPI-connected Display

Topics

Resources

License

Stars

Watchers

Forks