WLED 101

From Pumping Station One
Jump to navigation Jump to search

Premise and goal

WLED is an open source web server that runs on ESP boards to control addressable LEDs. This page documents a bit of a crashcourse to have a 1 meter strip of blinky LEDs you can control over wifi!

I'm Rubin, and am hoping to run at least 1 instance of this class. You can find me on #smart-home in the PS1 Slack.

Guide with pictures!

I wrote up the text guide here in a bit of a rush and then wasn't looking forward to tossing up pictures into the wiki. A friend suggested I just come up with a slide deck which is what I did. The slides provide pictured instructions for all of the assembly however link back here for the WLED programing steps. At some later point in time I'll add in pictures for the WLED stuff.

Click here for the guide with pictures!

Prerequisites

  • Please try to bring your own laptop to install WLED
  • You're comfortable with soldering (or at least trying)
  • You're comfortable trying to follow the directions provided here before needing guidance (especially with the soldering parts)
  • We should have all of the soldering gear needed at PS1, solder, flux (I hope)

Parts

During this meetup I will provide all parts needed (while supplies last). I will have a handful of my own USB cables and a large charger brick to test strips with, however you'll need to use your own when you take your strip home. The parts are provided for free to anyone attending, however if you want to kick back money please consider donating to PS1.

Extra shown off parts

I showed off a couple other items that aren't part of this kit. Here's a list of them.

Power supply notes

The WS2812B requires 5V to power the LEDs, as does the Wemos D1 board. Typically you will want to power both the strip and the board from a 5V power supply. For this short 1 m strip we're going to cheat and provide power to the LED strip from the USB port on the Wemos board. If you want to put together a new strip that's longer and requires more power you'll want to use a proper 5V power supply with more amps wired directly to the strip. Googling around you can find plenty of help on how to power strips. Do not power more than 60 LEDs via the Wemos USB port, you risk frying the board.

Steps

Solder LED strip to female connector

LED strips should be precut, but incase they're not, measure 1 meter and cut LED strip along dotted line

Grab JST SM 3 pin female connector (has 3 holes)

Apply flux wires on connector. The wires should be pre-tinned with solder.

Locate data flow direction arrow, you'll want to solder the connector to the side with the arrows going INTO the strip. See picture.

Put shrink tubing around LED strip. Make sure the shrink tubing is at least 5 cm up and away from the end of the LED strip so you don't accidentally start shrinking it with the heat from the soldering iron

Apply flux and pre-tin 3 solder pads on the side of the LED strip with the arrows going INTO the strip.

Solder female connector (has 3 holes) wires to LED strip pads, match up red to 5V+/Power, green to Din/Data, white GND/Ground

Double check for any solder blob shorts

Do not shrink the shrink tubing yet

Solder ESP8266 to male connector

Grab JST SM 3 wire male connector (3 pins), apply flux to wires, DO NOT pre-tin

Jam wire into enclosure side hole with the green wire on the left, see picture

Grab ESP8266, on the back (where all the pads are labeled) apply flux to VBUS/5V+/Power, GND/Ground, and 2/D4/GPIO2. These are all next to each other.

Push the red wire from the connector through the TOP of the board (where all the components are) so they stick through the BOTTOM of the board (where all the labels are that you’ve fluxed). You can use a small bit of electric tape to hold the wires down on the top. Check to make sure no wire strands have come undone and touch other components on the top side. Solder the wire to the VBUS/5V+/Power pad. Check that the solder hasn’t blobbed over to other pads.

Repeat this step for soldering the white wire to GND/Ground.

Repeat this step for soldering the green wire to 2/D4/GPIO2.

Triple check that no wire strands have come unbundled or solder blobs have created shorts.

Gently pull the wires back out the case and slide/pop the board into the case.

Test for shorts

Do not plug the connectors together yet. Do not plug USB into a computer.

Plug the board via USB into a USB charger.

