Skip to the content
4 layers51.4 × 21.1 mmScramble hat, the printed circuit board in 3D

Hat for Waveshare ESP32-P4-ETH and Raspberry Pi Pico

Size
51.4 × 21.1 mm
Copper layers
4
Thickness
1.6 mm
Parts
79
Nets
62
Pads
240
Tracks, vias
1,069, 138
Pours
4
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
31 May 2026
Updated
25 Aug 2026

Overview

Scramble hat is an open-source printed circuit board by scrambletools, from the scrambletools/ES8389-Hat repository on GitHub. It is a 4-layer board of 51.4 × 21.1 mm with 79 parts on 62 nets, routed with 1,069 tracks and 138 vias.

It is built around the ES8389, 74HC4053D and TPS7A2033DQN, with the KAQY214S, NCJ6FA-H and SS-12D00-G3 among its other parts. Its parts include 29 capacitors, 26 resistors, 7 connectors, 6 diodes and 4 ICs.

Main components

7

README

README.md

Scramble Hat-trik — ES8389 Audio Codec HAT

A compact 4-layer audio I/O HAT that stacks on a Waveshare ESP32-P4 carrier and gives it a studio-style balanced input and a headset/line output, bridged to the host over I²S (audio) and I²C (control). Its headline trick: it taps the carrier's 802.3 PoE rail to generate switchable ~48 V-class phantom power for condenser microphones — no separate supply.

Target carrier: a Waveshare ESP32-P4-ETH board with PoE module. You will need to solder taps on the output of the bridge rectifiers of the PoE module and connect those wires to J5 on the hat.


Capabilities

  • Balanced analog input — Neutrik XLR / ¼″ (6.35 mm) combo jack (J1) into the ES8389 ADC, with input coupling and ESD protection.
  • PoE-tapped phantom power — ~48 V phantom (tracks the 46–57 V PoE rail) through the standard 6.81 kΩ feed pair, manually switched (SW1) and opto-isolated, with a white presence LED, a resettable polyfuse, and a TVS rail clamp.
  • Headset / line output — 3.5 mm TRRS jack (J2): stereo output from the DAC plus an electret mic-bias input path.
  • Stereo audio codec — Everest ES8389 (QFN-24): I²S/PCM audio + I²C control.
  • Clean analog power — ultra-low-noise LDO (TPS7A2033) and ferrite-isolated AVDD.
  • Isolation barrier — the phantom / XLR side (PGND) is kept separate from the carrier audio ground (AGND), bridged only by a 2.2 nF Y2 safety cap (C19), with a DNP 0 Ω ground-lift option (R14).
  • External display header — 4-pin I²C breakout (J6: 3V3 / GND / SDA / SCL) for an off-board display.
  • Manufacturable — JLCPCB gerbers, drills, BOM and placement files are checked in; most parts are machine-assembled.

Signal & power flow

text
  XLR / 6.35" combo (J1) ──coupling──▶ ES8389 ADC ──▶ I²S ──▶ ESP32-P4 carrier
         ▲ phantom
  PoE (J5) ─F1─▶ SW1 ─opto OK1─▶ P-FET Q1 ─▶ 6.81k feed ─▶ XLR pins 2 & 3

  ESP32-P4 carrier ──▶ I²S ──▶ ES8389 DAC ──coupling──▶ TRRS out (J2)
  ESP32-P4 carrier ◀──▶ I²C ◀──▶ ES8389        (+ external display header J6)

Connectors & controls

RefPartFunction
J1Neutrik NCJ6FA-HXLR / ¼″ combo — balanced mic/line input; ¼″ side is a Hi-Z instrument input with auto-detect (hand-solder)
J2CUI SJ-3524 TRRS3.5 mm headset — stereo output + electret mic (hand-solder)
J3, J41×7 sockets (8.5 mm)mezzanine to the carrier — I²S, I²C, power
J51×2 headerPoE rail input from the carrier's PoE module (hand-solder)
J61×4 headerexternal I²C display (3V3 / GND / SDA / SCL) — DNP; hand-fit (top side) only for a display harness. Eurorack builds don't need it: the interposer drives the display directly
SW1SPDT slidephantom power on/off (manual) — DNP; populate only in builds that use phantom. Unpopulated = phantom permanently off; for switchless always-on phantom, bridge SW1 pads 1–2 instead

