MR60

Pixhawk external LED?

Hi,

Anyone succeeded to install external LEDs on Pixhawk?

On APM we could configure the param Led_mode to a binary value representing which actions turn LEDs on A5 and A6.

Is there an equivalent feature on Pixhawk? Found nothing in the wiki about it.

Thx for any info,

Hugues

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • For anybody who is interested in more bling on their copter or plane I have made a simple external lighting controller that can be used with APM. It is based on the LED driver in Cleanflight and connects to a Mavlink serial telemetry channel.

    It's called Mavpixel. It uses an Arduino Pro Mini 5v 16Mhz and can control up to 4 strips of 8 WS2812 LEDs each.

    Mavpixel can control up to 32 RGB LEDs, with functions including:

    • Flight modes
    • Arming status 
    • Warnings like low battery and failsafe
    • Indicators
    • Throttle position
    • GPS status with number of satellites
    • Orientation
    • Fixed colours
    • Animation effects
    • Thrust ring

    I have only just finished the firmware and it seems to work, but is totally untested and not ready for general release.

    However, early adopters can try the source code on GitHub. Documentation is scarce at the moment. The configuration interface, MavpixelGUI, is nearly ready as well.

    Anybody who is interested in helping me with the task of getting Mavpixel tested, documented and ready would be most welcome.

    Setting it up is pretty easy. Download and flash the firmware to a Pro Mini using Arduino version 1.0.6 and an FTDI programmer. Open the Serial Monitor at 57600 baud and use the CLI to set up the new Mavpixel's LED strips with Cleanflight style commands.

    Hooking it up is fairly straightforward too. Connect a free telemetry port on the flight controller to Mavpixel's serial port through it's programming connector using four wires +5v, gnd, txd->rxd and rxd->txd. Power the LED strips from the servo rail or a 5v UBEC. Run the data line from each strip to the Mavpixel pins A1(leds 1-7), A2(leds 8-15), A3(leds16-23), and A4(leds 24-31).

    Configuring the Mavpixel can be done through Mavlink, through the built-in serial CLI using the FTDI or over a secondary software serial CLI. In the future configuration will be handled mostly by MavpixelGUI. This windows application is undergoing heavy development and is only available upon request right now but if you really want to try it let me know.

    Note that Mavpixel has been developed against and currently works best with copter 3.3.

    For some reason in copter 3.4-rc1 Mavpixel heartbeats are not making their way through to the ground station leaving configuration over Mavlink unavailable. The cause for this is yet to be determined.

    So, time to start getting that bling on.

  • Driver integrated LED panels are now generally available and cheap. It would be a good time for somebody to help APM catch-up to with CleanFlight/Naze32 and it's support for programmable RGB LED support (including the status/location relative settings).

    http://www.banggood.com/Diatone-WS2812-WS2812B-RGB-LED-Board-5050-F...

  • For Arduino programmers. An Arduino library.

    https://github.com/pololu/pololu-led-strip-arduino

    The LED strip arrived and I'm slowly getting time back to tinker with hobbies, but I think I'll go the Microchip MCU initially as I can get going faster with it.

    Martin

    pololu/pololu-led-strip-arduino
    Arduino library for addressable RGB LED strips from Pololu - pololu/pololu-led-strip-arduino
    • Excellent pls post your progress!

      On a related subject I bought these http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=...

      I really like these!! The lights do the two most important things for me. They help with orientation and let me know when the battery is low [ handy if you don't bother with telemetry or don't have that ].  I built my own quad and installed LED's on the booms, red in front, green in rear. So these lights have a matching super bright red LED and green LED I place respectively aiming forward not down. It's amazing how much it helps with orientation. Simply hit the yaw and when you see bright red you know its aimed back at you. The lights are solid until 10.5 volts is reached at which point they flash quickly.  If I were smart enough to write the code I would have externally controlled LED's to do only what the pixhawk LED does. Seems like if it starts trying to communicate modes that could really get complicated for the user. The same flashing yellow light used for low bat could also be used to indicated a RTL failsafe event like it already does on the Pixhawk. Anyway just my two cents. I sure wish I could help with the code but that is certainly not my forte :[

    • MR60

      Nice use of LEDs.

      Since I asked the question, 3DR and resellers sell an external pixhawk led you can simply connect on the I2C port.

    • Yea I've used those. I wish the pixhawk had two I2C ports so you didn't need to about tripping your wiring to use one.

    • MR60

      Hi Richard, you can use the four I2C ports extension that comes standard with the pixhawk.

    • Developer

      One limitation of the Toshiba RGB LED (which is what's in the Pixhawk RGB LED) is that it has a fixed I2C address.  This means that only one can be present on each I2C bus.  On the Pixhawk the RGB LED that's on the board uses the "internal" I2C bus, if you plug an external RGB LED into the board's "I2C" port then it's connected to the "external" I2C bus.  It would be possible to light up both the RGB LED on the board and one that's plugged inextenally but we don't do this at the moment.

    • Developer

      Jay,

      If you want to do it in software, it would require changing the PXFirmware's rgbled driver so that it starts a driver on both the internal and external I2C buses.

      A simpler solution though is just to split the I2C line and run it to two RGB LEDs.  Because the LEDs simply listen I think it will work.

    • Ahhh I see. That explains why only one comes on. I've had an issue a couple times with connecting an external LED and it didn't work rather the internal one still did as though the Pixhawk didn't see the external one here. Yet plug in a different one and suddenly it works. fyi this was with a China LED's not 3DR. Remember that old verbiage 'scuzzi voodoo' ? Referencing when multiple hard drives were connected via scuzzi cables sometimes for no apparent reason you had to disconnect them and then connect them in a different order and then all worked as planned. On paper it shouldn't matter but....

      In perfect world I'd love to see the pixhawk with 2-3 I2C ports for a much cleaner wiring install for LED's and or a second compass availible for failover. Nothing hundreds of thousands of man hours and a tremendous amount of resources couldn't accomplish whilst I simply sit around and wait :] 

This reply was deleted.