Thursday, February 1, 2018

The ESP32 Pinball RGB Matrix Animation Clock (Espirgbani)

Displays the time and random DMD animations from various pinball machines. The whole show is run by a single ESP32. The inspiration came from http://run-dmd.com/.

The project on github



LEDs

I got my two 64x32 LED panels from Aliexpress. Not surprisingly (with that price tag) they were refurbished and showed some signs of soldering rework on the boards. They do work perfectly fine though.

Frame

Easy if you have access to a laser cutter. I used 1/4 inch plywood for the back and grey tinted acrylic (expensive!) for the front. Right on top of the LED modules is a milky diffuser foil, which I got from broken LCD monitors. Hexagonal spacers hold everything together. Laser cutting is great. Stuff actually fits together just the way it should :D

Here's the Fusion360 preview

Here's the actual .dxf files


Everything runs of a re-purposed 19 V laptop power supply. The higher voltage makes it possible to use thin stealthy power cables when hanging the clock on a wall. I used two cheap step-down modules mounted to the back of the panels to generate the 5 V at up to 5 A they need.

PCB

Extremely straightforward. There's the ESP32, a 3.3 V regulator, a programming port, a SD card slot (from a dead RaspiA) and that's about it. All the tricky stuff happens in firmware.


Firmware

Features

  • Uses sprite_tm's I2S DMA driver to refresh the display at > 100 Hz with zero CPU load
  • Right now there's 3 graphical layers: animated background, time string, pinball animations
  • All framebuffers are RGBA. Does full alpha compositing (with pre-multiplied RGB values) according to the classic paper.
  • Uses a variable width & anti aliased bitmap fonts for writing the time. Supports the AngelCode bitmap font format and reads .bmp and binary .fnt files from the SD card.
  • Credit for collecting a huge number of pinball animations goes to https://rundmdimage.wordpress.com/. This clock supports the same image-file format.
  • Uses some nice C (almost) one liners to produce attractive animated backgrounds on the fly. It's like a poor mans shader
  • Has a simplistic (needs more work!) web-interface based on the excellent libesphttpd




3 comments: