Skip to the content
2 layers50.6 × 39.6 mmMorayGlow, the printed circuit board in 3D

WiFi-connected RGB LED strip controller — XIAO ESP32-S3 firmware, custom PCB, MQTT/REST/WebSocket, Home Assistant auto-discovery

Size
50.6 × 39.6 mm
Copper layers
2
Thickness
1.6 mm
Parts
27
Nets
31
Pads
86
Tracks, vias
116, 6
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
10 Apr 2026
Updated
28 Apr 2026

Overview

MorayGlow is an open-source printed circuit board by GarethCooke, from the GarethCooke/MorayGlow repository on GitHub. It is a 2-layer board of 50.6 × 39.6 mm with 27 parts on 31 nets, routed with 116 tracks and 6 vias.

It is built around the IRLML6344TRPBF and 1N5819HW-7-F-01. Its parts include 7 resistors, 4 capacitors, 3 transistors, 2 diodes and 2 connectors. It belongs with the home automation and IoT and lEDs and displays boards and the ESP32 boards of this library.

Main components

2

README

README.md

MorayGlow

IoT LED strip controller — ESP32 firmware + web UI with Home Assistant integration.

Project Summary

MorayGlow controls an RGB LED strip via an ESP32. The device hosts a web UI and exposes a REST + WebSocket API. A browser-based client lets you toggle the strip on/off and pick a colour. The device also integrates with Home Assistant via MQTT auto-discovery, so it appears automatically as a light entity.

Project Structure

text
MorayGlow/
├── MorayServer/               # ESP32 firmware (C++, PlatformIO)
│   ├── platformio.ini
│   ├── src/main.cpp            # WiFi, LittleFS, REST API, WebSocket
│   ├── include/
│   │   ├── config.h            # WiFi credentials, MQTT config — edit before flashing
│   │   ├── state.h             # Pure logic: stateToJson, rgbToHex, parseMqttCommand
│   │   └── mqtt.h              # MQTT client + Home Assistant discovery
│   └── test/
│       └── test_state.cpp      # Unity tests (run on host, not device)
└── MorayClient/               # Web UI (plain HTML/CSS/JS — no framework)
    ├── index.html
    ├── css/style.css
    ├── js/
    │   ├── moray.js           # UMD utility module (buildWsUrl, isValidHexColor)
    │   └── app.js              # Main UI logic
    ├── test/
    │   └── moray.test.js      # Jest tests for moray.js
    └── test-server/            # Node.js mock server for UI development
        ├── server.js
        ├── logic.js            # Pure functions (testable without starting server)
        ├── db.json             # Persisted state between restarts
        └── test/
            └── server.test.js  # Jest tests for logic.js

API

MethodEndpointBodyDescription
GET/api/state—Returns {"on": bool, "color": "#rrggbb"}
POST/api/power{"on": bool}Turn strip on or off
POST/api/color{"color": "#rrggbb"}Set strip colour
WS/ws—Server pushes state on every change

Design Decisions

DecisionChoiceReason
MCUESP32 Dev BoardDual-core, Wi-Fi + Bluetooth built in
Build systemPlatformIODependency management, board config, native test env
Web serveresphome/ESPAsyncWebServer-esphomeSupports ESP32; async
FilesystemLittleFSServes client files from device flash
JSONArduinoJson v7 (JsonDocument)No capacity arg needed; widely supported
MQTTknolleary/PubSubClient + setBufferSize(512)Lightweight, well-maintained
HA integrationMQTT auto-discoveryDevice appears automatically in Home Assistant
ClientPlain HTML/CSS/JS (no framework)Keeps LittleFS footprint small
Client moduleUMD pattern (moray.js)Works as browser global and Node.js/Jest module
TestabilityPure functions in state.h / logic.jsCompiled and tested on host without hardware
C++ testsUnity (via PlatformIO native env)Bundled with PlatformIO; runs on host
JS testsJestStandard, zero-config for CommonJS modules

Before Flashing

Edit MorayServer/include/config.h and set your WiFi SSID/password and MQTT broker IP before building and flashing.

Running Tests

MorayServer — C++ firmware (Unity via PlatformIO)

Requires gcc/g++ on your PATH (install MinGW-w64 if not present).

powershell
cd MorayServer
pio test -e native

MorayClient — browser JS logic (Jest)

