Saturday, April 28, 2012

5.1 amplifier system redesign

I always wanted a 5.1 amplifier system for my computer, but never bothered to go out and buy one. One day I got a dead 5.1 amplifier system that appeared to be ok. When I opened it up, everything seemed to be in order. No signs of overheating, voltages were good, unit turned on normally. Everything worked, but no sound. System was based on three integrated circuits and a ordinary amplifier with preamplifier.

Time to diagnose what was wrong, starting with the amplifier and preamplifier. I took a ordinary cable with 3.5 jack from old headphones, pealed off one end and exposed GND, L channel and R channel. Then I connected this cable to my old MP3 player, turned the volume down to almost mute and pressed play. Next I connected the headphones GND with my amplifiers GND and start poking around with R and L channel. Before this I inspected the amplifier and preamplifier and looked for where the audio comes in. I also discovered that preamplifier had a MUTE option, so I had to connect this wire (MUTE) to +5V to enable sound. When I touched audio in pins on preamplifier with one of the headphones channel outputs, amplifier came to life and started playing. I tested all 6 channels (FRONT LEFT, FRONT RIGHT, CENTER, SUB, REAR LEFT, REAR RIGHT) and every one of them was ok. Sound was good, no distortion and good quality. From this I could assume that amplifier and preamplifier is ok.

Next I measured the MUTE wire from main microprocessor and found that it gives out +5V to enable amplifier. So this was not the case. Only 3 more options were left. Faulty micro controller, or two audio chips.

This system used BT2323 chip as audio selector and mixer, BT2258 as volume controller and BT1610 as the system controller. After some time searching on the net, I found nothing. Then I remembered some post long ago about volume controller IC PT2258. No problem here. Found data sheet, examples and even some source code for AVR. Then I compared these two chips and found out that they were the same. Same pins, same pin out (looked on the board and traced wires). Also tried with PT2323 and it was a hit. Same pin out same pins everything. Complete data sheets (with I2C commands) of these two ICs are included in my download. Sadly no luck for BT1610 or PT1610. Looks like it was a custom micro controller.

I assumed that the BT1610 was OK, because unit turned on normally. So it should be the fault in these two chips. BT2323 and BT2258. I searched eBay and found that they were very cheap. I immediately ordered 10 pcs of each chip (PT2258 and PT2323), put everything away and forgot about it for a month. Then the chips arrived.

PT2258 was easy to replace because it was in DIP package. PT2323 was a problem though. When I tried to remove it with a hot air station, all the cooper connections went with it. Really don't know if it was my fault or the PCB was really bad. Probably both. Well this didn't stop me and I successfully replaced PT2323, but it took me 2 hours of hand soldering little wires to the chip. After inspection and no problems found I hooked the system up and turned it on. Again no sound... This could only mean BT1610 has a fault. And it was true. I hooked up I2C line from BT1610 to Arduino I2C sniffer and found out I2C communication was dead. Thought to myself what a waste of time and money for trying to fix this. The system was beyond repair, because you couldn't get BT1610. Ok, for spare parts it is then. Once again I put everything away and forget about it for a week or so.

One day I was walking true some stores with hi-fi audio and saw that Genius and Logitech 5.1 systems start from 90€ and I really wanted one for a long time. But then again I would have to modify them to work with my setup I have in my room. Well, will be in my room anyways.... still working on it (I have 3 computers, 4 monitors and stereo audio system that I command over Internet - and I really do mean command, not just mains power relay switching. More of this setup in my next posts, for now it is just a proof of concept). It would be a waste spending money on something that needs to be modified completely. Then I remembered I already have a 5.1 system that needs a "little" more work done and it will be completely for my needs and my desires. So I started working...

I went to get that busted 5.1 amplifier and started thinking. I inspected all of circuitry and decided on what to do next. System had one stereo input and one 6-channel input, 4 buttons, encoder, 7-segment led display and IR receiver. And this is what I wanted to do:

add a relay for amplifier power (you can still hear that annoying buzz in speakers when on stand-by)

add serial communication for controlling over Internet

3 wires for controlling amplifier coming out (MUTE, SDA, SCL)

3 wires for power coming out (+5V, +12V, GND)

6 wires for amplifier power coming out (-12V|GND|+12V - RELAY- BACK TO AMPLIFIER)

20 wires coming out for LCD and FRONT PANEL:

LCD (GND, +5V, lcdV, back light, R, E, D4, D5, D6, D7)

Front panel (Button 1, 2, 3, 4, encoder 1, 2, leds, IR, GND, +5V)

7 wires coming out for 3 additional stereo inputs

L2, R2, L3, R3, L4, R4, GND

prepare all the wires coming out and soldered them to boards

Before I continue I will say that all this could be mounted inside the amplifier, but I like it this way. You can see all the effort went into this, otherwise you are looking in an ordinary amplifier bought in a store. It may be stupid for someone but for me... it keeps me warm inside knowing that this is my work.

