WS2812 Breakout Hookup Guide

Pages
Contributors: jimblom
Favorited Favorite 8

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.

SparkFun RGB LED Breakout - WS2812B

SparkFun RGB LED Breakout - WS2812B

BOB-13282
$3.50
2

Sewable LEDs

The LilyPad Pixel shares the same circuit as the breakout board, but it comes on a circular, purple LilyPad board. These are perfect for sewing onto clothing or other fabric, and embedding into an e-textiles project.

LilyPad Pixel Board

LilyPad Pixel Board

DEV-13264
$4.95

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, Bare (5m)

LED RGB Strip - Addressable, Bare (5m)

COM-12026
$99.95
2
LED RGB Strip - Addressable, Sealed (5m)

LED RGB Strip - Addressable, Sealed (5m)

COM-12028
$119.95
1

LED RGB Strip - Addressable, Sealed (1m)

COM-12027
8 Retired

LED RGB Strip - Addressable, Bare (1m)

COM-12025
7 Retired

Looking for smaller, higher density strips, or ones that emit on the side of the strip? The WS2812B's can also be manufactured in smaller packages such as the ones listed below.

Skinny LED RGB Strip - Addressable, 1m, 144LEDs (SK6812)

Skinny LED RGB Strip - Addressable, 1m, 144LEDs (SK6812)

COM-14732
$29.95
2
Skinny Side-Lit LED RGB Strip - Addressable, 1m, 60LEDs (SK6812)

Skinny Side-Lit LED RGB Strip - Addressable, 1m, 60LEDs (SK6812)

COM-14731
$14.95
1
Skinny LED RGB Strip - Addressable, 1m, 60LEDs (SK6812)

Skinny LED RGB Strip - Addressable, 1m, 60LEDs (SK6812)

COM-14730
$14.95

Matrices, Rings, and Stick

Depending on the project, they can also be populated on PCBs as a matrix, ring, or stick. These can be useful for marquees or adding unique animations to your project!

Flexible LED Matrix - WS2812B (8x32 Pixel)

Flexible LED Matrix - WS2812B (8x32 Pixel)

COM-13304
$109.95
6
NeoPixel NeoMatrix 8x8 - 64 RGB LED

NeoPixel NeoMatrix 8x8 - 64 RGB LED

COM-12662
$34.95
Pimoroni Unicorn HAT

Pimoroni Unicorn HAT

DEV-14037
$29.95
NeoPixel Stick - 8 x WS2812 5050 RGB LED

NeoPixel Stick - 8 x WS2812 5050 RGB LED

COM-12661
$5.95
5
NeoPixel Ring - 16 x WS2812 5050 RGB LED

NeoPixel Ring - 16 x WS2812 5050 RGB LED

COM-12664
$9.95
3
NeoPixel Ring - 24 x WS2812 5050 RGB LED

NeoPixel Ring - 24 x WS2812 5050 RGB LED

COM-12665
$19.95

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.!

White Tri-Color LED Strip - Addressable, Sealed (1m)

White Tri-Color LED Strip - Addressable, Sealed (1m)

COM-13898
$19.95
2

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).

LED - RGB Addressable, PTH, 5mm Clear (5 Pack)

LED - RGB Addressable, PTH, 5mm Clear (5 Pack)

COM-12999
$2.95
3
LED - RGB Addressable, PTH, 5mm Diffused (5 Pack)

LED - RGB Addressable, PTH, 5mm Diffused (5 Pack)

COM-12986
$2.95
8
LED - RGB Addressable, PTH, 8mm Diffused (5 Pack)

LED - RGB Addressable, PTH, 8mm Diffused (5 Pack)

COM-12877
$2.95
3

What makes the WS2812B really special is the way its controlled. The IC embedded into the LED communicates via a very unique one-wire interface. With the help of some libraries, they're really very easy to control. Plus they're chain-able -- the output of one LED can be connected to the input of another to create strips of hundreds of 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.

Required Materials

WS2812-Based LED Board or Strip

Stating the obvious: you'll need a WS2812-based board or strip. The more the merrier! In the example hookup, we'll be linking together five breakout boards, but the example should be adaptable to the other WS2812-based products. Grab however many you think you'll need for your project, regardless of how many you have, it's not enough.

Microcontroller

Aside from the star of the show, you'll also need a microcontroller. Something that can send the series of 1's and 0's used to control the LEDs. Our go-to is the classic Arduino Uno, but any Arduino board should do.

Arduino Pro Mini 328 - 5V/16MHz

Arduino Pro Mini 328 - 5V/16MHz

DEV-11113
$9.95
130
Pro Micro - 5V/16MHz

Pro Micro - 5V/16MHz

DEV-12640
$19.95
75
Arduino Mega 2560 R3

Arduino Mega 2560 R3

DEV-11061
$38.95
54
Arduino Uno - R3 SMD

Arduino Uno - R3 SMD

DEV-11224
$22.95
22

Or you can try to adapt the example code to your favorite microcontroller. Teensy development boards are an excellent choice when using a large number of WS2812 LEDs.

Teensy 3.6

Teensy 3.6

DEV-14057
$29.25
14
Teensy LC

Teensy LC

DEV-13305
$12.95
16
Teensy 3.5

Teensy 3.5

DEV-14055
$24.95
6

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.

SparkFun Solder-able Breadboard

SparkFun Solder-able Breadboard

PRT-12070
$4.95
17
Break Away Headers - Straight

Break Away Headers - Straight

PRT-00116
$1.50
20
LED Strip Pigtail Connector (3-pin)

LED Strip Pigtail Connector (3-pin)

CAB-14575
$1.25
Breadboard - Translucent Self-Adhesive (Red)

Breadboard - Translucent Self-Adhesive (Red)

PRT-11317
$4.95
1

Tools

In order to get a good, solid, electrically-sound connection to the breakout boards, you'll need to solder to the pins. That means you'll need at least a basic soldering iron, solder, and general soldering accessories. Check out our how to solder tutorial for help, if this is you first time soldering.

Solder Lead Free - 100-gram Spool

Solder Lead Free - 100-gram Spool

TOL-09325
$7.95
7
Soldering Iron - 30W (US, 110V)

Soldering Iron - 30W (US, 110V)

TOL-09507
$9.95
7

Suggested Reading

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, consider reading their tutorials:

How to Solder: Through-Hole Soldering

This tutorial covers everything you need to know about through-hole soldering.

Binary

Binary is the numeral system of electronics and programming...so it must be important to learn. But, what is binary? How does it translate to other numeral systems like decimal?

How to Power a Project

A tutorial to help figure out the power requirements of your project.

How to Use a Breadboard

Welcome to the wonderful world of breadboards. Here we will learn what a breadboard is and how to use one to build your very first circuit.

What is an Arduino?

What is this 'Arduino' thing anyway?