WS2812 LED Matrix

Published

A 8x8 LED panel conntected to an ESP8266 was constructed to make a kind of portable display module.

Alt text

The LED Matrix is constructed out of a WS2812B 8x8 panel, a 3D printed case, an ESP8266, a LiPo battery and some software.

Code

git clone https://github.com/robertfoss/esp8266_ws2812_matrix.git

The software is divided into two parts. The receiving end is run on the ESP8266 that has been flashed with NodeMCU and is a simple lua script that receives UDP packets and forwards them to the excellent WS2812 module created by the the equally excellent Konrad Beckmann.

The second part is run on a host pc. It's a simple python script that generates a framebuffer from a sinusoidal animation and transmits it over UDP to the IP of the ESP8266. This relies on the host pc being able to connect to the ESP8266. Ideally they're on the same LAN to minimise UDP packets being lost or delayed, which causes the animation to lag or skip. This part was also written by Konrad Beckmann as part of a larger fancier animation, but repurposed here to be used as a proof of concept.

3D Model

Alt text

The 3D model was created using google sketchup. The case is a made out of 2 parts. A front and a lid. The front has grooves that fit the WS2812 LEDs and make sure that the matrix is firmly stuck in place but also make sure that the light from the LEDs is diffused the proper amount.

Bill of materials

Alt text

A thing to be aware of is the fact that all orders from AliExpress will take at least 30 days to arrive to your door. Sometimes more.

Hardware construction

Alt text

You'll have to excuse the lack of a proper schematic, but this has been a fairly organic project.

The connectors of for the battery (B_VCC and B_GND), the WS2812 matrix (LED_VCC, LED_GND and LED_DATA), the ESP8266 (ESP_3V3, ESP_CH_PD, ESP_GND, ESP_GPIO2) and the AMS1117-3.3V (LDO_VCC, LDO_GND and LDO_3V3)

Issues and TODOs

Tags: ESP8266 · ESP · WS2812 · WS2812B · 3D Printing · CAD