Skip to main content
The NAU8325 is a highly efficient digital input Class-D audio amplifier designed by Nuvoton Technology Corporation. It is well-suited for compact and battery-powered devices, including portable speakers, IoT devices, tablets, and smart audio systems. It features integrated digital-to-analog conversion, eliminating the need for an external DAC and reducing system complexity.

How it Works

The NAU8325 receives digital audio via the I²S (Inter-IC Sound) protocol, which transfers pulse-code modulated (PCM) data between the MCU and the amplifier. I²S Signals:
  • BCLK (Bit Clock): Synchronizes each individual bit of audio data.
  • LRCK / WS (Word Select): Indicates whether the data is for the left or right channel.
  • SD (Serial Data): The real-time, synchronized audio stream.
  • MCLK (Master Clock): Optional high-frequency clock for advanced timing (not always required).
To ensure compatibility with the NAU8325 and ESP32 hardware, use the following audio settings:
Tools like Audacity can be used to convert audio files to these formats before playback.

Key Features & Applications

Key Features

  • Efficiency: High-efficiency Class-D output with digital volume control.
  • Simplicity: Direct I²S input, reducing PCB space and system cost.
  • Streaming: Supports real-time streaming, sine wave generation, and SD card playback.
  • Versatility: Ideal for IoT audio, portable speakers, and digital amplifiers.

Applications

  • IoT audio notification and voice prompts
  • Portable Bluetooth / Wi-Fi smart speakers
  • Embedded audio playback and music players
  • Educational kits and sound synthesizers

Example 1: Sine Wave Generation

Pin Configuration

Step 1: Hardware Required

  1. GLYPH Board
  2. NAU8325 Module
  3. Speaker

Step 2: Circuit Diagram

nau8325_circuit_diagram

Step 3: Code Setup

  1. Open Arduino IDE.
  2. Install the required libraries:
  3. Copy and paste the following code into the Arduino IDE:

Step 4: Upload the Code

  1. Connect the Board
    • Connect your GLYPH board to your computer.
  2. Select the Board and Port Do the following settings in your Arduino IDE:
    • Tools > Board > esp32 > Pcbcupid GLYPH
    • Tools > Port and select the port connected to your GLYPH.
    • Tools > USB CDC on Boot > Enabled
If USB CDC on Boot is not enabled, you won’t see any serial output in the Serial Monitor.
  1. Upload the Code
    • Click the upload button (➡️ icon) or use the shortcut Ctrl + U in Arduino IDE to upload the code to the board.

Step 5: Observe the Output

  • You should hear a continuous sine wave tone from the speaker connected to the NAU8325 module.

Example 2: SD Card Audio Playback

Pin Configuration

Step 1: Hardware Required

  1. GLYPH Board
  2. NAU8325 Module
  3. Speaker
  4. SD Card Module

Step 2: Circuit Diagram

nau8325_with_sdcard

Step 3: Code Setup

  1. Open Arduino IDE.
  2. Install the required libraries:
  3. Copy and paste the following code into the Arduino IDE:

Step 4: Upload the Code

  1. Prepare SD Card
    • Format the microSD card (FAT32 recommended).
    • Save your MP3 file as /Dwapara.mp3 on the SD card root directory.
    • Insert the SD card into the SD card module.
  2. Connect the Board
    • Connect your GLYPH board to your computer.
  3. Select the Board and Port Do the following settings in your Arduino IDE:
    • Tools > Board > esp32 > Pcbcupid GLYPH
    • Tools > Port and select the port connected to your GLYPH.
    • Tools > USB CDC on Boot > Enabled
If USB CDC on Boot is not enabled, you won’t see any serial output in the Serial Monitor.
  1. Upload the Code
    • Click the upload button (➡️ icon) or use the shortcut Ctrl + U in Arduino IDE to upload the code to the board.

Step 5: Observe the Output

  • Open the Serial Monitor at 115200 baud.
  • The MP3 file stored on the SD card will play through the speaker connected to the NAU8325 module.