Cameron Coward
Published © CC BY-SA

Vintage Rotary Phone Dial PC Volume Control

Use a vintage rotary phone dial to control the volume on your Windows PC.

IntermediateFull instructions provided4 hours3,711
Vintage Rotary Phone Dial PC Volume Control

Things used in this project

Hardware components

Vintage Bell Systems Trimline rotary phone
×1
Arduino Nano R3
Arduino Nano R3
×1
M3 Threaded Inserts
×1
M3 Machine Screws
×1
Resistors (470 and 10k)
×1
Wire
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

Rotary_Base.stl

Rotary_Top.stl

Code

Rotary.ino

Arduino
Error opening file.

rotary.py

Python
The Python script (needs to run in background at startup). Change COM port to your actual port.
from ctypes import cast, POINTER
from comtypes import CLSCTX_ALL
from pycaw.pycaw import AudioUtilities, ISimpleAudioVolume
import serial

def main():
    ser = serial.Serial('COM13', 9600, timeout = None)  # open serial port
    print(ser.name)         # check which port was really used

    loop = 0
    while loop == 0:
        NewVolume = float(("0."+(str(ser.read())[2:3])))

        sessions = AudioUtilities.GetAllSessions()
        for session in sessions:
            volume = session._ctl.QueryInterface(ISimpleAudioVolume)
            volume.SetMasterVolume(NewVolume, None)
            print("volume.GetMasterVolume(): %s" % volume.GetMasterVolume())


#        devices = AudioUtilities.GetSpeakers()
#        interface = devices.Activate(
#            IAudioEndpointVolume._iid_, CLSCTX_ALL, None)
#        volume = cast(interface, POINTER(IAudioEndpointVolume))
#        volume.SetMasterVolumeLevel(-20.0, None)

    ser.close()             # close port

if __name__ == "__main__":
    main()

Rotary.zip

Arduino
Contains the rotary.ino file to upload to the Arduino
No preview (download only).

Credits

Cameron Coward

Cameron Coward

15 projects • 1332 followers
Writer for Hackster News. Proud husband and dog dad. Maker and serial hobbyist. Check out my YouTube channel: Serial Hobbyism

Comments