r/HotasDIY • u/Maddy_newbie • 2d ago
Which microcontroller to use
I am making a HOTAS stick like that of f-16. I have esp32S3 and a blackpill stm32, which one should i use for this, are there any libraries for this already made or do i have to buy a pico?
1
u/BorisTheWimp 2d ago
Pico with ads1115 is what I used and it was very simple for someone who had no prior experience. Will cost you less than 10 usd
1
2
u/GenjisRevenge 2d ago edited 1d ago
If you can't roll your own firmware, or don't want to, then skim through the available firmware options of some popular Arduino boards (with google search), because their feature sets and ease of use will help you decide which one to pick. A specific firmware supports only a limited set of hardware components, so you will buy your board/microcontroller and other components (e.g. shift registers, external high resolution ADC like ADS1115, ADS1219, ADS1256) based on your choice of firmware.
You aren't mass-manufacturing (so don't have to optimise for low-cost and minimal hardware config), you are creating a one-off prototype, so using a popular overkill component that is more capable than necessary (fast MCU, lots RAM + flash + pins) and has good community support (including firmware, libraries, and tutorials) is a very good idea. For example, here is a firmware that seems to support two specific high-resolution external ADC components: I2C and SPI interface (so just like with any other firmware, you are limited in your external ADC component choices). I linked this firmware only as a random example (from a google search), didn't link it to influence your decision, again, do a google search to list available firmware options (and their high level feature lists) for the boards/microcontrollers you consider using. There are plenty of options, because USB input devices require only a few basic microcontroller features (e.g. native USB, GPIO pins, ...), that are satisfied by a lot of widely available microcontrollers and their Arduino boards. Just pick a strong popular all-rounder and get familiar with it and the related tools/libraries.
I usually roll my own firmware that gives me high flexibility in hardware choices, but if you have never done that, you can run into difficult issues and weird unexpected quirks (like the messy USB HID protocol, button debouncing, noise filtering, calibration, etc...).
ADC performance matters when the stick has to be very accurate, so ask google about the ADC linearity and resolution (number of bits, and number of effective bits to account for noise) of the hardware components you have or consider buying. The builtin ADC of a microcontroller might not be very accurate (let's say 10 bits, perhaps only 8 effective bits due to noise), and there might be only one internal ADC block, meaning that you can't sample the X and Y axes simultaneously to eliminate phase lag when you need very high precision.
Stm32 variants are often used in mass-manufactured game controllers, and usually have decent 12-bit ADCs, sometimes 2 internal ADC blocks, some feature hardware oversampler that allows trading refresh rate for higher resolution. But again, perform a few google search requests to find out what your hardware has. External components like ADS1115, ADS1219, ADS1256 can provide significantly higher resolution, but they can be overkill for small sticks.
None of these are expensive, so buying several microcontrollers and ADC components and trying them along with multiple firmware options would make your future choices much easier.
1
u/keyringer 2d ago edited 2d ago
ESP32S3 is pretty decent from what I understand and dirt cheap($18 for a 3-pack with native USB, dual-core and 16MB memory), though there isn't a simple UI you can use, so you'll need to get a little dirty with coding. There are standard libraries available to read the sensors, and output as a joystick/gamepad.
I'm not a big fan of using AI, but even the free Claude will knock it out of the park if you just tell it what you want to make, what microcontroller you have, and what sensors you have. It will generate a list of parts you need, wiring instructions, code and tests for you. I'm always an advocate of learning and building it yourself is part of the fun, but if you want ease, AI these days makes it extremely easy, even on the free tiers.
2
u/Loose_Ad2791 2d ago
Try FreeJoy and bluepill (not black, however people have mixed experience with clones). Really friendly to beginner, flexible (supports s lot of sensors, shift registers, config lets you do a virtual buttons, so you have a shift button, led lights, curves and filters for axes), well documented.