This video documents the creation of an open-source LED matrix display designed to interface with a computer via a standard M.2 NVME slot. The project leverages a WCH CH382 chip to bridge the M.2 slot's PCIe interface to a serial connection, communicating with a WCH CH32V208 RISC-V microcontroller that drives the LED matrix. Key challenges addressed include implementing the PCIe connection correctly (overcoming an initial design flaw where transmit and receive lanes were swapped) and enabling convenient firmware updates. A significant achievement was adapting a web-based serial programming tool (Web ISP) to flash the microcontroller's firmware directly from a browser without requiring disassembly or proprietary software, utilizing the chip's built-in bootloader. The project successfully demonstrates the M.2 LED matrix being controlled interactively through a custom web interface, allowing live stream viewers to draw and even stream video content (like Doom) to the display. All design files and code are available as open source.
Building an M.2 LED Matrix: From Concept to Community Control
00:00:02 Project Introduction: The goal is to create an LED matrix display board that plugs into an M.2 slot typically used for NVME SSDs, controllable via a web browser.
00:00:30 M.2 Connector Rationale: M.2 connectors are chosen for their common availability, dense pin pitch (0.5mm), and versatile interface options, particularly PCI Express (PCIe) provided by Keys B & M.
00:01:23 PCIe Interfacing Challenge: The main technical hurdle is interfacing with the low-level PCIe protocol. The solution involves finding an interface chip to convert PCIe to a simpler protocol like USB or Serial.
00:01:54 Chip Selection (WCH CH382): A WCH CH382 chip is selected, identified from existing PCIe-to-Serial adapter cards. This chip converts PCIe to two serial ports and is known for requiring minimal external components.
00:03:12 Initial Design: A circuit is designed connecting the M.2 PCIe lanes to the CH382, which then connects via serial (UART) to a WCH CH32V208 RISC-V microcontroller responsible for driving the LED matrix.
00:03:25 In-System Programming Problem: A key challenge is programming the microcontroller firmware after the board is installed in a PC. Standard debug headers are inconvenient.
00:03:36 Web-Based Flashing Solution: A browser-based firmware uploader (Web ISP) for WCH RISC-V chips is discovered. It uses the chip's serial bootloader, potentially allowing programming via the CH382's serial port by manipulating control flow pins.
00:04:42 PCB Manufacturing (Aisler): The 4-layer PCB is designed to the M.2 standard 0.8mm thickness and ordered from sponsor Aisler, utilizing their affordable 0.8mm service.
00:05:55 Assembly: The board, including 240 LEDs, is assembled using a pick-and-place machine (Pixel Pump) to manage the small components and correct LED orientation.
00:06:31 First Test Failure: The initial board assembly leads to excessive heating of the LDO and CH382 chip when plugged in, and the device is not recognized by the PC.
00:08:01 Root Cause Identified: Debugging reveals a critical design flaw: the transmit (TX) and receive (RX) pairs for one PCIe lane were swapped in the M.2 footprint layout.
00:08:41 Board Revision: The PCB layout is corrected, excluding the edge connector from the solder paste stencil, and new boards are ordered.
00:09:00 Second Test Success: The revised board is successfully recognized by the PC as a serial device after installing WCH drivers, though the LDO still runs warm (~75Β°C).
00:09:33 MCU Programming Verified: The CH32V208 microcontroller is successfully programmed with a test firmware (blinking LED) using the onboard programming header.
00:10:20 Reset Circuit Challenges: Implementing an automatic reset circuit triggered by serial control signals for the browser-based flasher proves difficult and requires manual intervention initially.
00:10:33 Collaborative Web Flashing: Working with the Web ISP tool author (Basil) and the online community, the browser-based firmware upload process is successfully implemented, enabling true in-system programming.
00:11:32 Web Control Interface: A web application is developed (initially with GPT assistance) allowing users to draw graphics and send the data over the detected serial port to the M.2 LED matrix.
00:11:50 Interactive Community Demo: During a live stream, viewers use the web tool via a websocket server to send their own artwork, text scrolls, and even stream Doom gameplay directly to the M.2 display.
00:12:17 Open Source Release: The entire project, including hardware design files and software code, is released as open source on GitHub for others to use and modify.