top of page

Arduino Components

- LED's

Wiring And Basic Tutorial for Mobiflight & Prosim using Ardunio Mega

Connecting a LED in your simulator, is on of the most satisfying feelings you can achieve. That instant feedback! Being able to see the virtual cockpit indicator onscreen illuminate, and your LED in real life illuminate blew me away! This was the point I realised I could take the Sim to a whole new level. I started with the PMDG 737 parking brake. 

 

I have now moved on and use a literally hundreds of LEDS's in my 737 DIY SIM.

These come in various sizes and colours. You can get Bi and Tri Colour LEDS if require. Very handy for the AFDS lights where yellow and red are needed in a single bulb. 3 & 5mm LED’s are predominately used in my Sim.

 

For panel back-lighting I prefer warm white to cool white (that's the colour used in the real aircraft).

It's really just a matter of personal preference as bight white works much better.

 

Remember to always use a resistor with the LED from the Arduino board. Normally a 220 Ohm resistor is perfect for the 5v Arduino power.

wire colour

Actual aircraft wire is predominately white. Red and Blue are also used. 

I like to use different colours for different devices. 

Here, in these examples. I have used blue for switches, Black for ground.

Red for +5V, yellow for LED's and grey for Servo's etc.

wire colour

Actual aircraft wire is predominately white. Red and Blue are also used. 

I like to use different colours for different devices. 

Here, in these examples. I have used blue for switches, Black for ground.

Red for +5V, yellow for LED's and grey for Servo's etc.

wire colour

Actual aircraft wire is predominately white. Red and Blue are also used. 

I like to use different colours for different devices. 

Here, in these examples. I have used blue for switches, Black for ground.

Red for +5V, yellow for LED's and grey for Servo's etc.

5MM_LED_green_2019-Mar-17_02-35-20AM-000
red led tactile switch.png
led white.png
TACTILE_LED_SWITCH_12MM_GREEN_2019-Mar-1
led red.png

LED - Leg Layout

LED Leg Layout
5mm LED Description of parts

The first thing you need to know about Light Emitting Diodes (LED's) is that they are polarity sensitive.

There are two legs that extend from the LED body, these are called; Anode and Cathode. 

The cathode (-) must be connect to the ground of the Ardunio.

The anode (+) must be connected to pins 2-53 on the Arduino. 

To distinguish between the legs they have the following features:

The cathode leg is next to the side with the flat side on  the body. This leg is slighter shorter. The anode is the slightly longer leg.

RESISTORS - A MUST!

Resistors
220 Resistor.jpg

As mentioned before, you must use a resistor with most LED's. Unlike an LED,a resistor is not polarity sensitive and can be fitted in any direction. A general rule is to use a 220 Ohm resistor.

A normal LED operates between 2-3Vdc. The Arduino operates at 5V. The resistor limits the current supplied to LED. I have found you can get away with the odd mistake not connecting an LED to a resistor, but it wont last long.

The brightness can be set by using different value resistors. Sometimes, if flying at night, you might find that 220 Ohm resistors are still a little too bright. Especially if you purchase ultra bright clear LED's.

There are plenty of online resistance/LED calculators to help you find the right value.

The colour code of a 220 Ohm resistor is:

Red, Red, Brown and a gold tolerance band of (5%)

Single LED Wiring

LED - WIRING

Wiring an LED is simple, The Cathode (the shorter leg on the flat side) is connected to the Ardunio ground directly. It doesn't matter which wire the resistor goes on, but I prefer to keep them on the anode side which goes to the Ardunio pin (2-53). If you use one of the pins that are PWM, you can vary the brightness of the LED in the software (You must still use a resistor). 

How you attach the resistor is up to you. I usually solder the resistor inline or you can use a breakout board with resistors placed inline.

MobiFlight LED Wiring Single.jpg
MobiFlight Single LED Close up.jpg
MobiFlight Single Wiring Diagram.PNG
MobiFlight Single LED Wiring Diagram.PNG
MobiFlight Multiple LED.jpg
Mobiflight Multi LED Diagram.png

LED's - 2 OR MORE 

Up to 40 LED's can be added per board. Below, I have shown 5 LED's to help keep the diagrams simple. But the principle is the same. You can see how the ground is simply daisy chained. This is to keep the wiring back to the Arduino to a minimal amount. The looms already can get quite big in size with 52 wires.

MobiFlight LED Wiring Multi.PNG
MobiFlight Multi Wiring Diagram.PNG

Daisy Chained Grounds

There are only 3 or 4 grounds on the Arduino Mega to connect all your devices too.

Sometimes its easier to connect all the grounds in daisy chain configuration. Linking devices to one and another using a single ground back the Arduino Mega.

Another way would be to used a break out board with a common ground connected line.

But by daisy chaining grounds, the wiring loom can reduced drastically.

Wiring Multiple LED's
Wiring LED's & Switches

LED's & Switches - Multiple Devices 

Combining LED's & Switches is now about daisy chaining the grounds and sending all the wires back to the Arduino Pins. It doesn't matter which pins you use. 

Mobiflight Led & Switches Together.jpg
Mobiflight LED & Switches Close up.jpg
Mobiflight LED & Switches.PNG
Mobiflight LED & Switches Diagram.PNG
Seen an error?
Want something changed?
Need extra help?

Get In Touch>

bottom of page