Before I started doing anything else, I connected PT2323 and PT2258 SDA, SCL and GND to Arduino, and send some data over I2C to try out if it works. I used wire library for Arduino. It is already included in Arduino IDE and all commands were listed in data sheets. A quick test was a success and amplifier was working. Now I can continue with my design.

Now that everything seemed ok, I put it all back together. I started thinking on which micro controller to use. I wanted to go with MSP430F2274, but it is not available in DIP package and I still haven't finished my UV lamp for creating circuits. So I decided to go with a DIP package soldered on breadboard. I needed 20 available I/O pins. And as luck would have it, ATMEGA328P for Arduino Uno has them, in DIP package and also I had one left. One thing I will miss though, MSP430 series have nice low power modes and put the chip to sleep. Arduino is a little bit different. But nevertheless, I don't need sleep mode because this is not battery powered application and power is not an issue. So I started drawing the schematic with consideration of which pin will do what.

Now that the schematic was done, it is time to create it on a breadboard. You can download all three schematics at the end of this post in PDF format. For the preamplifier and amplifier schematic you will have to search the net. There are tons of schematics out there.

Now that the breadboard was done, I wired it up and finished with the hardware part. I also hot-glued all the wires and holes to be air tight as much as possible. All together took me about 48 hours for the hardware part (testing, inspecting, repairing and redesign).

Now I had an 5.1 amplifier system that still didn't work. Off to programming software. First of all I went on the net and found all the libraries I needed. This is library for I2C, internal eeprom, lcd, ir, encoder and interrupts. The I2C, LCD and internal EEPROM libraries are already included in Arduino IDE. The rest I found on the Internet. IR library from Ken Shirriff, that I used before, PinChangeInt library for interrupts and AdaEncoder library for rotary encoder. So special thanks to all the authors of these libraries that made my life easier. Here is how they are included:

I used my own software timeout feature with a simple counter, it is used for:

check IR (delay between IR receive)

delay for reading buttons (for debounce)

LCD (to turn off after some time if active)

temporary LCD info (shows it, then goes to normal after some time)

I went with my method, all though I could use a function millis(). The problem here is that millis() overflow after approximately 50 days. And here a problem could occur, resulting as an unstable system (subtracting unsigned smaller value with a larger one). If someone has more experience working with this function please fell free to leave a comment. Well my counters get stuck at some point and they wait until called again (set to 0). With this I have full control, and never have to worry about overflow. These count delays are defined at the beginning. A reminder that this is not an accurate delay, but it is good enough to do my bidding. Of to uploading software to my board.

My breadboard has a external connector, from which you can connect your Arduino Uno and program the unit. You just connect TX, RX, Reset, GND, and +5V to your Arduino Uno with no chip in. Be aware that you also must disconnect jumper on the breadboard that supplies +5V from the amplifier. Reason why I'm using USB power is that, that sometimes Arduino Uno doesn't want to reset Atmega328p on upload if powered externally. Thus resulting in error message "not in sync". When uploading is finished, disconnect Arduino Uno and put the jumper back on. Now you can connect TX and RX for external control.

When upload was complete I hooked the system up and gave it a try. Everything was working, except one little hardware bug I had. I forgot to connect 100nF decoupling capacitor to reset and GND line. This was showing as an unexpected system reset when there was an EMF disturbance. When capacitor was added, this problem disappeared.

I have also tested my software in any possible way and it is very responsive, does not hang and is well commented. When compiled it uses 24116 bytes of memory, so there is still room for new features. Below you can see the video of what it can do.

First of all, I apologise about poor video quality and editing.. it was my first time. Audio on the video is poor because of poor microphone in my camera, otherwise audio is excellent quality. Volume on computers were set to 50%, that's why amplifier was laud at volume 60, otherwise it gets pretty laud at volume 50. I also had to censor some parts of the video, because my static IP was showed. And that's just for me to know :)

About controlling over Internet... I used Ethernet shield and Arduino Uno. System is communicating with TV and my Amplifier over serial connection, computer and other stuff are just normal digital outputs for now. Like I said, this is still a prototype and I'm still working on it. More of this will be published in my future posts.

Serial communication is the same as in my Serial LCD project with MSP430. Command must start with a code (in my case "AMP1") for system to accept it, other code and values must follow and a end of line (\n) to tell the system transmission is over. Here is a table of serial commands:

Serial commands:

code:AMP1

code

00

x

\n

x = 0 - 1

Turn unit ON/OFF

code

01

x

\n

x = 0 - 4

Select audio in

code

02

x

\n

x = 0 - 3

Select mode

code

03

FL

xxx

\n

x = 88 – 168

Front Left correct

FR

xxx

\n

x = 88 – 168

