6. ADAU1701-based stereo 3-way DSP Board

Objective

There are a number of boards using the ADAU1701 that provide a 2-input with 4-output capability, and those boards are good choices for building a stereo 2-way active speaker.  However, there aren’t any comparable boards that are small and low-cost that will work for 3-way speakers or 2-way speakers with one or two subs.  So that’s our goal:  a low-cost stereo 3-way DSP board.

The ADAU1701 supports 8 output channels, and it turns out that adding the extra two channels needed for a stereo 3-way active crossover is relatively easy.  This article describes the extra hardware required and it walks through all of the steps required to design, fabricate, assemble and test this DSP board.

The stereo 3-way board has many applications.  We can use it to make active 3-way systems, or use it for “active 2.1” systems.  By “active 2.1” I mean stereo active speakers, each with a separate woofer and tweeter channel, plus one or two subwoofers.  This is not a commonly referenced configuration, but it turns out to be very useful for computer speakers or TV speakers.  This is a “centralized” electronics configuration, where all of the electronics can be housed in the subwoofer box or in a small amplifier chassis.  I’ve used configurations like this for many years, and in case study #2 we will show the details of building some nice computer or TV speakers with the electronics inside of a subwoofer cabinet.  But first we need that stereo 3-way DSP board!

Block Diagram

The block diagram below shows all of the major functions of the stereo 3-way DSP board.  This is the block diagram for the first version of the board, and the second version of the board is very similar.  The first version works well, and you can download the board files and build it and have a lot of fun.  But the first version has a lot of tiny surface mount components, and building it requires a lot of tedious effort and more “inspiration” from inebriating spirits.  The second version fixes some problems and uses as many commonly available “eBay modules” as possible to simplify the construction.  The goal of the second version was to reduce the small parts count by a factor of 2 by using the modules.  Of course, modules available in 2017 may not survive beyond 2018, but that’s a feature of the rapidly moving world we live in.  Since you can download the source files for this board, you can change the board design to use other modules that may be available.

 

The Rev 1 board has a lot of commonality with the miniDSP or freeDSP boards, in that both are adaptations of the reference circuit in the data sheet for the ADAU1701.  However, our DSP board has some key differences.  First, we’ve added those extra two channels by including a stereo DAC.  We’ve selected the Wolfson/Cirrus Logic WM1824 for this DAC, as it is reasonably high quality, is readily available, and it has an on-board charge pump to eliminate the output capacitor and provide additional voltage swing for driving subwoofer plate amps.  Second, we have eliminated the EEPROM needed for self-boot on the freeDSP board, as the Adruino CPU loads the code into the ADAU1701.  The reason for not using self-boot mode is that the Arduino code needs to “know” the addresses for the Parameter RAM for each of the ADAU1701 DSP cells, by processing the output of the SigmaStudio compiler.  In order to ensure that the cell addresses correspond to the ADAU1701 Program RAM, it is best to have the Arduino microprocessor load that code.

The third way in which this board is unique is by using an Arduino CPU to provide a high-level interface to external computers or by providing a local user interface with an LCD display.  A lot more will be said about this Arduino CPU in the article on the Arduino Software.  This high-level interface provides 4 different physical control interfaces.  The user can use a “smart” LCD display (the Nextion displays) along with an IR keyboard, a “heavyweight” speaker design client running on a PC, or a Bluetooth cell phone app to select crossover types and frequencies, baffle step control, EQ, and other DSP functions.

Revision 1 DSP Schematic and PCB

The DSP boards were designed using DesignSpark PCB.  DesignSpark is free, it is easy to use and well documented, and it generates the Gerber files we need to get the board manufactured.  The schematic is shown below, but in order to examine the circuit you will need to download the project files and open them in DesignSpark.  There are also some custom library components made for this board, and you will need them if you want to make changes.  The files are in the Download section of this web site.

The boards were made using ITEAD.  For about $45 you get 10 good quality boards.  It will cost another $20 if you want them shipped quickly, but I’ve gotten some boards back in about 2 weeks using the standard shipping option.

