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.

LED - Leg Layout

 

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!

 

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%)

 

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.

LED's - 2 OR MORE 

Up to 50 switches can then be added. I have shown only two switches 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.

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.

 
 

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. 

Seen an error?
Want something changed?
Need extra help?

Get In Touch>

+673 7207616

Fancy helping the website

or buying us a thank you beer?