Introduction
The LED Controller (LC) for quadcopters controls up to 4 high-power LEDs that can be attached to the quadcopter and can be used to make it visible in the dark and/or indicate the status and condition of the quadcopter.
The LC supports multiple configurations of LEDs as described below. It allows the operator to select configurations via the remote control over a dedicated channel.
The blinking interval (the length of time that the LEDs are on or off) can be set by a potentiometer.
The LC may include an optional 7-segment display that shows the LC state.
Hardware
The LC consists of the following HW components:
Component | Purpose |
PIC16F1825 | Application processor – runs the main LC application |
PIC16F1826 | Optional 7-segment display controller |
7-segment display | Optional. Displays:
|
10K Potentiometer | Defines the “blink interval” the amount of time a LED stays on when blinking |
Push button – SPST | Forces the LC into settings mode |
4 Transistors | For switching current to the LEDs. One for each LED. |
4 High power LEDs |
LED Configurations
The LC supports the following configurations:
ID | Name | Description |
1 | All off | All LEDs are off |
2 | All on | All LEDs stay on permanently |
3 | All blinking – 1 – High intensity | All LEDs blinking in a fixed rate – on and off |
4 | All blinking – 1 – Low intensity | All LEDs blinking in a fixed rate – on and off |
5 | All blinking – 2 – High intensity | All LEDs blinking twice and then a break |
6 | All blinking – 2 – Low intensity | All LEDs blinking twice and then a break |
7 | All blinking – 3 – High intensity | All LEDs blinking three times and then a break |
8 | All blinking – 3 – Low intensity | All LEDs blinking three times and then a break |
9 | LEDS 1, 2 on and 3, 4 off | |
10 | LEDs 3, 4 on and 1, 2 off | |
11 | LEDs 1, 2 blinking 1 – High intensity | LEDs 3, 4 are off. LEDs 1 and 2 are blinking in a fixed rate |
12 | LEDs 1, 2 blinking 1 – Low intensity | LEDs 3, 4 are off. LEDs 1 and 2 are blinking in a fixed rate |
13 | LEDs 1, 2 blinking 2 – High intensity | LEDs 3, 4 are off. LEDs 1 and 2 are blinking twice and then a break |
14 | LEDs 1, 2 blinking 2 – Low intensity | LEDs 3, 4 are off. LEDs 1 and 2 are blinking twice and then a break |
15 | LEDs 1, 2 blinking 3 – High intensity | LEDs 3, 4 are off. LEDs 1 and 2 are blinking three times and then a break |
16 | LEDs 1, 2 blinking 3 – Low intensity | LEDs 3, 4 are off. LEDs 1 and 2 are blinking three times and then a break |
17 | LEDs 3, 4 blinking – 1 – High intensity | LEDs 1, 2 are off. LEDs 3 and 4 are blinking at a fixed rate |
18 | LEDs 3, 4 blinking – 1 – Low intensity | LEDs 1, 2 are off. LEDs 3 and 4 are blinking at a fixed rate |
19 | LEDs 3, 4 blinking – 2 – High intensity | LEDs 1, 2 are off. LEDs 3 and 4 are blinking twice and then a break |
20 | LEDs 3, 4 blinking – 2 – Low intensity | LEDs 1, 2 are off. LEDs 3 and 4 are blinking twice and then a break |
21 | LEDs 3, 4 blinking – 3 – High intensity | LEDs 1, 2 are off. LEDs 3 and 4 are blinking three times and then a break |
22 | LEDs 3, 4 blinking – 3 – Low intensity | LEDs 1, 2 are off. LEDs 3 and 4 are blinking three times and then a break. |
Main use cases
The main use cases of the system are:
1. Initialization
When the LC starts it enters the initialization sequence. The init sequence is described in a separate post.
2. Normal operation
In normal operation the LC drives the LEDs according to the currently selected configuration. The LC also monitors the following inputs:
a. Potentiometer – the potentiometer value determines the blink interval – the time that LEDs, in blinking mode, are on and off. In the “blinking 2” and “blinking 3” modes, the potentiometer value determines also the amount of time that the LED is off between blinks. This amount of time is twice as long as the blinking interval. When the value of the potentiometer changes the LC performs the “Setting the blink interval” use case.
b. RC input. If the PWM value on the RC channel changes then the LC performs the “Changing the LED configuration” use case.
During normal operation the 7-segment display, if present, shows the ID of the current LED configuration.
3. Setting the blink interval
When the blink interval is changed (i.e. the potentiometer value is changed) and if the 7-segment display is present, then the LC displays the new value of the potentiometer for 1 second. After 1 second the display returns to showing the configuration ID.
4. Changing the LED configuration
When the PWM value changes, the LC moves to the newly selected LED configuration. The LC also displays the current configuration ID on the 7-segment display, if present.