Ryan Kalagin

Mini HOTAS: the world’s smallest flight controller

The world's smallest HOTAS for flight simulators? It started as hand-wired Arduino builds at home. Now it’s moving to its first custom circuit board, built around Raspberry Pi’s RP2040 chip.

By Ryan Kalagin, V1 PCB underway

Revision 9 of the Mini HOTAS: a small grey box with two red throttle levers on the left, a dark fighter-style grip in the middle of a grid of white keys and a red rudder cap on the front face.
Revision 9, rendered from the CAD model with the real circuit board, sliders and stick in place.
Status
V1 PCB designed and ordered. The first two assembled prototypes arrive soon
Size
80 × 75 × 22 mm, smaller than a drinks coaster
Controls
A hall-effect stick with a push click, two throttles, a rudder slider and 20 keys
Electronics
One custom circuit board built around a Raspberry Pi RP2040. JLCPCB solders every part on, the stick and sliders included
Firmware
Written in C. It shows up on a PC as a normal game controller and updates by dragging one file onto it

Where it started

I had been building small flight controllers at home on Arduino for a while, with potentiometers and buttons wired into compact boxes. Every one taught me the same thing: a controller can be really small and still be properly usable. In DCS most modern jets do a lot of the work themselves, so you don’t need a desk full of hardware to fly them well. You need a stick, throttles and a rudder close to hand and plenty of buttons.

That’s the idea behind Mini HOTAS. A proper HOTAS, made as small as it can possibly be.

From a yoke to a stick

Over the years I’ve experimented with all sorts of layouts using different types of potentiometers, from airliner and Cessna-style yokes to joysticks. The first Mini HOTAS designs were a tiny yoke. Over four versions it grew shafts, sleeves, a toothed rack and gears and drifted a long way from the simple thing I had in mind. So I scrapped it and redesigned it around a hall-effect thumbstick. Hall sensors read the stick with magnets instead of rubbing contacts, so it doesn’t drift as it wears.

Version 5 was a 3D-printed box 110 mm square. It had a fighter-style grip on the stick, two throttles side by side, a rudder slider on the front for the left thumb and 27 buttons and toggles. It had no screws at all. The switches were held by their own nuts and everything else clicked into place on printed spring fingers. An Arduino Pro Micro ran it, with a button expander chip and a lot of hand wiring.

Version 5 of the Mini HOTAS from the front left, showing the throttles, rudder slider, buttons and stick.
Top view of version 5 with the lid made see-through, showing the layout of every control and board.
The 110 mm version 5 box from the front and from above with the lid made see-through.

Shrinking it

Version 5 worked, but 110 mm still wasn’t small. For version 6 I rethought the layout rather than just squeezing parts closer together and got the box down to 65 × 73 × 22 mm. I cut the buttons down to the 13 that matter most. The throttles stayed on the left, the stick and keys moved to the right and the Pro Micro went under the throttles with its USB-C socket flush with the back wall. The lid is held by one screw from underneath. On the test prints the sliders, the stick and the button supports all fitted with no play. Only the Pro Micro mount needed another go.

That box proved the size. I wired one up by hand and it worked, but it also showed me the next problem: far too many solder joints. Around 40 wires soldered at both ends is fine for one prototype. It’s slow though, easy to get wrong and impossible to repeat consistently. Anyone can hand-wire one controller. A circuit board is what lets you build them quickly and consistently, in numbers. So the next step was moving from hand soldering to PCB prototypes.

From hand wiring to one circuit board

Each revision from there took more hand work out of the build.

Revision 5 swapped the Pro Micro and its loose wires for three small boards. The main board carried an ATmega32U4 chip and came assembled from JLCPCB. Two switch boards held the keys, with seven plug-in cables joining it all up.

Revision 6 put everything on one board, with all 12 key switches soldered at the factory. That took the soldering at home from about 76 joints down to 14.

Revision 7 put the hall stick itself on the board, using a stick module JLCPCB can fit. That got rid of another cable and five more joints.

Revision 8 moved the three slide potentiometers onto the board too. No cables left and nothing to solder at home.

Inside revision 5: three green boards joined by cables, with the slide potentiometers in yellow.
Revision 5: three boards and seven cables.
Inside revision 6: one board carrying twelve key switches, with a separate stick module behind them.
Revision 6: one board with the keys soldered on.
Inside revision 7: the hall stick now sits directly on the main board behind the keys.
Revision 7: the stick on the board.
Inside revision 9: one board carrying the sliders, the stick and twenty keys, with no cables.
Revisions 8 and 9: the sliders too, so no cables at all.

I actually ordered revision 7, then cancelled it while it was still in review. Looking at it again, I didn’t want to carry the Arduino chip into a product just because the prototype had started with it. Before spending money on boards I wanted the electronics picked for production, not inherited from the bench.

Choosing the chip