Key components

RefPartRole
U1Everest ES8389 (QFN-24)stereo audio codec
U2TI TPS7A2033ultra-low-noise 3.3 V analog LDO
OK1Everlight EL3H7 (80 V)opto-isolated phantom enable
Q1Vishay Si2325DSP-FET phantom high-side switch
F1100 mA / 60 V PPTCphantom / PoE overcurrent protection
D6SMBJ58CA TVSPoE-rail clamp
D8white LEDphantom-present indicator
C192.2 nF Y2isolation-barrier safety cap

Board

  • ≈ 51.4 × 21.1 mm, 4-layer (F.Cu / In1.Cu / In2.Cu / B.Cu), 1.6 mm.
  • Components on both sides (SMD top + bottom) plus a few through-hole connectors.
  • Mechanical CAD (enclosure, mounting brackets, faceplates) is maintained outside this repo.

Host integration

The codec carries audio over I²S and is controlled over I²C. Its I²C address is set by the AD0/AD1 straps (R3/R4); R1/R2 are the SDA/SCL pull-ups. Typical firmware is ESPHome or ESP-ADF configured for an external I²S codec.

Mezzanine pinout (J3 / J4)

The header assignment is chosen so one unmodified board works on two hosts: the Waveshare ESP32-P4-ETH carrier it was designed for, and a Raspberry Pi Pico — the hat's footprint (2.54 mm pitch, ~17.8 mm row spacing, 51 × 21 mm outline) lands exactly on the Pico's USB-end pins 1–7 / 40–34.

Mezzanine pinout

J3 padnetP4-ETHPicoJ4 padnetP4-ETHPico
1SDAGPIO54GP01+5VVCC1_5VVBUS
2SCLGPIO19GP12passVCC_5VVSYS
3AGNDGNDGND3AGNDGNDGND
4DSDINGPIO18GP24pass3V3_EN3V3_EN
5BCLKGPIO17GP35+3V33V33V3(OUT)
6LRCKGPIO16GP46MCLKGPIO20ADC_VREF — unused
7ASDOUTGPIO15GP57DETGPIO21GP28

Why it lands this way:

  • BCLK/LRCK adjacent (GP3/GP4, WS = BCLK + 1) — stock side-set PIO I²S implementations work unmodified on the Pico.
  • SDA/SCL on GP0/GP1 — a hardware I²C0 pair and MicroPython's default.
  • MCLK sits over the Pico's ADC_VREF, which is harmless: both ends are passive (ADC_VREF is a filtered rail, the codec's MCLK is a hi-Z input), so a full 40-pin header can be fitted. The Pico runs the ES8389 in SCLK-source mode (reg 0x02 bit 6 = 0 — the codec clocks itself from BCLK; supported combos cover 44.1 k/48 k at 16/32-bit). The P4 keeps a true MCLK on GPIO20. Never jumper a Pico GPIO into a fitted J4.6. R28 (0 Ω 0805, fitted by default) sits in series right at J4.6: lift it on a Pico build that uses the Pico's own ADC, so the hat's MCLK trace can't couple noise into ADC_VREF — or use its codec-side pad as the MCLK injection point for an advanced Pico build (192 kHz needs a real MCLK).
  • DET on GP28 — instrument auto-detect readback works on both hosts.

Pico caveats: +5V is VBUS, so the analog LDO only runs on USB power; phantom power is unavailable (no PoE front end — see the phantom section below); full-duplex I²S needs a custom PIO RX machine against the TX clocks; no ES8389 driver exists for the Pico yet (port from ESP-ADF or the mainline Linux es8389.c). For low BCLK jitter set sys_clk to 153.6 MHz so 3.072 MHz divides exactly.

