With this project, you can control an WS2812 RGB LED stripe (up to 300 LEDs) via your browser.
The following features are realized.
- browser control
The device provides a webpage, where you can control the LED stripe (including simple animations).

- smooth on/off
The LEDs will be turned on and off smoothly via a PT1 damping - rightness is dependent form sunrise & sunset
You can define two different brightnesses, one for sunrise and one for sunset.
The brightness switches automatically when the sun rises or sets.

- color animations
You can define simple color animations

- sunrise & sunset calculation
You can configure NTP timing servers and your longitude and latitude, to calculate the sunrise and sunset.

- optionally IR motion sensors
Connect optionally two IR motion sensors to activate the LEDs by motion detection.
After a defined time the LEDs will be durned off.

- optionally IR distance sensors
Connect optionally an IR distance sensor to control on/oof and the brightness.
- fast moving across the distance sensor turns the LEDs on/off
- static distance in front of the distance sensor changes the brightness
The following main devices are used in the schema:
- Wemos D1 mini: ESP8266 CPU
doc: https://www.wemos.cc/en/latest/d1/d1_mini.html - WS2812B: single addressable LED-stripe
doc: data sheet - AM312: IR motion sensor (optional)
doc: data sheet - GP2Y0A21YK0F: IR distance sensor (optional)
doc: data sheet
- open project root in your VSCode editor
- connect device Wemos D1 mini via USB
- configured the connected COM port in
./platformio.ini - open your PlatformIo VSCode plugin
- select in PlatformIo / d1_mini / Platform / Upload Filesystem Image to upload the Sketch data stored in
./data/ - select in PlatformIo / d1_mini / General / Build to build the system
- select in PlatformIo / d1_mini / General / Upload and Monitor to upload the code and start the serial monito to see the debug output
This project sends a lot of debug information via the serial interface. These data will be sent with 115200 baud.
You can control which information should be sent, when you change the DEBUG_LEVELin file DebugLevel.h
Lines 4 to 20 in 8eb0543
When you turn on as first time, follow the next steps, to connect the device in your WiFi:
-
The blue onboard LED is blinking slowly to inform you, a Wifi-Access-Point was started.
-
Search and connect your mobile device with an WiFi-Access-Point named
WiFiLed-\<DeviceId\>name value SSID WiFiLed-<DeviceId> Password none Url http://192.168.4.1/ -
Open in your browser the page http://192.168.4.1/
-
In WiFi Setup add your WiFi SSID and password and press Success

-
The device starts new, but with a fast blinking onboard LED to inform you, the connection to your WiFi is trying
-
When the WiFi connection is successfully established, the onboard LED is static on.
- Search in your router the IP from device
- open the IP in your browser to control the LED stripe
-
When the WiFi connection fails after 3 minutes, the device will restart, but im WiFi-Access-Point mode (slow blinking onboard LED)
Repeat all steps from begin
- none

