
Dsp amp 2to4
kurozz/dsp_amp_2to4
Amplifier with DSP based on TPA3116D2 and ADAU1701 with 4 outputs and stereo input.

A KiCad 10 project for a powered-speaker node: an ESP32-S3 dev board drops into a socket, an I²S DAC + class-D amp turn the stream into 40–50 W of audio, and the whole thing runs from a single USB-C cable via USB-PD.
Amp is an open-source printed circuit board by rmalchow, from the rmalchow/ondaire repository on GitHub. It is a 2-layer board of 120 × 95 mm with 68 parts on 46 nets.
It is built around the CH224K, LM2596S-5.0 and AMS1117-3.3, with the PCM5102APW, TPA3116D2 and SS54 among its other parts. Its parts include 23 capacitors, 16 resistors, 7 ICs, 4 connectors and 2 diodes. It belongs with the audio and music boards and the ESP32 boards of this library.
A KiCad 10 project for a powered-speaker node: an ESP32-S3 dev board drops into a socket, an I²S DAC + class-D amp turn the stream into ~40–50 W of audio, and the whole thing runs from a single USB-C cable via USB-PD. JST plugs bring out a rotary encoder and an I²C OLED.
This carrier is the hardware counterpart to the esp32/ firmware in this repo —
the GPIO map, I²S pins and encoder pins are taken straight from
esp32/boards/board_esp32s3_*.h, so a flashed Super Mini or Waveshare Zero
works with no reconfiguration.
Status — schematic ERC-clean; board placed + ground-poured, not yet routed. Schematic, symbols, footprints, BOM and netlist are generated and validated (
kicad-cli sch erc→ 0 errors). The.kicad_pcbhas every footprint placed in a functional floorplan with GND zones on both layers; DRC is clean except the expected unrouted ratsnest (no overlaps/clearance/short errors). Signal and power routing is the remaining manual step. A few values need a datasheet/board check before you order — see Verify before you order.
┌───────── USB-C (PD) ─────────┐
charger │ VBUS ─┬─────────────► +20V rail ──────────────┐
─────────┤ CC1/2─┤ CH224K (≈3 A @ 20 V) │
20V/65W+ │ D± ───┘ PD sink │
└─────────┘ (CFG1: NC = request 20 V) │
│
+20V ──► LM2596S-5.0 buck ──► +5V ──► AMS1117-3.3 ──► +3V3
│ │
▼ ▼
ESP32-S3 socket PCM5102A DAC
(Super Mini / Zero) (MCLK-less I²S)
│ I²S BCK/LRCK/DIN │
└──────────────────────┘
│ OUT L/R
L+R passive sum ◄─────────┘
│
+20V ──► TPA3116D2 (PBTL mono) ──► LC filter ──► SPEAKER
▲ ▲ (4 Ω, ~50 W)
SD/FAULT gain=20 dB
│
JST: OLED (I²C SDA/SCL) ────────────┤ ESP32 GPIO
JST: rotary encoder (A/B/SW) ───────┘| Choice | Decision | Why |
|---|---|---|
| Amp topology | TPA3116D2, mono PBTL | One speaker per node; PBTL gives ~40–50 W into 4 Ω from a 20 V rail (min load 1.6 Ω). |
| DAC | PCM5102A, MCLK-less | Matches the firmware (i2s_mclk = -1, internal PLL); clean 2.1 Vrms line out, no I²C config. |
| Power | USB-PD 20 V via CH224K | Single-cable power; 20 V is the TPA3116's sweet spot. Single-resistor select, default = 20 V. |
| ESP socket | Both Super Mini + Zero | Populate one footprint; identical nets, so one board fits either dev board. |
| Buck / LDO | LM2596S-5.0 → AMS1117-3.3 | 20 V is above most synchronous bucks' input max; LM2596 (40 V in) is robust. Separate clean 3V3 for the DAC. |
USB-PD (CH224K). USB-C VBUS feeds the +20 V rail directly; the CH224K only negotiates. Voltage is set in single-resistor mode: R1 on CFG1→GND, with CFG2/CFG3 unconnected. R1 unpopulated = 20 V; 6.8 k = 9 V, 24 k = 12 V, 56 k = 15 V (WCH CH224K DS §5.2.1). D± route to the CH224K for BC1.2 fallback.
Amp (TPA3116D2 PBTL). Wired per the TI datasheet mono mode (SLOS708G §7.4.1, Fig. 36):
LINP, LINN → GND (this selects PBTL/mono at power-up).RINP/RINN (single-ended L+R sum, AC-coupled).OUTPR ∥ OUTNR → SPK+, OUTPL ∥ OUTNL → SPK−,
each half-bridge through its own 10 µH inductor, 1 µF across the speaker
(PBTL filter, min L = 10 µH / C = 1 µF).MODSEL = GND (BD modulation, lowest THD with the LC filter).PLIMIT tied to GVDD (no power limit). GAIN/SLV = 5.6 k to GVDD → 20 dB,
master mode (lowest gain the part offers).SDZ (enable) ← ESP GPIO1 with a 100 k pull-down (amp stays off at boot).
FAULTZ → GPIO4 (10 k pull-up). MUTE tied low (software volume handles mute).BSxx bootstrap caps = 220 nF. AVCC fed from +20 V through a 3.3 Ω
RC. PowerPAD → GND (thermal vias).Gain / headroom. At 20 dB the PCM5102A's 2.1 Vrms full-scale over-drives the 20 V rail by a few dB, so the firmware's digital volume sets the real level — keep it below ~−4 dBFS for clean full power (normal listening is well under that). To hard-limit in hardware, populate R17 (MIXIN→GND, DNP) to attenuate/divide the summer.
esp32/boards/board_esp32s3_*.h)| Signal | GPIO | Notes |
|---|---|---|
| I²S BCK | 5 | → PCM5102A BCK |
| I²S LRCK | 6 | → PCM5102A LCK |
| I²S DIN | 7 | → PCM5102A DIN (MCLK-less; SCK→GND) |
| Encoder A / B / SW | 15 / 16 / 17 | KY-040 / EC11 via JST (J4) |
| I²C SDA / SCL | 8 / 18 | SSD1306 OLED via JST (J3) |
| Amp enable (SDZ) | 1 | new — drive high to un-shutdown the amp |
| CH224K PG | 2 | new — power-good input |
| Amp FAULTZ | 4 | new — fault input (open-drain) |
GPIO 1/2/4/8/18 are the carrier-only additions; they're free and conflict-free on both boards. The firmware doesn't drive amp-enable / fault / OLED yet — the board is forward-looking on those. (3V3 from the dev board is left unconnected; the carrier makes its own clean 3V3 for the DAC.)
| Rail | Source | Load | Worst-case |
|---|---|---|---|
| +20 V | USB-PD | TPA3116 PVCC | ~3 A at full output |
| +5 V | LM2596S-5.0 | ESP32 (Wi-Fi TX peaks) + LDO | ~1 A |
| +3V3 | AMS1117-3.3 | DAC + OLED + pull-ups | ~50 mA |
Full output (~50 W audio, ~90 % amp efficiency) + logic ≈ 60 W → use a ≥ 65 W (20 V / 3.25 A) charger; a 100 W (20 V/5 A) supply gives headroom. A 60 W (20 V/3 A) charger works but limits peak SPL.
| File | What |
|---|---|
amp.kicad_pro | Project. Open this in KiCad 10. |
amp.kicad_sch | Schematic (generated). |
amp.kicad_pcb | Board: placed + GND-poured, unrouted (generated). |
amp.kicad_sym | Project symbols: TPA3116D2 + the two ESP32 sockets (generated). |
amp.pretty/ | Project footprints: ESP32 dev-board sockets (generated, placeholder geometry). |
sym-lib-table, fp-lib-table | Register the amp libs for this project. |
bom.csv | Grouped BOM with LCSC starting points (generated). |
gen_*.py, ksym.py | The generators — edit these, not the outputs. |
The schematic/symbols/footprints/BOM are produced from declarative data so the
design is diffable and editable. After changing gen_sch.py (netlist/parts):
cd esp32/amp
python3 gen_symbols.py # amp.kicad_sym
python3 gen_footprints.py # amp.pretty/*
python3 gen_sch.py # amp.kicad_sch
python3 gen_bom.py # bom.csv
python3 gen_pcb.py # amp.kicad_pcb (needs KiCad's pcbnew python module)
kicad-cli sch erc amp.kicad_sch # validate schematic
kicad-cli pcb drc amp.kicad_pcb # validate boardThe schematic is a connectivity-capture style: components on a grid with a global label on every pin (same name = same net). It's ERC-clean and exports a correct netlist; tidy the layout/wiring in Eeschema if you want a pretty sheet.
gen_pcb.py builds the board with the pcbnew API: it reads each footprint's
real courtyard size and shelf-packs the parts into functional regions (power-in
_ThermalVias footprint, so its PowerPAD
is already stitched to the back plane.What's left for you (in Pcbnew):
pcbnew limitation);
press B or Edit → Fill All Zones on open. This connects the whole GND net.The placement is a starting point — nudge parts to suit your routing. Re-running
gen_pcb.pyoverwritesamp.kicad_pcb, so once you start routing by hand, stop regenerating it (keep editing the schematic + re-import instead).
Designed to be SMT-assemblable. All ICs and passives are SMD (0805 jellybean, HTSSOP/TSSOP/SOT/TO-263). Hand-soldered (not SMT-placed): the ESP32 socket headers, the JST plugs, and the speaker terminal block — Aisler does SMT assembly, so place these THT parts yourself.
bom.csv are
starting points — verify against the live catalogue.These are flagged in the BOM / netlist and need a quick check against your parts:
amp.pretty/*) are placeholders — 1×14
headers tapping the GPIO1–18 edge. Super Mini clones vary in length / row
spacing, and the Zero is castellated+THT. Measure your actual board and
redraw the land pattern (and add a mechanical support header on the far edge).
Pad numbers already match the symbol, so the netlist survives the edit.L_12x12mm_H6mm placeholder; pick 10 µH parts rated
≥ 4 A saturation (e.g. shielded power inductors), 33 µH ≥ 3 A for the buck.CP_Elec_8x10.5 placeholder; match diameter/pitch to the
470 µF/35 V and 220–330 µF parts you actually buy.esp32/boards/board_esp32s3_*.h — the firmware's GPIO truth.| Qty | Value | Footprint | References |
|---|---|---|---|
| 12 | 100nF | C_0805_2012Metric | C2, C3, C4, C7, C8, C9, C11, C18, C20, C21, C22, CP1 |
| 8 | 10k | R_0805_2012Metric | R3, R5, R6, R7, R11, R14, R15, R16 |
| 7 | 1uF | C_0805_2012Metric | C1, C13, C14, C15, C16, C17, C19 |
| 4 | 10uH/4A | L_7.3x7.3_H4.5 | LL1, LL2, LR1, LR2 |
| 4 | 220nF | C_0805_2012Metric | CBL1, CBL2, CBR1, CBR2 |
| 2 | 10uF | C_0805_2012Metric | C5, C10 |
| 2 | 220uF/35V | CP_Elec_8x10.5 | CI1, CP3 |
| 2 | 4.7k | R_0805_2012Metric | R12, R13 |
| 2 | 470uF/35V | CP_Elec_8x10.5 | CB1, CB2 |
| 1 | 100k | R_0805_2012Metric | R10 |
| 1 | 1nF | C_0805_2012Metric | CP2 |
| 1 | 1uF/63V | C_0805_2012Metric | CF1 |
| 1 | 2.2k | R_0805_2012Metric | R4 |
| 1 | 2.2uF | C_0805_2012Metric | C12 |
| 1 | 22uF | C_0805_2012Metric | C6 |
| 1 | 3.3 | R_0805_2012Metric | R8 |
| 1 | 330uF/16V | CP_Elec_8x10.5 | CO1 |
| 1 | 33uH/3A | L_12x12mm_H6mm | L1 |
| 1 | 5.6k | R_0805_2012Metric | R9 |
| 1 | AMS1117-3.3 | SOT-223-3_TabPin2 | U3 |
| 1 | CH224K | MSOP-10-1EP_3x3mm_P0.5mm_EP1.73x1.98mm | U1 |
| 1 | DNP (NC=20V; 6.8k/24k/56k=9/12/15V) | R_0805_2012Metric | R1 |
| 1 | DNP (atten/downmix) | R_0805_2012Metric | R17 |
| 1 | ENCODER | JST_PH_B5B-PH-K_1x05_P2.00mm_Vertical | J4 |
| 1 | ESP32-S3 Super Mini | ESP32S3_SuperMini_Socket | U6 |
| 1 | ESP32-S3 Zero | ESP32S3_Zero_Socket | U7 |
| 1 | LM2596S-5.0 | TO-263-5_TabPin3 | U2 |
| 1 | OLED I2C | JST_PH_B4B-PH-K_1x04_P2.00mm_Vertical | J3 |
| 1 | PCM5102A | TSSOP-20_4.4x6.5mm_P0.65mm | U4 |
| 1 | PWR | LED_0805_2012Metric | D2 |
| 1 | SPEAKER | TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_Horizontal | J2 |
| 1 | SS54 | D_SMB | D1 |
| 1 | TPA3116D2 | HTSSOP-32-1EP_6.1x11mm_P0.65mm_EP5.2x11mm_Mask4.11x4.36mm_ThermalVias | U5 |
| 1 | USB-C PD in | USB_C_Receptacle_GCT_USB4085 | J1 |

kurozz/dsp_amp_2to4
Amplifier with DSP based on TPA3116D2 and ADAU1701 with 4 outputs and stereo input.



Kilan777/HomeDeck
Jarvis HomeDeck: a Raspberry Pi CM4 carrier board and voice-assistant software for a 7-inch smart display (KiCad hardware, generated from Python, plus the Python/JS assistant)

El-Luhb/nvme-Carrier-for-LattePanda-Mu
nvme Carrier PCB for the LattePanda Mu compute module

ut-ras/chessbot
Python/MQTT software, Raspberry Pi Config files, PCB Schematics for an autonomous chess playing robot


mbeayou/esp32-hifi-bluetooth-speaker-pcb-board
A custom high-fidelity Bluetooth speaker PCB featuring the ESP32 (I2S), PCM5100 DAC, and TPA3116D2 Class D Amplifier. Includes Schematics, Gerber files, and BOM.
It measures 120 × 95 mm and has 2 copper layers, 1.6 mm thick.
68 parts, built around the CH224K, LM2596S-5.0, AMS1117-3.3 and PCM5102APW. 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.
From the rmalchow/ondaire repository on GitHub, at the commit this page was made from: the board is esp32/amp/amp.kicad_pcb and its schematic esp32/amp/amp.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask rmalchow before reusing the design.