Audio System Controller

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi Everyone,

First of all, I appologise if I'm not posting in the right section cause I am really clueless under what category should my DIY be considered and I've looked through every category and this category seemed most suitable.

So anw, for the past few months, I have been working on a project and thought I might share it with you.

Motivation
I have been DIYing since a young age and I was getting a little tired with the usual DIYing of amps, speakers, preamps etc. Furthermore, ever since I upgraded my speakers, the process of turning on the system got a little more complicated as there was more equipment to turn on in a particular sequence. I wanted to make my system user friendly so my family members could use it too, after all, my speakers took up quite some space in the living room and for that, I am very thankful for them for putting up with my hobby.

Introduction
My quest for this project began as a simple power on sequencer. It consisted of a microcontroller, 3 relays and a power supply. It was a very hasty design with no much thought put into the mechanical design. The project was put in a corner of my room for close to a year without any utilisation.

An externally hosted image should be here but it was not working when we last tested it.


I thought I shouldn't waste the microcontroller that I had earlier bought. So I rethought about this project that I abandoned and came up with the idea of integrating as much things as I could into one box. I also wanted something that would be challenging for me to DIY, something different from the usual DIY that I have done for many years. I came up with a list of things that I wanted to be within this box:

  • FM Radio
  • Power Sequencer
  • DAC
  • Selector
  • Volume Control
  • LCD Display with Touchscreen
  • IR Remote Control
  • Wireless Network Control

The Brains
The heart of the entire system is a microcontroller. I chose to use Arduino as a microcontroller as it was easy to learn the platform, open source and the development platform is free. All you needed to do is purchase the hardware. Furthermore, there was a very active community of people sharing ideas and sample codes to use with Arduino and also providing technical support for it.

In particular, I chose to use the Arduino Mega 2560 board as it had a lot of outputs, I2C bus, SPI, Serial ports for communication and most importantly, large SRAM.
Arduino - ArduinoBoardMega2560

FM Radio
FM radio function is achieved with the Si4703 module purchased from Sparkfun (https://www.sparkfun.com/products/10344). It operates on 3.3V and communicates on the I2C bus, which is easily handled by the Arduino microcontroller. The module has an on board headphone amplifier, thus the output signal requires no additional conditioning before it is fed into the volume control stage.

Power Sequencer
My entire system has 4 amplifiers, 2 per side. Turning them on was troublesome to me as the amps were located near the speakers and not at a common location. Furthermore, there was a particular turn on/ off sequence which I had to follow to avoid damaging the speakers. To achieve this, 3 10A DPDT relay were used for switching the 240Vac. The turn on/off sequence is programmable and can be changed to suit different speaker systems allowing for future upgrades.

DAC
The DAC is the ODAC from nwavguy (NwAvGuy: ODAC Released). Though there were very very mixed reviews about the products from this guy, I decided to give it a try since it was really value for money. The power supply powering this module is fed by a dedicated linear regulator which only turns on when the DAC is connected to a laptop/PC.

Selector
I had 6 sources. DAC, PS3, CDP, Spare, TV and FM. The selection of the source is done through 7 DPDT relays, each source with 1 relay except for the FM module which has 2 as I did not like the idea of the FM ground being always connected to the signal ground. Control of the relays is managed by the microcontroller.

Volume Control
From the selector, the signal is passed to the volume control. I was contemplating between using a DACT motorised stepped attenuator or a digital solution to perform this function. Eventually I decided to adopt a digital solution as it offered a lot more steps although the distortion figure is slightly higher. The PGA2310 Stereo Volume Control IC was chosen. The analog section of the IC operates at +/- 12V while the digital section operates on 5V. This preserves the dynamic range of the audio signal. The IC communicates through Serial Interface, which is also easily handled by the Arduino Microcontroller. Initially, there was an input and output buffer working together with this IC but they were removed as they did not contribute to an increase in performance/ listening pleasure.

An illuminated encoder is used to provide a form of control for the user to set the volume. The encoder's output is wired to hardware interrupt pins on the Arduino microcontroller such that the volume control portion of the software will run whenever there is a change in the encoder's state. Pushing down the encoder will mute the system and the knob will be illuminated red.

LCD Display with Touchscreen
One very important aspect of a technology related product is its user interface. In my opinion, the reason why apple made it so big was because they made their user interface very intuitive. Adopting this principle, a LCD touchscreen was added for the user to control the system. The LCD display is rather primitive but still does the job well. The touchscreen is a 4wire resistive touchscreen where its resistance changes when pressure is applied on the screen. The LCD display communicates with the microcontroller through Serial Peripheral Interface (SPI) and an 8 bit data bus. I had to modify the library provided with this LCD display as the pins that the library used were not ideal.

An externally hosted image should be here but it was not working when we last tested it.


The sources available are drawn as square boxes and touching it would enable the source. The current source selected is shown on the bottom left corner of the screen while the volume is shown on the bottom right corner of the screen. For FM tuning, selecting the FM source will bring the user into a FM display page where the user can tune into the selected radio station.

An externally hosted image should be here but it was not working when we last tested it.


Touching the top right button would make the FM module seek up while the left top button would seek down.

On hindsight, a SD card can be added to this system to allow display of bitmap graphics making the user interface more pleasant looking.

IR Remote Control
An IR receiver is integrated into the system. The IR receiver signal goes through a comparator to minimise errors while reading the remote control signals. Timer interrupt is used to constantly read the IR input for data. Only through using timer interrupts then will there be minimal errors and instant response when a command is sent by the remote control.

At the moment, the IR function is not very sensitive. Still working on it and the main suspect is the comparator's resistor values.

Wireless Network Control
With all the hype about network music players, having a network ready audio system controller seemed like a very fun idea. To provide a wifi connection, the RN-XV WiFly Module was used (https://www.sparkfun.com/products/11048). It communicates with the Arduino microcontroller through serial interface and is able to connect to my home's wireless network. The module is programmed first to connect to my home's network upon turn on and thereafter to host a web server. At the moment, the web interface is very simple consisting only of buttons and status displays.

An externally hosted image should be here but it was not working when we last tested it.


There are still some bugs on the wireless portion of the system as sometimes the data packets get lost and the connection hangs. Still lots of room for improvement.

The final machine looks like this..
An externally hosted image should be here but it was not working when we last tested it.


Finally, here is a video showing how the system operates:
Audio System Controller - YouTube
Sorry for the very amateurish video :p

Thanks for reading!
 
Last edited:
Awesome! Got any pics of the insides? Would you share your code?

Hi maxw,
you can go to this FB album for pictures of the build process:
https://www.facebook.com/media/set/?set=a.10150954834437574.396834.621777573&type=3

Part of the code actually originates from you, the PGA2310 portion, and I am very thankful for the open source community, thus I am more than willing to share the code :) But I need some time to do some touch up first cause there's bits and pieces of debug code everywhere :S So hang on while the code gets tidied up.
 
wow! thankyou so much.

this is brilliant and just what I am after for my whole house audio system...I am familiar with the arduino (at a basic level) never even thought to look for an FM radio shield!

I love the video, it looks so easy to use.

mine will all be in a rack, and controlled via tcp so no need for a display or remote so that will simplify it for me.

can you provide details of the circuits you are driving please? (particularly the volume control using the pga2310).

thanks so much for posting this.
 
The PGA2310 circuit that I used is the basic circuit that can be found inside the datasheet. I did not include any input or output buffers as I found that it did not lead to an improvement in performance.

From the output of PGA2310, the signal is split into 2 through a parallel configuration. One signal is fed to my subwoofer amp and the other is fed to the amp driving my fullrange drivers.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.