Power & host-connection notes

  • USB-C and PoE at the same time is safe. The carrier has an onboard power mux (PoE-priority P-FET + Schottky), so the supplies never fight and the PC's USB port can't be back-driven; the 48 V PoE line side stays behind the PoE module's transformer isolation (Y-cap bridge only), with or without phantom switched on. Flashing/serial over USB while running on PoE is the intended debug workflow.
  • Don't hot-plug USB mid-recording — the ground-equalization transient can print as a pop at +36 dB mic gain. Connect first, then record.
  • Bench use on USB only: leave phantom off (SW1 open/unpopulated) — with phantom on, K1/K2 close and reconnect the unpowered PoE module, which injects mains hum into the input.
  • Eurorack builds: USB-C for flashing/serial works while Synthia powers the carrier from the rack — the interposer feeds the carrier's pre-mux node (bench-verified), so the same USB power mux applies. Avoid leaving USB plugged in with the rack powered off (it back-feeds the module's buck output); details in the Synthia repo.

Phantom power source (the PoE tap)

Phantom power is the one hat feature that needs more than the mezzanine: the 48 V-class rail is tapped from the PoE bus and enters the hat on J5 (pin 1 = TAP_HV +, pin 2 = TAP_GND −). On the ESP32-P4-ETH carrier, the RJ45 mag-jack's pair centre taps run raw to the H7 header; the plug-in PoE module on H7 carries the bridge rectifiers (BD1/BD2) that turn them into 37–57 V DC before its isolated DC-DC makes the 5 V. Tap the two bridge-rectifier outputs on the PoE module — + to J5.1, − to J5.2. The module has no connector for the tap, so the two leads are hand-soldered directly to the rectifier output pins; keep them reasonably short:

PoE tap for phantom power

  • The tap sits before the module's isolation barrier: 37–57 V is present whenever a PoE switch/injector is attached, even with SW1 off.
  • Never add bulk capacitance to the tap (> 0.15 µF breaks the module's 802.3af detection signature and the carrier won't power up). The hat is designed for this — its reservoir sits after Q1.
  • Verify +/− with a meter at the bridge outputs before wiring; a reversed tap defeats the D6/Q1 protection.
  • Raspberry Pi Pico builds: phantom power is unavailable. A Pico has no Ethernet, so nothing like this PoE front end exists — the XLR condenser path is dead unless you feed J5 from an equivalent isolated 44–57 V source with the same polarity. Every other hat function (instrument input, dynamic mics, headphone/line out, display) works normally on a Pico.

Microphone setups

Two validated configurations, using the AVB endpoint firmware's controls (ES8389 PGA via the entity's Mic Gain control; digital gain via the talker's ESP_AVB_TALKER_MIC_DIGITAL_GAIN_DB Kconfig, which also engages an always-on DC-block ahead of the gain):

Condenser (phantom)Dynamic
Phantom switch (SW1)ONOFF
PoE feed (J5)connected + powereddisconnect the PoE module (see note)
ES8389 PGA gain+36 dB+36 dB (ceiling is +36.5 dB)
Digital gain (Kconfig)0 dB+20 dB

Notes:

  • Unpowered PoE module injects mains hum. With the PoE module installed but not powered, the input picks up ~60 Hz mains at near full scale even with SW1 off — remove/disconnect the module (J5 feed) when running without PoE. (Addressed in the current design: SW1 off now opens both PoE-tap lines through the K1/K2 PhotoMOS relays, so the module can stay connected.)
  • Dynamic microphones sit ~20–30 dB below condenser output; the ES8389 PGA ceiling (+36.5 dB) alone leaves them ~-40 dBFS, hence the digital gain stage.
  • Mic Gain writes above the PGA ceiling clamp silently — verify the value the response reports, not the value requested.
  • The input is wired differential (MIC1P/1N) at the codec; both mic types run balanced through the XLR.

Instrument (guitar) input

