TK100I2Sbeginner

I2S Amplifier

An NS4168 I2S amplifier on a TinkerBlock board: the ESP32-S3 sends sound as numbers on three wires and the chip drives a 4 Ω speaker, about 1 W on 3.3 V. CTRL must be driven HIGH or it stays off, the L/R jumper picks which channel the mono chip plays, and neither speaker wire is ground.

I2S Amplifier TK100

Specifications

TypeMono Class-D amplifier with a built-in DAC and an I2S input. The ESP32 sends numbers; the chip drives the speaker
ChipNS4168 (Nsiway), ESOP-8. Always an I2S listener: the ESP32 makes every clock
Supply3.3 V on 3V3, as printed. Not 5 V: at 5 V the chip's logic HIGH is 3.5 V, above what a 3.3 V GPIO gives
HostA 3.3 V board with an I2S peripheral, such as the ESP32-S3. An Arduino Uno or Nano has no I2S
Header6-pin right-angle male, 2.54 mm: GND, 3V3, LRCLK, BCLK, DIN, CTRL. 22 Ω in each I2S line; CTRL through 22 kΩ
CTRLHIGH to play, LOW to shut down (about 1 µA). Unconnected is off or undefined, so always drive it
ChannelMono: plays the right channel with the L/R jumper open, as shipped, and the left with it bridged (CTRL then sits at 1.03 V)
OutputBridge-tied, neither wire is ground. 1.2 W into 4 Ω at 3.6 V (datasheet, 10 % THD+N); about 1 W at 3.3 V, worked out
SpeakerA bare 4 or 8 Ω speaker on a 1.25 mm 2-pin socket. Never headphones, GND or another amplifier's input
ProtectionAnti-clipping (turns its gain down up to 10 dB), overcurrent, over-temperature and under-voltage
Sample rate8 to 96 kHz; bit clock 16, 24, 32, 48 or 64 per frame. The book's sketches use 16 kHz, 16-bit stereo
Board22.4 × 30.4 mm TinkerBlock board, two LEGO-compatible holes 16 mm apart, red power LED
In the boxThe I2S audio kit: TK100, TK101 microphone, TK103 DAC, a 4 Ω 3 W speaker that plugs into the TK100, a 3.5 mm cable and a 3.5 mm to RCA cable. Headers fitted

What it does

The TK100 plays sound on a speaker from numbers. The ESP32-S3 sends samples on three I2S wires, LRCLK, BCLK and DIN, and the NS4168 on the board turns them into a voltage and amplifies it to drive the speaker: DAC and amplifier in one chip. The ESP32 does only the arithmetic.

The TK100 from above at an angle: a black board with a gold border, a white two-pin speaker socket at the back between AUDIO + and AUDIO -, the eight-legged chip in the middle, a jumper marked L/R, two round LEGO holes, lonely binary up the left edge, and six right-angle pins out of the front edge.
The TK100: speaker socket at the back, ESP32 at the front.

Two things to know before wiring

  • CTRL must be driven HIGH. LOW or unconnected, the chip is off, and the power LED stays lit either way. Every sketch here sets CTRL HIGH before it plays.
  • Neither speaker wire is ground. Both AUDIO + and AUDIO - switch. Only a speaker goes across them: never GND, never headphones, never another amplifier's input. And the board is 3.3 V only.

Wiring, in four lines

  1. GND to GND, 3V3 to 3V3.
  2. BCLK to GPIO 15, LRCLK to GPIO 16, DIN to GPIO 17.
  3. CTRL to GPIO 18, driven HIGH in the sketch.
  4. The kit's 4 Ω speaker into the white socket.

Where to start

The handbook below is nine short articles. Read What is on the board before wiring and CTRL: on, off, left or right before your first sketch. First sound plays a scale; Record and play back adds the microphone.

The rest of the kit

The TK100 comes in the I2S audio kit with two other blocks, each with its own handbook on the same pin map: the TK101 PDM microphone, which records, and the TK103 I2S DAC, which feeds headphones or powered speakers.

When it doesn’t work

Why is there no sound when the LED is on?
The LED only shows power. The chip stays off until CTRL is driven HIGH. Wire CTRL to a GPIO (18 in this book) and set it HIGH before playing.
Does it work with an Arduino Uno?
No. The Uno's ATmega328P has no I2S peripheral and runs 5 V logic. Use an ESP32-S3, which has two I2S ports and can put them on almost any pin.
Can I plug headphones into it?
No. The output is a switching, speaker-level signal on two wires, neither of them ground. For headphones or powered speakers, use the TK103 DAC from the same kit.
Why does a stereo song play only one side?
The NS4168 is mono and plays one channel: the right as shipped, the left with the L/R jumper bridged. Two TK100s on the same three wires, one bridged, make stereo.
Can I run it from 5 V to make it louder?
Not with an ESP32 driving it. At 5 V the chip needs 3.5 V to see a logic HIGH, more than an ESP32 pin gives. Power it from 3V3; it gives about 1 W into the kit's 4 Ω speaker.
My sketch will not compile: expected unqualified-id.
The sketch names a pin PIN_CTRL, which the ESP32-S3 core already defines. Rename it; this book uses PIN_AMP_ON.

The I2S amplifier 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.

Numbers in, sound out

2 articles

What an I2S amplifier does that the ESP32 cannot, and what is on the board.

Three wires and a switch

2 articles

The three I2S lines, the one channel a mono chip plays, and the CTRL pin that has to be HIGH.

The speaker side

2 articles

Why neither speaker wire is ground, how loud it gets on 3.3 V, and what the chip does when a sound is too loud.

Using it

3 articles

A scale on the speaker, then three seconds recorded with the TK101 and played back, and where to look when it stays silent.

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

Community

Questions about this product

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

Ask a question ↗

I2S Amplifier

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