MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

Posts: 1
Hi everyone,

I need some guidance for my project, I am building an A320 home cockpit simulator. About my programming skills, intermediate level. Some years ago, I worked with opencockpits IO Cards, building a 737 sim, but not with Arduino yet.

The reason for this post is to approach to the numbers/types of boards that I'll need for this project, and have an idea about the budget. I read about Mega 2560 + Multiplexers, but maybe price isn't friendly. The idea is to minimize the numbers of boards, prevent crazy wiring, be efficient at the end. I'll list numbers of switches, LEDs, encoders, and displays I am planning to use:

270 LEDs
14 Rotary switches (60 inputs)
220 Pushbuttons
7 MAX7219 *8 digits
9 MAX7219 *4 digits
15 On-off-on
10 On-off
15 Encoders
10 Pots 10k

I knew about expanders, clones, drivers, addressable LEDs, daisychain, etc. But in the end, I am thinking to work with MobiFlight, so I 'd like to know what is compatible and not.
Thanks in advance
2019-10-11 13:25
From: NW of KPWK, United States
Posts: 1482
You can have 50 functions per board.
The LEDs and Pushbuttons sum up to 490. That’s basically 10 Megas right there.

You need 2 pins for a max7219 chain with up to 8 chips in sequence. The 10 unused pins on the 10th Mega can be used to drive those.

The other input devices sum up to 100 (no potentiometer support right now), that’s 2 Megas.

That’s theoretically 12 Megas with virtually all pins used, so you’d better plan with 2-3 extra Megas for better distribution of the boards in your cockpit to allow for shorter wiring and better separation of concerns (like OVHD panel has all Boards it needs to work completely, pedestal has its boards, MCP etc..)

I hope that helps.
Have a great day!

MobiFlight - Simply build your own home cockpit for your favorite flight sim - MSFS2020, FSX, Prepar3D (FSUIPC), X-Plane (XPUIPC)
2019-10-11 14:47
From: ETSI, Germany
Posts: 6007

Welcome to Mobiflight

At first congratulations !! You are a guy who think first before get the Chainsaw in his hands :thumbup:
Most users simply start and not think about the result..... And then they have a big box with electircal trash that is not needed..... And a complete chaotic system.

Give you a hint is a bit difficult..... Cause 10 Users who reply here will give you 10 different recomendations ( everybody prefer a other "own" system)
So i will tell you "my idea" ..... No garantee if its perfect. Thats your work to think about it finaly.


Basic strategie.

1. ALL is possible what your request..... WITHOUT the 10k Pots. ..... Mobiflight not support potentiometers.... Not now and also not in the near future.
Here you can work with a self Build Arduino System ( a sketch will change a Arduino Micro or Leonardo to a Joystick HID Controller)
OR you buy a expensive but perefctly designed "Leo Bodnar" Board..... Google for that. This is basicly like a Gamepad Controller.... Include analog Ports for Pots and also Digital Ports for Buttons ( and a special system for encoder, too)

So your first work is to define WHERE are the Potis in your cockpit..... And WHERE do you set this ArduinoHID or LeoBodnar Boards ( i think you need 2 Boards..... Check how many analog axis(pots) can be used..... Pretty sure not 10 at once) If your Potis are located completly on different spots you maby need more controllers..... Its not recommend to wire a Poti in Overhead with a 3 MEter cable to the controller nearby the Throttle.

THEN you "can" think about if you like to put some of your "pushbuttons" also on the free ports of this Boards .
I personaly would not do this.... Cause this "mix" the system. But if you like to save money for maby 1 Mega then you can do it.

2. Pins
Mobiflight is based on a DIRECT setting of devices. We not work with splitters, Matrix Systems, Adressable LED and so on. Maby this will come in future, but Sebastian thinks conservative like me..... So i think this will NOT come.
So the number of Pins can be calculated verry easy .....

270 LEDs = 270 Pins
14 Rotary switches (60 inputs) = 60 Pins
220 Pushbuttons = 220 Pins

7 MAX7219 *8 digits = Minimum 3 Pins .... I Recommend to plan with 9-12 Pins
9 MAX7219 *4 digits = Minimum 3-6 Pins .... I Recommend to plan with 6-12 Pins
Here question is also if you use PCB or Wires ..... Maby a perfect System simply use 16 Max7219 and each single means 3x16= 54 Pins

15 On-off-on = 30 Pins
10 On-off = 10 Pins
( For a better "Sync" System you can think about using ON-ON and ON-ON-ON switches instead... Then number of Pins increase to 45 and 20

15 Encoders = 30 Pins
10 Pots 10k = NO PINS ( Other Board System as talked above)

A Minimum from nearly 630 Pins ..... Or a Maximum of naerly 700 Pins


3. Number of Megas.
Here its difficult to give a awnser without see the complete system. Basicly a Mega can be calculated with 50 Pins (theroetical 51 but lets say 50)
So 700/50 = 14 Megas.
This wont work..... Cause for example if your Overhead have 1 Pin empty you can not wire a LED from Pedestal to it ( 2 Meters of Cable) .... So your Overhead got 1 empty and your pedestal need one more. Or you need a Diplay on a Board where only 2 Pins are left but you need 3.

So you should think a bit more conservative...... Lets count with 40 Pins..... Then 700/40 = ~~~ 19 Boards. Then every Board got theoretical 10 Pins Empty and allow you more flexibility.

4. Electrical splitting.
A Mega have a limit of Power ( 800mA by Mega..... 500mA mostly with USB Power)
So its usefull to split the devices ( also to save Processor power of ATMega Chips) in a good logic.
For example not set 8 Displays to one Mega..... If 4 Megas are nearby then set 4x2 ... So chains are shorter and each processor must calculate only 2 Displays...... Not one must calculate data from 8 Displays.
Same with LED..... A Switch need no power.... A LED need it. So its recommend to put not 40 LED to "Board a" and 40 Buttons to "Board b" Split them 20/20 on each Board.
( This means.... If you have a Element with lots of LED and now buttons then its maby usefull to use 2 Megas with only 20 Pins used each.... Cause 1 Mega with 40 LED is maby overpowerd ..... Thats why its difficult to count needed Megas without a Full Plan of each Device and location)

5. Tidy System.
I Personaly recommend to split the different elements.... And also split parts of a element.
For eaxmpel the Pedestal can be split in 3 Parts (Boeing) .... So build every part single with a own Arduino. Whatever you need 5 Pins more in the Middle part and you have 5 empty in the left part.... NOT use them.... Simply add another Mega in the Middle.
Target is to have less wires as possible.... No crossing of elements.... And a clear logic that Arduino X is Element X.... Arduino Y is element Y and so on.
I personal say..... "Using 5 More (unneeded) megas is no problem..... But Have a chaotic system is bad"



1. Check the solution for the Potis and think if you like to include other stuff on that boards.

2. Make a plan for the single elements ( for example number of LED, Buttons etc for Overhead ONLY )..... And Calculate how many Megas you need THERE.
Finaly count all Element Megas together and you know what you need.

3. On a short overview i would say you should plan with 17-21 Megas.... That give you a perfect fexibility and lots of posibilitys to split things logical and electrical perfect.
But maby you see after plan the single elements you can do it already with 15 Megas or you maby need 25 . Simply check the single elements..... Then you will see

4. Think conservative...... A Mega is cheap. Its better to use 5 more as get in trouble on final build..... Cause then you need lots of hours to change locig and rewire. So not care about 200-300 empty Pins in the whole system.... Thats better as 1 Pin that is not existing finaly cause you save 10$ for a board.

Hope this information helps. If you have another questions simply ask !
Good Luck !
2019-10-11 15:08