Introduction and Guide to HIFIDUINO
This blog has been sort of a notebook for me to write down my own learning with Arduino and the TPA boards. Therefore the information presented assumes that the reader’ is learning at a pace equal to mine.
Beginners are overwhelmed with the amount of information here so this post is to help those by outlining the basics of building a controller board for the superb kits produced by Russ and Brian of Twisted Pear Audio. TPA is also developing a controller for their products so this is an alternative to their solution utilizing low cost, and widely available parts. (As of July 2011, the TPA controller board in not yet available, so this is the only “ready-to-run” option)
Basically, all modern audio chips have a software interface and they communicate with a micro-controller through a communication protocol called “I2C”. I have chosen the Arduino platform because I am not a programmer and Arduino is geared towards that audience. In addition, the Arduino community provides a lot of help for beginners and non-programmers.
HIFIDUINO is about building a controller that can talk to those audio chips. So far I’ve interfaced to the OPUS DAC with the WM8741 and the Buffalo II boards. But the same platform can be used to interface to other chips such the WM8804 spdif interface.
The controller consists of:
Any official board or clone will work. The current (v.09) code size is about 14K bytes, so even the bottom of the line Arduino will work. All of he following models work: UNO, Dueminalove, Seeeduino v.2.2, NANO and others. I have used the UNO and the Dueminalove.
The rotary encoder is used to change volume and settings. In theory, you can use any “quadrature” or “gray code” encoder. However, I find that the preferred characteristics of the encoder are:
- About 30 cycles per turn. This gives a good “feel” when changing the volume, changing 30 db per revolution -not too fast or too slow
- Built-switch. The switch is used to change from volume control to DAC settings control. This is not mandatory, you can implement with a separate switch
- A rotary encoder with “clicks” is preferred because you can feel the clicks when you select the different settings. This is not mandatory but it provides a better feel
I use a Panasonic model that has been discontinued, but available from Electronic Goldmine. Other candidates are: Bourns PEC11, BI EN12. The current version of the code (v.09) does not require that you build a debouncing circuit as the debouncing is done in the software (I had used the rotary encoder without hardware debouncing or a long while, but I finally added the debouncing capacitors). For more information on debouncing, see: link
The code assumes a 20×4 LCD. Any LCD that is compatible with the HD44780 protocol will work with the code: Do a search for “20×4 LCD HD44780″ on eBay. The one I purchased is from Sure Electronics. You can also purchase directly from their website: [link].
As it turned out, a large portion of the code is the user interface and it assumes a 20×4 LCD. Thus, if you use a different form-factor LCD (for example a 16×2 LCD, you will have to overhaul a large portion of the code.
IR receiver and a remote control
A level converter from 5V to 3.3V for the I2C lines
This part maybe optional. As the I2C inputs of the Buffalo are “supposed to be” 5v tolerant, but the data sheet does not say specifically and I have not determined that to be the case with 100% certainty. (You can easily build it if you do not wish to buy the module)
The best use of this project is for you to experiment with your own choice of components and ideas. You can reuse whatever part of the code you wish (as I have reused code from other contributors. -This is the spirit of open hardware and software of the Arduino community). If you do this you will find that the audio hobby is not just about changing cables, capacitors and power supplies :-)
However, if you wish to just replicate what I have done, this is what you do:
- Get familiar with the Arduino development environment. At the minimum you must know how to compile code and upload to an Arduino. The Arduino tutorials listed in the side bar are a good start.
- Procure the parts above and hook them up according to the different hookup diagrams in this blog. The current code does not require that you build a debouncing circuit for the rotary encoder so you can skip the debouncing circuit
- Download the latest version of the code from the code tab. Compile and Upload to the Arduino