Wled setup

WLED is an open-source software application that controls LED light strips and matrices. It is specifically tailored for use with ESP8266 and ESP32 microcontroller units. WLED stands out for its user-friendly interface and extensive feature set, including a wide range of lighting effects, colour palettes, and configurations. It supports Android and iOS devices through a web-based interface or dedicated app, allowing users to easily customize and control their LED setups. Additionally, WLED integrates with popular smart home solutions and offers advanced features like music synchronization, making it a versatile choice for DIY enthusiasts and professional lighting setups.

Below is based on the Wled Getting Started guide

Wiring the led to the ESP32

Always ensure that the ESP32 and the LED strips are powered appropriately, and the power supply has enough capacity to handle the LEDs' current draw (see image below to hook up a power supply)

Default pins:

See Getting Started for more details

In general, use one of the GPIOs that support output and are not used by the ESP32 for critical functions. Good choices are GPIOs 2, 4, 12, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, or 33.

Upload the firmware

To upload the firmware, do the following:

Connect to the Wled interface

Connect to a WIFI network

Adding interactivity

Multiple button types can be created:

With analog input only use ADC1 not ADC2 which interferes with wifi (see pinlayout below).

See more here:


Control Commands: 

These commands are used to directly control the LED lights. They include turning the LEDs on/off, setting the brightness, changing colors, selecting effects, and adjusting effect speed and intensity.

Example wiring of potentiometer.

Example wiring of button (active low example)

Example wiring of joystick.

Setting up a button example

2. Go to Settings => Led Preferences. Then, set the GPIO pin.

3. Go to Settings => Time & Macros. Then, set the buttons actions. The number represents the id in the step 4. 

4. Goto front control panel and press "+ Preset". Then uncheck "Use current state" then add the API command

The pin maping of the ESP32 Mini

This is a relatively technical diagram. You will not need this in the beginning but at a later state this will help you to look up the different pins and what they can do. The green boxes indicate the the pin can be used to read analog signals (0v to 3.3v). The pink boxes indicates that the pin can be used as touch sensor.

Control Wled over Websocket + p5js

Communication is done via JSON API:  https://kno.wled.ge/interfaces/json-api/

The official websocket guide can be found here: https://kno.wled.ge/interfaces/websocket/

P5jS: WebSocket example: https://editor.p5js.org/hobye/sketches/u_RXbKk4t


2. Run P5 sketch

MQTT + p5js

Communication is done via JSON API:  https://kno.wled.ge/interfaces/json-api/

The official mqtt guide can be found here: https://kno.wled.ge/interfaces/mqtt/ 

P5jS: WebSocket example: https://editor.p5js.org/hobye/sketches/RE30GYpxR 

Get mqtt liveview here: https://www.shiftr.io/try

Open sketch:

Compile with arduino

Some of the above libraries  can be found in the libraries tab other may need to be downloaded and added manually.

Look for the libraries in the library tap.
Else download them from the links and add them in the menu Sketch => Include Library => Add .Zip ibrary.

3. Open it in Arduino

4. Verify that the program has been opened correctly