Introduction: The Smartphone Operated House-Wide Audio System
This system solves the seemingly ubiquitous problem of being able to listen to your music from anywhere in your house. Say goodbye to a separate iPod dock in each room! This instructable will show you step-by-step how to build a house wide, multi zone audio system which can be entirely controlled from your Smartphone or computer (really anything with a web browser) from anywhere in your house which you have a Wifi connection (no more annoying bluetooth range issues!). Did I mention it's also expandable to however many zones you need? There are systems which aim to accomplish this same task such as the Sonos brand of speakers, but this system allows you to use speakers and amps of your choosing and at a fraction of the cost of a Sonos system.
In this project we will be making use of an Arduino uno with an ethernet shield and a custom PCB which can be ordered from your favorite PCB manufacturer (I recommend OSH Park). The central component of the PCB is the PT2258 IC. This IC allows for volume control of 6 audio channels and communicates with the Arduino over the I2C bus.
Now that we've covered the basics of the system, LET'S GET BUILDING!
Step 1: Gathering the Components
For this project, a number of components are required:
- Speaker wire run from a centralized location (such as a utility room in the basment) to each zone
- Speakers of your choosing for each zone
- 6 channel amp (such as this one) or multiple small 2 channel amps such as the popular Lepai 2020a+
- Power supply for the amp
- Spare 3 prong AC power cable
- SPST Relay (I used this kit from Sparkfun)
- Arduino Uno with Ethernet Shield
- Male to female jumper wires
- Custom PCB for the PT2258 (I have attached the file for this which you can upload and order from OSH Park)
- The PT2258 IC (I ordered this from ebay)
- 10uF Capacitors
- 100 kOhm resistors
- 3.5mm through hole jacks
- Male .1" spaced headers
- A microSD card (any size)
- HDMI audio extractor (I used this one)
- RCA to 3.5mm cables
I was able to purchase and complete the build for around $300. My system includes 3 zones but you can expand it as much as you need to.
Step 2: Soldering the PT2258 Board
I soldered the components to the circuit board in the following order:
- PT2258 IC
- 3.5mm Jacks
- Male headers
Step 3: Connecting Everything Together!
Using the male to female jumper wires connect the following pins on the PT2258 board to the Arduino
- VCC to +5V
- GND to GND
- SDA to A4
- SCL to A5
- CODE2 to GND (Note: if using more than 1 PT2258 board for more than 3 zones, CODE2 needs to be connected to GND on one board and +5V on the other. This changes the address of the PT2258 IC so the arduino can communicate with the two boards separately)
Connect the relay to the Arduino:
Connect VCC to +5V, GND to GND, and the signal pin to digital pin 8 on the Arduino
Powering the Amp
Cut off the non 3 prong end of the AC power cord and strip the three wires inside. Do some googling to find out which wire colors correspond to live, neutral, and ground. For my cord, live is brown, neutral is blue, and ground is green. Attach neutral and ground to the power supply as shown. The live wire needs to be routed through the relay so we can control when the amp gets power. Attach the end from the cord to the normally open pin of the relay and attach the load pin of the relay to the live pin of the power supply. Using some spare wire (I used speaker wire) connect + and - of the power supply to + and - on the amp.
If you chose to use several small amps such as the lepai 2020a+, they should have all come with their own smaller power supplies. I have not personally done this, but I recommend plugging all the power supplies for the 2020a+ into a power strip and using the relay in line with the power strip supply cord.
The final touches!
The only other thing left is to connect the Arduino to your home network with an ethernet cable and your router and plug USB power into the Arduino.
Step 4: CODE!
This is where the real magic happens. I have attached files containing the code for the Arduino as well as the HTML file for the ethernet shield.
Open the text file with the Arduino code in the Arduino IDE. There are a few things you will need to change to have a properly functioning system.
- Change the IP address variable to a suitable IP address for your home network (this will be the ip address of the Arduino)
- Change the gateway variable to the IP address of your router
- Change the subnet variable to that of your home network
- Change the mac variable to the MAC address of your ethernet shield (it should be on a sticker)
- Change the two address variables to the address of your PT2258 chip
Now that your code is ready, upload it to the arduino!
The HTML file needs to be on the root directory of the SD card. Name the file "Kamdora.html" and put the SD card in the slot of the ethernet shield.
Step 5: Audio Input
All this work would be pointless without some music, right?
In order to maintain the idea of being able to control the system from a smartphone, I used a Chromecast with an HDMI audio extractor. This allows us to take the audio the Chromecast outputs and plug it into our PT2258 control board. Thus we can simply cast our favorite Pandora station or music from Google Play Music to the Chromecast and control the volume from our Arduino. Simply plug the Chromecast into a TV and set it up on your home network, then unplug it from the tv and plug it into the HDMI audio extractor. Using a RCA to 3.5mm cable, plug the HDMI audio extractor into the input of the PT2258 board. Finally plug the outputs of the PT2258 Board into the inputs of the amp.
Step 6: Accessing and Controlling the System
The system can be controlled by anything which has a web browser and is connected to your home network. All you have to do is type in the IP address of the arduino followed by "/?app" (i.e. 192.168.1.199/?app) and you will be brought to the control app for the system (shown in the picture). This allows you to change the volume of each zone and turn on an off the system.
Step 7: Final Thoughts and Future Expansions
The greatest limitation of this system is the fact that there is only one audio input for the entire system. That means you have to listen to the same song throughout the entire house. I'm currently working on a newer revision of the system which will have two inputs (2 chromecasts) and allow for switching between the inputs on a zone-by-zone basis. My initial thoughts are to use transistors and the digital output pins on the arduino to control which input goes to which channel. If you have any suggestions or problems be sure to let me know!
Thanks and I hope you enjoy your new audio system!
Participated in the
Summer #mikehacks Contest
Participated in the
Remote Control Contest
Participated in the
squeeze more awesome out of summer contest