Simple DIY Volume Control Knob!

129,756

398

81

Introduction: Simple DIY Volume Control Knob!

About: Follow me in Instagram: https://www.instagram.com/engineeringns/

Got a desktop with a sound system far from where you sit?--I do. After a bit of digging, I found that it was pretty easy to make my own soft volume control knob on the cheap.

In this tutorial I will show you how to create a USB volume control knob for your PC!

To keep things simple, Instead of Arduino, I will use an arduino compatible board called the Digispark. Not only is the Digispark small, but it is cheap! Normally I pick mine up from aliexpress.com for less than $2 USD

Lets get started!

Step 1: What You Will Need...

What you will be needing:

Micro USB cable

Micro USB DIgispark (can't be full sized version)

Rotary encoder (also cheap on aliexpress)

Not needed (but nice to have): Some sort of enclosure and knob

Arduino IDE and digispark environment.

Step 2: Time to Get Everything Set Up.

I won't teach you how to use the Arduino Development Environment, there are plenty of tutorials for that on the web already. If you are not familiar with the Digispark, setup information can be found here: https://digistump.com/wiki/digispark/tutorials/con...

Once set up, go to: https://learn.adafruit.com/trinket-usb-volume-knob... and download the Library that we will be needing for this project. Extract the .zip file and place the "Adafruit-Trinket-USB-master" folder into C:\Users\ \Documents\Arduino\libraries

Then copy and paste the sketch found on the same webpage into the Arduino IDE and upload it to your digispark.

Note:

The reason that we can do this so easily is because Adafruit has a product called the Trinket that uses the ATtiny85 chip (they have developed this simple-to-use library to work with their trinket) but the DigiSpark also uses the ATtiny85 chip!--So we can very easily use the cheap digispark to run the code and save some money!

Anyway, download the library and go to step 3!

Step 3: The Wiring

Next we can start on the hardware. I shall now demonstrate my artistic skill by drawing a simple schematic for you...

Anyway, as you can see it is very simple and that is all there is to it!

Step 4: The Build!

This is optional and depends on how you want the finished product to look (unless, of course, you just want it to sit on protoboard when you're done)

What I did was cut a small hole into a pill bottle and stick the rotary encoder though it, then I hot-glued the digispark inside the lid (remember to cut a small hole in the side of the lid for the micro USB port to connect to your computer)

Lastly I glued a piece of rubber mat to the bottom--that completes the base!

For the lid, I took the knob from an old broken stereo receiver and plopped that on top!

Note:

I also filled it with wax and iron pellets to give it a heavy quality feel, but you can watch the video to learn more about that in step 5.

Step 5: Finished!

That is it!

If you liked it, Follow meh on instagram where I post project updates: https://www.instagram.com/engineeringns/

This video may or may not be useful to you, but check it out!

If you have any problems getting it to work, contact me here on Instructables or leave a comment on the youtube video!

Also, if you find that the rotation is reversed, try changing the following lines at the top of the sketch from:

#define PIN_ENCODER_A 0

#define PIN_ENCODER_B 2

into:

#define PIN_ENCODER_A 2

#define PIN_ENCODER_B 0

Remember to check out some of my other instructables!

19 People Made This Project!

Recommendations

  • For the Home Contest

    For the Home Contest
  • Make It Bridge

    Make It Bridge
  • Game Design: Student Design Challenge

    Game Design: Student Design Challenge

81 Comments

0
ForrestA3
ForrestA3

5 years ago

Hey guys, I added mute to the code! Here is the source. OP i strongly think you should add this.

https://pastebin.com/qBANMPkr

Connect one side of the button (presumably the built in one on your encoder) to VIN, then connect the other side to p1. You can even change it from mute to whatever you like. Towards the bottom of my file you will see the MUTE command. You can change it to any of the ones given here https://github.com/adafruit/Adafruit-Trinket-USB/b...

But they dont all seem to work


You can even change it to whatever key you want

0
kth0
kth0

Reply 1 year ago

A version with a little debounce on the button. (mine seemed a little buggy without it)

0
bradbury212elissa
bradbury212elissa

Reply 1 year ago

Is it possible to make the volume control smooth rolling instead of a stepped in increments control ? For example ,on a mouse ,there's a clip that can be removed from the mouse wheel to make it smooth instead of all the clicking.

0
Kenokke
Kenokke

Reply 5 years ago

Im wondering if there is any way to make it work as scroll whell?

0
Kris S
Kris S

Reply 5 years ago

Thank you!

0
Kris S
Kris S

Reply 5 years ago

I've featured your comment!

0
moinmoin6308
moinmoin6308

Question 10 months ago

how to connect digispark to this ENCODER please help me

280693255_342118948023669_8013127630446929736_n.jpg283306028_706159340694335_2460298337011472588_n.jpg280693255_1016595092395033_5886055955240297965_n.jpg
0
Kons3ns
Kons3ns

Answer 2 months ago

You got there a potentiometer and not an encoder.

0
vdundović
vdundović

1 year ago

if you are using attiny85 and hw040 you just need to invert the + and gnd and the mute will work

IMG_20211224_162520_edit_1045605394647743.jpgIMG_20211224_162541_edit_1045586158170142.jpg
0
saadland
saadland

Question 3 years ago

Hello.
I am want to make such volume knob, but I would like it to be wireless, if possible.
Did somebody manage to make it wireless; or though about it.
I am looking for a bluetooth module that can handle HID, to transmit keyboard data, and a battery for it to be owered.
Can somebody recommand some modules please
Thx

0
kroome
kroome

Answer 2 years ago

I am looking for a bluetooth module that can handle HID, to transmit keyboard data, and a battery for it to be powered
maybe this could help... : check this out...

0
dfearnley
dfearnley

2 years ago

Would this work on Android? Basically I'm converting the face of my original stereo to co control my carpc and IV run out of pins on my pro micro.

And any chance you could paste the config file too. I'm very new at this lol. Can you tell.

2
AikonM
AikonM

Tip 4 years ago

You can use an another version of the board to avoid a wire connection :)

I used a encoder from old mouse. It's very small.

IMG_20180803_001022.jpg__2.jpg___3.jpg__4.jpg
0
saadland
saadland

Reply 3 years ago

very neat version, but that is a good version for those that have keyboard with USB port available on it.

0
Quang1102
Quang1102

Question 4 years ago

How to use the remaining 3 batteries (p3, p4, p5) to control led RGB (or 1pin-1led) when the Rotary encoder????. please help me!!!!!

0
saadland
saadland

Answer 3 years ago

looking for the same, to control a RGB ring. did youfind something since??

0
mauempoleon
mauempoleon

Question 4 years ago

Hi, i´m making the project but the mute button doesnt work, it only turn off the intregated LED on the Digispark. What can i do?

IMG_20181031_081039-1.jpgIMG_20181031_081453-1.jpg
0
scek.uros
scek.uros

Answer 3 years ago

If I connect cables like this then volume control is very smooth. With other configuration it doesn't work as well. Sometimes it doesn't change volume, sumetimes do.
I'm using rotary encoder with small motherboard underneath and it has 5 pins, so I can't copy from original post (which has only 3). I'm also using ATTINY85 with microUSB, not the one from the picture.
I really would like MUTE to work so I could finish my project. The red light near the P2 pin blinks if I press the switch so I must be very close. None of the solutions in comments doesn't work for me. Or I don't understand how to connect cables :)
So if anyone has the solution, please share.

0
kroome
kroome

Reply 3 years ago

if you are using encoder with built-in resistors, one pin of the switch
is connected to ground therefore you need to transfer the connection to
(+) ... just traced the pins of the button switch to make it sure...

0
psychodido
psychodido

4 years ago

Hey Kris, Please help! I make it work only with volume knob!!! But I can not do mute when i pres the knob... The photos show how I've connected Rotary encoder and The ATtiny85! Where am I wrong?

IMG_20180427_154325.jpgIMG_20180427_154416.jpg