The figure below shows the completed board, along with the low-cost ($16) Nextion touch screen display.  The figure shows the board before I modified it to add a Bluetooth interface.  There was a lot of interest on the Parts Express Techtalk board about being able to control the DSP from a cell phone app, so I removed the parts for the FTDI interface and hot-melt glued a Bluetooth board in their place.  This figure also shows the teensy-LC board, which was the initial selection for the Arduino CPU.  However, as the code kept increasing in size, I exceeded the code space limitation of the teensy-LC (64K) and had to switch to the teensy3.2 board.  The board will accept either module, since they used nearly identical pinouts.  The teensy3.2 board is more expensive, but it is also a lot faster, and it has plenty of code space for this project to evolve.  It’s also got 5V-tolerant pins, so we don’t need a level shifter to connect the 5V Nextion display.

As noted earlier, this board works fine for the stereo 3-way project described in Case Study #2, but only if you are OK with soldering all of these components.  However, there are a lot of SMD parts on this board that can be replaced by some readily available modules.  For example, the stereo DAC chip, which is in the upper right section of this board, uses a 24-lead QFN package and has about 8 supporting components.  You can buy a PCM5102 module for about $4 on eBay that uses an easy-to-solder 6 pin connector, and that is much less work.  Similarly, there are a number of switching regulator modules, FTDI modules, and Bluetooth and WiFi modules available at surprisingly low prices.  So the next iteration of the board is a bit larger to accommodate these modules, but it is much easier to assemble.

Revision 2 Board

The block diagram shows the modules in a reddish color, with the blue blocks indicating areas of SMD components that need to be assembled.  Unfortunately, there are no ADAU1701 modules that meet our needs.  The Sure ADAU1701 DSP module is somewhat close to being useful for this application, but the number of I/O connections would make that approach cumbersome.  So there is still some tedious SMD soldering involved, but this situation has improved to where you can view this as a one day, one or two beer project, instead of a multiple evening effort.

The block diagram also shows a new component:  an isolated 5V supply.  This is needed for the external Dayton WiFi Adapter, which makes a lot of interesting noises unless it uses an isolated ground.

 

The assembled PCB is shown below, and you can see from the schematic that it is more modular and there are fewer SMD components to deal with.  Some of the modules are “stuffing options” to provide different interfaces.  For example, you can use either Bluetooth or WiFi to control the DSP, but you can’t use both because they share the same serial port.  And you can use the FTDI USB interface for controlling the DSP from a PC or for the Arduino debugger, or you can leave this module off the board if you don’t need those interfaces.  You will still need to solder on the 64-pin ADAU1701, but all of the passive SMD components are 0805-sized, which isn’t that difficult to solder.  If someone wants to investigate getting these boards machine assembled or if someone wants to build some up to sell, I’d be happy to help with some of the details.

Getting Boards Made

There are many good PCB manufacturing companies that will allow you to upload the Gerber files and have boards made within several days.  Since most of these PCB companies are in China, the cost of quick shipping is often about the same as the cost of the board fabrication.  However, if you are willing to wait for relatively slow economy shipping, you can get a small run of boards made for about $40 with shipping about $10.  I’ve been using ITEAD for the last two years to have the boards made, and I’ve had consistently good service.

