my03
June 25, 2025, 6:19pm
1
This is most probably a silly question, i agree, but i still wanted to ask:
Would it be possible to add a potentiometer to this device in order to control the (master) volume, without resorting to a software solution?
Hello what device are you referring to?
my03
June 26, 2025, 3:05pm
3
Sorry, that info disappeared, i meant the AUDIO + V3 audio card
It is possible to add a potentiometer on the gpios of the RPI to control the volume:
README.md
# 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](https://www.40percent.club/2020/12/orthopi-rotary-encoder.html) and [savetheclocktower rotary encoder volume control](https://gist.github.com/savetheclocktower/9b5f67c20f6c04e65ed88f2e594d43c1). 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.

# Hardware Requirements
Hardware requirements for this project are a Raspberry Pi, a cheap rotary encoder, jumper wires, and 3 free GPIO pins.
# Software Requirements
This file has been truncated. show original
gpiozero_volknob.py
#!/usr/bin/env python3
r"""__ ___ (_)__ ___ ___ _______ _ _____ / / / /__ ___ ___ / /
/ _ `/ _ \/ / _ \/_ // -_) __/ _ \ | |/ / _ \/ / / '_// _ \/ _ \/ _ \
\_, / .__/_/\___//__/\__/_/ \___/ |___/\___/_/ /_/\_\/_//_/\___/_.__/
/___/_/
Volume control using rotary encoder by Charles Stevenson <brucesdad13>
Inspired by:
https://www.40percent.club/2020/12/orthopi-rotary-encoder.html
This file has been truncated. show original
README.md
# Using a rotary encoder as a volume control
On my RetroPie machine I wanted a hardware volume knob — the games I play use a handful of emulators, and there's no unified software interface for controlling the volume. The speakers I got for my cabinet are great, but don't have their own hardware volume knob. So with a bunch of googling and trial and error, I figured out what I need to pull this off: a rotary encoder and a daemon that listens for the signals it sends.
## Rotary encoder
A rotary encoder is like the standard potentiometer (i.e., analog volume knob) we all know, except (a) you can keep turning it in either direction for as long as you want, and thus (b) it talks to the RPi differently than a potentiometer would.
I picked up [this one](https://www.adafruit.com/products/377) from Adafruit, but there are plenty others available. This rotary encoder also lets you push the knob in and treats that like a button press, so I figured that would be useful for toggling mute on and off.
This file has been truncated. show original
monitor-volume
#!/usr/bin/env python3
"""
The daemon responsible for changing the volume in response to a turn or press
of the volume knob.
The volume knob is a rotary encoder. It turns infinitely in either direction.
Turning it to the right will increase the volume; turning it to the left will
decrease the volume. The knob can also be pressed like a button in order to
turn muting on or off.
This file has been truncated. show original
monitor-volume.service
[Unit]
Description=Volume knob monitor
[Service]
User=pi
Group=pi
ExecStart=/home/pi/bin/monitor-volume
[Install]
WantedBy=multi-user.target
my03
July 4, 2025, 8:09pm
5
Hi,
thanks for the github link
I’m afraid that in my case, i’m not running an OS per se, but bare metal (GitHub - probonopd/MiniDexed: Dexed FM synthesizer similar to 8x DX7 (TX816/TX802) running on a bare metal Raspberry Pi (without a Linux kernel or operating system) ) so my question was more of an hardware oriented one (such as physically inserting a potentiometer in the signal chain). Its a long-shot of course, but it never hurts to ask.
br
my03
July 4, 2025, 8:57pm
6
Ok, i think i got it. I think i can basically “insert” a 50kohm lin PCB stereo (B50K) between the 3.5 out and my 6.3 phono connectors and make it that way. All good
If you want a purely analogic solution sure you can add stereo potentiometer made for audio, logarithmic one will give you a more natural progression