Powering Any WS2812b Setup
While one strip is great there are all sorts of awesome projects that call for special LED sizes and configurations. This guide will go over the different types of WS21812b strips, how to figure out how much power you need, and to connect more than one. If you missed it and want to learn more about how these type of LED strips work, check out our main guide here. Learn To Program Custom LED Lights
Types
The type of strip we want are WS2812b. They typically com in IP64, IP65, and IP67. IP64 strips have the least protection from the environment but are the easiest to cut into smaller pieces. They also come with a sticky back that can be used to mount them to all type of surfaces. The IP65 strips also come with a sticky back and have a silicon covering the makes slightly more difficult to solder. The IP67 type are fully enclosed in a silicon casing and have no sticky back.
They also come in different led densities. The main configurations are 30 leds/m 60leds/m and 144led/m. In my experience 30 leds/m is plenty dense as each led can get extremely bright. This gives you the maximum length per cost as well easiest to satisfy power consumption.
Practically all WS2812b LED strips can be cut into multiple smaller strips. Each of the copper pads can be cut in half and used to connect sections together. Wires can be soldered to each end. Just be sure to connect the GND <-> GND, VCC <-> VCC, and DIN <-> DOUT. Here’s a grid of lights we made out of sections of an IP64, 60 led/m strip.
Power
Since everything we’re using runs on 5 volts, we can use the terms power and current interchangeably. The amount of current (amps) that each LED consumes depends on their color and brightness. If only one of the three red, green, or blue LEDs are on, it will use less power. If the pixel is set to white (all three LEDs on) it will use the maximum amount of power.
The defacto advice on the internet is to make the assumption that each of the RGB lights will use at maximum 20mA (the actual value is slightly lower). This give us 20mA + 20mA + 20mA = 60mA per pixel. Therefore for an entire 150 pixel LED strip we would be using a maximum of 9A of power. This is why we picked a 10 amp power supply for the primary guide where we use a 150 pixel strip.
However while this is a safe approximation, we would only use the full 9A when we have all the LEDs set white at max brightness. If we’re a little clever about how we program our LEDs, we can get away with connecting many more LEDs with a less powerful supply.
As you’ll see, these LEDs are BRIGHT! Setting them to max 255 brightness can make them downright hard to look at without any diffusion. Additionally, when thinking about the power requirement we only have to consider the worst case scenario. This means if we are willing to sacrifice some brightness, we can safely connect more LEDs per amp of current.
The graph below shows the power consumed per pixel (white, RGB all on) at different brightness levels. Rather than just assuming the default 60mA per pixel, we can more accurately match our LEDs and power supply. For example if we have a 5 amp power supply and want to hookup 150 LEDs, that gives us a power budget of 33.3mA per pixel (5000mA / 150). Accord to our graph we can safely run all 150 LEDs as long we don’t set any brightness values over ~170.
The supply we need must be 5 volts, however the shape and amperage they provide can vary greatly. Wall warts (typically 0.5-2 amp) and power brick (typically 1-10 amp) supplies usually come with barrel jack connectors. For large amounts of current they make supplies with their own metal enclosure (typically 1-60+ amps). They will require wires directly from a wall plug and provide multiple sets of 5 volt connections.
As a word of warning, it is important to use a quality 5 volt power supply. Many power bricks, especially those that advertise over 5 amps, use cheaper components and cannot actually maintain that level of current. Even on a quality supply I’d recommend giving around 20-30% of headroom to be safe. Trying to pull large amounts of current can cause the voltage to sag, reducing the brightness of your LEDs, or worse damaging them or your power supply.
For those less familiar with the electrical terminology, the voltage can be thought of as water pressure and current as water flow. If we try and turn up the water flow (current) higher then the supply can handle, the water pressure (voltage) will go down. If the LEDs are taking a shower in this analogy, low water pressure is no good.
Every strip has little wires embedded into them to connect one LED to the next. These act like pipes carrying the water (current) through the strip. If we try and set all of the LEDs to max white brightness, it draws too much water (current) for these little pipes to carry. By the time we get to the end of a long strip the voltage has sagged and the brightness and color quality of the LEDs has deteriorated. To fix this we just need to apply the power and ground to both sides of the strip. Many strips even have an extra pair for 5V and GND wires at each end specifically for “injecting” more power.
Similar to reducing brightness, we can also reduce power but turning off all of either the red, green, or blue LEDs in the strip. If we use a combination of two of the three LEDs on each pixel we can reduce the power to two thirds the normal consumption. If we only program our LEDs to be exactly red, green, or blue, we can cut the power consumption down to one third since two of the three LEDs are off. For example, if we know we only want to use yellow (red + green) and purple (red + blue), at max brightness of 100, the worst case would be 12.5mA per pixel. A brightness of 100 uses about 19mA from the graph, times 2/3 since we know we’ll only be using two of the three colors at a time, give us 12.5mA per pixel.
Depending on how harsh of constraints you impose on yourself, the amount of power you need for each pixel can be greatly reduced. If you know exactly what maximum brightness and colors you need, you can calculate the specific worst case power requirement. Although, it is typically a good idea to give yourself as much flexibility as possible to create a wider variety of animations and colors.
Setups
If we only need to power a couple LEDs we can actually get away with using only the Arduino. The USB plugged into our computer can provide 500mA of power. I wouldn’t recommend using much more than 350mA. Accidentally pulling too much power could damage your Arduino or worse your computer. However 350mA is enough to safely power 6 LEDs or more depending if you use the techniques described above.
To power additional LEDs we will need an external power source. For experimentation and programming it will be useful to have our Arduino pulled into the computer. In this case the ground from the power supply should be pulled into the Arduino but NOT the 5 volt wire. The USB will provide the 5 volts power that the Arduino needs.
Once we have the Arduino programmed to our liking. It may be preferential to remove the USB-computer connection. After disconnecting, the whole system can be powered from our 5 volt power supply.
Perhaps you want to use more than one LED strips. For the most part you can just connect the end of one to the start of the next. If you have two, 150 LED strips connected to each other, just define one strip in your controller as 300 LEDs long. Similar to before when we set an entire strip to max brightness, connect so many LEDs in a row will require power to be injected in the middle and/or at the end.
You can even have as many different 5 volt power supplies as you want/need. Just be sure to only connect only their grounds together. The different +5V lines from separate power supplies should not be connected.
The strips can also be connected individually to your controller (in parallel). In this case each strip can be defined as its own set of LEDs in the controller. Each strip gets its own name and data pin.
Lastly for large setups it is important to keep in mind how many LEDs different types of controller can handle. Since each pixel’s color values get store in the controller memory we need enough bits for our strips. An Arduino Uno can handle up to ~600 pixels while an Arduino Mega can handle up to ~2400. There are many other controllers that can operate these LED strips that we may cover in a future guide.
With that, hopefully the setup and powering of these incredibly versatile strips is more clear. For more info check out our main LED guide here. Learn to Program Custom LED Lights