Skip to the content
PCBKitNew board
2 layers64 × 64 mmStacklight, the printed circuit board in 3D

ESP32-based physical status monitor — polls New Relic alerts and Azure DevOps deployments to drive a 4-segment stacklight

Size
64 × 64 mm
Copper layers
2
Thickness
1.6 mm
Parts
24
Nets
42
Pads
86
Tracks, vias
96, 0
Pours
1
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
25 Apr 2026
Updated
25 Apr 2026

Overview

Stacklight is an open-source printed circuit board by AnthonyBrown-CPU, from the AnthonyBrown-CPU/Stacklight repository on GitHub. It is a 2-layer board of 64 × 64 mm with 24 parts on 42 nets, routed with 96 tracks and 0 vias.

It is built around the BC547 and BC557. Its parts include 8 resistors, 8 transistors and 8 connectors.

Main components

2

README

README.md

Stacklight Monitor

An ESP32-based physical status monitor that polls New Relic alert statuses and Azure DevOps deployment states, driving a 4-segment stacklight to provide an at-a-glance view of system health.

Stacklight installed


Overview

The ESP32 polls two data sources every 60 seconds:

  • New Relic — queries alertSeverity across multiple APM entity GUIDs via NerdGraph (GraphQL). The worst-case severity across all entities determines the main light colour.
  • Azure DevOps — polls in-progress release deployments across configured production environment IDs. A deployment in progress illuminates the blue light; one running past a configurable timeout causes it to flash.
ConditionLightColour
No alertsGreenOn
WarningYellowOn
CriticalRedOn
WiFi / API errorYellowFlashing
Deployment in progressBlueOn
Deployment overdueBlueFlashing

Hardware

Components

ComponentValue / PartNotes
MicrocontrollerESP32-WROOM-32D Dev BoardStandard 30-pin DevKit
Transistor (NPN)BC547 x4Low-side driver
Transistor (PNP)BC557 x4High-side driver
Resistors10KΩ x8Base resistors for transistor pairs
Buck ConverterMP1584 (fixed 5V)12V → 5V for ESP32
Power Input12V DC Barrel JackPS0519
Output Connector5-pin Screw Terminal5.08mm pitch, 55° entry
PCBCustom, manufactured by JLCPCBHASL lead-free surface finish

Stacklight Wiring

Each segment draws approximately 46mA. Total current draw across all four channels is ~181mA.

Screw Terminal PinNetStacklight WireGPIO
1SL_RRed12
2SL_YYellow14
3SL_GGreen27
4SL_BBlue26
5GNDCommon Ground—

Pins are active high. GPIO12 is a strapping pin on the ESP32-WROOM-32D — it may briefly pulse during boot, which does not affect normal operation.

Circuit Design

Each output channel uses a complementary BC547/BC557 transistor pair to level-shift the ESP32's 3.3V GPIO logic to the 12V stacklight supply. The MP1584 buck converter steps 12V down to 5V to power the ESP32. All grounds are common.

The PCB was designed in KiCad 10 and manufactured by JLCPCB. KiCad project files are in stacklight PCB/.

FrontBack
PCB frontPCB back

Enclosure

The enclosure was modelled in Autodesk Fusion and sliced with OrcaSlicer. STL files are in enclosure model/.


Software

Built with PlatformIO using the Arduino framework for ESP32.

Dependencies

  • ArduinoJson v7 (bblanchon/ArduinoJson@^7.2.2)
  • ESP32 platform (platform-espressif32 via git)

Architecture

The firmware is split into focused modules, each with a corresponding unit test suite:

ModuleResponsibility
StacklightLED state machine + ISR-based blink timer
NewRelicMonitorNerdGraph GraphQL polling; EU/US endpoint inferred from API key prefix
AzureDevopsMonitorADO release deployments API; deployment timeout detection
ConfigStoreNVS key-value store with OnChange callbacks
SerialCommandParserRuntime config updates via serial key=value commands
PollingTimerReusable interval timer with injectable clock
NtpSyncNTP time synchronisation

Hardware dependencies are isolated behind IGpioHal and IHttpClient interfaces, making all modules unit testable without hardware.

Configuration

Configuration is split into two categories:

Build-time constants (entity GUIDs, ADO org/project/pipeline IDs, pins, timeout) live in src/config.h, which is gitignored. Copy src/config.h.example to src/config.h and fill in your values before building.

Runtime credentials (WiFi SSID/password, New Relic API key, Azure DevOps PAT) are stored in ESP32 NVS flash and set via serial commands at any time after flashing:

text
ssid=YourNetwork
password=YourPassword
nr_key=NRAK-xxxxxxxxxxxx
ado_pat=your_ado_personal_access_token

Connect at 115200 baud using the PlatformIO serial monitor or any terminal.

Behaviour

  • Polls New Relic and Azure DevOps every 60 seconds
  • New Relic: queries alertSeverity for each configured entity GUID — NOT_ALERTING, WARNING, or CRITICAL. Worst case across all entities drives the light colour.
  • Azure DevOps: polls in-progress deployments for each configured production environment ID. Deployments running longer than DEPLOY_TIMEOUT_MINUTES cause the blue light to flash.
  • On WiFi loss or API error — all lights turn off and yellow flashes. Blue light state is restored on the next successful poll.
  • Serial debug output at 115200 baud.

