Pico Led Controller 0.1.0
A project to control LEDs using Raspberry Pi Pico W
|
This project is a simple example of how to manage a WS2812B LED strip with a Raspberry Pi Pico W and a Web interface.
For 120 LEDs to power, you will need a 5V power supply with at least 6A current. The power supply should be connected to the LED strip and the Raspberry Pi Pico W. For this project, two 5V 3A power supplies were used. General schema is shown below:
The code is written in C and follows src, include
structure. The project is based on the Raspberry Pi Pico SDK and FreeRTOS.
For this project to build, you will need the following packages:
You will probably need those environmental variables exported:
There is gitignored Wi-Fi credentials file to create in following directory led_controller/include/wifi_credentials.h
:
The web interface is a simple page that allows you to control the LED strip. It is served by the Raspberry Pi Pico W itself. Data fetch intervals are set to 5 seconds to avoid overloading the Pico W. Start timestamp is created by the server although counting elapsed is fully client-sided.
[!NOTE] Building the frontend separately with Python is an older practice. This could be avoided using CMAKE.
To build the web interface, simply run:
If you will be using the web interface locally, you don't need https to install the app. In Chrome, resolve chrome://flags/#unsafely-treat-insecure-origin-as-secure
and your's Pico W IP address. Restart the browser and manifest.json will allow for the install. Then, Chrome flag can be set back to default.
After building the project, you can flash the Raspberry Pi Pico W with the generated led_controller.uf2
file. The LED strip should light up with the default mode Rainbow Wheel
. You can change the color by choosing one of the buttons on the web interface. When connecting to the Wi-Fi for the first time, check the serial output for the IP address.
This project is licensed under the MIT License - see the LICENSE file for details.