The ATmega32U4 is the chip in the Arduino Leonardo and the Pro Micro, so it was the obvious place to start. It talks USB directly, which means a PC sees it as a game controller without any extra parts. For the production board I looked again and moved to Raspberry Pi’s RP2040.

It costs a fraction of the price, even with the flash memory chip and crystal it needs. Its analogue inputs are 12-bit instead of 10-bit, so the stick and sliders are read in finer steps. Its USB loader is built in, so a new board plugs in as a USB drive and you just drag the firmware file onto it. The ATmega boards needed a bootloader put on with a separate programmer first. With the RP2040 customers can update the firmware themselves too. And two cores at 133 MHz leave plenty of headroom.

It did bring a few things to design around. The RP2040 keeps its program on a separate flash chip and needs a 12 MHz crystal, so both sit right next to it. It also only has four analogue inputs and the controller has five axes. Rather than move to a bigger chip, I added a tiny analogue switch so the two throttles share one input. The firmware flips between them and reads each throttle in turn.

Revision 9: twenty keys round a centred stick

Revision 8 had the stick at the back right with 12 keys in front of it. It worked but looked unbalanced. DCS also uses a lot of buttons. For revision 9 I centred the stick front to back on the right-hand side and put 20 keys around it: eight in front, eight behind and four down the right. The box is about 14 mm wider than before to fit the extra column of keys and the room the chip needs to route its signals out. It’s no deeper or taller.

Twenty keys on their own pins would use up most of the chip. So they’re wired as a grid of four rows and five columns with a diode on every key. The firmware pulls one row low at a time and reads the columns, which means the 20 keys and the stick click only need 10 of the chip’s pins. The diodes stop ghost presses (where holding three keys makes a fourth look pressed) so any combination of keys reads correctly.

Revision 9 with the lid off: one green board in the printed tub carrying the slide potentiometers, the stick module and twenty switches with their key caps.
The revision 9 circuit board on its own, with the three slide potentiometers along its edges, the stick module and twenty switches.
Inside revision 9: one board and no cables. On the right, the board on its own as it will arrive from JLCPCB.

The stick now gets its full 30 degrees of travel each way, stopped by the stick module itself and not the lid. To make that work the grip has a slim neck where it passes through the lid and between the key caps, then widens out into a normal grip above. The hole in the lid is a cone that follows the neck at full tilt with just under half a millimetre to spare.

Close-up of the grip tilted to its full 30 degrees towards the nearest keys, clearing the lid opening and the key caps.
Cross-section through the stick and its nearest key at full tilt, showing the slim neck clearing the lid and the key cap.
The stick at its full 30 degrees towards its nearest key. On the right, a cut through the same position.

Designing the board with margin

JLCPCB publishes the smallest gaps and features it can make. You can design right up to those limits. But every one of them is a spot where a slightly over-etched track, a bit of stray solder or a part that shifts can cause a short or a fault that comes and goes. I want to build this in volume, so I set my own rules with some margin on each one:

Signal gap
0.2 mm between copper on different signals. JLCPCB can do 0.127 mm
Tracks
0.15 mm for the chip’s signal lines so they fit out between its pins. 0.2 mm or wider for everything else
Vias
0.4 mm holes, kept at least 0.25 mm from any other copper. JLCPCB can drill 0.3 mm
Between parts
At least 0.5 mm between the pads of neighbouring parts, so solder can’t bridge between them during assembly
Board edge
No tracks or vias within 0.75 mm of the edge
Under the chip
Nothing routed under the RP2040 apart from its own ground and core supply

The trickiest part of the layout is getting the signals out of the RP2040. Its pins are only 0.4 mm apart, so tracks that leave neighbouring pins side by side and then turn together would squeeze to under 0.2 mm at the bend. I laid the tracks leaving the chip’s busy right-hand side by hand, with each one turning a step after its neighbour so the gap holds all the way out. The rest of the board was routed automatically to the same rules and then checked.

Close-up of the circuit board copper around the square RP2040 chip, with tracks leaving its right-hand side in a staggered fan.
Around the RP2040. Each track leaving its right-hand side turns a step after its neighbour so the 0.2 mm gap never closes up. Top copper is gold and bottom copper is blue.

The rest is good practice for a USB device. The crystal and the flash chip sit close to the RP2040 and its power pins have decoupling capacitors right beside them. The USB data lines go through a protection chip just behind the socket and a resettable fuse protects the 5 V supply. Each axis has a small capacitor to filter out noise. Both sides of the board have a ground pour, stitched together with vias.

The whole revision 9 circuit board drawn in gold and blue, showing every track, pad and via.
The whole board with the ground pour hidden so the tracks show. The chip and its support parts sit in the narrow strip between the sliders on the left and the keys on the right.

Testing before ordering