New Relic Setup

  1. Create a dedicated New Relic user with a Restricted Read Only role, scoped to the relevant accounts
  2. Generate a User API key under that user (type must be "User" — NRAK- prefix for US, eu01xx- prefix for EU)
  3. Obtain entity GUIDs for your monitored APM services via the NerdGraph Explorer or the entity URL in the New Relic UI
  4. Set the entity GUIDs and entity count in src/config.h and set the API key via serial (nr_key=your_key)

Azure DevOps Setup

  1. Generate a Personal Access Token (PAT) with Read permission on Release
  2. Note the release definition ID (visible in the ADO URL when viewing a release pipeline)
  3. Note the environment IDs for your production stages (visible in the ADO URL when viewing a stage, or from the deployments API response)
  4. Set these values in src/config.h and set the PAT via serial (ado_pat=your_pat)

Security

Runtime credentials are stored in ESP32 NVS (non-volatile storage) flash, not in firmware. This means:

  • Credentials survive reboots without being visible in source code or build artefacts
  • src/config.h (build-time constants) is gitignored — commit src/config.h.example instead
  • The New Relic API key is scoped read-only — a compromised key cannot modify any New Relic configuration or access infrastructure credentials
  • The ADO PAT should be scoped to Release read only

If the device is decommissioned, revoke the New Relic API key and ADO PAT.


Testing

Unit tests run on-device using the Unity test framework via PlatformIO.

text
pio test -e test_esp32

To run a single suite:

text
pio test -e test_esp32 --filter test_polling_timer

Available suites: test_polling_timer, test_serial_parser, test_ado_monitor, test_nr_monitor, test_stacklight, test_config_store.

Parts

24
QtyValueFootprintReferences
8R10KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR1, R2, R3, R4, R5, R6, R7, R8
4BC547Package_TO_SOT_THT:TO-92_InlineQ1, Q4, Q6, Q8
4BC557Package_TO_SOT_THT:TO-92_InlineQ2, Q3, Q5, Q7
4Conn_01x02_PinConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ5, J6, J7, J8
2Conn_01x15Connector_PinHeader_2.54mm:PinHeader_1x15_P2.54mm_VerticalJ3, J4
1Barrel_Jack_MountingPinConnector_BarrelJack:BarrelJack_GCT_DCJ200-10-A_HorizontalJ1
1Screw_Terminal_01x05TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-5-5.08_1x05_P5.08mm_HorizontalJ9

Questions

How big is the Stacklight PCB?

It measures 64 × 64 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Stacklight use?

24 parts, built around the BC547 and BC557. 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 Stacklight KiCad files?

From the AnthonyBrown-CPU/Stacklight repository on GitHub, at the commit this page was made from: the board is stacklight PCB/Stacklight.kicad_pcb and its schematic stacklight PCB/Stacklight.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Stacklight design in my own project?

Its repository states no licence, so its author keeps all rights: ask AnthonyBrown-CPU before reusing the design.

Similar boards

  • 2 layers56 × 65 mmSeaTalk1, the printed circuit board in 3D

    SeaTalk1

    dotnet/iot

    This repo includes .NET Core implementations for various IoT boards, chips, displays and PCBs.

    24 parts2.4kMIT
  • 2 layers148.8 × 132.2 mmUsbflashprog, the printed circuit board in 3D

    Usbflashprog

    robsonsmartins/usbflashprog

    A memory device programmer (Flash/EPROM/E2PROM) board and software, connected to PC by USB port.

    125 parts36
  • 2 layers83.8 × 72.4 mmVoice board, the printed circuit board in 3D

    Voice board

    Windfisch/analog-synth

    A low-cost semimodular analog synthesizer

    131 parts31GPL-3.0
  • 2 layers13 × 0.5 mmKamstrup, the printed circuit board in 3D

    Kamstrup

    Hal9k-dk/kamstrup

    Kamstrup IR-øje

    11 parts19
  • 2 layers167.8 × 200.6 mmRandom Jazz Generator, the printed circuit board in 3D

    Random Jazz Generator

    telec16/modular-synth

    Little side project, don't expect much updates.

    132 parts16
  • 2 layers100 × 100 mmWhiteBoy, the printed circuit board in 3D

    WhiteBoy

    nodep/NovaBox

    Circuit and PCB design of simple Bluetooth stereo receiver and amplifier

    111 parts11GPL-3.0
  • 2 layers53 × 55.1 mmLedclock sensor, the printed circuit board in 3D

    Ledclock sensor

    luk6xff/led-clock

    LED clock with some fancy features

    35 parts9MIT
  • 2 layers135.8 × 128.4 mmMoog Filter, the printed circuit board in 3D

    Moog Filter

    jojo-monk/Yusynth-MiniMoog-Filter

    Eurorack adaptation

    78 parts8