Introduction: How to Program LEDs

LEDs are extremely useful when put on quadcopters because they can help with identification and orientation, meaning you'll be able to see your quad better in the air and you will be able to tell which direction it is facing. They can also be programmed to change colour based on the different inputs received from the radio. For example, you can set the LEDs to show green when disarmed and red when armed. Or you can fade from one colour to another depending on how much throttle is applied. You can also assign indicator lights, where 2 LEDs on either side, blink depending on which direction the quadcopter is rolling, just like a regular car when it is turning either left or right.

This instructable shows you how you can individually address LEDs on an LED strip and how to connect it to your quadcopter.

Step 1: The Software

The LEDs receive the signal from the flight controller and are therefore programmed through the flight controller. As long as your flight controller supports LEDs, you can program it through the software used to adjust the flight controller settings.

(Shameless plug incoming) If you don't know what a Flight Controller is, you can visit the other instructable I made, where I explain how all the components in a quadcopter work and how to build your very own. But to save you the time, a Flight Controller simply takes the signal received from the radio/remote control and sends it to the motors which individually spin up and down depending on the direction you told it to go with the radio.

The flight controller that I use is the Naze32 which uses CleanFlight. CleanFlight provides a very simple and easy tool for individually addressing the LEDs while also allowing awesome features such as the ability for the colours to change based on the amount of throttle input and other parameters.

Once you've downloaded the software, you can then connect your flight controller to the computer.

Step 2: Connecting the Flight Controller to the Computer

Some flight controllers come with the older miniUSB ports while some come with the newer microUSB ports. Grab the correct cable for your flight controller and plug it into the USB port.

Step 3: Getting Into the Software

If you're connecting the Flight Controller to the computer for the first time, you'll need to wait for your computer to automatically download the correct drivers. Once it is installed and you have the correct COM port selected (fig.1), click on 'connect' (fig.2), which will take you into the software where you can adjust all the different settings (fig.3).

There are many tabs to choose from on the left. We're only interested in the 'Configuration' tab and the 'LED Strip'' tab.

Click on the configuration tab and scroll down, right to the bottom, where you'll see a list of options. Halfway down the list, you have the option to enable LEDs under 'LED_Strip'. Click on that and it should turn green (fig.4).

Next, you can go straight into the LED Strip tab where you'll be greeted with the LED programmer (fig.5).

Step 4: Activate 'Wire Ordering Mode'

Click on 'Wire Ordering Mode'. This will allow you to assign the LED sequence. Your LED doesn't have to be the same order as mine. It could also be a ring or a board. All you have to do is copy the shape/order of the LEDs. Mine was a basic straight line with 8 LEDs so I will select 8 LEDs in order, going from left to right.

The shape of the LED doesn't matter either, what matters is the way the LEDs were wired. You could have an LED board in a square shape, consisting of 9 LEDs and you could select 9 LEDs in a straight line and it would work because CleanFlight has no way of telling what the shape is, therefore creating the same shape in CleanFlight is only to make it easier to understand how the colours will be assigned to the individual LEDs.

Step 5: Assigning the Colours

Click on LED 0, click on 'Color', then click on the 2 on the right side where the coloured boxes are. This means that the first LED will light up red.

Repeat this process for all 8 LEDs, assigning each with its own colour.

Below I've listed the colour that each LED should be assigned to. If you hover the mouse over any of the colours, its name will appear.

LED 0 = 2 (Red) (fig.1)

LED 1 = 3 (Orange) (fig.2)

LED 2 = 4 (Yellow) (fig.3)

LED 3 = 5 (Lime Green) (fig.4)

LED 4 = 6 (Green) (fig.5)

LED 5 = 9 (Light Blue) (fig.6)

LED 6 = 10 (Blue) (fig.7)

LED 7 = 11 (Dark Violet) (fig.8)

When you're done, hit 'Disconnect' and unplug the USB from the flight controller.

Step 6: Connecting It to Your Quadcopter

Once you've programmed the LED strip, you are ready to attach it to your quad. On the Naze32, you can connect the power wires (red and black) to one of the spare ESC/motor pins. The signal wire (white) connects to 'LED/5'.

You can choose to place the LED strip wherever you want. I placed mine on the bottom of the arms but you can also attach it to the back so that it acts as a set of tail lights.

If you have any questions, post them in the comments below. I'd be glad to answer them :)

Comments

author
fighteren (author)2016-08-17

Very useful gadget for my project. I'm building a quadcopter and I want to fly with it in the night were the light comes to it's right.

Thums up and keep up the good Work and pls. give us some more gadgets for quadcopter.

I just love it.

Have a nice day.

author
Prowlr (author)fighteren2016-08-18

Glad you found it helpful.

author
makeosaurus (author)2016-07-05

That is definitely a neopixel stick from adafruit! I have one in front of me!

author
Prowlr (author)makeosaurus2016-07-05

I wish! I wanted to buy the neopixels but they were too expensive so I bought these Matek LED strips instead :)

author
grayl (author)2016-07-03

Which LED strip are we talking about here?

author
Prowlr (author)grayl2016-07-03

These are the Matek LED strips, but the process is the same with all LEDs, no matter which brand.

About This Instructable

5,380views

144favorites

License:

Bio: I'm 20 years old, I study physics at university and I love science, building and flying drones and calisthenics.
More by Prowlr:How to Program LEDsThe Ultimate Guide to Drones
Add instructable to: