Skip to the content
2 layersMetromap, the printed circuit board in 3D

A lit-up Budapest metro map: ESP32, two MAX7219 LED drivers, a custom KiCAD PCB and 96 hand-wired LEDs.

Copper layers
2
Thickness
1.6 mm
Parts
46
Nets
40
Pads
95
Tracks, vias
106, 1
Pours
1
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
12 Oct 2026
Updated
26 Oct 2026

Overview

Metromap is an open-source printed circuit board by gergelytothh, from the gergelytothh/metromap repository on GitHub, published under the MIT licence. It is a 2-layer board with 46 parts on 40 nets, routed with 106 tracks and 1 via.

It is built around the MAX7219M. Its parts include 2 capacitors, 2 ICs and 1 resistor. It belongs with the lEDs and displays boards and the ESP32 boards of this library.

Main components

1

README

README.md

Metromap

Metromap with all LEDs lit

A map of the Budapest metro, designed to show trains moving on all four lines. There are 96 LEDs on the map: two at each station (one per direction) and one at each terminus. They are hand-wired and soldered onto the map and driven by an ESP32 through a custom PCB. Right now it runs a simulated train animation; live data from BKK is the next step.

I'd seen lit-up metro maps of other cities online, but none of Budapest, and I didn't like the design of the ones I found. Since I'm studying electrical engineering anyway, I decided to build my own.

How it works

The LEDs are driven by two MAX7219 chips, controlled by an ESP32. Each chip has 16 outputs: 8 DIG (digit) pins that sink current and 8 SEG (segment) pins that source it. Each LED sits where one DIG line and one SEG line cross, so one chip can control 64 LEDs and the two together 128.

Only one DIG line is active at a time. The chip sets the SEG lines for the LEDs that should be lit in that row, pulls the DIG line low, then moves on to the next row. It cycles through all 8 rows hundreds of times a second, so every lit LED looks constantly on.

The two chips are daisy-chained: they share the ESP32's clock and load pins, and U1's data output feeds U2's data input. The ESP32 shifts out 32 bits, a 16-bit word for each chip (an 8-bit register address and 8 bits of data, which set the SEG lines for one DIG row), and then a pulse on LOAD makes both chips apply them at the same time.

There are 96 LEDs, so one chip wasn't enough. I split them by metro line, so each line stays on a single chip and both chips stay under the 64-LED limit:

ChipLinesLEDs usedSpare slots
U1M1 + M24024
U2M3 + M4568

Every LED has an ID (1–96) and is assigned a chip, a DIG and a SEG. This mapping table is in station_map.h (also as a CSV).

The firmware builds on this table:

  • One LED by ID: looks the ID up in the table and turns on that chip/DIG/SEG.
  • Walk test: lights every LED in turn, 1 to 96, and prints its station to the Serial Monitor, so wiring mistakes are easy to spot.
  • Train mode: each line gets a route, from one terminus out along the forward LEDs and back along the backward ones, and four trains, one per line, move one stop at a time.

Hardware

The bare PCB

I designed the driver PCB myself in KiCAD and had it made by NYÁKÁRUHÁZ Kft. It holds both MAX7219s in DIP sockets, so the soldering heat couldn't damage the chips. Every DIG and SEG pin goes to a labelled pad.

The finished map with the driver board and ESP32

From each pad, a wire runs to the back of the map, where it connects to the right LEDs. That's around ~280 solder joints in total, all by hand.

The rear wiring The back of the map. Every wire is labelled in pencil with its DIG/SEG line.

PartWhat
MicrocontrollerESP32-WROOM-32U dev board
LED drivers2 × MAX7219 (DIP-24, socketed)
PCBOwn design in KiCAD, made by NYÁKÁRUHÁZ Kft.
LEDs96, one colour per line
MapPrinted poster on cardboard
Power5 V from USB, via the ESP32

Design files: schematic (PDF) · KiCAD project · 3D render

What I'd do differently

  • The wiring. It works, but it's hard to trace and service. Next time I'd group the LEDs on small boards or connectors behind each line, with ribbon cable to the driver board.
  • The ISET resistor. Both chips share one 10 kΩ R1, but each MAX7219 should have its own. According to the datasheet’s output current curves, a shared resistor behaves roughly like 20 kΩ per chip, about 25 mA peak per segment instead of about 45 mA, and the split between the chips isn’t guaranteed to be even. It works and the brightness looks fine, but a second version would give each chip its own resistor.

Build and flash

