This is not a normal step-by-step how-to guide. Instead, it is a consolidation of some of my most requested wiring diagrams. This is in response to repeated requests for copies of wiring diagrams from my YouTube channel. Many of these diagrams have alternate versions, additional optional components, etc. so I decided to create a single article with most of these diagrams that can easily be referenced.
Again, this article is not going to include the actual build process nor how to use the device. I will include links to videos and/or blog articles where the devices are used, and those will contain full build details, parts list, firmware links, etc.. I'll just include some notes where appropriate, but refer to the linked videos or articles below for more details on how to use the device or create the project.
Standard Disclaimer
While most of these devices operate using low DC voltages, some can carry high current and rely on mains AC power for the DC voltage power supply. Always exercise caution and assure you are following proper techniques to avoid any nasty shocks! Use a properly rated power supply for your projects (see the section below on calculating power supply size for LED projects). Always assure any components and wiring used are properly rated for both the voltage and amperage of the project. Failure to do so could resulting in components overheating, melting or possibly even starting a fire. If unsure, check with a more experienced user or a qualified electrician. These diagrams are provided for informational purposes only and it is up to you to determine suitability for your project and to employ any necessary safety precautions.
LED / WLED Controller
This controller is primary designed for 5V WS2812b LEDs, but can be adapted for other LED types that use a single data wire (clockless). I've built it in a number of different 'flavors', with different ESP boards and different peripherals. I've also used it in numerous projects that I'll link to below. This initial diagrams all include the use of an I2C logic level shifter, but a section below shows wiring diagram options for other shifters.
ESP8266 NodeMCU on Breadboard/ElectroCookie
ESP8266 Wemos D1 Mini on ElectroCookie Mini Proto board
ESP32 Mini on ElectroCookie Proto Board
Click to enlarge - shown with optional push button |
Controller with 12V Clockless LEDs - single 12V power supply
This is shown using the D1 Mini, but the same power wiring would be used for any of the ESP boards, ESP8266 or ESP32.
It is possible to use a 5V power supply for the controller and a separate 12V power supply for the 12V LEDs. However, you must establish a common ground between the power supplies or the LEDs will behave unexpectedly. Again, the D1 Mini is shown, but the power runs would be the same for any ESP board used.
Logic Level Shifters
Most of the above diagrams show the use of an I2C logic level shifter. While it is possible to omit the shifter if you keep the controller very close to the start of the LED strip, a logic level shifter will "boost" the data signal from the 3.3V output by the ESP board to the 5V expected by the LED strip. If your LEDs are flickering, non-responsive or showing unexpected effects, odds are you need a logic level shifter. Some people claim the I2C is "too slow" for LEDs... however I have found it works just fine up to at least 500 pixels if you aren't trying to produce video-style animations. But I'll show the wiring for the three most common types of shifters.
I2C Shifter
(Best for < 800 pixels and non-video style animation installations)
Click to enlarge |
SN74AHCT25N Shifter
(Recommended for larger installs or matrices showing video-style animation)
Click to enlarge |
Sacrificial Pixel
(You can 'sacrifice' a pixel installed close to the controller as a shifter)
Click to enlarge |
Optional Add-ons for the above LED controller
UPDATE: I now have a completely separate video and article on adding various components to a standard WLED controller. Please refer to these for the latest diagrams and many additional types of add-ons:
Level Up Your WLED Projects: A Guide to adding Components (YouTube Video)
Adding Components to Your LED Projects (written guide)
Connecting and Powering LED strips
As a best practice and safety precaution, the power for the LED strip should NOT pass through either the ESP board, ElectroCookie board or breadboard. While most LED strips operate off of low voltage (e.g. 5V, 12V), the current draw can get quite high with a large number of LEDs. The first thing you need to do for any LED project is to calculate the estimated maximum current draw and select the properly sized power supply.
Calculating Power Supply Size
To safely operate your LEDs, the power supply should be able to provide adequate power to operate the LEDs at maximum brightness and power draw (usually when producing white for standard RGB strips). It's easy to calculate the power draw with the following formula:
Max current = (Total number of LEDs) x (max current per LED pixel)
The max current per LED pixel will vary based on the type of LED strip being used, but can be found online. For WS2812b, which is what is used in most of my projects, I use a value of 60 mA per pixel (each pixel consists of 3 LEDs... red, green and blue... that draw 20 mA each. When all three are lit to produce white, that's 60 mA). Using an example of 300 pixels, then the maximum current draw would be:
Max current = (300 LEDs) x (0.06 A per LED) = 18 Amps
The recommended max passthrough current for an ESP: 0.5 A
The recommended max current for a breadboard: ~1 A
The recommended max current for an ElectroCookie Board: ~1 A - 2 A*
*I could not find an actual official rating on the ElectroCookie boards. But just based on the size of the copper traces, I would suspect no more than a couple of amps should be passed through those boards without adding to the traces with solder or wire.
So, as you can see above, trying to run up to 18 amps through the controller or board is a really, really bad idea. It will likely either fry the controller or could even cause the board to melt (or worse... catch fire). For this reason, anytime you are using more than just a few pixels (> ~10), you should run your power in parallel to the controller and LEDs.
Oh... and the power supply you select should be able to supply this current, with a little to spare (you generally don't want to run a power supply at its max rating for extended periods). So, for the above example, I would select a power supply that is capable of providing at least 20-25 amps.
While most quality power supplies have overload protection built-in, as an extra safety precaution (especially with larger, higher amp installs), you may want to consider adding an inline fuse to the +V line between the power supply and before you split the power line.
Parallel Power Connections
To run your power in parallel to the controller and LED is very simple. You simply split off two runs for 5V (or 12v) and ground from the power supply and connect one run to the controller and the other directly to the start of your LED strip.
If you are using a larger power supply with multiple terminals, you can easily split the power lead like this:
If you are using a smaller "brick style" supply with only one output lead, you have a couple of options.
If your power supply comes with a small adapter to allow you to connect bare wire leads, I recommend that you do not use it. These are also not rated for high current loads and I have had more than one fail. Instead, you can either cut off the existing barrel connector and strip the wiring insulation to expose the two wires, or you can purchase a small pack of matching female barrel connectors. I prefer the latter method as it still allow me a convenient way of temporarily disconnecting power to the controller and LEDs without having to reach the AC outlet to unplug the power supply.
Regardless of the method used, you need to have a bare positive and ground wire lead from the power supply. You can then split these leads to the controller and LEDs.
Click to enlarge |
I'm using Wago lever nuts in the above diagram (my personal favorite), but you can use standard wire nuts, or even solder the wires together if desired.
Creating a Test Controller
I've also had numerous requests about creating a test controller where you can test both the controller and LED strips. I have a couple of different test controllers (depending upon the ESP types and pin outs) that I actually soldered onto ElectroCookie boards. But you could temporarily create the same thing on a breadboard using the same process. My test controllers are very similar to the above diagram, with a few exceptions.
First, I use pin headers for where the ESP board is mounted. This allows me to easily swap out ESP boards, both to check out if the ESP is good... and to try different firmware (or easily re-flash an existing ESP with different firmware). Again, you may need different headers or versions if using a full size NodeMCU or an ESP32. I use the version shown above for both the D1 Mini and the ESP32 mini (when only using the inner row of pins on the ESP32 mini).
Click to enlarge |
I go ahead and solder a female JST connector to my test assembly, as most LED strips come with a male JST connector attached to the start of the LED strip. With this setup, I simply connect the appropriate sized power supply, plug in the controller I want to use/test and then connect an LED strip that I want to test/use. If you are planning on creating multiple LED projects, a test setup like this will be invaluable in your future projects.
Example Videos and Blog Articles
I cover the use and build of various versions of the above controllers in multiple videos and blog articles, including in some cases, step by step processes of building the controller... or hooking up additional components, like buttons and sensors. Here are a few that you may want to reference if you are relatively new to building LED controllers or DIY electronics. Note that some of these older videos or articles may contain outdated information. The diagrams included above are the most recent, updated versions and should be the ones you use. In addition, some projects may require a particular ESP type, such as an ESP8266 vs. an ESP32, but this will be noted in the video and/or article.
General Knowledge - beginner videos
Building an LED Controller (step-by-step):
Using WS2812b LED Strips:
Adding Peripherals to an LED Controller:
Logic Level Shifter and WS2812b LEDs:
Planning an LED Installation:
Project Specific Videos using LEDs/LED Controller
Motion Activated LED Stair Lighting (Home Assistant version):
Motion Activated LED Stair Lighting (standalone version):
DIY Sound Reactive LED Floor Lamps:
Hexagonal LED Panels using WLED:
Magnetic WLED Lettering:
WS2812b Matrix with Dual Controller Clock and WLED:
A Parking Assistant using ESP8266 and WS2812b LEDs:
Upgrade Your Christmas Tree with Sound Reactive WLED:
Additional Diagrams and Drawings
I may add additional diagrams or drawings to this article from time to time when situations arise where clarifications, updates or other changes are needed. In most cases, everything you need to know about completing the wiring for one of my projects will be covered in the YouTube video, related blog article or both. This article will primarily serve as a quick reference or review for some of those projects that require it.
Supporting this blog and related YouTube channel
If you'd like to support future content on this blog and the related YouTube channel, or just say thanks for something that helped you out, you can say thanks by buying me a one-off cup of coffee at:
These diagrams (and the videos you post) have been super helpful for me. I do have a question, though, about the Logic Level Shifter wiring. I'm not using a breadboard, so I'm having a hard time following the wiring. I was having an odd issue that it seemed like the LLS would fix it, but I wired one up and it didn't make a difference. Is there any way that you could create a diagram that would show direct wiring for a d1 mini with a logic level shifter without a board?
ReplyDeleteI can try to come up with a diagram and maybe add it to this article when I get a chance. The issue without using a breadboard or prototype board of some sort is that the D1 Mini only has one 5V, 3.3V and ground pin... but you need multiple connections for each of those (except 3.3V). The 5V pin and ground are needed for incoming power to power the board (unless using USB for power). You then need a 5V and ground connection to the HV side of the shifter. Then on the LV side, you need the 3.3V and yet another ground connection. You could potentially splice wires together, but this where having a power rail or extra connections to a single pin on the D1 mini is really handy. It can be done, but you will be either wiring in jumpers or splicing wires. I'll try to put together a diagram, but I can't promise when I get it done based on other current projects.
DeleteThank you for the explanation! I think that clears up my question. So like this if I were not using a breadboard: https://photos.app.goo.gl/LegiLfYZNoaUZyCA6
DeleteThat's close... the only thing is that the 5V and 3.3V should be connected to HV and LV (respectively) and not HV2 and LV2. HV and LV are for the source voltages. The numbered connections are for the data signal(s) that you wish to shift. So, if you just move the 5V connection to HV and the 3.3V connection to LV, then I think everything else looks good.
DeleteHaving issues posting a question regarding Buck regulator with post containing links.
ReplyDeleteYeah... posts with links are automatically blocked but I did get your original post, so I will attempt to reply to your questions here. First, I believe if a converter "fails open" that means it fails with the circuit open and no voltage would be passed. The circuit would be "closed" when 'active' and voltage is being passed. When in doubt, you can always fuse the system to prevent damage to components in the event of a failure.
DeleteAs far as the Athom device, it has internal circuitry to handle up to 16A. This is significantly different than my DIY versions where all the current is run directly through the ElectroCookie board (much like a breadboard) if you try to power the LEDs from the controller. If you look at the internal photos of that device, it has relays, capacitors and I am assuming much larger traces for carrying the extra voltage/current. It also has internal fusing. This device is a much different animal than the DIY bare board version I cover in these diagrams. My guess is that they are more or less passing the power through to the LEDs (again, with components rated for that current) and using a step down converter to power the ESP chip... much like my diagrams, but they are putting all in one package with extra power handling components.