Part 2 of my XR18 handheld controller build. Last time I covered why I chose MIDI. This post covers the parts I picked and the reasoning behind each one, followed by the full bill of materials for one handheld and one receiver.
The brain: two ESP32 boards
The system has two small boards: a handheld one with the knobs and a receiver that plugs into the mixer. I used ELEGOO ESP-WROOM-32 development boards for both. They are cheap, they have Wi-Fi and Bluetooth built in, and they work with the Arduino tools I already know. The feature that mattered most is ESP-NOW, a direct radio link between two ESP32 boards that needs no router and no network. That is what lets the handheld talk to the receiver with nothing else switched on.
The controls: rotary encoders, not potentiometers
The handheld has four rotary encoders: input channel, output, gain and volume. I chose encoders over potentiometers for one reason. The link to the mixer is one-way, so the controller never knows where the mixer’s faders really are. A potentiometer has a fixed physical position, and when it disagrees with the mixer you either get a sudden jump or a dead zone while it catches up. An encoder turns endlessly with no position of its own, so the firmware keeps the value, and the knob always starts from whatever the display shows.
I bought a 10-pack of Konohan EC11 encoders, which includes black knobs. They are the standard type, which have a push switch built into the shaft. The shaft bushing is M7, so the panel holes are about 7.4 mm. One of the push switches doubles as the per-channel mute.
The display: a small OLED
A small SSD1306 OLED shows the selected input and output and the current gain and volume. It talks over just two wires (I2C), and it is readable at a glance while you are watching the band. It also draws very little power, and the firmware dims it after 30 seconds and turns it off after 60 so it does not waste battery.
The display is the ELEGOO 0.96 inch OLED, which came as a small pack with jumper wires. At that size it is easy to read from arm’s length, and the panel window for it is 25 by 14 mm.
The mute button
I wanted one button that mutes the whole mixer, because that is where this project started. I looked at a latching switch and at a momentary button. I went with a momentary button, and the firmware keeps track of whether the mixer is muted. That way the button always does the same thing when pressed, and the display shows the state even if the switch itself would not.
The button is a 7 mm Gebildet momentary push button, and the panel hole for it is 7.2 mm. I also looked at a 12 mm latching button and at a slider switch for the mute function. The latching button found a better job as the power switch, where holding its own position is exactly what I want. A latching switch or a slider holds its own position, so it can disagree with the real state of the mixer, which is the same problem as the potentiometer. A momentary button never gets out of step, because the firmware owns the state and the display shows it.
Talking to the mixer: almost nothing
The receiver’s MIDI output needs very few parts. A MIDI connection is a current loop, so the receiver’s pin drives it through two 33 ohm resistors and a ground wire. I did not add an optocoupler, because that is only needed to protect something that receives MIDI, and this board only sends it.
For the MIDI connection I bought a 2-pack of Cable Matters 5-pin DIN MIDI cables. I am cutting one in half and soldering the wires straight onto the receiver board, so there is no socket to buy or fit, and the second cable is a spare. Wire colours on cables like this are not standardised, so I check which wire reaches pins 2, 4 and 5 of the plug with a continuity test instead of trusting the colours. The resistors for the MIDI current loop came from a LuminologyPro 1,000-piece resistor kit, which is far more resistors than this project needs but saves a trip for the next one.
Power
The handheld runs from the LiPo battery through an Adafruit bq25185 USB / DC / Solar Charger with 5V Boost board. One small board does three jobs: it charges the battery over USB-C, it steps the battery voltage up to the 5 V the ESP32 board wants, and it can run the load while the cable is plugged in. Its default charge current is 1 A, which is a 1C rate for a 1,000 mAh cell, and a jumper on the back drops it to 500 mA if I want to be gentler on the battery.
The boost converter is rated for steady loads, and the board’s documentation warns it can stall on sudden loads over about 200 mA. The ESP32 can briefly draw more than that when its radio transmits. So I am adding capacitors on the 5 V line right next to the ESP32 to soak up those spikes: a 470 µF, 16 V electrolytic as the main one, with a 10 µF and a 0.1 µF ceramic beside it. If the handheld still resets while sending, the next step is a 1,000 µF capacitor. I will report back on what it takes.
Between that board and the ESP32 there is a physical power switch: a Gebildet 12 mm prewired latching push button (SPST on/off). It is not connected to the firmware. It cuts the power completely, which is the most reliable way to turn off a battery-powered device. To stretch the battery, the radio is only on for about two seconds after something changes, and the processor runs at 80 MHz instead of full speed.
The battery is a Meshnology 3.7 V 1,000 mAh single-cell LiPo (size 102050) with a protection board built in. It came in a pack of four with a USB charging cable. A protection board matters on a handheld device that sits in a bag, because it guards against over-discharge and short circuits.
The enclosure
The front panel is 3D printed, with guides around the knobs and a window for the display. The circuit board is not mounted on the panel. The encoders, button and display connect to it with wires, so the panel can stay thin.
Bill of materials: one set
A set is one handheld controller plus one receiver that plugs into the mixer. Here is everything in it.
| Part | Qty | Goes in |
|---|---|---|
| ELEGOO ESP-WROOM-32 dev board | 2 | Handheld and receiver |
| ELEGOO 0.96 inch OLED (SSD1306) | 1 | Handheld |
| Konohan EC11 rotary encoder, with knob | 4 | Handheld |
| Gebildet 7 mm momentary push button | 1 | Handheld (master mute) |
| Meshnology 3.7 V 1,000 mAh LiPo (102050), with protection board | 1 | Handheld |
| Adafruit bq25185 USB / DC / Solar Charger with 5V Boost | 1 | Handheld |
| Gebildet 12 mm prewired latching push button, SPST on/off (power switch) | 1 | Handheld |
| Electrolytic capacitor, 470 µF, 16 V (1,000 µF as fallback), next to the ESP32 | 1 | Handheld |
| Ceramic capacitors, 10 µF and 0.1 µF, next to the ESP32 | 2 | Handheld |
| Cable Matters 5-pin DIN MIDI cable (cut and soldered) | 1 | Receiver |
| 33 ohm resistor | 2 | Receiver |
| Hookup wire and solder | as needed | Both |
| 3D-printed front panel and enclosure | 1 | Handheld |
Buying in packs
Most of these parts only come in packs, which is why I ended up with spares. A 10-pack of encoders covers two handhelds with two left over, and the 12-pack of power switches covers a lot more handhelds than I will ever build. The LiPo batteries came four to a pack, and the MIDI cables two to a pack, so a second set only needs a few extra parts. The capacitors came as two assortment kits, one of ceramics and one of electrolytics, with far more values than I need. The resistor kit has 1,000 resistors, far more than the two I need, but it will cover whatever I build next.
How the receiver is powered
For now the receiver runs from USB-C power, which is the simplest way to get it working. Later I plan to run it from a battery too, so the whole system has no cables except the one MIDI lead into the mixer. That will need its own charger and boost board, and I may reuse the same design as the handheld.
Not in the list
A few things are not on the list because they depend on what is in the drawer: a soldering iron, a multimeter for continuity checks on the MIDI cable, and a computer with the Arduino tools to program the boards.
Next up: the firmware and how the handheld decides what to send.
