The Arduino Controlled, Phone Operated, House Wide Audio System (Part 4)


Now that the volume control module is finished, there is one more thing we need to consider. We want to be able to turn the system on and off remotely. I used this relay in line with the power supply for the amp to allow the Arduino to control whether the amp gets power.

Time to wire everything together:

  1. Plug the Ethernet shield into the top of the Arduino

  1. Connect 5V and GND on the relay to 5V and GND on the PT2258 board

3. Connect the relay signal to any of the digital pins of the Arduino

4. Connect 5V and GND of the PT2258 board to the Arduino
5. Connect SCL and SDA of the PT2258 to A5 and A4 on the Arduino, respectively
6. Connect both CODE1 and CODE2 to GND on the arduino (if you are using two PT2258s, connect CODE2 to +5V on the second)

7. Find a spare 3 prong AC power cable (it MUST be 3 prong), cut the non-3-pronged end off and expose the three wires inside.

  1. Do some Googling to find out which of your three wires is live, which is neutral, and which is ground.

  2. Connect neutral and ground to their corresponding ports on the power supply and connect the live wire to the normally open port on the relay board.

  3. Connect the load port on the relay to the live port on the power supply.

  4. Using some spare wire, connect + and – of the power supply to + and – on the amp.

The finished system should look like this


What would be the point of all this if you still had to walk over to your computer to change the song? The days of getting out of your La-Z-boy to play “Never gonna give you up” are over!

If you haven’t yet heard of a Chromecast, prepare to be amazed. A Chromecast is a small HDMI dongle which allows you to play Netflix, Hulu, Pandora, whatever you want on your TV! All for just $35! Oh, and did I mention you control it from your phone through WiFi? Bingo! That’s what we want. If you pair a Chromecast with an HDMI audio extractor, you are able to take the audio signal the Chromecast outputs and send it through our PT2258 chip. All you need to do is plug the Chromecast into the HDMI port on the audio converter and plug the RCA outputs on the converter into the input of our freshly soldered PT2258 board.

Wow, that was pretty easy! Now on to some harder parts….


This section will be relatively short. Writing this code is not a beginner task. If you are well versed in C++, feel free to have a go at writing your own code. For those of you who are still beginners, I have attached the code I have written for this project. Feel free to use it however you like!

There are some changes you must make to the code depending on your setup. I have listed those at the very top of the code file and have included instructions on how to fill in the blanks.


I will be approaching this section in the same way as the Arduino code. I have attached the code I use and, if you are so inclined, you may use it knowing that it will work. All you need to do is take the HTML file containing the webpage, put it on the microSD card in the root directory and name the file “Kamdora”. Next put the microSD card back in the Ethernet shield and you’re ready to go!


In order control the system from your phone you will need to open the browser of your choice and type the IP address of the arduino followed by /?app (i.e. This will take you to the control webpage and you are good to go! Start casting some music through the Chromecast and have full control over where and how loud it plays! By the way, this web-app will work on any device will a web browser, not just your phone.

This is the screen you should see. Press System On to engage the relay and allow power to travel to the power supply and amp. Press mute all to instantly mute all channels and silence your house. Click on any of the channels individually to mute separate zones. The volume scale is 78 (quietest) to 0 (loudest) and is controlled by the arrows.

Congratulations! You have just successfully completed your very own house wide audio system! I hope you enjoyed my tutorial and that you learned something in the process!

Kamdora (Ardunio Code).txt (10.2 KB)

Kamdora (HTML File).htm (18.8 KB)