Loading...
 

Teensy Telemetry LED Extension

This is an extension to the Teensy Telemetry Project at Teensy Telemetry Project to provide an extremely configurable dynamic lighting system.  An infinite number of patterns can be setup in a configuration file that is processed and uploaded to the Teensy's NVRAM.  The patterns can be triggered by live flight controller data such as battery voltage, flight time, flight modes, altitude, speed, etc.

 

 

Supported LEDs

The Teensy will support up to 8 LED strips.  Not every type of LED strip is supported in this project.  This project uses the octows2811 library which takes advantage of the DMA (direct memory access) hardware available on the Teensy.  This writes to the LEDs extremely fast and efficiently so that the Teensy is offloaded to do other tasks.  We may support other LEDs in the future but may not be able to sustain the 100 updates per second that we can currently maintain.  

Each strip can have up to 16 LEDs.  You can buy strips of 60 and cut them into smaller strips or you can use NeoPixel sticks which are already separated into 8 LEDs per strip and have a rigid base.  

Here are the LED strips that have worked for me.  Please try any strips at your own risk, and it's always recommended that you follow the best practices when wiring strips.

DescriptionNumber of LEDsLinkPrice (US$)Shipping (US$)Notes
Adafruit NeoPixel Stick8/stickAdafruit NeoPixel Stick - 8 x 5050 RGB LED5.9518.15
Adafruit NeoPixel Strip60/meterAdafruit NeoPixel Digital RGB LED Strip - Black 60 LED24.9518.15Yellow looks yellow
Banggood60/meterBanggood1M 18W WS2812B 5050 RGB12.39FreeYellow looks greenish free shipping 
AliExpress (Ray Wu)60/meterDC5V WS2812B BLACK PCB led pixel srip,IP68,60pcs WS2812B/M with 60pixel22 for 4m15 + 16 DHL clearance feeYellow looks greenish (received within 1 week)

Overall, I like the great color and quick delivery I got from the Adafruit, but it ended up being the most pricey option.

 

Support and Community

There is an active blog for this project at RC Groups Thread

Setup

The LEDs can draw a significant amount of current, depending on how many you have.  Consider getting started with a single LED strip to display battery status, HDOP, etc instead of setting up a concert quality LED light show.  Whatever path you choose, don't be afraid to ask for help in the thread.

Power Considerations

Add up the total current that your LEDs could draw.  If each LED segment can draw 60 milliamps (0.06 Amps), then a strip of 8 will draw 0.48 Amps.  8 strips of 8 could draw up to 3.84 Amps.  This is a good number to keep in mind as you design your system.

It's strongly recommended to use a buck voltage regulator to power the LEDs for several reasons.  An adjustable buck regulators accept a high input voltage and efficiently reduce it to a desired voltage.  You must use a common ground buck regulator since the negative input of the regulator is likely connected flight battery negative, which is connected to the flight controller negative.  

Set the output voltage of the buck regulator to the correct voltage before connecting it to any LED strips.  The buck regulators often leave the factory set to the maximum voltage which will destroy your electronics.

Wire the + power input of the LED strip to the + (positive) of your buck regulator 

Wire the - power input of the LED strips to the - (negative) of your buck regulator

Connect the - (negative) of the buck regulator to the - (ground) of the Teensy

Wiring Option 1 (Simple Configuration)

The Teensy outputs 3.3V logic signals to control the LED strips.  The LED strips use 5V logic.  This means that when the Teensy is sending a logic 1 voltage to the LED strip, it probably won't be a high enough voltage to get read as a 1 by the LED strip.  

One way around this is to reduce the voltage supplying the LED strip.  The documentation indicates that as long as the logic voltage is greater than 75 percent of the supply voltage of the LED, the LED will recognize the signal as a 1.  If the Teensy outputs 3.0 Volts as a logic 1, we should be able to get away with supplying the LED strip with 4.0 Volts.  4.0 * .75 = 3.0.  From my experiments, I have found that supplying between 4.0 and 4.2 Volts to the LED strip works well, especially with 4 LED configuration where there isn't as much noise as with 8 LED strips.

Another shortcut is to wire the control wire of the LED strip directly to the Teensy and bypass the 330 ohm current limiting resistor that is recommended by LED wiring best practices.  I have had good success doing this, but if you decide to skip using inline resistors, do so at your own risk.  Please see https://learn.adafruit.com/adafruit-neopixel-uberguide/best-practices 

Power Option 2 (Level Converters)

The electrically correct way to wire up the LED strips is to power them with a clean 5.0 Volt supply and use a voltage level converter to increase the control signals from the Teensy to 5V logic.  You can purchase a board to do this from PJRC.  It's very inexpensive and easy to use.  

We are going to produce an opensource board that you can build up as well.  The only advantage of the opensource board over the PJRC board is that the opensource board will manage all the wiring if you use standard 3 pin rc servo cables for wiring your LED strips.  The PJRC board is currently the best solution we could find, you just need to do a bit of wiring to a RJ45 connector.

Control Wires

The control wires should be wired the following way.  This diagram shows wiring option 1.

 

Image  

