top of page

Arduino Components

Switches & Buttons

Wiring And Basic Tutorial for Mobiflight & Prosim using Ardunio Mega

It's easy to connect a switch to your simulator, making it a great starting point and proof of concept for any enthusiast. The type of switch you choose doesn't matter, as a large toggle and tiny tactile switches will work with systems like Arduino, Mobiflight, and Prosim. In a 737, large toggle switches are used in many places, from overhead to MIP. Tactile switches, 12mm and 6mm are used in various panels, and those with LEDs are particularly helpful for illuminating buttons. Buying switches in bulk from China on eBay is an affordable option - even if you're not aiming to replicate a Boeing, you can still have up to 50 switches on each Arduino to customize as you please.

switches
LED TACTILE SW
LED Tactile Switch Green
c3423_large_miniature_spdt_toggle_switch
Mini Toggle Switch ON-OFF

Switch & Button - PIN LAYOUT

Toggle Switch Pin Description Layout

Each switch has at least two contacts or terminals. One of these is always the ground or common pin, which should be connected to the Arduino ground. If multiple buttons or switches are used, their grounds can be connected in a chain. The other pins in the diagram, labeled as PIN1 and PIN2, can be connected to any other pin on the Arduino Mega, from pins 2 to 53.

led tactile sw pinout

The diagram to the right shows how an LED tactile switch is wired.

Switch & Button - ON - OFF

Wiring a single ON-OFF Switch to Arduino

A basic ON-OFF switch typically has two pins and can come in either a latching or momentary button type. The pin assigned to the ground is not crucial for this switch type.

 

Once the wiring is complete, programming can be done using Mobiflight and Prosim. If assistance is needed, check out the YouTube video Helimech Episode 25 or visit the Button Programming page on this website. Although the Arduino Mega has 52 available pins, Mobiflight only allows for up to 50 switches due to a software restriction. The remaining two pins can be utilized for other devices such as LEDs, encoders, or servos.

Switch & Button - ON - OFF - ON

The ON-OFF-ON switch is similar to having two separate ON/OFF switches, but you can only select one of two states. Typically, there is a common pin in the middle that is used for grounding, while the other two pins connect to the Arduino Mega (Pins 2-53).

​

​

Wiring a ON-OFF-ON Switch to arduino

Switch & Button - 2 OR MORE SWITCHES

Wiring dual switches to an arduino

You can add up to 50 switches to the setup. For simplicity, I have only included two switches in the diagrams. However, the concept remains the same. The ground is connected in a daisy chain fashion to reduce the amount of wiring that needs to go back to the Arduino. With 52 wires, the wiring looms can become quite large.

​

​

Rotary Switches - 1 to 12 pins 

Rotary switch wiring is similar to the examples mentioned above. These switches come with up to 13 pins, but you may not need all of them. Typically, each rotary switch includes a locking collar that can be inserted into the front and has 11 positions to fit it. The number of positions/pins you want to use determines your choice. The locking collar prevents the knob from rotating to the full 12 positions if necessary. Wiring diagrams for all 12 positions, including a centre ground/common pin, are below. However, multiple rotary switches can quickly fill up an Arduino Mega board.

​

There are two main types of rotary switches used on the 737 Sim.

​

A 12 Position (45 Degree) single pole switch

​

An 8 Position (30 Degree) single pole switch

​

All these switches look very similar, but look for the single throw with a single pin in the middle and NOT 2 or 3 three!

Rotary switch
Rotary Close up
bottom of page