This project is a full-scale cockpit simulator of twin-engine Beechcraft Baron 58. The goal was to make the panel as close as possible to the original in both functionality and appearance. There was no concern about durability for home cockpit, and such material as PVC and other plastic were used for most of the details. This panel is controlled by a single Arduino board.
Before building this panel I have had experience with Arduino and after several tests with X-Plane's UDP protocol we found out that it could be a good idea to create an input/output interface based on Arduno. Using just one Arduino board (with an "Ethernet Shield" for connection to LAN) and X-Plane built-in LAN protocol for data transfer it became possible to build a input-output system for the cockpit interface.
Arduino Mega was chosen to be used in the project, as this version of Arduino family has a large number of digital outputs/inputs.
First, we had to figure out how to get the necessary data from the simulator (and then how to send data back) using Arduino. With a few test programs the problem of data transfer between X-Plane and Arduino was quickly solved and the rest of the time was to debug the main program ( you can see some of the first programs in the code archive).
X-Plane has built-in capabilities for data exchange with other computers on the network using the Ethernet UDP protocol. The data format is quite simple, it is described, in particular, in the file "Sending Data to X-Plane.html", located in the /Instructions/ folder of the simulator.
For connecting Arduino to the local network additional "Ethernet Shield" was used. This board is mounted on top of the Arduino board and allows Arduino to communicate with other Ethernet devices using Ethernet library.
The simple way of I/O interface building is to use only one Arduino board, without using any other schematics or key-matrix, having about 50 digital inputs for buttons/toggles and encoders.
For this Baron-58 project, though, in addition to Arduino the data extention board for 128 inputs and a board with the registers for LED indicators (serial output from Arduino) were made.
A total of 128 digital inputs is used in this interface (including 19 encoders), organized in 8-bit data bus (16 ports x 8 bit), i.e. used only 8 digital inputs of Arduino, plus 4 outputs to address these 16 ports. For additional switches 10-12 more digital pins of Arduino were used.
See more in detail - 128 inputs extension for Arduino
For output to the LED indicators only two digital outputs of Arduino are used- one for data, one for strobe, i.e. output is organized in the form of three serial external shift/latch registers.
Seven Arduino outputs are used for servo gauges: Fuel, Bus Volts, Alt load, Prop Amps, De-Icing Pressure (Prop Amps and De-icing pressure show only two values - 0 when the corresponding switches are in the off position and nominal values when they are turned on.)
For the axes analog inputs of Arduino are used.
Block diagram of the simulator:
Main computer - Phenom II X4 965, 8GB memory, video-card GigaByte GeForce GTX 570 1280MB, OS - Linux Mint 10-17, 64-bit (linuxmint.com/)
(Why Linux? It is a separate issue, but, in short, I have long gone from Windows, and X-Plane fortunately is multi-platform, and, in my experience, in Linux it runs faster (in frames/sec).
This computer is "master", with X-Plane installed and used to provide the external view.
The Second computer is a motherboard with videocard and a small HDD, mounted inside the panel:
- AMD Sempron 150, 2900MHz/45Watt, 2GB memory, Video - GeForce GTS250/512M, OS - Linux Lubuntu 64-bit LXDE (lxde.org/)
Both the computers and Arduino are connected to the network via router.
The second (panel) computer has two LCD panels. Everything is set up so that you only need to press the power button - at startup the whole instrument panel is expanding to fit the work area of both LCD screens
For instruments we are now using our standalone program (SimVim Panel), that is receiving data via network and the whole system can consist of several instrument modules, using cheap old computers or laptops (no need of another copy of X-Plane and a powerful PC).
But initially (as a temporary solution) another copy of X-Plane was used for the instruments visualization, when the main computer sends data via UDP to the second one ("Menu: Net Connections-->External Visual" to display the instrument panel).
When I was planning this project, I downloaded a lot of photos of the Baron cockpit, and then I calculated all sizes in the graphic editor, drawing upon all the known dimensions, such as cutouts for 3 1/8" instruments and sizes of the GPS, ADF, etc.
So I got all the dimensions, which, I think, are very close to the original (+/- 1 cm at full width).
Total time spent on handwork only, from scratch to the "test flight" stage, was roughly 100 man-hours during one year period of building.
Photo of the panel in a test connection to X-Plane as of Nov. 2012.