User Tools

Site Tools


tutorials:products:pixel12mm:index.html

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorials:products:pixel12mm:index.html [2012/03/06 15:45]
ladyada [LED full color (RGB) Pixels!]
tutorials:products:pixel12mm:index.html [2016/01/28 18:05] (current)
Line 7: Line 7:
   * 12mm diameter round waterproof pixels ​   * 12mm diameter round waterproof pixels ​
   * Comes in both "​Bullet"​ (thin) shape and "​Square"​ (flat) shapes   * Comes in both "​Bullet"​ (thin) shape and "​Square"​ (flat) shapes
-  * Approximately ​inches (100mm) apart on 4-pin strand+  * Approximately ​inches (80mm) apart on 4-pin strand
   * 5 Volts DC, 60 milliamps max per pixel (all LEDs on, full white)   * 5 Volts DC, 60 milliamps max per pixel (all LEDs on, full white)
   * WS2801 LED driver chip provides 24-bit color: [[http://​www.adafruit.com/​datasheets/​WS2801.pdf|Datasheet]]   * WS2801 LED driver chip provides 24-bit color: [[http://​www.adafruit.com/​datasheets/​WS2801.pdf|Datasheet]]
Line 47: Line 47:
  
 {{ :​tutorials:​products:​pixel12mm:​12mmpixels.jpg?​nolink&​ |}} {{ :​tutorials:​products:​pixel12mm:​12mmpixels.jpg?​nolink&​ |}}
 +{{ :​tutorials:​products:​pixel12mm:​id738rainbow_lrg.jpg?​500 |}}
  
-The LED pixels are spaced along a strand of ribbon cable, with about inches or 100mm between pixels. If additional distance is needed you can cut the ribbon cable and solder 4 wires to extend the gap to the desired length.+The LED pixels are spaced along a strand of ribbon cable, with about inches or 80mm between pixels. If additional distance is needed you can cut the ribbon cable and solder 4 wires to extend the gap to the desired length.
  
 {{ :​tutorials:​products:​pixel12mm:​12mmwires.jpg?​nolink&​ |}} {{ :​tutorials:​products:​pixel12mm:​12mmwires.jpg?​nolink&​ |}}
Line 68: Line 69:
 Each pixel contains a small microchip within the silicone dot. The WS2801 LED driver chip is custom designed for this purpose. These chips are very simple to communicate with — all they do is shift color data in from one pin and out another. To issue data from a microcontroller such as an Arduino, one "​shifts out" 24 bits of color information — the first data out corresponds to the pixel closest to the microcontroller. To write data to 10 LEDs, you would issue 240 bits (10 * 24). Following the data, a 500 microsecond pause will "​latch"​ the data and show the new LED colors. Each pixel contains a small microchip within the silicone dot. The WS2801 LED driver chip is custom designed for this purpose. These chips are very simple to communicate with — all they do is shift color data in from one pin and out another. To issue data from a microcontroller such as an Arduino, one "​shifts out" 24 bits of color information — the first data out corresponds to the pixel closest to the microcontroller. To write data to 10 LEDs, you would issue 240 bits (10 * 24). Following the data, a 500 microsecond pause will "​latch"​ the data and show the new LED colors.
  
-**PLEASE NOTE: THE LED DRIVER CHIP AND WIRE COLORS HAVE CHANGED FROM EARLIER BATCHES OF THESE PIXELS. ANYTHING PURCHASED RECENTLY SHOULD MATCH THE FOLLOWING DECRIPTION. We initially sold LEDs in this form factor using the LPD6803 driver chip. If you are using those pixels, [[http://​www.ladyada.net/​products/​pixel20mm/​index.html|please go to the 20mm pixel tutorial]] — the wiring and code are the same, and nothing further here applies. After switching to the WS2801 chip, the first batch used different wire colors, but the order and functions are the same as described below.**+<class notewarning>​
  
 +**PLEASE NOTE: THE LED DRIVER CHIP AND WIRE COLORS HAVE CHANGED FROM EARLIER BATCHES OF THESE PIXELS. ANYTHING PURCHASED AFTER AUGUST 2011 SHOULD MATCH THE FOLLOWING DECRIPTION. We initially sold LEDs in this form factor using the LPD6803 driver chip (BEFORE August 2011). If you are using those pixels, [[http://​www.ladyada.net/​products/​pixel20mm/​index.html|please go to the 20mm pixel tutorial]] — the wiring and code are the same, and nothing further here applies. After switching to the WS2801 chip, the first batch used different wire colors, but the order and functions are the same as described below.**
 +
 +</​class>​
 ==== Wiring ​ ==== ==== Wiring ​ ====
  
Line 76: Line 80:
 Though it looks like the 4-conductor ribbon cable is continuous, //it isn'​t!//​ The ground and 5V lines pass through from one pixel to the next, but the two data control lines are different on the input and output sides. The input side goes to the LED driver chip, which then drives its own output to the next pixel in the strand. Though it looks like the 4-conductor ribbon cable is continuous, //it isn'​t!//​ The ground and 5V lines pass through from one pixel to the next, but the two data control lines are different on the input and output sides. The input side goes to the LED driver chip, which then drives its own output to the next pixel in the strand.
  
-When connecting these pixels to a microcontroller,​ make sure you're connecting to the strand'​s **input** pins! Best way to distinguish the correct end is to closely examine the circuit board embedded in the first pixel, looking for the "​INPUT"​ label. If connecting multiple strands together, make sure the output of one strand goes to the input of the next.+When connecting these pixels to a microcontroller,​ make sure you're connecting to the strand'​s **input** pins! Best way to distinguish the correct end is to closely examine the circuit board embedded in the first pixel. If its a WHITE PCBtry looking for the "​INPUT"​ label. If connecting multiple strands together, make sure the output of one strand goes to the input of the next.
  
 {{ :​tutorials:​products:​pixel12mm:​12mminput.jpg?​nolink&​ |}} {{ :​tutorials:​products:​pixel12mm:​12mminput.jpg?​nolink&​ |}}
 +
 +If the PCB is Green, look for the black rectangular chip, this is the input
 +
 +{{ :​tutorials:​products:​pixel12mm:​12mmgreenpcb.jpg?​500 |}}
 +
 +If you have flat pixels, look for the embossed ARROW on the side of the pixel, connect to the end that's the '​tail'​ of the arrow (not the pointy head as that indicates which way the data travels down the strand'​
 +
 +{{ :​tutorials:​products:​pixel12mm:​flatarrow.jpg?​500 |}}
 +
  
 Wiring is pretty easy since there are only 4 wires. The only important thing is that you should not try to power the LED strand from the Arduino'​s 5V line, unless you'll be using only a few LEDs at a time. The Arduino is only meant to drive about 500mA of current, and as we saw earlier, a fully-lit strand can require 1000mA or more! This is why we suggest using an external 5V supply. Wiring is pretty easy since there are only 4 wires. The only important thing is that you should not try to power the LED strand from the Arduino'​s 5V line, unless you'll be using only a few LEDs at a time. The Arduino is only meant to drive about 500mA of current, and as we saw earlier, a fully-lit strand can require 1000mA or more! This is why we suggest using an external 5V supply.
Line 90: Line 103:
 ==== Download ==== ==== Download ====
  
-To download the Arduino library, [[https://​github.com/​adafruit/​WS2801-Library|visit the repository on GitHub]]. +To download the Arduino library, [[https://​github.com/​adafruit/​Adafruit-WS2801-Library|visit the repository on GitHub]]. 
-Click the DOWNLOAD ZIP button near the upper left, extract the archive and then rename the uncompressed folder to ''​WS2801''​. Confirm that this folder contains the files ''​WS2801.cpp''​ and ''​WS2801.h''​ and the ''​examples''​ folder.+Click the DOWNLOAD ZIP button near the upper left, extract the archive and then rename the uncompressed folder to ''​Adafruit_WS2801''​. Confirm that this folder contains the files ''​Adafruit_WS2801.cpp''​ and ''​Adafruit_WS2801.h''​ and the ''​examples''​ folder.
  
-Place the WS2801 ​folder inside your Arduino ''​Libraries''​ folder. You may need to create this folder if it does not yet exist. In Windows, this would be ''​(home folder)\My Documents\Arduino\Libraries''​ and for Mac or Linux is ''​(home folder)/​Documents/​Arduino/​Libraries''​ [[http://​www.ladyada.net/​library/​arduino/​libraries.html|We also have a tutorial on library installation]].+Place the Adafruit_WS2801 ​folder inside your Arduino ''​libraries''​ folder. You may need to create this folder if it does not yet exist. In Windows, this would be ''​(home folder)\My Documents\Arduino\Libraries''​ and for Mac or Linux is ''​(home folder)/​Documents/​Arduino/​Libraries''​ [[http://​www.ladyada.net/​library/​arduino/​libraries.html|We also have a tutorial on library installation]].
  
-After installing the WS2801 ​library, restart the Arduino IDE. You should now be able to access the sample code by navigating through menus in this order: File->​Sketchbook->​Libraries->​WS2801->​strandtest+After installing the Adafruit_WS2801 ​library, restart the Arduino IDE. You should now be able to access the sample code by navigating through menus in this order: File->​Sketchbook->​Libraries->​Adafruit_WS2801->​strandtest
  
 ==== Code! ==== ==== Code! ====
Line 106: Line 119:
  
 // Set the first variable to the NUMBER of pixels. 25 = 25 pixels in a row // Set the first variable to the NUMBER of pixels. 25 = 25 pixels in a row
-WS2801 ​strip = WS2801(25, dataPin, clockPin);+Adafruit_WS2801 ​strip = Adafruit_WS2801(25, dataPin, clockPin);
 </​code>​ </​code>​
  
/home/ladyada/public_html/wiki/data/attic/tutorials/products/pixel12mm/index.html.1331048731.txt.gz · Last modified: 2016/01/28 18:05 (external edit)