This article was translated to English, and was originally published for deviceplus.jp.
In this article, I’d like to try out a variety of things that can be done, such as a “device plus” way using that function!
Instructable recipe
Est time:60分
Necessary parts
Table of contents
Whenever I’m working on a computer, I often work while playing music. However, I often have problems adjusting the volume. Since the volume button is on the keyboard for note PCs, that problem can be easily solved by just pressing it. However, for desktops, since that button doesn’t exist, it’s a little more difficult.
Take Windows as an example; you have to click on the speaker icon at the bottom right of the screen to change the volume; or, use the volume adjustment on each playback software. This time, to solve this annoyance, I’ll create a device where you can easily change the volume!
The Arduino Pro Micro will also be used this time. I’ll continue using this.
Well, I thought about making it, but as I was looking things up for this article, I discovered quite a lot that I need to get off my chest. For Windows, you can actually turn up the volume with “Win” + “PageUP” on the keyboard, and turn it down with “Win” + “PageDown.”
However, the “Win” key and “PageUP” and “PageDown” are far away from each other, so you have to use both hands. Above all else, I want to control the volume with a knob. For that reason alone, I’ll try to make this device.
How to adjust the volume from Arduino
Although we already introduced this before, let’s think about a keyboard command on Arduino for adjusting the volume.
This time, if the volume resistance rotates, simply acquire the state and try to implement it by increasing and decreasing the volume. Since we won’t know what the current value is through this method, finer adjustments will be difficult. However, there shouldn’t be any problems with quick rotations, so let’s give it a shot!
The volume can be adjusted on Windows by combining the keys highlighted on the picture. This key is sent to Arduino Pro Micro as a virtual key command.
Since we adjusted the volume, let’s also set up the volume resistor for the parts. The circuit is simple; detect the value of the volume resistance with the analog input (A0 pin), and try to send the key to the Windows side according to the increase or decrease of the value.
Adjust the volume for the program
In the conditional statement, _pos-2)> ain is a program that sends a key if the resistance value is larger or smaller than the previous state. Although there have been cases where the numerical value fluctuated slightly, such as + -1 to 3 even though the volume resistance hadn’t been touched, here it is set to + -2 so that it doesn’t malfunction even if the resistance value fluctuates.
If we turn on the volume knob, then the sound on Windows should also change! Now, working on a computer has become even more comfortable!
Since it seems a bit empty by itself, let’s make a case to put it in. I picked up this block of wood at my local goods store at a reasonable price. All you need now is an electric drill to attach the volume resistor.
Attach an ON/OFF switch.
Drill a hole that fits your Arduino, and place the parts inside.
You can solder directly onto the Arduino, but since I want to use it again, I left some space in between.
After that, place the Arduino inside the hole and you’re all set. Let’s check if it still works.
It works! Now, that looks a lot different from your usual Arduino, right?
In today’s article, we created a volume adjustment device based upon Arduino Pro Micro. By applying keyboard shortcut keys or mouse operations, you can create a device that specializes in specific processes for games or for completing simple tasks. Give it a try and see what you can make.