Simple DIY Volume Control Knob!

85,416

334

57

Published

Introduction: Simple DIY Volume Control Knob!

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!

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!

15 People Made This Project!

Recommendations

  • Woodworking Contest

    Woodworking Contest
  • Casting Contest

    Casting Contest
  • Clocks Contest

    Clocks Contest
user

We have a be nice policy.
Please be positive and constructive.

Tips

1 Questions

0

I bought http://www.dx.com/p/micro-usb-interface-digispark-kickstarter-attiny85-development-board-378845#.Wn4kBXPLfqA . But i don't now how to program it to use more 2 functions and how to make the swicths work.
I use this https://learn.adafruit.com/trinket-usb-volume-knob/add-a-mute-button. Please help! I make it work only with volume knob and mute. I need more 2 functions for FWD/BACK. I have a old front panel autoradio and I transform it for a multimedia controller of a android autoradio. Please help!

0

My work...

1518364645511186908087.jpg15183646983021730683547.jpg15183647487601342870408.jpg

57 Comments

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

3 replies

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

Thank you!

I've featured your comment!

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
1 reply

Hey psychodido. Did you get it to work? I wired my Tiny85 with the encoder as shown in your pictures; my volume up/down now works correctly, but i have the same problem as you: The Mute-Button don't work. Any suggestions? :-/

Could you please guide me to add more media control button. I want to use new trend mechanical switch keyboard but i can't live without these DELL magic keys. Please...

screenshot.114.jpg

Unable to compile, I keep getting an error. Looked over the steps multiple times and everything seems fine. Error:

C:\Users\Marmbo\Documents\Arduino\sketch_aug12a\sketch_aug12a.ino:1:29: fatal error: TrinketHidCombo.h: No such file or directory

#include "TrinketHidCombo.h"

^

compilation terminated.

exit status 1
Error compiling for board Digispark (Default - 16.5mhz).
Invalid library found in C:\Users\Marmbo\Documents\Arduino\libraries\Adafruit-Trinket-USB-master: C:\Users\Marmbo\Documents\Arduino\libraries\Adafruit-Trinket-USB-master
Invalid library found in C:\Users\Marmbo\Documents\Arduino\libraries\Adafruit-Trinket-USB-master: C:\Users\Marmbo\Documents\Arduino\libraries\Adafruit-Trinket-USB-master

1 reply

I must be late. I think you have moved whole Trinket-USB-master folder into Arduino\libraries folder, you have to move one of the subfolders, specifically TrinketHidCombo folder from inside Trinket-USB-master.

hey guys i wanted to know if this can work as a knob . it was one used as a volume knob and i just wanted to know is this can work and also can you show what pin is what

20170920_225809.jpg20170920_225920.jpg20170920_225948.jpg

I was directed here from this Thingiverse page ( https://www.thingiverse.com/thing:2329074 ) and it has this page linked so I am going to favourite this instructable and use this comment as a link to myself if I want to get back to that page. The 3D model looks quite good so if anyone else wants a case for this Instructables project, this one should suffice but I'm sure there are many other good ones online or even some Instructables of how to make one or something. This comment isn't advertising or anything just a note to self, ignore it if you want. I can't wait to get the parts specified in this Instructable so I can try it out so thanks to Kris S for these instructions. :)

1 reply

Thank you!

Not sure if its the coding or the my hardware, but having the digispark wired exactly like adafruit's diagram. I still cannot get the click button to do anything.

Any ideas?

Instead of volume, can you make it control a media player?

Only keys I want are:
-Left arrow key: when rotated counter clockwise
-Right arrow key: when rotated clockwise
-Spacebar: when pressed

4 replies

Yeah that'd be pretty easy. But I believe you'd need to use an arduino leonardo, (or pro micro)

All you need to do is use an encoder library, and map the rotations to a virtual keyboard emulated by the leonardo.

I haven't done it, so this is just speculation on my part.

Let me know if you are interested in trying it.

Ah damn I already ordered the same parts as your guide assuming it was just a change in the coding.

What's your thought on the size of the leonardo or pro micro though? I was hoping for something similar to the size of the digispark so that it can actually be placed inside a knob.

Just did a quick search and it seems that it is possible to use the digispark to emulate a keyboard.

Check this link: https://digistump.com/board/index.php?topic=20.0

Let me know if it is useful.

Also: https://www.google.com/webhp?sourceid=chrome-insta...

Awesome, will keep you updated on how it turns out.

Also I can't seem to get to that google link, sorry.

in online i am getting 5 pin encoder does it will support

1 reply

There should be 3 pins for the encoder, and two pins for a push button for mute--Totaling 5 pins :)