powershell
cd MorayClient
npm install   # first time only
npm test

Test server — Node.js logic (Jest)

powershell
cd MorayClient\test-server
npm install   # first time only
npm test

Starting the Test Server

The test server lets you develop and test the web UI without the physical device.

powershell
cd MorayClient\test-server
npm install   # first time only
npm start

Then open http://localhost:3000 in a browser.

State is persisted to MorayClient\test-server\db.json between restarts.

Parts

27
QtyValueFootprintReferences
4Hole_PadMountingHole:MountingHole_3.2mm_M3_ISO7380_PadH1, H2, H3, H4
3100Resistor_SMD:R_0603_1608MetricR1, R2, R3
3100kResistor_SMD:R_0603_1608MetricR4, R5, R6
3IRLML6344TRPBFIRLML6344TRPBF:TRANS_IRLML6344TRPBFQ1, Q2, Q3
20.1uFCapacitor_SMD:C_0603_1608MetricC1, C3
2LOGOLOGOG***, G***
1100uFCapacitor_Tantalum_SMD:CP_EIA-3216-18_Kemet-AC4
110uFCapacitor_SMD:C_0603_1608MetricC2
11N5819HW-7-FDiode_SMD:D_SOD-123D1
1330Resistor_SMD:R_0603_1608MetricR7
1Barrel JackConnector_BarrelJack:BarrelJack_Kycon_KLDX-0202-xC_HorizontalJ1
1LEDLED_SMD:LED_0603_1608MetricLED1
1MP1584 5V buck moduleMP1584EN:SRT_MPT1584EN_ModulePS1
1RGB LEDConnector_JST:JST_XH_S4B-XH-A_1x04_P2.50mm_HorizontalJ2
1SW_DIP_x01Button_Switch_SMD:SW_Push_1P1T_NO_CK_KMR2SW1
1XIAO-ESP32-S3-Plus-SMDXIAO_Series_Footprints:XIAO-ESP32-S3-DIPU1

Similar boards

  • 2 layers149.6 × 127.1 mmErgodash, the printed circuit board in 3D

    Ergodash

    omkbd/ErgoDash

    keyboard

    187 parts732MIT
  • 2 layers100 × 50 mmShapones xiao rp2350, the printed circuit board in 3D

    Shapones xiao rp2350

    shapoco/shapones

    an NES emulator for programming study.

    75 parts37
  • 2 layers65.3 × 18.3 mmKlipper nano expander, the printed circuit board in 3D

    Klipper nano expander

    orobardet/klipper_nano_expander

    Klipper Nano Expander, an Arduino Nano Shield to be used as an auxiliary Klipper MCU

    39 parts35MIT
  • 2 layers79.7 × 62.6 mmOpenReflow, the printed circuit board in 3D

    OpenReflow

    CarlosGS/OpenReflow

    Simple reflow oven controller that is configurable from a phone

    39 parts25GPL-3.0
  • 2 layers35 × 50 mmImu rc hand unit, the printed circuit board in 3D

    Imu rc hand unit

    DimitriOnLSD/imu-rc

    Gesture-based RC car controller using ESP32-S3, BLE, LSM6DSO IMU, OLED display, and LiPo battery with USB-C charging.

    76 parts7MIT
  • 4 layers36 × 36 mmVapeagochi, the printed circuit board in 3D

    Vapeagochi

    lucia3e8/vapeagochi

    Eventually I want to target the bc5000 because it's cuter but I'd have to redesign the PCB

    50 parts5
  • 2 layers65 × 65 mmLMR14050SDDA reference, the printed circuit board in 3D

    LMR14050SDDA reference

    luxas/special-computing-machine

    Let's make a Raspberry Pi cluster similar to real data centers!

    49 parts5Apache-2.0
  • 2 layers467.5 × 140 mmMiddle, the printed circuit board in 3D

    Middle

    Ciaanh/keyboards

    259 parts4

Questions

How big is the MorayGlow PCB?

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

What parts does the MorayGlow use?

27 parts, built around the IRLML6344TRPBF and 1N5819HW-7-F-01. 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 MorayGlow KiCad files?

From the GarethCooke/MorayGlow repository on GitHub, at the commit this page was made from: the board is docs/KiCad/MorayGlow.kicad_pcb and its schematic docs/KiCad/MorayGlow.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the MorayGlow design in my own project?

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