magnify
Home Arduino projects Arduino based ArtNet-Node for led pixels
formats

Arduino based ArtNet-Node for led pixels

Arduino based art-net node for led pixels and digital led strips with drivers type WS2811, TM1803, TM1804, TM1809, TM1812.

In this post we show you how to build an Art-Net pixel node based on Arduino Mega with direct support for led pixels and digital led strips with drivers type WS2811, TM1803, TM1804, TM1809, TM1812. This node answers to the basic messages of the Art-Net protocol, so that any controller that meets the protocol will be able to detect it and use it.

 

What do we need?

– An Arduino Mega 2560 or Mega 1280 or Arduino UNO, the code has been tested with Arduino Mega 2560 and UNO, should work without problems in 1280.

– An ethernet shield based on Wiznet W5100 (Arduino ethershield)

– Library fast-spi (included in package)

– Library ethernet (included in package)

– Arduino IDE v0023 (The code for the Art-Net node does not work for now with higher versions)

*** Updated 17-12-2012 *** Support for Arduino UNO (1 universe) and Mega (2 universes)
Download code for Arduino based ArtNet Pixel Node v.0.2

Old version 0.1
Download code for Arduino based ArtNet Pixel Node

Installation Instructions:

Copy the folder “Ethernet” included in the package to the folder arduino-0023/libraries/

Copy the folder “FastSPI_LED” included in the package to the folder arduino-0023/libraries/

Copy the folder “pixel_node” to Arduino sketches folder, in my case “Arduino”

Now we can open the sketch of the “pixel_node”, compile the code and upload to Arduino.

Download code for WS2801 Pixel node (1 universe)

 

In order to avoid random flickering, and problems in first pixels you need:

For types TM18xx and WS2811:
– Use shielded audio cable or shielded data cable for connections between node and pixels. (central wire for DATA, shield to GND)
– Maybe necessary put a resistor (between 10 Ohm to 50 Ohm) in series into DATA line (close to controller)

For type WS2801:
– Put two 150 Ohm resistors, one between GND and data pin, and other between GND and clock pin.
– Use at least twin shielded audio cable for connections between node and pixels. (one of central wire for DATA and other for CLK, shields to GND)

Twin shielded audio cable

 

To test the performance I have used the software “MADRIX”

Configure your computer with the IP 2.0.0.1, subnet-mask 255.0.0.0, gateway 2.0.0.1

Arduino data output is pin 4 by default, connect to data input on led pixels or digital led strips.

 

I hope to share your experiences in the Blog.

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
147 Comments  comments 

