This instructable aims to help you get started with an Arduino YUN which is controlling a string of WS2812 RGB leds. The WS2812 is an individually addressable flexible LED strand. The strand can be cut, or put back together, and has a fairly high bending tolerance. The WS2812 is also completely digital, being driven by a single Data In pin rather than individual channels for red, green and blue.
In our demo we have an Arudino YUN running PHP and the PHP Bridge library which will allow us to send our color string to the Arduino and change the color of our LED strand. We also have a button to turn the strand on and off.
The basic diagram for our circuit looks like the above.
We have an Arduino YUN connected to our network via Ethernet. There is a common ground that ties the button and WS2812 strand together.
We are supplying 5v to one leg of the button and a 10KΩ resistor connects that 5v leg to ground. Our opposite leg is connected to pin 3 on the Arduino.
The WS2812 Strand:
The WS2812 data is transmitted via Pin 6 on our Arduino, and the line is protected by a 220Ω resistor. We also tie the grounds together from our strand and power supply. Because the WS2812 can have a rather large power budget you must drive it off an independent 5 volt power supply. You can use your 5 volt supply to the Vin pin on the Arduino if you want less power cables to manage, for this example I am using USB power from the computer to drive the Arduino.