The LED on the board should turn on, if you do not see this double check for shorts on both the board and the LED strip

The first 2 LEDs on the strip should turn on

Slide shrink tubing down, use a heat gun, lighter or side of soldering iron to heat shrink the tubing around the freshly soldered connection

Pop the cap to the case.

Flashing the ESP8266 with WLED

Do not plug in the board to your computer yet

Open Chrome (this will not work with Microsoft Edge, Safari, or Firefox)

Go to: https://install.wled.me

The instructions on the website direct you to plug the board into the computer, do not do this just yet.

At the time of this writing the latest version of WLED 0.14.1-b2, this is a perfectly good version to install. You’ll just want the “Plain” version.

Click Install.

A window will pop up showing all serial devices Chrome sees. Take note of what items are listed WITHOUT the board plugged in.

Plug in the board.

A new device should appear, it will be named differently depending on what OS you’re running.

If Chrome does not find your device, cancel and then click on “No device found?” to grab and install drivers for the CP2102. You may need to restart your computer before trying again.

Click connect

WRITE MORE HERE

You should see the first 30 LEDs light up amber.

Open up webpage (you may need to tell Chrome that you’re ok connecting with an unsecure webpage)

Connect to and configure WLED

Once you’re on the web page for your WLED strip from the previous step

Take note of the IP address now, this will change when you reconnect WLED to your home wifi

Go to Config > User Interface

Server description, enter in a unique name so you can differentiate your LED strip from everyone else’s on the wifi network. Hit Save. Hit Back.

Go to LED Preferences

Power being sent to the LED strip is being fed from USB and going through the ESP8266 board. The board isn’t designed to push more than about 1000mA or 1A.

Keep Enable automatic brightness limiter to on, and Maximum Current to the default of 850 mA. LED voltage should also remain at the default 5V default (55mA).

WLED needs to know how many LEDs are in the strip you’ve plugged into it. WLED also needs to know if you have multiple segments of strips plugged into different GPIO pads on the board.

On the same screen go to Hardware setup > LED outputs. We only have 1 segment of 60 LEDs plugged into GPIO 2. Under 1 set the length to 60 LEDs

Hit Save. Hit Back.

Use WLED, quick crashcourse

There’s a power button in the top left. You’ll need to research how to have defaults setup for when WLED is first plugged in.

If you’re viewing on a laptop screen you’ll find a brightness slider at the right, and columns, of which the first two are Color Palette and Effect Mode.

If you’re viewing on a phone screen you’ll find a brightness slider under the top buttons, and buttons at the bottom for Colors and Effects.

In the Color column/screen you can select either a solid single color, or a palette of colors, select a random cool palette.

In the Effects column/screen you can select an effect to make the LED strip do cool stuff with the color palette. Try Phased. Some of the effects will have hard set color palettes of themselves. At the bottom of the effects screen there will be sliders to play with the speed of the effect or the intensity. Some effects will require a mic to be soldered into the board to do anything.

Moving WLED to a different wifi network, like at your house.

When WLED cannot find the wifi network it was previously configured to it should open up its own wifi network where you can connect to and reconfigure the wifi network settings in the Config menu. Once moved you can use one of the WLED phone apps to scan and find the device on your wifi network.

If after 3 minutes you don’t see a “WLED” wifi network come up then you can plug the board back into a computer and go back to install.wled.me. When you tell the website to “install” again it’ll detect WLED already existing and offer an option to change the wifi network. Again note down the IP address, or try one of the apps.

WLED Phone App

The phone apps can most of the time find WLED instances on your network automatically.

Home Assistant

If you have Home Assistant running, you can go to Settings > Devices & services. HA might auto discover WLED already on your network and give you an option to add the device. If HA doesn’t auto discover it, then just click Add Integration, select WLED, and provide the IP address.

WLED and beyond

Pop into #smart-home in the PS1 Slack if you’ve got more questions!