One control wire must be added to the Teensy for each block of 8 LEDs.  The LED strips must also be connected to an adequate voltage source that has a common ground with the Teensy.  There are some considerations you need to think about before doing this.

The LED strip can draw 480 milliamps when all 8 LEDs are bright white.  You should plan for at least this current draw.  

  1. Wire DIN of each LED strip to the pins shown in the diagram above.  In order to make the default LED patterns work across quad, hex and octo, we are not using the Arducopter motor numbers.  We've come up with a simple numbering with odd numbers on the left, and even on the right.  1 and 2 on the front, 7 and 8 on the back.
    If you get it wrong, you can use the ledmap command in the console to correct the LED mapping.
    • Quad
      • 1 red on front left
      • 2 red on front right
      • 3 red on gear left  (optional)
      • 4 red on gear right  (optional)
      • 5 red on gear left   (optional)
      • 6 red on gear right  (optional)
      • 7 red on back left
      • 8 red on back right
    • Hex
      • 1 red on front left
      • 2 red on front right
      • 3 red on middle left
      • 4 red on middle right
      • 5 red on gear left   (optional)
      • 6 red on gear right  (optional)
      • 7 red on back left
      • 8 red on back right
    • Octo
      • 1 red on front left
      • 2 red on front right
      • 3 red on middle front left (could be put on arms or gear)
      • 4 red on middle front right (could be put on arms or gear)
      • 5 red on middle back left (could be put on arms or gear)
      • 6 red on middle back right (could be put on arms or gear)
      • 7 red on back left
      • 8 red on back right

 

 

Programming the Teensy

Make sure your Teensy is running version 2.1.6 or later of the firmware at urlhttp://www.rcgroups.com/forums/showthread.php?t=2529072/url

Programming the Taranis

The default LED configuration uses both channel 8 and other MAVLINK data.  You can modify the LED configuration file so that you control the LEDs completely by MAVLINK or even just a fixed pattern.

Release 2.1.7 and earlier
-100: All LEDS off
-80: Normal flight mode - Single red on left, green on right
-60: Landing mode 1 - Red on left, green on right, white in center
-40: Landing mode 2 - Red on left, green on right, motion from out to in is descending, motion from in to out is ascending

Release 2.1.8 or greater (there will be a minor change of the order to assist with diagnosing issues with CH8 when 2.1.8 is released)

-100: Normal flight mode - Single red on left, green on right
-80: All LEDS off
-60: Landing mode 1 - Red on left, green on right, white in center
-40: Landing mode 2 - Red on left, green on right, motion from out to in is descending, motion from in to out is ascending
-20: Flying mode 1 - 4 LEDs in a sequencing pattern. Red on left, green on right.  Motion from inside to outside on back and outside to inside on the front. 

Release 2.1.17 and later

See the configurator documentation.  The default configuration has been enhanced with every release and it can also be customized.

Degugging

If something isn't working as expected, double check all your wiring.  Adding a BEC can make things more difficult to diagnose.  Even if you verify that your extra BEC's negative is connected to the copters main GND, you still may need to run an extra ground wire directly from the the BEC's negative output to the Teensy's ground, the flight controller's ground or the receiver's ground to reduce noise generated by the BEC.

You can use connect to the Teensy's diagnostic console and use the dump command to confirm that the value that your Taranis is sending on CH8 is making it's way to the Teensy.  If not, you should double check the SR0_RC_CHAN parameter in mission planner.  (possibly SR1_RC_CHAN or SR2_RC_CHAN on Pixhawk).  

Positioning the LED Strips

The following is new to 2.1.16a9 and above ****


The first default pattern is a LED strip identification pattern that shows 1 red LED on strip 1, 2 red LEDs on strip 2, etc.  When you display this test pattern, you should see 1 LED on the front left arm, 2 LEDs on the front right arm, 3 LEDs on the arm behind the front left, 4 LEDs on the arm behind the front right, etc.  On an octo, you'd see 8 LEDs on the back right arm.

When your LEDs are in the correct order, you'll be able to share patterns with other people and have the LEDs show up in the correct spot. 

Full Ledmap Procedure

If you LEDs are not in the correct position, you can use the ledmap console command.  You'll have to connect the Teensy to a computer like what you did when you flashed it.  For now, you'll need a terminal emulator like putty.  Please see the main article for this project to connect to the console.

1) Display the test pattern

2) Observe each "position" and write down how many LEDs are displayed in each. (Position 1 is the front left, position 2 is the front right, 3 is back left, 4 is back right, etc). 
For example, if you see 3 LEDs lit on the front left, 6 on the front right, you'd write down:
Position 1 - 3 LEDs lit
Position 2 - 6 LEDs lit
Position 3 - 2 LEDS lit
Position 4 - 8 LEDS lit
Position 5 - 1 LEDs lit
Position 6 - 4 LEDs lit
Position 7 - 5 LEDs lit
Position 8 - 7 LEDs lit

3) Then, for the above observation you'd type "ledmap 3 6 2 8 1 4 5 7"

4) After that, reboot, and you see the correct number of LEDs lit in each position

 

Support and Community

There is an active blog for this project at RC Groups Thread