A few friends of mine asked me how to build something similar to my Control Boxes. Their problems is very simple: they have never done anything like that! Hence I decided to write this guide. I have only one problem: I have just finished my UFC/PRTz/PVI-800 Control Box and I don’t have the necessary material to build something new. Also, that project is quite complicated and definitely the best place to start. I will then follow the simplest plan: the mix of encoders and pushbuttons I have found and realized by copying this video. That video is decently detailed, has the full list of components required in the description and links to a supplier.
We will start by introducing the core or brain of every control box: the board. I usually use the Arduino Leonardo boards, which are based on the ATmega32U4 chip. You can find its datasheet here.
Arduino Leonardo is not the only Arduino board that supports HID (or Human Interface Device) but I really like it. Unfortunately I kinda sucks hardware-wise (at the end of the day, I’m a developer) so there might be more appropriate boards for this task but Leonardo is both cheap and easy to find so.. why not?
This is my reference sketch of the board:
If you are even a little familiar with basic electronics you must have already recognized GND and Vcc. If you haven’t, here are some Wiki page with some info about Ground and Vcc (don’t forget to donate to Wiki sometimes 🙂 ).
Without going too much into detail, RAW and RST are used by Arduino and are not available for our use. RST (RESET) is used, for instance, in order to program the board whereas RAW is the input voltage that runs into the regulator (again, let’s keep this simple, pretent it doesn’t exist for now). GND, Vcc and RAW hence are the so-called “power-related pins”.
TX and RX are a different story and can be used, same goes for all the numerically-identified pins. These are di digital pins. The four pins identified by An (so, A0 to A3) are the analog pins. Again, if you are not familiar with the concept (you should, think about your joystick for a moment and why you use it) have a look at these Wiki pages about Digital signals and Analog signals. TL;DR: digital values are sort of binaries, so they assume just two values. Analog instead can assume any number in a defined interval.
Let’s sum it up, shall we? Arduino Leonardo has:
- 6x power-related pins (3xGND, 1xVcc, 1xRAW, 1xRST) – we don’t need them now;
- 4x analog pins (A0→A3);
- 14x digital pins (well, everything else).
These info are necessary in order to proceed to the next step: planning.