A voice-controlled LED clock running on a Raspberry Pi. Say "hey clock" to wake it, then speak a command to change patterns, show the moon phase, or toggle the clock display. LED animations are driven by a Pixelblaze controller over the local network.
- Raspberry Pi (any model with audio input)
- Pixelblaze LED controller named
k-clockon the local network - USB microphone or audio input device
- The Pi continuously listens for the wake word "hey clock" (via Picovoice Porcupine)
- On detection, the active pattern switches to
C wake wordto signal the clock is listening - You have 5 seconds to speak a command, which is parsed by Picovoice Rhino
- The command controls the Pixelblaze over WebSocket
- Every 15 minutes, brightness is adjusted automatically on a cosine curve (dim at night, brighter during the day)
| Phrase | Action |
|---|---|
| "set pattern to moon phase" | Fetch today's moon phase, display it for 5s, then return |
| "set pattern to clock on" | Switch sequencer to clock-on playlist (C patterns) |
| "set pattern to clock off" | Switch sequencer to clock-off playlist (C- patterns) |
Patterns come in pairs:
C <name>— clock-on variant (clock overlay visible)C- <name>— clock-off variant (background only)
On startup, the sequencer playlist is built from the C variants. The "clock off" command swaps to the paired C- variants without leaving the sequencer.
Requires Python 3.11+ and a Picovoice access key.
pip install -r requirements.txtTwo model files are required (not committed — generate from the Picovoice Console):
hey-clock_en_raspberry-pi_v4_0_0.ppn— Porcupine wake word modelk-clock-pattern_en_raspberry-pi_v4_0_0.rhn— Rhino intent context model
python3 k-clock.py \
--access_key <PICOVOICE_KEY> \
--keyword_paths hey-clock_en_raspberry-pi_v4_0_0.ppn \
--context_path k-clock-pattern_en_raspberry-pi_v4_0_0.rhnUseful flags:
| Flag | Description |
|---|---|
--show_audio_devices |
List available audio input devices |
--show_inference_devices |
List available Porcupine inference devices |
--audio_device_index <n> |
Select audio device (default: -1) |
--sensitivities <float> |
Wake word sensitivity 0.0–1.0 (default: 0.5) |
sudo systemctl start k-clock
sudo systemctl stop k-clock
sudo systemctl status k-clock
journalctl -u k-clock -fThe service unit is defined in k-clock_service.service. It calls startup.sh, which activates the virtualenv and passes the access key and model paths.
k-clock.py # Entire application (single file)
startup.sh # Launch script for the Pi (activates venv, passes args)
k-clock_service.service # systemd unit file
requirements.txt # Python dependencies
Rotating log file at k-clock.log in the working directory (40 KB, 5 backups).