Prepare the wooden board using a laser cutter or a printed circuit diagram.
Flash the sketch to the Arduino
Attach cables with Dupont connectors
Mount thumbtacks and connect them with soldered wires
Place components on the board using adhesive pads
Shorten cables and fit Dupont connectors
Connect everything according to the circuit diagram
Detailed Instructions
Step 1: The "Circuit board"
Since this is a DIY project meant to be built with minimal effort and low material cost,
the circuit board is not professionally manufactured. Instead, a small wooden board is used where components
are attached with adhesive pads. Components are connected using bell wire with crimped Dupont connectors.
The board can either be laser-cut or you can print the circuit diagram at full size
and glue it onto the board.
Circuit diagram as PDF Circuit diagram as LightBurn template for Lasercutters Circuit diagram as SVG
Step 2: Programming the Arduino
This step is only necessary if the Arduino has not yet been flashed with the MIDI controller program.
At the JOTAJOTI workshop the Arduinos are usually already flashed, so you can skip this step.
Install the Arduino IDE if you don't have it yet. Download here.
Install the MIDIUSB library:
Open the Arduino IDE and go to Tools -> Manage Libraries... (or Ctrl + Shift + I).
Search for MIDIUSB (by Arduino).
Click Install.
Update the AVR board core:
Go to Tools -> Board -> Board Manager...
Search for Arduino AVR Boards.
Click Update (or choose the latest version).
Copy the code into the Arduino IDE and select the correct board (Arduino Micro)
and the correct port.
Click Upload
Code:
#include
USBMIDI_Interface midi;
// CCAbsoluteEncoder send the absolute MIDI-Values between 0 and127.
// Syntax: {{Pin_A, Pin_B}, CC_Nummer, Pulses_per_step}
CCAbsoluteEncoder encoders[] = {
{{3, 2}, 10, 4}, // Encoder 1 -> CC 10
{{5, 4}, 11, 4}, // Encoder 2 -> CC 11
{{10, 16}, 12, 4}, // Encoder 3 -> CC 12
{{15, 14}, 13, 4}, // Encoder 4 -> CC 13
};
// The Builtin switches (SW) of the encoders 1 to 4 ---
CCButton encoderSwitches[] = {
{6, {14, CHANNEL_1}}, // Switch 1 -> CC 14
{7, {15, CHANNEL_1}}, // Switch 2 -> CC 15
{A0, {16, CHANNEL_1}}, // Switch 3 -> CC 16
{A1, {17, CHANNEL_1}}, // Switch 4 -> CC 17
};
//Additional encoder as infinite rotary encoder for the VFO in UBER SDR
CCRotaryEncoder infencoders[] = {
{{9, 8}, 18, 4}, // Encoder 5 -> CC 18
};
void setup() {
Control_Surface.begin();
}
void loop() {
Control_Surface.loop();
}
Step 3: Thumbtacks
Press the four thumbtacks into the designated positions on the board.
If the board is too thin, cut off the protruding tips on the backside
with diagonal cutters so the thumbtacks do not stick through.
Then tin all thumbtacks with solder. Hold the soldering iron on the thumbtack for a few
seconds so it heats up. Feed solder to the thumbtack until it is tinned.
Then connect the thumbtacks with short black wires.
Step 4: Prepare the cables
Take the bell wire and cut the following lengths and strip both ends with the wire stripper:
2x 9cm, green
2x 9cm, blue
2x 8cm, green
2x 8cm, blue
4x 4.5cm, black
1x 9cm, black
Crimp Dupont connectors onto both ends of the green and blue cables.
All black cables get only one connector; the other end is soldered directly
to the thumbtacks.
To crimp, place the metal sleeve into the crimping tool so it rests on the small step.
Close the crimping tool gently until the sleeve is slightly compressed. Insert the cable end
so the wire is inside the sleeve, then fully close the crimping tool.
Now build four cable assemblies, each consisting of a green, a blue and a black cable.
Assemble everything
Use the adhesive pads to stick the four rotary encoders and the Arduino to the correct
positions on the board.
Solder the four exposed black wires from the cable assemblies to the thumbtacks.
Then connect the cable assemblies to the corresponding pins:
Arduino Pin
Drehimpulsgeber Pin
2
DT 1
3
CLK 1
4
DT 2
5
CLK 2
10
DT 3
16
CLK 3
14
DT 4
15
CLK 4
GND
Reiszwecken
Testing and Troubleshooting
Connecting
If you have connected everything correctly, plug the Arduino into the computer using the USB cable.
The two red LEDs on the Arduino should light up.
Function test
Go to https://www.midimonitor.com/
and click "Start Monitoring".
Now turn the rotary encoders. If everything is connected correctly, the values should appear on the website.
If not, check the cable connections.
Check that:
The cables are in the correct sockets
The ground (GND) cable is connected
Use a continuity tester to verify all thumbtack connections
Troubleshooting
Problem
Solution
The values only switch between 0 and 1
Check the cable connections. One cable must go to CLK and one to DT.
Turning clockwise decreases the values
The CLK and DT cables are swapped.
Nothing happens
The GND cable is not connected correctly.
What can you do with it now?
Any software that supports MIDI can now be controlled with the controller.
Originally, MIDI was designed for controlling musical instruments.
Nowadays, there are also many other applications that support MIDI.
For example, you can use the controller to play games or operate radio equipment.
Extension for Radio Enthusiasts and those who want to do more with it
The code above can evaluate more than just the four encoders as rotary knobs.
Additionally, each rotary knob has another function:
You can press it to trigger another MIDI command.
This allows you to turn things on and off, or switch between different modes.
In UBER SDR you can use this to switch between different frequency bands.
To use this function, you only need 4 additional cables about 10cm long with
Dupont connectors
installed. One end goes to each encoder
at the "Sw" (Switch) pin, and the other end is is connected to the Arduino
pins 6, 7, A0 and A1
The four encoders only send fixed values between 0 and 127 when rotated.
If you want to adjust the frequency in UBER SDR, this is not very practical.
You can only adjust a very small frequency range.
What you need is an infinite rotary encoder,
which continues to rotate and adjusts the frequency continuously up or down.
That's why there is another encoder defined in the code above,
which is connected to pins 8 (DT) and 9 (CLK) as well as GND.
This one can be assigned in UBER SDR for example to the function "encoder (100Hz steps)"
and then used as a frequency dial.
Another application would be the DJ app Beatport. There you can use the infinite rotary encoder
to move the virtual turntable for scratching..