TK103I2Sintermediate

I2S DAC

TI's PCM5102A stereo DAC and a 3.5 mm jack on a TinkerBlock board, for the ESP32-S3, which has no DAC of its own. Three wires carry the samples in and the chip makes its own master clock from the bit clock. The output is line level, 2.1 V RMS: headphones and powered speakers, never a bare speaker. 3.3 V only, and XSMT is already held HIGH.

I2S DAC TK103

Specifications

TypeStereo DAC with a 3.5 mm line output. It turns I2S samples from the ESP32-S3 into a voltage for headphones or a powered speaker; it is not an amplifier
ChipTI PCM5102A (PCM5102APWR), TSSOP-20. 16, 24 or 32-bit samples at 8 to 384 kHz, I2S format
Output2.1 V RMS full scale, line level, ground-centred by a built-in charge pump, so no DC-blocking capacitors. 470 Ω and 2.2 nF on each channel, TI's recommended filter, corner about 154 kHz
Supply3.0 to 3.6 V on 3V3, about 20 mA typical: a 3.3 V board. The absolute maximum is 3.9 V, so never 5 V
Performance112 dB dynamic range and SNR, THD+N −93 dB, typical, from TI's datasheet (48 kHz, 24-bit, 10 kΩ load). Not measured on this board
Header6-pin right-angle male, 2.54 mm: GND, 3V3, BCK, DIN, LRCK, XSMT. GPIO 42, 41, 40 and 39 in the book
XSMTSoft mute, held HIGH by a 10 kΩ pull-up, so the DAC plays with nothing connected. Driven LOW it ramps the sound down; HIGH ramps it back up
ClocksThree-wire I2S: the chip's PLL makes its master clock from BCK. It locks at 32 or 64 bit clocks per sample from 32 kHz up, 64 only at 16 kHz, and not at all at 8 kHz
Jack3.5 mm stereo (PJ-327A): left, right and ground. For headphones, earbuds and line inputs, never a bare speaker
HostA board with I2S, such as the ESP32-S3. An Arduino Uno or Nano has no I2S peripheral
Board22.4 × 30.4 mm TinkerBlock board, two LEGO-compatible holes, red power LED
In the boxThe I2S audio kit: TK103 DAC, TK100 amplifier, TK101 PDM microphone, a 4 Ω 3 W speaker for the TK100, a 3.5 mm to 3.5 mm cable and a 3.5 mm to RCA cable. Headers fitted

What it does

The ESP32-S3 can make sound as numbers but has no DAC to turn them into a voltage. The TK103 is that DAC: the ESP32-S3 sends samples on three wires, and TI's PCM5102A puts left and right on a 3.5 mm jack at line level, the signal headphones and a powered speaker's input expect.

The TK103 from above at an angle: a black board with a gold border, a black 3.5 mm headphone jack standing off the back edge, the twenty-legged PCM5102A in the middle between two round LEGO holes, small capacitors around it, the power LED at the front left, and six right-angle pins out of the front edge.
The TK103: the jack at the back, the header at the front.

Two things to know before wiring

  • Line level, not speaker level. Headphones and powered speakers go in the jack. Never a bare speaker, and never a speaker amplifier's output.
  • 3.3 V only. Take the supply from the ESP32-S3's 3V3 pin, never 5 V.

Wiring, in four lines

  1. GND to GND, 3V3 to 3V3.
  2. BCK to GPIO 42, DIN to GPIO 41, LRCK to GPIO 40.
  3. XSMT to GPIO 39 if the sketch should mute; otherwise leave it off.
  4. Headphones or a powered speaker in the jack.

Where to start

The handbook below is nine short articles. Read What is on the board before wiring, Three wires, no master clock before choosing a sample rate, and Headphones, powered speakers, never a bare speaker before plugging anything in. Left, then right is the first sketch; Internet radio plays an MP3 station in stereo.

The rest of the kit

The TK103 comes in the I2S audio kit with the TK100 I2S amplifier, which drives the kit's speaker, and the TK101 PDM microphone. The book's pin map keeps all three on separate GPIOs, so any two can be wired to one ESP32-S3 at once.

When it doesn’t work

Can I plug a speaker straight into the jack?
Not a bare one. 2.1 V behind the board's 470 Ω cannot move a speaker cone: a 4 Ω speaker gets about 18 mV, worked out. Use a powered speaker, or put the kit's speaker on the TK100 amplifier.
Do headphones work?
Yes, at a moderate volume. 32 Ω headphones get about 0.13 V RMS at full scale through the board's 470 Ω, worked out: plenty for earbuds, modest for big headphones. For loud, use powered speakers.
Do I have to connect XSMT?
No. A 10 kΩ resistor on the board holds it HIGH, which means play. Wire it to a GPIO only if the sketch should mute.
Can I power it from 5 V?
No. The PCM5102A runs from 3.0 to 3.6 V with an absolute maximum of 3.9 V. Take the supply from the ESP32-S3's 3V3 pin.
Why is it silent at 8 kHz or 16 kHz?
With no master clock the chip builds one from the bit clock, and only for the rates in TI's table. 8 kHz is not listed; 16 kHz needs 32-bit slots. At 44.1 and 48 kHz, 16-bit stereo works.
Does it work with an Arduino Uno?
No. The Uno's ATmega328P has no I2S peripheral, and its pins are 5 V. Use an ESP32-S3.

The I2S DAC handbook

9 articles · about 45 minutes

This page is the reference: what the part is, what it is made of, and the questions people arrive already asking. The handbook is the walk — the same part in the order somebody actually meets it.

What it does

2 articles

Numbers in, a voltage out: what a DAC is, and what is on this one.

Clocks and mute

2 articles

Three wires and no master clock, which bit clocks the chip locks to, and a mute pin you may leave alone.

Line level

2 articles

What comes out of the jack, the filter in front of it, and what it may be plugged into.

Using it

3 articles

A tone in each ear, internet radio in stereo, and where to look when the jack stays silent.

Edit this page — content/modules/i2s-dac.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

I2S DAC

Loading discussions…

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum