All projects
HardwareIoTComplete

MorayGlow

WiFi-connected RGB LED strip controller built on the XIAO ESP32-S3 with custom PCB design, MOSFET drivers, MQTT/REST/WebSocket control, and Home Assistant auto-discovery.

XIAO ESP32-S3KiCadPlatformIOC++JavaScriptIRLML6344TRMP1584MQTTLittleFSHome AssistantLEDC PWM

// Overview

MorayGlow is an ESP32-S3 firmware that turns a 12V 5050 RGB LED strip into a smart home device. Three IRLML6344TR N-channel MOSFETs are driven by 1 kHz LEDC PWM on GPIO1, GPIO2 and GPIO6, giving full 8-bit colour control of each channel. An MP1584 buck converter provides regulated 5V from the same 12V rail that powers the strip, keeping the BOM simple.

The device runs an ESPAsyncWebServer serving a LittleFS-hosted single-page UI, a WebSocket endpoint for real-time state push, and a JSON REST API. It simultaneously connects to an MQTT broker and publishes Home Assistant auto-discovery payloads, making it zero-configuration in a standard HA setup. State changes from any source — REST, WebSocket command, or MQTT — funnel through applyLedState() → broadcastState() → mqttPublishState(), keeping all clients in sync.

On first boot (or after a button-hold factory reset) the device starts an access point and serves a captive portal that scans for nearby networks and saves credentials to EEPROM. The mDNS-based device discovery endpoint allows the devices.html UI page to list all MorayGlow units on the local network automatically.