Skip to content

Tutorial Setting up 7 segment LED modules with SimConnect Events

Jaime Leon edited this page Nov 18, 2021 · 40 revisions

Setting up 7-Segment LED modules with Mobiflight and SimConnect Events

WORK IN PROGRESS - COME BACK LATER

The type of 7-segment LED modules supported in Mobiflight is the MAX7219 chip. MAX7219 is an integrated serial input/output common-cathode display driver that is very popular for arduino projects with each chip capable of driving up to eight digits. A commonly found package in all the online stores is the one using this chip with eight numeric display blocks. These complete modules are used often to display numeric information in simulator panels such as speed, or heading settings in an autopilot or the barometric pressure setting for the altimeter.

Here is a picture of these modules and a typical schematic diagram of how they are connected.

MAX7219 LED MODULE2

In addition to the power and ground wires, only three additional connections (DIN, CS and CLK) are needed to the Mobiflight board digital pins. If needed, several modules data lines can be connected in daisy chain. Because these modules contain a diode to protect the components from erroneously applying the power, the voltage drop introduced by these diodes makes daisy chaining the power connections beyond two or three boards difficult. Individual 5v wiring to each module is the recommended solution. Desoldering the diodes to eliminate the voltage drop is also an option, but more complicated. The data lines do not have this limitation.

Mobiflight can handle up to 8 modules in a daisy chain and up to 4 individual chains for a total capacity of 256 digits per Mega board. Electrically, each module may consume up to 120mA which means only up to about 4 modules can be powered from an Arduino Mega. Any number beyond will require an external 5v power supply.

The MAX7219 modules are connected to the Arduino Mega with only five wires as shown in the diagram below. The three digital pins in the board can be any pins. There is no special requirement for these pins. Make a note of which pins are connected to DIN, CS, and CLK in your LED module, as you will need this information later.

7 segment arduino connection

Create the LED module device in your board configuration

In the previous section, you completed the wiring of your 7-segment display to the Arduino Mega board. Now we will create the device configuration for the display in the board configuration. We assume that you have already uploaded the Mobiflight firmware to your board. If not, you need to complete this step before proceeding. If you don't know how to do this, please refer to the tutorial on how to upload the firmware.

Open Mobiflight Connector and go to the "Mobiflight Modules" window by pressing the button located in the main toolbar.

image

Mobiflight will display all Arduino boards connected to your PC (if more than one). Your board should be recognized by the application and included in the list of available boards with the blue Mobiflight logo icon. If the board is shown as unknown, you will probably need to upload the firmware and try again.

Select the correct board from the list by clicking on its icon. Press the "Add device" button at the bottom of the window. A drop down list will appear with all the device types. Select "LED 7-Segment".

image

A new device named "LedModule" will be added to the list of devices connected to your board and the device configuration window for the 7-Segment display will be shown on the right side of the window. Here you will enter the Arduino pin numbers where you connected the DIN, CS and CLK pins of your display module. The "Num" parameter is the number of LED modules connected in daisy chain to these pins. As mentioned earlier, you can daisy chain up to 8 modules and can have up to 8 separate chains. You can also change the device name if desired.

image

That's it for the device configuration. You should now upload the configuration to your board by pressing the upload button. This will take a few seconds and Mobiflight will confirm when the action is complete. It is a good idea to also save the configuration in a mfmc file by pressing the save button, in case something may happen to your Arduino board.

Setting up the 7-Segment Module to Display AP Heading and Altitude

Installation

User Interface

Examples and tutorials

MSFS2020

X-Plane

Workshops

Community Boards & Devices

Additional Information

Firmware

Clone this wiki locally