The ¼″ side of J1 feeds a high-impedance buffer (U3, ~500 kΩ input) into the codec's MIC1 channel through an analog mux (U4). Inserting a mono TS plug (guitar cable) shorts the jack's Ring contact to the Sleeve, pulling the DET line low — this automatically switches MIC1 from the XLR mic path to the buffered instrument path, and is readable by the carrier on J4.7 (input, active-low = instrument present). Remove the plug (or use an XLR mic) and the input returns to the mic path. Phantom power never reaches the ¼″ contacts.

Hardwiring a guitar without installing the Neutrik connector — three connections on the J1 footprint, not two:

Guitar wirePadNote
Tip (signal)either T padthe two T holes are the same net (GTIP); one is enough
Sleeve (ground)S padPGND; the larger G pad is the same net if a thicker wire is used
—jumper R → Srequired. With no jack fitted, nothing shorts Ring to Sleeve, so DET stays high and the mux stays on the (absent) XLR path — the guitar would be silent. The jumper forces instrument mode. Easiest form: populate R27 (0805 0 Ω, DNP by default) — it shorts DET to PGND on-board. Remove/leave it off if the Neutrik is fitted.

Eurorack module link (J7): instead of hand-wiring, an optional 1×4 female socket J7 (8.5 mm stacking, same series as J3/J4, DNP by default) direct-mates the Synthia eurorack interposer's J8 header. Populate J7 only when J1 is absent (they use the same input path), and populate R27 with it (the module's input jack can't pull DET low). Pinout: 1 = GTIP, 2 = PGND, 3 = AGND, 4 = HP_L_OUT — signals on the outer pins with both grounds between them.

Eurorack + display: the interposer drives a display directly from its own display socket (J10, on the main GND/3V3/I²C nets), so J6 can stay DNP in eurorack builds — no bottom-side fitting needed. Fit J6 (top side) only for a normal display harness in non-rack builds.

Cable: use two-core shielded cable (the input is high impedance and hums otherwise) — one core to T (signal), the other core to S (return), and the shield joined to S at the hat end only; at the guitar end connect just the two cores (tip / sleeve) and trim + insulate the shield. The return current then flows in the tightly-coupled core pair while the shield does pure screening — bonding it at both ends would let ground-loop and pickup currents flow through it in series with the signal. For very short runs (a few cm) plain coax — center to T, shield as the return to S, connected at both ends — also works.

Mono amplifier output (hardwiring J2)

To feed a mono amplifier that expects only tip and sleeve, skip the 3.5 mm jack and solder wires directly to the J2 footprint. Careful: J2 is wired as a CTIA TRRS headset jack, so the pad named S is not ground — on CTIA the physical sleeve is the microphone conductor.

Amp wirePadNote
Tip (signal)THP_L_OUT — left audio channel
Sleeve (ground)TNAGND — audio ground. Do not use the S pad: it is the headset-mic line (MIC2_RAW) and carries mic bias — grounding it gives hum and injects into the MIC2 input.

Notes:

  • This taps the left channel only; have firmware output a mono downmix if the source is stereo. Do not bridge the T and R pads to "sum" the channels — that shorts the two DAC output stages into each other. (A passive sum, if ever wanted, is a ~1 kΩ resistor from each of T and R into the amp tip.)
  • An amp input (typically ≥10 kΩ) is a much lighter load than headphones, so the 22 µF output coupling caps give essentially full bass extension here.
  • Unlike the J1 guitar hardwire, no jumper is required — J2 has no plug-detect circuit.
  • Cable: use two-core shielded cable — one core to T (signal), the other core to TN (return), shield joined to TN at the hat end only; at the amp end connect just the two cores (tip / sleeve) and trim + insulate the shield. This keeps the shield free of audio and ground-loop current (which its resistance would otherwise convert to hum in series with the signal) while still screening the run. This link is forgiving (low-Z source into a ≥10 kΩ amp input), so for runs under ~10 cm plain coax with the shield as the return, connected at both ends, is also fine.