Front Right correct

SU

xxx

\n

x = 88 – 168

Subwoofer correct

CE

xxx

\n

x = 88 – 168

Center correct

RR

xxx

\n

x = 88 – 168

Rear Right correct

RL

xxx

\n

x = 88 – 168

Rear Left correct

code

04

x

\n

x = 0 – 1

Set enhance

code

05

x

\n

x = 0 – 1

Set boost

code

06

xx

\n

x = 0 – 79

Set volume

code

07

x

\n

x = 0 – 1

Set mute

code

08

x

\n

x = 0 – 1

Set external buttons

code

09

x

\n

x = 0 – 1

Set external remote

code

10

x

\n

x = 0 – 1

LCD settings

code

11

\n

Store in eeprom

code

20

\n

Return status

code

21

\n

Return correction settings

Response:

code

OK

\n

Respond with OK

code

PxCxMxExAxVxxMUxBxRxLx

\n

Return status

code

LxxxRxxxSxxxCxxxLxxxRxxx

\n

Return corrections

You can find table of commands with descriptions in my download.

There is still room for improvement, and new features... but for now I don't need them:

Great work you have done friend. I am facing the same problem with my 5.1 .there was 28 pins micro controller used for volume up-down + input selector+ and mode=controlling the volume for SR, FR, C & SW, this chip may be internally short because when I connect +5v it drops to 1.5v. cant i get ready programmed chip instead of this to run my system ? my level of knowledge is not that much as you suggested above. pl. guide to replace this chip.

I doubt a microcontroller is the cause of a voltage drop. Try and replace all capacitors on 5V line and see if this solves the problem. Sorry to say but if you don't have enough knowledge replacement is very difficult and hard to do on your own.

For past one months, i am searching over net to get guidence to update my 5.1 ch Philips home theatre.

1. Its not having USB/FM/ Bluetooth support2. Its consists 2 stereo + 6 Channel Input RCA available.3. I want to one more INPUT for my USB/FM/Bluetooth board in existing system.4.Input device having BT2323M IC and PT2258 volume control.5. There is no much more diplay and single LED only glowing front.6.I have tried and soldered in the I/p of pin 3 and 26 of 2323m which is free in the IC for stereo I/P.7. after soldered, i connected to FM board, this input not detecting. but in another I/p is detecting.8.anything to be updated in the IC programming (BT2323M)9.Kindly help to update my audio system

Hi NeoxyThanks for the informative post.I am having a Philips SP065 5.1 amplifier system (which was dead. The unit was given to a Philips authorized service center; they changed the amplifier board and gave it back. It worked for two days and stopped working after two days. The unit was taken back to them but they hesitated to accept it blaming my power supply at home. They returned the unit with the board cost without repairs. Now it is with me and wanted to repair it. I opened the unit and details are below.1.It is powered by a Transformer 15-0-15, 2A.2.Two boards are there .One is the power board cum power ampboard having DC out +18,0 and -18 supplies, +9V and amp ICs , 5 Nos.TDA 2030 for 5 nos. speakers and 2 nos.TDA 2050 for SW. The same board contains 2 nos. HCF4053 BE ICs.3. The preamp or input board has 4 nos. 4558 ICs (inputs are TV(L/R), AUX (L/R), CD (L/R) and DVD (FR,FL,SW,C,RR,RL) 1 no.PT2258 (20 pin DIP) and 1 no.BT2323M (28 pin SMD).There is one basic remote and front panel (without display only LED indication)What I understood from the datasheets and of course your details, TDA 2030s and TDA 2050s are for power amps.BT 2258 is for volume control side, BT2323M is for channel selection.I blindly switched on the system and a heavy motor bike sound was continuously heard from the SW. Noticed that one of the 2050s was getting much heated, and replaced both 2050s simultaneously connected to the SW.( I think that for the power amp side, the 5 nos. 2030s are for all 5 channels and two 2050s are for SW? –Total 7 ICs ?). Also I changed both the HCF4053BE (MUX/DEMUX) and then checked and found the abnormal sound has stopped but not working, now some humming sound from the SW .Also I observed that the PT2258 is getting much heated soon after the unit is switched on and the 9V supply (7809) is loaded very much.There is no heat felt on BT2323M and all 4 nos. 4558Ds.Now I like get your advice what shall I do next / check to solve / troubleshoot the issue. Pls help me as you are an experienced hand in this area.Regards and expecting an early replyHareesh.

I have 5.1 multichannel 6150watt subwoofer of logitech. It's power supply card is burnt, please suggest me some Power supply card for it or smps for it. It will be thankful.my Email id :- verma123.anil@gmail.com

Hi all,i need to construct my own 5.1 ch remote amplifier,can anyone here to help me.please write me on my mail.vvmoorthyal@live.com.i am not able to download the project so please help me to construct it .thanks in advance.