A board you’ve paid for can’t be fixed with a software update. So before ordering, the first job was to decide what actually needed testing. I wrote down everything that could realistically go wrong with this board and how I’d catch each one on screen before it became a real problem:

  1. Nothing should short or bridge. I set my own spacing rules in KiCad and ran its Design Rules Checker until it came back with no errors.
  2. Every connection should be where the firmware expects it. A mixed-up pin is the classic first-board mistake, so I put together a Python script for this with a bit of help from AI. There’s more on how it works below.
  3. Every part should go on the right way round. I went through JLCPCB’s placement preview part by part, checking the pin 1 marker on every chip and the marking on every diode.
  4. Everything should fit and move freely. In CAD I tilted the stick to its stop all the way round to make sure the grip clears the lid and the keys. I also dropped each part into the box in the order I’d assemble it.
  5. The keys should read properly. I ran the key-reading code on my PC against a simulated keypad and pressed combinations of keys to make sure no ghost presses show up.

The script is less mysterious than it sounds. KiCad comes with its own copy of Python and a library called pcbnew, which can open a board file and list every part, pad, track and connection on it exactly as KiCad sees them. The firmware keeps all its pin assignments in one small file called board_pins.h. The script reads that as plain text. It then goes through each pin the firmware uses and checks it lands on the right chip pin, the right signal and the right part, with every key’s diode pointing the right way. It also measures every gap on the board against my spacing rules.

On Windows I run it from the KiCad Command Prompt that installs with KiCad, so the right version of Python is already set up. Each check prints ok or FAIL. Nothing gets ordered unless the last line says everything passed. Here’s a run cut down to a few lines:

$ python3 verify_pcb_r9.py
== firmware pin table -> board ==
  [ok ] row lines GPIO [16, 17, 20, 21] -> nets MR1 MR2 MR3 MR4
  [ok ] column lines GPIO [22, 23, 24, 25, 19] -> nets MC1 MC2 MC3 MC4 MC5
  [ok ] K1: column MC1 -> switch -> diode D1 -> row MR1
  [ok ] K2: column MC2 -> switch -> diode D2 -> row MR1
  ...
  [ok ] every diode points from the key to its row line
== spacing rules, measured on the finished copper ==
  [ok ] every gap between different signals is at least 0.2 mm (closest 0.200 mm)
  [ok ] every pad at least 0.5 mm from another part’s pad (closest 0.519 mm)
  ...
ALL 103 CHECKS PASSED
JLCPCB placement preview around the USB-C socket, flash chip and RP2040, with pink dots marking pin 1 on each chip.
JLCPCB placement preview next to the stick, showing three key diodes with pink markings for their direction.
Checking JLCPCB’s preview by eye. The pink dots should sit on each chip’s pin 1 corner and every diode’s marking should face the same way as on the board.

If you design your own boards, my one tip is to put your own clearances into KiCad before you route anything, under File > Board Setup > Design Rules, rather than the manufacturer’s minimums. The Design Rules Checker under Inspect then holds you to them every time you run it. I also got into the habit of hovering over a track and pressing the backtick key (`) to light up the whole connection. It’s the quickest way I know to follow a signal from the chip to the part it’s meant to reach.

Ordering the prototypes

Revision 9 became my V1 PCB, the first one I’ve actually had made. It went to JLCPCB as manufacturing files, a parts list and a placement file with the position and rotation of every part. Getting a part’s rotation wrong is one of the most common assembly mistakes, so I matched every rotation to the footprint JLCPCB’s own machines use. I went for a lead-free finish and covered vias. I also paid for their engineers to review the production files and the part placement before anything gets made, which is worth it on the first run of a new board.

JLCPCB's placement preview of the board from above, with every part labelled.
JLCPCB's preview of the underside of the board, with the key numbers K1 to K20 and the board name printed on it.
JLCPCB’s placement preview from above and the underside with the key numbers.
3D preview close-up of the stick module in the middle of the key switches, with the RP2040 and crystal beside it.
3D preview close-up of the USB-C end of the board with the RP2040, flash chip and protection chip.
Close-ups from the 3D preview. Left: the stick among the keys with the chip beside it. Right: the USB-C end of the board.

Every part comes soldered on, including the sliders, the stick and the switches. I ordered five boards with two of them fully assembled. A first run like this is about proving the design, not building stock. The cost per unit comes down a long way with volume once the design is proven.

Where it’s at now

My V1 PCBs are designed and ordered. The first two assembled boards should arrive very soon. When they do I’ll start with the basics. I’ll check the 3.3 V supply with my multimeter and make sure the board shows up on my PC as a USB drive. Then I’ll load the firmware and check Windows picks it up as a game controller.

After that I’ll go through every key on its own and in combinations, along with the stick click and all five axes. I’ll also run the calibration and make sure it remembers its settings after being unplugged. The last test is the one I’m most looking forward to: building it into the printed box and flying with it in DCS.

If everything works, I’ll move on to a bigger production run to bring the cost per unit right down. I’ll also register a USB product ID so it shows up on a PC as its own device. The goal is the same as it was with my first Arduino box: the smallest HOTAS you can buy.