Repository layout

PathContents
scramble_hat.kicad_sch / .kicad_pcbhierarchical schematic + layout
BOM.csvbill of materials — single source of truth
fab/JLCPCB gerbers, drills, BOM, CPL — see fab/README.md
tools/gen_fab.pyregenerate every production file from the design
tools/check_sync.pyverify schematic ↔ PCB netlist agreement
lib/project symbols, footprints, 3D models
docs/schematic + silkscreen PDFs

Manufacturing

See fab/README.md for the full ordering guide. In short: JLCPCB fabricates and assembles most parts; you hand-solder J1, J2, J5 and C19 (the Y-cap), and R14 is left unpopulated (DNP ground-lift jumper). J6 (display header) is also DNP — hand-fit it only when a display is used (top side normally, bottom side for the eurorack stack). Regenerate all fab outputs with:

sh
python3 tools/gen_fab.py

⚠️ Before committing an assembly order, verify part rotations in JLCPCB's preview — especially U1 (the QFN's rotation is applied manually and is a best estimate).

Parts

79
QtyValueFootprintReferences
121uFCapacitor_SMD:C_0402_1005MetricC2, C5, C7, C8, C9, C12, C20, C21, C23, C24, C25, C26
6100nFCapacitor_SMD:C_0402_1005MetricC1, C3, C4, C27, C28, C29
5100kResistor_SMD:R_0402_1005MetricR11, R13, R19, R22, R23
310kResistor_SMD:R_0402_1005MetricR1, R2, R25
333RResistor_SMD:R_0402_1005MetricR9, R10, R24
21MResistor_SMD:R_0402_1005MetricR21, R26
21uFCapacitor_SMD:C_0805_2012MetricC10, C11
222uFCapacitor_SMD:C_0805_2012MetricC14, C15
2470Resistor_SMD:R_0402_1005MetricR17, R18
26.81k 1%Resistor_SMD:R_0805_2012MetricR5, R6
2KAQY214SPackage_SO:SOP-4_3.8x4.1mm_P2.54mmK1, K2
2PESD3V3L1BA (ESD)Diode_SMD:D_SOD-323D1, D2
10R (MCLK link)Resistor_SMD:R_0805_2012MetricR28
10R DNP (PGND lift)Resistor_SMD:R_0402_1005MetricR14
1100nF 100VCapacitor_SMD:C_0805_2012MetricC30
1100nF/100VCapacitor_SMD:C_0805_2012MetricC17
110k (AD0 strap)Resistor_SMD:R_0402_1005MetricR3
110k (AD1 strap)Resistor_SMD:R_0402_1005MetricR4
110uFCapacitor_SMD:C_0805_2012MetricC6
115kResistor_SMD:R_0805_2012MetricR16
11kResistor_SMD:R_0402_1005MetricR12
11uF (bias filter)Capacitor_SMD:C_0402_1005MetricC13
11uF/100VCapacitor_SMD:C_1206_3216MetricC18
12.2kResistor_SMD:R_0402_1005MetricR20
12.2k (mic bias)Resistor_SMD:R_0402_1005MetricR7
12.2nF Y2 (PGND-AGND)scramble_hat:C_Y2_DE2B_THC19
12.2uFCapacitor_SMD:C_0402_1005MetricC22
1600R@100MHzInductor_SMD:L_0603_1608MetricFB1
174HC4053Package_SO:TSSOP-16_4.4x5mm_P0.65mmU4
1Carrier LEFT 1-7Connector_PinSocket_2.54mm:PinSocket_1x07_P2.54mm_VerticalJ3
1Carrier RIGHT 1-7Connector_PinSocket_2.54mm:PinSocket_1x07_P2.54mm_VerticalJ4
1DMP3098 (P-FET 60V)Package_TO_SOT_SMD:SOT-23Q1
1ES8389scramble_hat:ES8389_QFN24_P0.35mmU1
1I2C 3V3/AGND/SDA/SCLConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ6
1LED white 0805LED_SMD:LED_0805_2012MetricD8
1MMSZ4699 (Zener 12V)Diode_SMD:D_SOD-123D7
1NCJ6FA-HConnector_Audio:Jack_XLR-6.35mm_Neutrik_NCJ6FA-H_HorizontalJ1
1Polyfuse 50mAFuse:Fuse_1812_4532MetricF1
1R0 (force instrument mode)Resistor_SMD:R_0805_2012MetricR27
1SMBJ58CA (TVS 58V)Diode_SMD:D_SMAD6
1SS-12D00-G3scramble_hat:SW_Slide_SS-12D00-G3SW1
1TLP291Package_SO:SOP-4_4.4x2.6mm_P1.27mmOK1
1TLV9061Package_TO_SOT_SMD:SOT-23-5U3
1TO EURORACK MODULE (alt. to J1)Connector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_VerticalJ7
1TPD1E10B06 (ESD)Package_SON:Texas_DPY0002A_0.6x1mm_P0.65mmD9
1TPS7A2033Package_TO_SOT_SMD:SOT-23-5U2
1TRRS PJ-3X4S (CTIA, bottom-side)Connector_Audio:Jack_3.5mm_CUI_SJ-3524-SMT_HorizontalJ2
1VDD_PoE / PGNDConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ5