Places like ITEAD (https://www.itead.cc/open-pcb.html) require that you pay them for the boards using an online form, and then they will send you a link for uploading the zipped Gerber files.  The files are automatically analyzed, and for some reason, my DesignSpark files don’t pass the automated test.  But don’t worry–they look at the files manually before making the boards and they will send you email if they find problems.  I’ve had some part issues where the silkscreen turned up in the wrong layer, or one layer didn’t use the same measurement scale, and ITEAD was very good about pointing out the problems.  If you run into problems, download the Gerbv program or other Gerber viewer app to help debug the problems.  DesignSpark has a tutorial on preparing the manufacturing files that can also be helpful.  The zipped Gerber file will include about 15 files, with top and bottom layer information and drill data.

The zip file in the Download section for this project is what was used for the current design.  You should be able to send it to ITEAD and have your own boards made without any problems.

Parts List
Assembly Instructions
Testing and Debug

Revision 3 Board

The Revision 2 boards are a good solution for an active 2.1 system or a stereo 3-way system, and it’s a lot easier to build than the original board.  By adding an external Linkplay-based WiFi adapter the Rev2 board can be the core of a high performance active speaker system.  However, we can improve the design and make it smaller and simpler by adding a Linkplay A28 module to the board, and that is the major change for the Revision 3 board.  But there are some “gotcha’s” that need to be addressed.

First, the WiFi adapter is usually connected via the analog output of the WiFi adapter, which uses the WM8918 CODEC.  The WM8918 isn’t on the Linkplay module itself:  it is on the board that includes the Linkplay module.  So if we want to use the analog input of the ADAU1701, we need to include both the Linkplay module along with the WM8918 and its associated circuitry.  But we are trying to minimize the number of tiny SMD chips, and adding the WM8918 doesn’t help achieve that goal.

A better approach is to use the I2S input of the ADAU1701 and connect the Linkplay module using the digital output.  This eliminates the need for the WM8918 and makes the path to the DSP all-digital, without an extra DAC and ADC in the signal path.  However, this digital input also creates a problem in that the ADAU1701 needs to use the Linkplay clock, as there is no sample rate converter in the ADAU1701.  Fortunately, the ADAU1701 includes a PLL for multiplying the bit clock to generate the necessary internal clock, and the Linkplay sample clock is “close” to the clock normally used for the ADAU1701 (44.1KHz vs 48KHz).  So with a couple of changes to the ADAU1701 circuit and a different SigmaStudio load and some Arduino software changes to account for the different sample rate, we will be able to connect the ADAU1701 as an I2S slave to the Linkplay A28 module.

In order to keep the board about the same size, I used a vertical switching power supply IC instead of the large module, and removed a couple of features such as the IR remote control for the Nextion display.   I also added a switch input that isn’t shown on the block diagram that allows using the ADAU1701 analog inputs for playback of “local” audio such as a PC.  The Linkplay module provides an analog input via the WM8918 CODEC, so removing that chip means we need to provide an alternate path for analog input to maintain that useful feature.

Status:  as of 3/18/2018, 4 of the Rev 2 boards are partially assembled and close to being tested.  Once they are tested, the Rev 3 PCB’s will get sent out for manufacture.  The Rev 3 boards are actually ready to go out now, but I need to test the Rev 2 boards first because there is a lot of commonality between those boards and I want to make sure there are no mistakes.  Here is a look at the Rev 3 board:

Status update: as of 8/31/2018, the Rev 2 board is getting put in a chassis for testing, but the Rev 3 board is out for fabrication, even though Rev 2 isn’t fully tested yet.  I didn’t specify quick shipping as I have other projects underway that will keep this project from being expedited.  But in about a month I’ll probably have all the parts and boards to get started on this.

Revision 4 Board

Really?  Sure, why not…even though the Rev 3 boards are in, but none have been built yet…

The ADAU1701 “learning board” available at AliExpress and eBay is one more game-changer in this evolving design.  The board includes the same DSP circuitry as used in the previous versions of this board, but everything is already soldered onto a module that you can buy for around $15.  So now there is the possibility of having the design be nothing more than a passive motherboard, with pads and wiring for adding the DSP, CPU and other modules.  That’s an attractive design, and it would make a nice product.  However, the focus on these pages isn’t so much to develop commercial products, but rather to explore new and interesting possibilities.  So let’s see how we can take this delightfully simple approach and add a few challenges 🙂 .

First, in a separate effort that isn’t documented on these pages yet, there is a new cell phone application written entirely with Android Studio for controlling the DSP.  And rather than using a Bluetooth interface for this control, it is using MQTT.  MQTT is the protocol used for the Internet of Things (IoT), and it uses WiFi rather than Bluetooth.  So we will be able to put this Revision 4 board on our home network and could even control it from a remove site somewhere on the Internet.  But we need to make a change to the CPU, as the teensy boards don’t have WiFi built in, and adding that capability  will increase the cost and wiring complexity.  The new CPU choice will be based on the ESP32, which provides WiFi, a 32-bit CPU and even a small OLED display for less than $20.

Second, the Linkplay A28 audio module is pretty cool, but the new WiFi audio modules from Parts Express are using a much newer module (A31V4) with additional circuitry to provide Bluetooth audio.  In order to continue to take advantage of these evolving modules, it will make sense to provide an optical connection on our board so that we can use any of the WiFi modules.  So even though we added the A28 module in the previous version of the board, we will remove it in this iteration and replace it with a TOSLINK receiver module that can interface directly to the ADAU1701 module.

And third, we will add a power amp module to this board that will provide 4 channels of audio, each with about 15 to 20 watts of power.  There is a new board that just went out for production (June, 2019) which has 2 Analog Devices SSM3582 class D power amp chips.  This design will provide an all-digital path from the WiFi input module to the power amp chips.  The SSM3582 amps are very high quality, with Delta-Sigma modulation and high order filters that result in very low distortion.  The amps are relatively low power, but they should be adequate for small speakers and for the tweeters and midranges of larger 3-way speakers.  Since we can use the analog outputs of the ADAU1701 for external amplifiers for woofers and subwoofers, the DAC module on the Revision 3 board could be eliminated.  However, to allow using the board without the amplifier modules, we will keep the DAC module in the board design, to allow greater flexibility for 3-way applications (this option is still being evaluated)

So here is the block diagram for this Revision 4 board:

The really nice feature of this design is that with the exception of the Amp Module, all of the red blocks are modules that are readily available at this time, and that there are no SMD chips on the board.  The Amp Module has quite a few SMD chips, but the author is looking into have a small run of these boards made, once the circuitry has been validated.  The reason these boards might get manufactured is that this board was designed to replace the SSM3302 amplifiers on the line array project.  It requires 5 of these boards for each line array speaker (20 power amps per line array), which would be a prohibitive amount of hand soldering.

Update, June 7, 2019:  While laying out this Revision 4 board, it became apparent that the proposed digital interface wasn’t going to work.  The problem is that the clock signal for the ADAU1701 is not available on external pins on that module, so you can’t just run the chip from the recovered SPDIF clock, which was the approach used in the Revision 3 board.  So the SPDIF to I2S module can’t be used as an input–the only input option for the ADUA1701 module is either analog or an I2S slave device such as an analog-to-digital converter.  So this revision 4 board may end up taking on two different flavors:  a simpler version, with analog input only, or a more complex version that uses the ADAU1452 module that is available for around $50.  The ADAU1452 has integrated ASRC functionality for dealing with different sampling rates, and it has an integrated SPDIF converter as well.  However, there are a number of software changes for the ADAU1452 that would slow down the implementation of this version, so the ADAU1452 alternative may get implemented as an entirely new revision (Revision 5).  The final version of Revision 4 is shown below as Revision 4a, along with the proposed Revision 5.

 

The Rev 4a board has been laid out and will be sent out for fabrication as soon as one Rev 3 board has been built.  It’s important to know how well that Linkplay module works, as we want to build on that approach in the future.  The Rev 4a board also has a lot of new risks:  the CPU is new; the ADUA1701 circuitry is new; the CPU doesn’t have EEPROM, so we need to use the EEPROM on the ADAU1701 board; and those amplifier modules are new.  So this is a lot of new components and software that needs to get tested.  The Rev 5 board is even riskier, since the DSP will require quite a few changes to accommodate the different number format and much more complex hardware architecture.  The Rev 4a is a logical step toward Rev 5, and keeps the number of new “issues” to a manageable amount.  And for those who want a “basic” stereo 3-way DSP board that is easy to build and easily programmed from a cell phone, this board version should be a nice product.

The Rev 5 board will be a big jump forward for this design, as the ADAU1452 DSP is considerably more capable.  This board will provide an SPDIF input for WiFi audio, an IoT WiFi interface for controlling the DSP, and onboard digital amps that can be used for the mids and tweeters in a high quality 3-way system.  And with the exception of the amplifiers, all of the “components” are high-level modules that get soldered or plugged into a motherboard.  The motherboard has a few extra components, but no challenging SMD devices.  This is a nice design with a lot of applications.  The ADAU1452 has enough resources for implementing FIR filters, which make room and driver compensation much easier, so there will be a good upgrade path for the software.  This Rev 5 board will make a really nice integrated solution for active speakers that won’t require a lot of hardware expertise to implement.  The combination of the Rev 4a board along with the Rev 5 board looks like a nice evolutionary end for this stereo 3-way DSP design.