NeoPixels, or WS2812B RGB LEDs as they are officially called, are a compelling offering for manufacturers. They produce a soothing light show and can be controlled with just about any microcontroller. raspberry pi pico and the BASIC programming language.
Writing code to control a NeoPixel is not difficult, but what if you want to bring a little light to your home or office and control everything from your browser? WLEDsis a feature-rich web server for ESP8266 and ESP32 that gives you full control over various RGB LEDs.
There is currently no WLED software for Raspberry Pi Pico. So for the time being I’m going to use the venerable ESP8266 as my microcontroller. We will use Wemos D1 Mini, one of his most popular development boards for ESP8266 projects. The ESP8266 has slightly longer teeth and may be significantly underpowered compared to the Raspberry Pi Pico. But if you’re just controlling a few LEDs, you don’t need the extra horsepower.
In this how-to, you’ll learn how to attach a WLED to a Wemos D1 Mini and use the WLED to control an array of NeoPixel LEDs.
What you need for this project
Wemos D1 Mini and NeoPixels come with unsoldered header pins. best soldering iron When solder the header pins Use it on a breadboard.
Controlling the NeoPixel is easy. Electrically, only three connections are required between the Wemos D1 Mini and the NeoPixels. Power comes from the 3.3V pin, which is connected to the NeoPixels’ 5V (VCC) pin. The NeoPixel runs from 3-7V, while the Wemos D1 Mini uses 3.3V logic for its GPIO, so matching the voltage to your logic is the best option. Wemos D1 Mini’s GND (G) connects to NeoPixels’ GND. Finally, connect Wemos D1 Mini’s D4 to the NeoPixels’ data input pin via a 330 ohm resistor. This resistor is there to limit the current drawn from the data pin. Any value resistor between 300 and 500 ohms can be used. Check color code before connecting to the circuit.
The shape of the NeoPixels doesn’t matter. They all follow the same principles of power, data and ground connections. The Wemos D1 Mini’s 3.3V pin isn’t enough to power a long chain of NeoPixels. Instead, power must be injected into the pixel from an external source. Adafruit’s Uberguide to NeoPixels I will explain how to approach this.
|Wemos D1 Mini||wire color||neo pixel|
Attach WLED to Wemos D1 Mini
WLED made installing this custom firmware very easy. Gone are the technical steps to prepare a device for firmware. Just plug it in, click a few buttons, and the installer does all the heavy lifting.
1. Connect Wemos D1 Mini (ESP8266) to your computer using a high quality USB cable. Some cables are power only, others have poor connections. Always use a good quality cable when flashing firmware to your board.
2. open Navigate to the WLED installer page from your browser. This page will walk you through all the installation steps.
Four. Select Wemos D1 Mini,[接続]Click. WLED uses Web Serial to open a serial port on your computer. Wemos D1 Mini / ESP8266 is connected via USB serial port.
Five. [Install WLED]Click to start the process.
6. Confirm the installation and flash the firmware to the board. Installation will take a few minutes. This extra step is a final warning. After this, all data on the device will be destroyed.
7. [次へ]Click to finish the installation process.
8. Enter your Wi-Fi details,[接続]Click. This will connect the Wemos D1 Mini to the Wi-Fi access point and save the details for later use.
9. [デバイスにアクセス]Click to open the Control Panel. This connects to the WLED running on the Wemos D1 Mini. Make a note of the IP address as you will need it to access the control panel.
Ten. The NeoPixels should start to move and glow a solid color. If not, check your wiring before proceeding.
WLED’s user interface is simple, but it can be overwhelming at first. By default it opens in a mobile friendly page. Here’s how to use WLED from your mobile device. Since we are sitting in front of our PCs, we need to change the interface to make the most of our screen.
1. Click PC Mode. This reformats the interface to show a wider display.
2. Select a color using the color wheel. This is a basic check to see if you can control the NeoPixels.
The WLED user interface is divided into five areas.
1. composition: Here you’ll find buttons to open advanced features such as sync (to synchronize multiple lights using WLED across a network) and advanced features such as JSON and MQTT to access display LEDs. You can find a configuration that allows you to set the number.
2. Color picker: You can set the current color of the LED using the color picker. This is a static display or animation. Scroll down this section to access different color palettes that you can use in your effect.
3. effect: This section contains pre-made animation sequences that can be used with NeoPixels. Effects come with their own color palette,[カラー ピッカー]You can change these as needed using sections.
Four. segment: If you have a large array or matrix of NeoPixels, dividing them into segments means you can control each segment with a different color, animation, or color palette.
Five. preset: Here you can create custom light show presets and create playlists that cycle through the many animations provided.
Set the number of NeoPixels
1. [構成]Click. This opens a mobile-centric user interface.
2. Select LED settings.
3. Scroll down to hardware settings and set the length to match the number of NeoPixels. I’ve tested with a series of 8 pixels, but I usually run a 20 pixel LED star.
Four. scroll to the bottom and[保存]Click.
Five. [戻る]Click to return to the main screen.
Changing effects is as simple as choosing one of the great options from the effects list (3).
1. Select an effect. NeoPixels react instantly.
2. Change the speed and strength of the effect. The higher the slider, the faster and stronger the effect. It may cause strobe, so please be careful if you are sensitive to light.
3. Change the color palette using presets under the color picker. This keeps the animation effect but replaces the color.