Similar boards

  • 4 layers227 × 40 mmAnyboard, the printed circuit board in 3D

    Anyboard

    mattclarkdotnet/anyboard

    Any to any passive patch panel

    11 parts
  • 2 layers153.5 × 35 mmAudio over Cat5 (XLR Combo Female), the printed circuit board in 3D

    Audio over Cat5 (XLR Combo Female)

    PKCubed/RJ45XLR

    A simple, robust PCB that allows a shielded twisted pair category cable (Cat5e, Cat6a, etc.) to take the place of up to four heavy XLR cables.

    10 parts
  • 6 layers60 × 30 mmUdsp card, the printed circuit board in 3D

    Udsp card

    crsknr/hw_udsp-card

    A compact DSP development board for real-time embedded audio and sensing

    221 parts2GPL-3.0
  • 4 layers91.9 × 53.2 mmPhoenix main board, the printed circuit board in 3D

    Phoenix main board

    Phalkon-Industries/phoenix-instrument

    Git repo for the content of the new Phoenix ph handheld instrument.

    117 parts2CERN-OHL-S-2.0
  • 4 layers88 × 58 mmBIOCHEST ECG EMG, the printed circuit board in 3D

    BIOCHEST ECG EMG

    8aChristian/BIOCHEST-ECG-EMG

    Figure 1: Full 4-Layer High-Density Medical PCBA with Galvanic Isolation Barrier & Routed Copper Tracks.

    29 parts
  • 6 layers178 × 118 mmMoriShield Carrier 6L, the printed circuit board in 3D

    MoriShield Carrier 6L

    aswinserigreen/morishield_hardware

    all components bom , pcb layouts and schematics of morishield is maintained here

    157 parts
  • 4 layers71 × 42.8 mmCadProd compact, the printed circuit board in 3D

    CadProd compact

    botsqerebot/AudioDeck

    Everything to change, check and test for rev 2. The main goal is power saving while the player is off:

    83 parts
  • 4 layers285 × 94.5 mmLX60EC - STM32, the printed circuit board in 3D

    LX60EC - STM32

    FriedS0ul/Gamma-LX60EC

    Standard 60% EC pcb with drop-in lx60 compatibility

    247 parts

Questions

How big is the Scramble hat PCB?

It measures 51.4 × 21.1 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Scramble hat use?

79 parts, built around the ES8389, 74HC4053D, TPS7A2033DQN and KAQY214S. 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 Scramble hat KiCad files?

From the scrambletools/ES8389-Hat repository on GitHub, at the commit this page was made from: the board is scramble_hat.kicad_pcb and its schematic scramble_hat.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Scramble hat design in my own project?

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