CS-01 Embedded BLE Custom PCB Power Systems In Development

USB–BLE
MIDI Bridge

Wireless MIDI Interface · ESP32-S3 · 4-Layer PCB · LiPo Power

Full-stack embedded systems project — from system architecture and schematic capture through 4-layer PCB layout and firmware bring-up. Demonstrates end-to-end capability across hardware design, power systems, USB protocol, and BLE wireless communication.

01

Project Overview

MCU
ESP32-S3
WROOM-1 · 240 MHz dual-core · USB OTG + BLE 5.0
PCB
75 × 40mm
4-layer FR4 · 57 components · 1.6mm
Schematic
7 sheets
KiCad 10.0 · Rev 1 · April 2026
USB Protocol
USB 2.0 Host
Custom host stack · MIDI class parsing
Wireless
BLE 5.0
NimBLE · Apple BLE MIDI specification
Power
LiPo + USB-C
3-rail architecture · auto-switching · charge management
Embedded Firmware Custom PCB Design Power System Architecture BLE / Wireless USB Protocol Mixed-Signal Layout Rapid Prototyping
02

The Challenge

The brief was to create a device that removes cable dependency from USB MIDI controllers in a live or studio environment — bridging a standard USB MIDI keyboard into a wireless BLE MIDI stream receivable by any BLE-capable DAW host, including macOS with Apple's BLE MIDI specification.

The hard constraint was that the device could not be software-only. The target users don't want driver installations or middleware — the device must present as a native MIDI port with zero configuration overhead. Equally, for wired-preference scenarios or when battery is low, the same hardware needed to route keyboard data through to a host Mac directly, without the ESP32 in the path.

That passthrough requirement — true hardware-level USB signal routing that bypasses the MCU entirely — was the primary design driver. It ruled out simpler MCU bridging approaches and required a dedicated high-speed USB switch IC in the signal path, which in turn constrained the PCB layer stack, impedance planning, and power architecture.

Battery management added further complexity: the system needed to accept USB-C charge input while simultaneously providing a boosted 5V VBUS rail to power the connected keyboard — requiring a 3-rail power architecture with autonomous source switching.

Operating Modes
Wireless (BLE) + Passthrough (hardware)
Key Constraint
Zero-config, no host driver required
Wireless Target
Apple BLE MIDI specification compliance
Battery Source
LiPo + USB-C; auto-switch, charge while running
Passthrough Method
Hardware USB switch, MCU out of signal path
03

System Architecture

Wireless Mode Signal Path
USB Keyboard
USB 2.0 device
──>
TS3USB30E
USB 2.0 switch
──>
ESP32-S3
USB host stack
──>
NimBLE
BLE MIDI out
──>
DAW Host
macOS / BLE client
Passthrough Mode Signal Path
USB Keyboard
USB 2.0 device
──>
TS3USB30E
switch → passthrough
──>
USB-C Upstream
direct to host
──>
DAW Host
native USB MIDI

The TS3USB30E high-speed USB 2.0 switch is the architectural pivot. In wireless mode it routes keyboard data lines to the ESP32's USB OTG peripheral. In passthrough mode it connects the keyboard port directly to the upstream USB-C connector, keeping the ESP32 entirely off the signal path — critical for signal integrity and for presenting a standard USB device to the host.

On the firmware side, the ESP32 runs the ESP-IDF native USB host stack to enumerate the keyboard as a USB HID/MIDI class device, extract MIDI data from USB bulk transfers, and re-emit it as BLE MIDI packets over NimBLE. The BLE MIDI implementation follows Apple's specification for service/characteristic UUIDs and packet timestamping, which is what allows macOS to surface it natively in Audio MIDI Setup without any driver.

An SPI OLED provides live status feedback — connection state, mode selection, battery level — without host software dependency.

KiCad 7-sheet schematic — top-level block diagram
Fig. 1 — 7-sheet KiCad 10.0 schematic · Rev 1 · April 2026
04

Power Architecture

The power architecture manages three distinct rails with different source priorities, and does so transparently — the device can charge its LiPo battery from USB-C while simultaneously running off that USB-C input and supplying boosted 5V to the keyboard VBUS, all without interruption when the source switches.

The TPS2116 dual-input power mux provides seamless priority switching between USB-C VBUS and battery. When USB-C is present it supplies the system rail directly; on disconnect, the mux transfers to battery without a glitch on the output. The BQ24074 LiPo charger handles charge termination and battery protection, and operates in parallel with the mux so the battery charges whenever USB-C is present regardless of system load.

The 5V keyboard VBUS boost (TLV61047) runs from the system rail and is enabled only in wireless mode — in passthrough mode VBUS is sourced from the upstream USB-C connector, so the boost is disabled to avoid backfeeding the source.

