Monday, January 21, 2019

Simple I2S stereo decoder with amplifier

In this project we build simple I2S stereo decoder with amplifier. To decode I2S data we use Princeton Technologies PT8211 16bit DAC. KA2206 audio power amplifier is used as driver stage of this system.

Prototype version of I2S stereo decoder

Structure of this I2S amplifier is self-explanatory from the schematic. We select PT8211 and KA2206 combination due to lower cost and availability. Unfortunately PT8211 DIP package is not available in local market and we use SO package in our prototype. We design PCB for the DIP packages, and therefore we solder PT8211 SO package to PCB using "SO8 to DIP8" converter.

We design this system to work with 9V DC power source but at the prototyping stages we noticed that it works well with lower DC voltage such as 5V. For the output use any 8Ω or 4Ω (5W or higher rated) full range speaker pair. We test this with 8Ω 8W oval speakers which are commonly found on televisions.


PT8211 test setup with Raspberry Pi 3

Technically this project should work with any 3.3V I2S bus. We test this with Raspberry Pi 3 I2S bus and it gives us an excellent results. Due to different timing format of the PT8211 DAC we use custom device tree overlay for this audio interface. The complete configuration details for Raspbian Stretch is described in below:
  1. Connect I2S decoder with Raspberry Pi using following mapping: 
J1 pin-out Description Raspberry Pi header pin
1 GND 6
2 DIN 40
3 WS 35
4 BCK 12
  1. To install soft-volume control and to perform other system configurations use Adafruit MAX98357 installation script: 
curl -sS https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2samp.sh | bash
  1. Copy "generic-lj.dtbo" file to "/boot/overlays" directory.
  2. Open "/boot/config.txt" file and comment the "dtoverlay=i2s-mmap" line and add "dtoverlay=generic-lj" to a new line. After the above modifications dtoverlay section of the file looks like this:
dtoverlay=hifiberry-dac

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
#dtoverlay=i2s-mmap
dtoverlay=generic-lj
  1. Restart the Raspberry Pi, and now Raspbian is ready to use this new I2S decoder.
  2. First test the system with simple audio formats like wave files using aplay command. For example:
 sudo aplay /usr/share/scratch/Media/Sounds/Vocals/Singer2.wav
  1.  To play MP3 files use mpg123.
To adjust the volume use alsamixer or volume control available at the graphical desktop.

If KA2206 is not available, or hard to find, use TEA2025 or TA7769 ICs, those chips are direct substitutes for KA2206 AF power amplifier.

Audio quality of this decode is impressive but do not compare it’s audio quality with high-end audio system or with high resolution DAC based sound cards. As a summery this DAC gives superb results for it's price and simplicity.

Schematic and PCB design of this project are available to download at google drive.

No comments: