Русская версия: README.ru.md
32x8 LED-matrix clock for Raspberry Pi (MAX7219 + SPI) with CPU temperature, date ticker, auto-brightness and lightweight animations.
- Right-aligned
HH:MMclock with custom blinking colon - CPU temperature widget (
°C) on the left - English ASCII date ticker (scrolling line)
- Day/night auto brightness by time window
- Seconds progress bar
- Optional hour sparkle + minute swipe animations
- Runtime configuration via environment variables
- Raspberry Pi (with SPI enabled)
- MAX7219 32x8 LED matrix (4 cascaded 8x8 blocks)
- SPI wiring (default
SPI0 CE0)
- Python 3.10+
luma.led_matrix
Install deps:
pip install -r requirements.txtpython3 led_clock.pyLED_TIME_FMT(default:%H:%M)LED_FONT(1 = TINY, 2 = SINCLAIR)LED_BLINK_COLON(0/1)LED_COLON_VGAP(default:2)LED_TIME_ALIGN(rightorcenter, default:right)
LED_DRAW_TEMP(0/1)LED_TEMP_SHOW_C(0/1)
LED_TEMP_CYCLE_ENABLE(0/1)LED_TEMP_CYCLE_ITEMS(e.g.cpu,outdoor)LED_TEMP_CYCLE_EVERY(seconds, default10)
LED_WEATHER_ENABLE(0/1)LED_WEATHER_PROVIDER(open-meteo)LED_WEATHER_LAT/LED_WEATHER_LON(required for outdoor temp)LED_WEATHER_REFRESH(seconds, default1800)LED_WEATHER_TIMEOUT(seconds, default4)
LED_TICKER_EVERY(sec, default60)LED_TICKER_SPEED(default0.07)LED_TICKER_GAP(default16)LED_TICKER_WITH_YEAR(0/1)LED_TICKER_FONT(1/2)
LED_AUTO_DIM(0/1)LED_BRIGHTNESS_DAY(0..255, default12)LED_BRIGHTNESS_NIGHT(0..255, default3)LED_NIGHT_FROM(default22:30)LED_NIGHT_TO(default07:00)
LED_SECONDS_BAR(0/1)LED_SECONDS_BAR_DOTTED(0/1)LED_SPARKLE_ON_HOUR(0/1)LED_SPARKLE_DURATION(default0.45)LED_SPARKLE_DENSITY(default0.15)LED_SPARKLE_FPS(default20)LED_MINUTE_SWIPE(0/1)LED_MINUTE_SWIPE_PX(default8)LED_MINUTE_SWIPE_DELAY(default0.03)
LED_SPI_PORT(default0)LED_SPI_DEVICE(default0)LED_BUS_HZ(default16000000)LED_CASCADED(default4)LED_ORIENTATION(default-90)LED_ROTATE(default0)
To keep code clean and follow configuration-as-data pattern, display behavior is grouped into profiles:
config/profiles/clock.env— minimal clockconfig/profiles/status.env— balanced status modeconfig/profiles/info.env— info carousel (custom page set)config/profiles/tempclock.env— temperature + clock (no ticker)config/profiles/weather.env— CPU/outdoor temperature cycling
Switch mode quickly:
chmod +x scripts/mode.sh
./scripts/mode.sh clock
./scripts/mode.sh status
./scripts/mode.sh info
./scripts/mode.sh tempclock
./scripts/mode.sh weatherThe script updates /etc/default/led-clock and restarts service.
info mode is configurable via:
LED_INFO_PAGES=time,temp,cpu,load,ram,ip,date,uptimeLED_INFO_ROTATE_SEC=6LED_INFO_ENABLE=1
Files in repo:
deploy/systemd/led-clock.servicedeploy/systemd/led-clock.env.examplescripts/install-systemd.sh
Install on Raspberry Pi:
chmod +x scripts/install-systemd.sh
./scripts/install-systemd.shService checks:
sudo systemctl status led-clock.service
tail -f /var/log/led-clock.log
sudo journalctl -u led-clock.service -fEnvironment config is stored in /etc/default/led-clock.
Logrotate config is installed to /etc/logrotate.d/led-clock.
- The script handles
SIGINT/SIGTERMand clears display on shutdown. - CPU temp reads from
/sys/class/thermal/thermal_zone0/temp, then falls back tovcgencmd.
Work in progress. Interface and defaults may still change.