Rail IC Topology Purpose
VSYS TPS2116DRL Dual-input mux USB-C / LiPo priority switching, system rail
3.3V TPS62162DSG Synchronous buck MCU, BLE radio, USB switch, OLED, peripherals
5V VBUS TLV61047DDC Boost converter Keyboard VBUS supply (wireless mode only)
VBAT BQ24074RGTT LiPo charger Battery charge management, protection, fuel gauge
Source Priority
USB-C > LiPo (auto)
Switchover
Glitch-free via TPS2116
Charge-while-run
Yes — concurrent charging and operation
VBUS backfeed
Protected — boost disabled in passthrough
ESD Protection
PRTR5V0U2X on USB data lines
05

PCB Design

4L
Layer count
57
Components
75×40
PCB size (mm)
7
Schematic sheets

The 4-layer stackup was chosen primarily to achieve a solid, uninterrupted GND reference plane beneath the USB signal traces. USB 2.0 differential pairs (D+/D−) on the ESP32 peripheral, the USB switch, and the upstream USB-C connector all require controlled 90Ω differential impedance — achievable at the outer copper weight and dielectric on a standard JLCPCB FR4 stackup only when a solid reference plane is immediately adjacent.

The layer assignment is: F.Cu (signal/component side), In1.Cu (GND plane), In2.Cu (3.3V power plane), B.Cu (secondary signal/routing). Power plane stitching vias are placed around the BQ24074 and TPS2116 thermal pads for both heat sinking and current distribution. The MCU antenna keep-out zone is maintained on all copper layers beneath the ESP32-S3-WROOM module's antenna section.

The TS3USB30E USB switch is centrally located between the keyboard-side USB-A port and the ESP32 USB OTG pins, minimising stub length on the signal switch outputs. The BLE antenna zone at the ESP32 module edge is kept clear of pours and vias on the adjacent inner layer.

Layer Stack
F.Cu · GND · 3.3V · B.Cu
USB Impedance
90Ω differential, controlled
Substrate
FR4 · 1.6mm · 1oz Cu
Tool
KiCad 10.0
Fab target
JLCPCB (PCBA)
Status
Layout complete — awaiting fab
PCB 3D render — top side
Fig. 2 — PCB 3D render, top side (KiCad)
PCB 3D render — bottom side
Fig. 3 — PCB 3D render, bottom side (KiCad)
PCB 2D layout — component placement and routing
Fig. 4 — PCB 2D layout · 75 × 40mm · 4-layer FR4
06

Outcome

The end-to-end pipeline was validated on bench prior to PCB fabrication. A breadboard prototype with the ESP32-S3 dev kit running the complete firmware stack was used to verify USB host enumeration, MIDI parsing, BLE advertisement, and BLE MIDI packet delivery to a macOS host.

The keyboard was correctly enumerated by the USB host stack and MIDI events were received over BLE in FL Studio without any driver installation — the device appeared natively in macOS Audio MIDI Setup as a standard MIDI port, confirming Apple BLE MIDI specification compliance.

With firmware and PCB layout both complete, the project is at the point of fabrication submission. The 3D-printed enclosure is in progress, designed to mate with the PCB mounting pattern and expose the USB-A keyboard port, USB-C charge/passthrough port, mode toggle, and status OLED.

Bench prototype — USB keyboard connected to ESP32-S3 dev kit
Fig. 5 — Bench prototype: USB keyboard → ESP32-S3
ESP32-S3 breadboard prototype with USB host active
Fig. 6 — ESP32-S3 dev kit with USB host stack running
End-to-end test: MIDI keyboard data arriving in FL Studio over BLE
Fig. 7 — Live test: keyboard MIDI → BLE → FL Studio on macOS
macOS Audio MIDI Setup showing device as a native MIDI port
Fig. 8 — macOS Audio MIDI Setup: device appears as native MIDI port
Validation Result

Firmware complete. PCB layout complete. Bench-validated end-to-end. USB MIDI keyboard enumerated by the ESP32-S3 USB host stack; MIDI data delivered over BLE MIDI to FL Studio on macOS with the device appearing natively in Audio MIDI Setup — zero driver installation. PCB layout finalised at 75 × 40mm, 57 components, 4 layers; awaiting fabrication and assembly.

07

Current Status

Firmware
COMPLETE
Schematic
COMPLETE · Rev 1
PCB Layout
COMPLETE
Bench Validation
COMPLETE
Enclosure
IN PROGRESS
Fabrication
PENDING

Have a Similar
Systems Challenge?

This project demonstrates Āvega Systems' approach to full-stack embedded hardware — system architecture, custom electronics, firmware, and validation in one tightly integrated engagement. If your team needs this kind of capability, get in touch.