Arduino Nano ESP32 - LED Matrix Via Web
by DIYables in Circuits > Arduino
51 Views, 1 Favorites, 0 Comments
Arduino Nano 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://newbiely.com/tutorials/arduino-nano-esp32/arduino-nano-esp32-led-matrix-via-web
This build turns an Arduino Nano ESP32 into a web server with a WebSocket connection, letting you type text on a web page and have it scroll across an FC-16 LED matrix signboard. The board hosts the page, listens for messages over WebSocket, and pushes any text it receives straight to the display.
Supplies
Everything below is what the build uses. The links go to the parts we make and test.
- Arduino Nano ESP32
- 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 Arduino Nano
- Breakout Expansion Board for Arduino Nano
- Power Splitter for Arduino Nano ESP32
- DIYables Sensor Kit (18 sensors/displays)
Wiring
Connect the FC-16 LED matrix to the Arduino Nano ESP32, wiring its CS pin to pin D10 on the board. Power and data lines for the matrix run through the usual SPI-style connection used by the MD_MAX72xx driver. If you are using more than one 8x8 block (this project uses 4), chain them together as the matrix module expects.
How It Works
The Arduino Nano ESP32 connects to your WiFi network and runs both a web server and a WebSocket server. Loading the page in a browser serves HTML/CSS/JavaScript content stored in index.h. When you submit text on that page, it goes to the board over the WebSocket connection, triggering onWebSocketMessage, which clears the LED matrix and scrolls the new text across it using MD_Parola. The board then broadcasts a confirmation message back to connected clients.
Code
The project uses two files: the main .ino sketch, which sets up the web server and WebSocket server, and index.h, which holds the webpage content. The sketch uses the DIYables_ESP32_WebServer library for serving pages and handling WebSocket events, and MD_Parola with MD_MAX72xx to drive the LED matrix. Set your WIFI_SSID and WIFI_PASSWORD at the top before uploading. The code is commented line by line, so read through it in the Arduino IDE for the details.
arduino-nano-esp32-led-matrix-via-web.ino - the sketch from the tutorial, unchanged.
Things That Go Wrong
If the sketch won't compile, check that you installed the DIYables ESP32 WebServer library and the MD_Parola library through the Library Manager, and that you picked the Arduino Nano ESP32 board with the correct COM port. If the matrix stays blank, double check the CS pin is wired to D10 and that MAX_DEVICES matches the number of 8x8 blocks you have connected.
Full Tutorial
The complete tutorial, wiring diagram and code explanation: https://newbiely.com/tutorials/arduino-nano-esp32/arduino-nano-esp32-led-matrix-via-web