Hey! This is my take on the popular deej project!
What's a deej?
It's a set of physical sliders that allow you to control the volume of different applications on your computer!
Why would I want that?
Have you ever been playing a game, and the game is too loud?
Have you had friends on discord who you couldn't hear (or maybe could hear too well)?
With the “deej” you can reach over and turn individual application volumes up or down with physical sliders! No need to alt+tab out of your game!
What will I need to make my own?
- (A bit of) Programming experience: There isn't a lot of programming, but there's a bit.
- Parts: Parts list is included below
- Take a look at the project for more information: https://github.com/omriharel/deej
Things that will make this project easier, but aren't strictly necessary
- Soldering Iron: Used for wiring as well as inserting the brass threaded inserts
- Soldering experience
- Wiring experience
- Arduino experience (honestly, this project is a pretty good jumping in point for learning how to program micro-controllers)
- Multimeter: Makes it easier to figure out what the pins on your sliders go to.
Parts List
Some of the below links are to unavailable parts, for those you'll have to find a replacement.
| Name | Link | Quantity | Notes |
|---|---|---|---|
| Teyleten Robot ESP32-S3-DevKitC-1 | https://www.amazon.com/dp/B0B6HT7V7P | 1 | There's a small capacetor below the BOOT button. Remove it. |
| Slide Potentiometer Single Linear | https://www.amazon.com/dp/B07QVQ67MV | 5 |
This is the model number: SC609N Physical dimensions are 15.5mm W 88mm L. Shank is about 9mm wide, screws are positioned 80mm apart. |
| Brass threaded inserts | https://www.amazon.com/dp/B0CNVXWQYZ | 8 | |
| M3x6mm screws | https://www.amazon.com/dp/B07CMRQ3TB | 10 | Most/any M3x6mm socket head cap screws should work |
| M3x12mm screws | You can find these pretty much anywhere | 4 min | Most/any M3x12mm socket head cap screws should work. |
In addition to the above parts, you may want to consider buying some wire jumper cables that are common in electronics kits. If planned carefully, you could assemble this without needing to solder anything.
Printed Parts list
Lid: 1
Base: 1
Knob: 5
Assembly
The wiring is messy, but the physical assembly is pretty easy. Slide all 5 slide potentiometers into the lid and screw them in with the M3x6mm screws.
After that, use a soldering iron or something else that gets hot to insert the brass threads into the base. NOTE: there are 2 brass insert locations per corner of the base. One on the top, closest to the lid and one on the bottom. The inserts on the bottom are optional, but the ones on the top are not.
After the brass threaded inserts are inserted, use the M3x12mm screws to screw in the lid.
Wiring
This really depends on which potentiometers you bought. For the ones I linked, pin 1 is Ground, pin 2 is the variable pin and pin 3 is 3.3vcc.
Your potentiometers may be a bit different. You can test them in real-time using the serial monitor after uploading the deej arduino sketch to the microcontroller.
While these aren't the only pins you can use on the board, pins 9-13 are all close to one another and are all ADC pins (aka will work for this project).
No matter what, you'll need to find the output pin (or variable pin) and wire it to an ADC pin on the ESP32 microcontroller. Each slider will be wired to a separate ADC pin. (I suggest using pins 9 though 13)
In addition to wiring up the ADC pins, you will need to make sure each slider has a connection to Ground and to VCC (either 5v or 3.3v depending on which ones you bought, again, you can test this using a serial monitor). How you do this is up to you.
Programming
The deej project expects the slider readings to be between 0 and 1023 (inclusive), but the ESP32-S3-DevKitC-1 goes from 0 to 4095 (inclusive), so the default sketch found in the deej github repository won't work out of the box (or rather, it will, but you'll max out your volume after going 1/4th of the way up)
The solution is luckily pretty simple. You just have to change one line of code. I'll show the exact line, and then include the whole sketch just for completeness's sake.
Line #23 in deej-5-sliders-vanilla.ino needs to be changed from this:
analogSliderValues[i] = analogRead(analogInputs[i]);
To this:
analogSliderValues[i] = (int)(((u_int64_t)analogRead(analogInputs[i])) * 1023 / 4095);Here's the complete sketch:
const int NUM_SLIDERS = 5; const int analogInputs[NUM_SLIDERS] = {9, 10, 11, 12, 13}; int analogSliderValues[NUM_SLIDERS]; void setup() { for (int i = 0; i < NUM_SLIDERS; i++) { pinMode(analogInputs[i], INPUT); } Serial.begin(9600); } void loop() { updateSliderValues(); sendSliderValues(); // Actually send data (all the time) // printSliderValues(); // For debug delay(10); } void updateSliderValues() { for (int i = 0; i < NUM_SLIDERS; i++) { analogSliderValues[i] = (int)(((u_int64_t)analogRead(analogInputs[i])) * 1023 / 4095); } } void sendSliderValues() { String builtString = String(""); for (int i = 0; i < NUM_SLIDERS; i++) { builtString += String((int)analogSliderValues[i]); if (i < NUM_SLIDERS - 1) { builtString += String("|"); } } Serial.println(builtString); } void printSliderValues() { for (int i = 0; i < NUM_SLIDERS; i++) { String printedString = String("Slider #") + String(i + 1) + String(": ") + String(analogSliderValues[i]) + String(" mV"); Serial.write(printedString.c_str()); if (i < NUM_SLIDERS - 1) { Serial.write(" | "); } else { Serial.write("\n"); } } }An alternative to this, if you're more comfortable programming in Golang, is to just modify the Go code to accept values up to 4095. Either way, the choice is yours.
Model Kaynağı
