ESP32 - LED Matrix Via Web
by DIYables in Circuits > Microcontrollers
88 Views, 0 Favorites, 0 Comments
ESP32 - LED Matrix Via Web
This is a compact build guide. The full tutorial, with the wiring diagram and a line-by-line walkthrough of the code, is here: https://esp32io.com/tutorials/esp32-led-matrix-via-web
This build turns an ESP32 into a web server that drives an FC-16 LED matrix signboard. You open a web page, type text, and the ESP32 pushes it over WebSocket to the matrix, which scrolls it across the display. It is a compact way to send messages to an LED sign from any browser on the same network.
Supplies
Everything below is what the build uses. The links go to the parts we make and test.
- 38-pin ESP32 ESP-WROOM-32 Dev Module - Narrow
- 38-pin ESP32 ESP-WROOM-32 Dev Module - Wide
- 30-pin ESP32 ESP-WROOM-32 Dev Module - Wide
- ESP32 Uno-form board
- ESP32 S3 Uno-form board
- USB Cable Type-A to Type-C (for USB-A PC)
- USB Cable Type-C to Type-C (for USB-C PC)
- FC-16 LED Matrix 32x8
- Breadboard
- Jumper Wires
- DC Power Jack
- Screw Terminal Expansion Board for ESP32
- Breakout Expansion Board for ESP32
- Power Splitter for ESP32
- DIYables ESP32 Starter Kit (ESP32 included)
- DIYables ESP32 S3 Starter Kit (ESP32 S3 included)
- DIYables Sensor Kit (18 sensors/displays)
Wiring
Connect the FC-16 LED Matrix 32x8 to the ESP32 with the CS pin going to ESP32 GPIO21. The sketch is set up for 4 cascaded matrix blocks (MAX_DEVICES = 4) using the FC16 hardware type. Power the ESP32 and the matrix appropriately; if you are not sure how to power the ESP32 and a display together, check a dedicated power guide before wiring everything on the breadboard.
How It Works
The ESP32 runs both a web server and a WebSocket server. Loading the page in a browser serves HTML/CSS/JavaScript stored on the ESP32. When you type text and send it, the WebSocket message handler receives it, clears the LED matrix, and scrolls the text across it centered, moving left, using MD_Parola. The ESP32 then broadcasts a confirmation message back to connected clients showing what was displayed.
Code
The project uses two files: the .ino sketch, which sets up the web server, the WebSocket server, and the MD_Parola LED matrix object, and index.h, which holds the webpage content served to browsers. You need the DIYables ESP32 WebServer library and the MD_Parola library installed via the Arduino IDE Library Manager. Set your WiFi SSID and password in the sketch before uploading. The code is commented line by line, so read through it for details on each part.
esp32-led-matrix-via-web.ino - the sketch from the tutorial, unchanged.
Full Tutorial
The complete tutorial, wiring diagram and code explanation: https://esp32io.com/tutorials/esp32-led-matrix-via-web