Do you have a question about the WS2812 and is the answer not in the manual?
Questions and answers
Summary of Contents for Sparkfun Electronics WS2812
Page 1
WS2812 Breakout Hookup Guide Introduction The addressable WS2812 and WS2812B are unassuming RGB LEDs with an integrated control circuit hidden underneath. We love the simplicity of this little IC/LED combo. It's at the heart of a number of products. To name a few, the WS2812B is included in the simple WS2812B Breakout Board.
Page 2
LilyPad Pixel Board DEV-13264 LED Strips The WS2812B serves as the heart and soul of a variety of LED strips. These strips come in sealed and unsealed: 5 meter sealed, 1m sealed, 5m bare, and 1m bare. LED RGB Strip - Addressable, Sealed (5m) LED RGB Strip - Addressable, Sealed (1m) ...
Page 3
Skinny LED RGB Strip - Addressable, 1m, 60LEDs (SK6812) COM-14730 Note: While APA102's are not compatible with the WS2812's, the APA104's are compatible with the WS2812B's! LED RGB Strip - Addressable, Sealed, 1m LED RGB Strip - Addressable, Bare, 1m...
Page 4
Warm White, Cool White, and Amber Looking for a more natural white instead of mixing RGB? There are also WS2812's that have warm white, cool white, and amber color. Add ambient or task lighting to your projects with the tri-color strips.!
Page 5
White Tri-Color LED Strip - Addressable, Sealed (1m) COM-13898 Through-Hole Packages Lastly, if you require WS2812B LEDs in through-hole form, they are also available as a through-hole package. The size of the bulb can either be 8mm or 5mm. The LEDs can be diffused or clear depending on how they were manufactured: Diffused 8mm (5 Pack), Diffused 5mm (5 Pack), and Clear 5mm (5 Pack).
Page 6
LEDs. The more boards you have linked together, the fancier your animations can be! In this tutorial we're going to get you familiar with the workings of the WS2812 and WS2812B. We'll go over some of the ways you might want to hook up to the breakout board, LilyPad, or strips. And we'll close the tutorial out with some example Arduino code.
Page 7
Teensy LC Teensy 3.6 DEV-13305 DEV-14057 Teensy 3.5 DEV-14055 Note: Depending on the amount of WS2812 LEDs that are being used with the Teensy, you may need to use the octows2811 adapter board: PJRC: OCTOWS2811 LED LIBRARY...
Page 8
Wires You'll also need some way to connect between the board and an Arduino. You could use a combination of male headers and breadboard (solderless or solderable). Or you could just go with a few pieces of hookup wire or 3-pin JST-SM pigtail connectors.
These boards aren't too hard to use. If you've done anything with Arduino before, you'll be prepared to work with the WS2812. If you're not exactly sure what this "Arduino" thing is, or if you're not familiar with the topics below,...
Page 10
APA102-based LEDs for more information. The WS2812-based LED is much more than meets the eye. It may look like a common 5050-sized (5x5mm) LED, but there's actually an integrated circuit embedded inside there too. If you look really hard, you can see the tiny black chip hidden in there, along with minuscule gold wires connecting the chip to the LED.
Page 11
It's interesting to talk about, because the interface is so unique. The communication interface between a microcontroller and the WS2812 is weird. It's one wire, but it's not like a standard, UART serial interface. This interface is very time-specific. Both a logic 0 and a logic 1 require a square pulse, and it's the length of the pulse that defines which it is.
Page 12
Want to embed the WS2812 LEDs into your clothing? We have a thing for that! The LilyPad Pixel Board is the e- textile version of the WS2812 Breakout. The functionality and pinouts are exactly the same, though the pins are in slightly different location to make threaded traces easier.
Page 13
The LED strips come on a reel as shown above. The WS2812 Addressable LED strips come in a few flavors, which vary by size and sealant. You can get them in either 1m or 5m lengths, high density, or side emitting. For each length the strip, they can be either covered by a waterproof sealant or left bare.
Page 14
To reuse the rest of the LED strip, check out the LED Strip pigtail connector to easily connect the cut strips: LED Strip Pigtail Connector (3-pin) CAB-14575 Addressable Through-Hole LED If you require WS2812 LEDs in through-hole form, they are also available as a through-hole package.
Page 15
Clear 5mm (5 Pack) Through-Hole LED Pinout The datasheet for the WS2812 addressable through-hole LEDs is not clear with the pinout. For reference, you can refer to the bulb's flat edge and the length of the terminals as indicated below.
Page 16
Select a Power Source The WS2812 requires about 5V to work. It should operate at anywhere between about 4V to 7V , but 5V is readily- available on most boards. The WS2812B operates between about 3.3V to 5V. The 5V header on an Arduino board, for example, is a perfect voltage supply for the LEDs.
Page 17
addressable LEDs. You may need an additional adapter or cable to connect. Wall Adapter Power Supply - 5.1V DC 2.5A Wall Adapter Power Supply - 5V DC 2A (Barrel (USB Micro-B) Jack) TOL-13831 TOL-12889 USB Wall Charger - 5V, 1A (Black) ...
Page 18
In addition to the hookup above we recommend the following additions to help you get the most out of your WS2812-based devices: Add a Big Smoothing Capacitor Before connecting the WS2812 to a power source, connect a big capacitor from power to ground. A cap between 100µF and 1000µF should be good.
Page 19
The cap will act as a "power reservoir" to store energy in case the supply dips. Try to place this cap as close to your WS2812 as possible by placing it in parallel to the Vcc and GND pins. Add an In-Line Resistor On the Data Signal Placing a small-ish resistor between your Arduino's data output and the WS2812's data input will help protect the data pin.
Page 20
For more information on daisy chaining LED strips, check out this section that talks about avoiding voltage drops. Voltage Drops Along the Daisy Chained LED Strips in Mean Well LED Switching Power Supply Hookup Guide: Power Large Loads and Daisy Chained LED Strips Adding Firmware Note: This example assumes you are using the latest version of the Arduino IDE on your desktop.
Page 21
Looking for an alternative library? Try checking out the FastLED library for more advanced features. The library also supports other LED chipsets. FASTLED GITHUB REPO Resources and Going Further For more information about the WS2812 and WS2812B, check out the resources below: Breakout Board Schematic (PDF) Breakout Board Eagle Files (ZIP) Breakout Board GitHub Repo...
Page 22
Adafruit NeoPixel Library GitHub Repo FastLED Library GitHub Repo Now that you've got the gist of the WS2812 Breakout board, how are you going to use it in a project? Need some inspiration? Check out these tutorials: Using OpenSegment -- The OpenSegment is a very large, 4-digit 7-segment display. If you're on a blinky- high after playing with the WS2812 LEDs, this is another fun component to play with.
Page 23
In this tutorial, we will be connecting a Mean Well LED switching power supply to an addressable LED strip controlled by an Arduino. Check out these projects using the WS2812 addressable LEDs for more ideas: Enginursday: Sound Wave Printing IoTuesday: DIY Smart Backlit Mountain Scene...
Page 24
ATP: Circuit Design with LEDs DIY Desktop Light Sculpture JULY 2, 2018 JULY 31, 2018 Enginursday: A Glowing Guitar for Decadon Wearable Tech at Dragon Con, Part 1 AUGUST 16, 2018 SEPTEMBER 13, 2018 Wearable Tech at Dragon Con: Part 2 Enginursday: Glowing Guitar, Part Deux SEPTEMBER 20, 2018 NOVEMBER 15, 2018...
Page 25
DIY Edge-Lit Acrylic Display Expecto Patronum! MARCH 12, 2019 FEBRUARY 12, 2019...
Need help?
Do you have a question about the WS2812 and is the answer not in the manual?
Questions and answers