147 Responses

  1. Janson

    Yeah, thats possible. Madmapper uses broadcast mode. Currently I only have one Universe, but I really have to get it working on 5+ universes in the future. I will check what happens when sending more than one universe to MEGA tomorrow.

    The network is not connected to the internet. It’s a crossover cable at the moment. I will send you a wireshark capture later.

  2. Janson

    Have a look at this:

    http://www.pjrc.com/teensy/td_libs_OctoWS2811.html

    This guy managed to drive 8 WS2811 Stripes with only one teensy 3.0 board. As I found out, there is also an Wiznet ethernet module available and most of the libs from arduino are working. Do you think it will be possible to get 8 artnet universes up and running? 🙂

    • Toni Merino

      Hi Janson.
      Teensy 3.0 uses an:

      32 bit ARM Cortex-M4 48 MHz CPU (M4 = DSP extensions)
      128K Flash Memory, 16K RAM, 2K EEPROM
      14* High Resolution Analog Inputs (13 bits usable, 16 bit hardware)
      34* Digital I/O Pins (10 shared with analog)
      10 PWM outputs
      8 Timers for intervals/delays, separate from PWM
      USB with dedicated DMA memory transfers
      3 UARTs (serial ports)
      SPI, I2C, I2S, IR modulator
      I2S (for high quality audio interface)
      Real Time Clock (with user-added 32.768 crystal and battery)
      4 general purpose DMA channels (separate from USB)
      Touch Sensor Inputs

      Difference is on use of DMA memory transfers (frees processor from these tasks), 32 bits core, higher core clock and more…
      Arduino UNO and MEGA don’t have DMA, have 8 bits core, and runs at 16 Mhz. 🙁

      With 32 bits processors is possible to handle 8 and more Artnet universes.

  3. Janson

    Yes, I know, but I mean porting your code to teensy or merging with the code from this guy 🙂

    • Toni Merino

      Hi.
      I have downloaded the code for take a look.
      A few months ago, I tried porting the code of pixel node to mbed, and the results were not as good as expected, hardly improved the performance of Arduino.

      I am currently testing the AVR32.
      As I can, I’ll try with teensy 3.0, due compatibility with arduino.

  4. Erick G

    hi
    I am currently driving the ws2811 leds with the fast_spi to make a 32 X 7 led matrix and i was wondering..how i can create and save animations so I can take this matrix on the go. Is it possible to use madrix and buy a sd card chip? and also the ethernet chip to communicate with the madrix?

    • Toni Merino

      Hi Erick.
      You can use this node with Madrix, or any other Artnet enabled software, the code for Arduino is on top of page, you need an ethershield based on W5100, this allow to use up to 340 WS2811 RGB pixels. (with Arduino MEGA)
      Ethershield have onboard uSD conector, but for the moment is not implemented any use of uSD card in this software.

      Regards.

  5. Erick G

    can i not use it with just an arduino UNO? and also how can make this project mobile. Does madrix save files that arduino can save and read?

    • Toni Merino

      Hi Erick.

      can i not use it with just an arduino UNO? and also how can make this project mobile. Does madrix save files that arduino can save and read?

      No, Madrix use their own (undocumented format) only for Madrix hardware.
      For this use you need code written from scratch.

      Regards.

  6. Erick G

    Thanks Toni
    thats helps a lot. How would i go about about coding and assigning an led a position and color?

    • Toni Merino

      Hi Erick.
      With library fastSPI you have included an example of use with Arduino in standalone mode, use this as start point.
      You can also use Adafruit WS2801 library, and many others, depends of pixel controller type.

      Regards.

  7. Nate McGraw

    So my WS2811 finally came in today, Out of the box, they seem to work just fine with the UNO and everything else.
    I’m running to the same issue as Janson with MadMapper.
    The LEDs are working just fine with the software, but if there are fast changes with the LEDs they seem to freeze after a short period of time. If I stop the video feed and start it up again everything seems to catch up, but again, after a few moments it will freeze.
    I ran a capture with WireShark if that helps at all.
    https://www.dropbox.com/sh/ziyqn7lxu80sscm/SWLZogr21K

    I’ve posted a short video to show what is happening.
    http://youtu.be/TFgg9hBEl_M

    Also my RGB values seem to be flipped I changed the following:
    struct CRGB { unsigned char b; unsigned char r; unsigned char g; };
    struct CRGB *leds;

    rgb to brg which is how I fixed this in the FastSPI test file, but it didn’t seem to have the same effect here. Should I be changing the code in a different area?

    Thanks again for all the hard work, this stuff is great.

    • Toni Merino

      Hi.
      I have send the request to Madmapper support:

      Hi.
      I wrote some time ago code for use an Arduino as Art-Net node
      , recently many people ask me for problems using Madmapper.
      I have reviewed the wireshark captures received from people, and view very high frame rates on Art-Net output:

      capture 1:
      406 frames send in 5.99 seconds = 67,77 FPS

      capture 2:
      2827 frames send in 31.61 seconds = 89,43 FPS

      capture 3:
      1635 frames send in 25.99 seconds = 62,90 FPS

      capture 4:
      14029 frames send in 165 seconds = 85,02 FPS

      Is there a reason for this?, this is a double of 42 FPS for Full DMX512 universe
      Madmapper don’t have the possibility of adjust Art-Net output speed, to reasonable limit of 30 – 50 FPS like other programs?

      And finally other question, is not possible to use unicast packets for Art-Net?

      I await your response.

      Best regards.

      I have tested the UNO node with many programs and works up to 50 FPS.

      Regards.

    • Toni Merino

      Hi Nate.
      The option for reorder colors was removed in previous versions due to it is faster to make in controller.
      I include them another time in next revision.

      Regards.

  8. Sanath

    Hi Toni,

    I used your code to implement Arduino for artnode & managed to modified to get more than one universes by following your instructions. Can you please intruct how to get different node number other than default 0. Even though I followed your instructions could not get it going. Can you please help on this.

    King Regards,
    Sanath

    • Sanath,
      You are able to get more than 1 node by assigning a different IP address to each arduino. My experience with madrix using the default code on 2 Arduino’s is they mirror each other. By default the artnet node code runs universe 0 and 1. You can change this to universe 3 and 4 (assuming you’re using arduino mega) by editing the two commands that show “packet->universe== 0” command strings.

  9. Hey folks, I’m not new to DMX however I am a total NOOB to arduino and ArtNet.. I’m setting up a video and LED mapping rig for a show this summer and just invested in about 40 meters of WS2811 RGB strips. Based on the density of pixels, I need about 19 universes total to control 2400 pixels. I’m perfectly willing to post the project as it progresses but need to know if it’s feasible to have a few Arduino Mega’s running 2 or 3 universes each using their own IP’s.

    Do you you all mind helping me clarify since I’m not finding much reading / research material on this matter.

    • Toni Merino

      Hi Mackeroney.

      You know Art-Net?
      Apart of nodes you need software or controller, Art-Net enabled.

      There is no problem to handle 2 universes with Arduino mega. Is possible to use nodes as many as you need.

      Regards.

      • Thanks Toni. I plan on using Madmapper (keeping my eye on the latest string of posts regarding the FPS issue) I’m willing to help test once the equipment arrives. I’ll keep everyone posted on the progress. Thank you for answering 🙂

        • Toni Merino

          Sorry, it is true, there is a problem with nodes when using Art-Net in broadcast mode (MM only uses broadcast for now)

          I’m trying to solve the problem.

          • No worries. I just received the strips today. I’m still waiting on the arduino mega/ethernet boards and power supplies to arrive (using an ATX supply temporarily :/). I may use Madrix to help build the strips & test.

            Let me know if I can help with getting MadMapper folks to respond.

  10. Janson

    Hi Toni,

    I as the madmapper support told me I checked the output of madmapper. My fast changes only have 25 FPS maximum. They also said that the madmapper output is crapped at 40 FPS and will not output more 🙁

  11. Janson

    It’s me again… DMXWorkshop shows heavy peaks in the Artnet Monitor (up to 500Hz) I don’t know which program I can trust 🙁

    • Toni Merino

      Hi Janson.

      Be patient.
      I am waiting response from MadMapper support.
      I’m trying to solve.

      Regards.

  12. Brian

    Hey Toni,

    I tried out your Code now. I used ws2801 chips. As ArtNet Controller I’m using Madrix on a PC. Everything works fine, except the first two pixels. They do not light up. All other pixels are OK. So they just get skipped.
    Do you have any idea regarding this?

    Best Regards.

  13. Brian

    Hey Toni,

    think my last Post got lost…if not I’m sorry 😉
    I have a problem using ws2801 pixels with ArtNetNode + MADRIX. In this configuration the first two pixels do not light up. Order of pixels is still fine. So no data is getting shifted.
    Do you have any idea how this can happen?

    Best Regards!
    Brian

    • Toni Merino

      Hi Brian, sorry.
      Put two 150-Omh resistors between GND and data, GND and clock, and let me know the result.

      regards.

  14. Hey Toni, Update: I’ve got all 10 strips tested with Madrix to make sure they work.. currently having some exchanged for dead pixels. In the mean time I build some of the strips I need for the shows: https://fbexternal-a.akamaihd.net/safe_image.php?d=AQBvH97o13wiR_Gg&url=https%3A%2F%2Ffbcdn-vthumb-a.akamaihd.net%2Fhvthumb-ak-prn1%2Fs403x403%2F632218_10200784276629212_10200784272149100_61768_1124_b.jpg&jq=100

    For some of the comments above, you are correct. I was able to create my own fixture in Madrix to edit the color channels since my WS2811’s are GRB. I don’t see any options to modify this inside of MadMapper yet but still looking.

    I put your code up against Madrix, everything tests out great! I load the fixture into MadMapper and I get good results however I’m not sure how madmapper works with the 2nd universe as I’m not getting any activity on the strips. Madrix used the 2nd universe without problem.. I was actually able to drive 5 strips off 2 universes in their software.

    Anyone have suggestions for something I might be missing?

    • Never mind. I caught my oversight – I had missed the channel offset option in madmapper.

      Now that I have 2 arduino mega nodes, now I am working on setting up universes 3 and 4 on the 2nd arduino. Can this be done as universes or do you have to use the 2nd subnet universe 0 and 1?

    • Toni Merino

      Hi Mackeroney.
      There is a problem with MadMapper, due they use Broadcast mode for Art-Net packets, MadMapper team says that unicast mode comes in next versions, by the moment I don’t have any solution.
      Arduino is able to handle only 50-100 Art-Net packets per second.
      Due to use of broadcast, traffic from each node is propagated to another, plus traffic of 256 universes that MM sends in intervals of 4 seconds (even if universes are not used), these amount of packets floods the node.

      It is necessary wait to next MM version 🙁

  15. Pete

    Hi,

    Thanks for your work toni – you’ve given us all a great tool to extend our work. You can also add me to the list of people waiting/praying for madmapper support – I was pricing up the system I’m building at a couple of thousand in artnet->dmx->spi adapters until I thought of the ardunio option and came across your site.

    I’m using 3 mega’s with ethernet shields, using pin 10 as output and it seems to be working fine so far (I’ve only got the first fixture done) with a few exceptions: Like the poster above my R+G pixels are reversed and I’m struggling to change them, also the first pixel (green) is continuously lit (though operates fine using the example test sketches. Any advice would be greatly appreciated.

    Cheers

    Pete

    • Toni Merino

      Hi Pete.
      In order to avoid random flickering, and problems in first pixels you need:

      For types TM18xx and WS2811:
      – Use shielded audio cable or shielded data cable for connections between node and pixels. (central wire for DATA, shield to GND)
      – Maybe necessary put a resistor (between 10 Ohm to 50 Ohm) in series into DATA line (close to controller)

      For type WS2801:
      – Put two 150 Ohm resistors, one between GND and data pin, and other between GND and clock pin.
      – Use at least twin shielded audio cable for connections between node and pixels. (one of central wire for DATA and other for CLK, shields to GND)

      Twin shielded audio cable

      Regards.

Leave a Reply

Your email address will not be published. Required fields are marked *