Skip to content

Instantly share code, notes, and snippets.

View brucesdad13's full-sized avatar
⚖️
Balancing family, work, and university

Charles K Stevenson brucesdad13

⚖️
Balancing family, work, and university
View GitHub Profile
@brucesdad13
brucesdad13 / README.md
Last active June 1, 2024 13:25
Raspberry Pi volume knob with mute using rotary encoder and Python

Raspberry Pi volume knob with mute using rotary encoder and Python

Adjust the volume or mute the active audio device on your Raspberry Pi using a rotary encoder and a few GPIOs. This project was inspired by the Orthopi mechanical keyboard and savetheclocktower rotary encoder volume control. Holding down the knob launches PulseAudio Volume Control. Tested on Raspberry Pi models 3B+, 4, and 400 with HDMI audio output, analog out (on the 3B+), and with a wireless headset via USB dongle. It works with Raspbian Bullseye 32-bit and 64-bit and Retropi--possibly older releases but I haven't tested.

Rotary encoder WikiCommons

Hardware Requirements

Hardware requirements for this project are a Raspberry Pi, a cheap rotary encoder, jumper wires, and 3 free GPIO pins.