Built with Arduino IDE 2.3.10 and the Espressif ESP32 board package 3.3.12.

  1. Install the MD_MAX72xx library (by majicDesigns, tested with 3.5.1) from the Library Manager.
  2. Open firmware/metromap/metromap.ino.
  3. Select Tools → Board → ESP32 Dev Module and the ESP32's serial port.
  4. Upload.

Pick the mode in loop(): trainMode() runs the train animation, and walkTest() lights every LED in turn and prints each station to the Serial Monitor (115200 baud).

What went wrong and how I fixed it

For a long time the addressing didn't work: telling the firmware to light a specific DIG/SEG lit the wrong LED. I lit one address at a time and wrote down which LED actually came on, until a pattern appeared: the MD_MAX72xx library numbers the columns in a different order from the chip's SEG pins. SEG_A is column 6, down to SEG_G at column 0, and only SEG_DP stays at column 7. I then tested that theory LED by LED, and it held. The fix is a single line in metromap.ino.

More in the bring-up log, including how the datasheet corrected my assumption about the shared ISET resistor.

What's next

  • Live trains. I chose the ESP32 for its built-in Wi-Fi. The plan is to fetch data from BKK's open API using an API key. As it turns out, BKK doesn't publish live positions for metro trains, only a timetable that's updated in real time, so the map has to work out where each train is from that.
  • Turning a timetable into train positions. This is the tricky part. Using the timetable directly, a train could disappear between two stations, or appear at several at once. Each train has to be tracked so that it's always shown at exactly one station: the last station it departed from, until its scheduled departure from the next one.

Acknowledgements

The firmware and this README were developed in collaboration with Claude and Claude Code. The hardware design, PCB, wiring and testing are my own.

Parts

46
QtyValueFootprintReferences
36~TestPoint:TestPoint_THTPad_D1.5mm_Drill0.7mm5V1, CLK1, DIG0/1, DIG0/2, DIG1/1, DIG1/2, DIG2/1, DIG2/2, DIG3/1, DIG3/2, DIG4/1, DIG4/2, DIG5/1, DIG5/2, DIG6/1, DIG6/2 +20
4MountingHoleMountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4
2MAX7219Package_DIP:DIP-24_W7.62mmU1, U2
1100nFCapacitor_THT:C_Disc_D5.0mm_W2.5mm_P2.50mmC2
110kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1
110uFCapacitor_THT:CP_Radial_D5.0mm_P2.00mmC1
1~TestPoint:TestPoint_THTPad_D1.0mm_Drill0.5mmSEG_DP1

Similar boards

  • 2 layers181 × 97 mmOpenDeck r3.1.2, the printed circuit board in 3D

    OpenDeck r3.1.2

    shanteacontrols/OpenDeck

    A platform for building interactive control and sensing devices using MIDI and OSC built with Zephyr RTOS.

    262 parts960Apache-2.0
  • 2 layers482.6 × 35.6 mmPrecision clock, the printed circuit board in 3D

    Precision clock

    mitxela/PrecisionClock-Hardware

    PCB design for the Precision Clock Mk III

    49 parts41
  • 2 layers85.6 × 41 mmHl alyx glove, the printed circuit board in 3D

    Hl alyx glove

    StarGate01/hl-alyx-glove

    Firmware and Hardware for a Half-Life: Alyx Gravity Glove Replica

    38 parts21MIT
  • 2 layers542.3 × 27.3 mmGlowboardng, the printed circuit board in 3D

    Glowboardng

    Eigenbaukombinat/glowboard

    The Glowboard Plotter plots images using 64 UV LEDs attached in a line moved over a 120cmx60cm glow-in-the-dark sheet by a stepper.

    69 parts6
  • 2 layers70 × 50.1 mmDoom clock, the printed circuit board in 3D

    Doom clock

    stecman/avr-doomclock

    GPS clock on an ATTiny with MAX7219 7-segment driver

    24 parts5MIT
  • 2 layers91.4 × 119.4 mmPainel pcb1, the printed circuit board in 3D

    Painel pcb1

    ArqueologiaDigital/PatinhoFeio_Painel_KICAD

    63 parts4
  • 2 layers142.2 × 64.4 mmFcu mb, the printed circuit board in 3D

    Fcu mb

    VirtualGit/HomeCockpitA320

    A320 Home Cockpit project

    69 parts4

Questions

What parts does the Metromap use?

46 parts, built around the MAX7219M. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Metromap KiCad files?

From the gergelytothh/metromap repository on GitHub, at the commit this page was made from: the board is hardware/kicad/Metro Map.kicad_pcb and its schematic hardware/kicad/Metro Map.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Metromap design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).