Recently, after wrapping my head around X-Plane’s plugin API, I embarked on my first journey into the Arduino Uno. The Arduino Uno is a USB-based microcontroller board with 14 digital IO pins, and 6 analog inputs. On Windows, the Arudino board uses standard USB COM drivers, so no need to fiddle with driver installation. On my computer, the Arduino uses COM11.
As you can see, I wasn’t going for aesthetics. The switch box serves as a functional proof of concept, and opens the door for future projects.
Arduino Uno and Other Hardware
Although I could have undoubtedly purchased lower cost parts on the internet, I decided to grab them from my local Radio Shack:
- (1) Arduino Uno
- (1) 8x6x3 project box
- (1) Modular IC breadboard socket
- (2) Solderless breadboard wire kit
- (1) 3-pack 75′ #22 strand wire (red, black, green)
- (1) PCB standoffs
- (8) SPST High-Current Mini-Toggle Switch
- (4) 3-Amp Soft Touch Momentary Switch
- (1) 5-pack 10K ohm, 1/4 watt resistors
- (2) 5-pack 560 ohm, 1/2 watt resistors
The Arduino Uno board:
The breadboard and microcontroller side-by-side:
As you can see, it can get a bit crowded, so organization is key. I used the following system of organization:
- Red – 5V power
- Black – Ground
- Green – Digital IO pin
- Orange/Blue – Jumpers
Integration with X-Plane 10
I used two external libraries to integrate Arduino with X-Plane 10. PythonInterface allows programmers to avoid having to compile C++ code, which makes debugging MUCH easier. pySerial provides an interface between Python and serial communication devices, and has a very small learning curve.
In case anyone is interested in starting an Arduino/X-Plane project, I posted all my code on GitHub. I will keep the plugin free and open source, and likely continue to improve it as long as I am using Arduino. I still have some refactoring I want to do, so keep that in mind as you look at the code!
Well, that’s all for now. I hope this has been somewhat interesting. I’m open to questions, comments, and suggestions. This is a learning process, and there’s always room for improvement.