Upgrading the Amplifier

Yes... Yet another entry about Hi-Fi and audio! Is it too much? I really should touch the inside of a DS or 3DS again!

I might post additional updates after I make more additions to the project, but no promises on that.
Should I write a blog entry about it? I did take some photos.
I'm still not sure if I should write a blog entry about the upgrade.
I will write about it, better stop being lazy. A sickness tried to stop me from doing it, but I will not let it defeat me and delay the blog entry half a year again. Even if not many people will read it, I know at least @KleinesSinchen will appreciate it, and it will also serve me as my own journal on the project.
It's not like I should be surprised that not many people on a gaming forum are interested in an audio project. But I love writing blog entries, even if takes quite a bit of time to write one and not many people will read it. Long-form and written content keeps getting pushed to the side, these days. Eventually, I plan to host my blog on my own blog website, so it can possibly reach a slightly wider audience, but I'm not sure when I'll finish doing that. Maybe some years later I will write a full book? Who knows.

Upgrades

So, two weeks ago, around the weekend, I started working on the upgrades I described in my previous entry about the amplifier project.
The upgrades to do: wiring the previously unconnected front-panel headphones jack as an additional auxiliary audio input, and giving the amplifier more switchable 230V power outlets, so it can switch the power to all of the external Hi-Fi components, rather than just the radio tuner and DAT deck.

Obligatory warning: Good news, I didn't die working with 230V this time! But if you don't know how to safely work with mains AC voltage, if you're not really sure what you're doing, and if you're not sure about fire safety, please do not repeat what I did. It can be very hazardous. That goes for 100V AC in other countries, too.

First, before even disassembling the Hi-Fi, in order to minimize its "downtime" and the clutter in the room, I started working on the power-switching thing. I ended up buying a cheap power strip with 5 outlets, and 5 individual switches for turning the power off or on on each one. I planned to replace those individual switches with my own electromechanical relays that can be controlled electronically from the amplifier's microcontroller. But I concluded that it's better to leave those switches in place, since they seemed pretty much fused to the plastic housing of the power strip. Even if I removed them, that would leave big holes behind, that ideally I would have to patch for safety. And there still wouldn't be a lot of space inside of the power strip for the relays and their circuitry, which would also need a proper thick wall of isolation, since otherwise it would be a huge safety hazard if some of the low-voltage circuitry touched high-voltage. I decided that it will be better to desolder the "input" power wire from each of the 5 switches, and in place of that shared live wire, I'll solder five separate wires to each of the switches, and those 5 wires, plus a main live wire, will go outside of the power strip into an external electric box, where I'll be able to fit the 5 relays and all needed circuitry. I drilled two holes in the housing of the power strip, for two standard grounded AC power wires, and got to work.

photo_2026-06-22_12-50-17.jpg photo_2026-06-22_12-50-19.jpg photo_2026-06-22_12-50-20.jpg photo_2026-06-22_12-50-25.jpg

I created this circuit board with 5 relays, and a 595 shift register for controlling them, at a size just right for the electric box. The actual perfboard is split into two under the relays, for a clear gap between the high-voltage and low-voltage sides. The amplifier already uses 595 shift registers internally, so the plan is, that I'll just be able to daisy-chain this external shift register to the ones inside the amplifier, and that will expand the entire shift register from 24-bit to 32-bit. The central microcontroller will just send more bits using the same driver pins. Inside the amplifier, I will only have to add an output pin header on the audio board, for the external shift register. Of course, including 5V power for the circuit and 12V power for the relays. 6 wires total.

After I finished the work on the power strip and finished making the circuit board, then made a quick test, the preparations were complete, so I started disassembling the Hi-Fi tower, disconnecting and removing components from the top until I got to the amplifier. I disconnected everything from it and moved it over to my table. This will be the first time disassembling it in 15 months, I think. So, it really has been operating trouble-free. When moving it, it's kind of surprising how lightweight this amplifier is compared to other components in the Hi-Fi. I think that's mostly thanks to the fact that it doesn't have a big and heavy linear transformer power supply anymore, while the other components, even the low-power ones, still have one that weighs quite a bit. The original transformer of this Marantz was particularly huge and overweight. I still have it somewhere, but I have no idea what to do with it. With that much weight, I wonder how much scrap value it has.

In the meantime, I also did some light maintenance work on a few of the other Hi-Fi components. Anyway, disassembly.
photo_2026-06-22_12-50-27.jpg photo_2026-06-22_12-50-31.jpg
Thankfully, despite the many ventilation holes in the top of the case, the amount of dust inside is not too awful. I expected worse, since I always find a disgusting layer of dust on the top of every Hi-Fi component when disassembling the tower.

Before the external power strip, I'll add/connect the front-panel headphone jack as an additional audio source, as I described in the previous blog entry. I decided that it will be best to give it its own audio relay, so that it becomes an 8th switchable input source.
It wasn't really complex, but removing the front-panel jack and speaker switch PCB, while the other internal components were in the way, was an absolute nightmare. Without the right-angled screwdriver bit, I wouldn't have done it. I then simply soldered a stereo shielded wire to the two 330-Ohm resistors of the headphone jack (and ground). And on the audio board, in a free spot, I installed the pin headers for an additional audio relay module, and of course a pin header to connect the wire coming from the front jack. I still had a few of these relay modules left over from back when I was creating the amplifier, so I didn't have to make any new ones. There were still 4 unused output pins on one of the shift registers on the audio board, so I simply connected the relay module's control pin to one of them, and of course later modified the firmware to add it as a new audio source.

For the external power strip, I added the 6-pin output header on the audio board. This actually has the exact pinout as the input header that the logic board connects to in order to drive the audio board. It connects to the exact same signal/power lines too, with the exception of the data pin, which connects to the daisy-chain output pin of the last shift register on the audio board.

photo_2026-06-22_12-50-39.jpg photo_2026-06-22_12-50-37.jpg
So, that should be all the changes I have to make to the audio board, for now. And I also had to build a cable to connect to the external electric box.

Time to test it... Well, it didn't work out at all. Even worse, the entire device was now working incorrectly. The shift registers were totally acting up.
I spent a lot of time troubleshooting. Had to grab the oscilloscope out of the abyss, too. Skipping all the troubleshooting details... Well, the logic-level conversion (boost 3.3V->5V) circuits I made in the amplifier worked fine, but their flaw is that the voltage-boosted signal is very weak and can't take much load without voltage dropping too low. It worked just fine and perfectly reliably with just the internal shift registers, but I discovered that I didn't even need to connect the external shift register board to make it all go out of whack. Just connecting the loose, unconnected, open cable to the pin header caused all the same problems.

photo_2026-06-22_12-50-42.jpg
A lot of time went into trying to fix the problem. I lose track of time when soldering, I ended up staying up far too long at night, and made this absolute mess of a tightly-packed logic-signal circuit on the external board, in hopes of fixing the issue after connecting the signal lines in the audio board output header to a stronger point that wasn't causing the shift registers to go out of whack just by connecting an open cable. Unfortunately, it ended up also not working. I had to go to sleep.

In my mind, there was also a very stupid idea that could possibly work. Uhh... Remember how I said that there were still 4 unused pins on the audio board's shift registers, and still 3 free pins after installing the new audio source? Can you see where this is going?
A 595 shift register is driven by three logic signals: data, clock, and latch. Since I still have three free output pins on the shift register, I theoretically could use those three pins to drive another shift register from scratch, instead of daisy-chaining with the same clock and latch signals. It's absolutely silly, but in theory it should work. So, I rewired the signal lines in the output header to the 3 unused pins instead, and then wrote some more complex firmware code so that it drives the external shift relay using 3 bits of the internal shift register, while also driving that internal shift register. It's called recursion, I suppose. Did it work? Yes, it worked perfectly on the first try, including the code. I no longer felt like troubleshooting the signal level issues, so this ended up being the silly solution.

The external shift register is slower this way, since it takes multiple full refresh cycles of the internal shift register for one cycle of the external shift register. But for switching external power outlets, this is not a problem at all. You switch one on or off, you don't need that to happen within a microsecond and you don't need to do it many times a second (that would only cause harm).

The real problem is... I wasted the 3 pins, and no longer have any free output pins on the shift registers on the audio board. If I'd like to add even more audio inputs or features in the future, that will be a big problem. But I suppose, I have to leave this stupid problem for the future, and then I can be mad at my past self. It's time for reassembly.

photo_2026-06-22_12-50-48.jpg

The spectrum analyzer?

No. At least not yet.
Honestly, I can't even find much information on the Internet about circuits for safely and reliably inputting analog line-level audio signals into a microcontroller like the ESP32. By that I mean, moving the audio signal's voltage range into exactly 0V-3.3V, or maybe something like 0.5V-3.0V for better operation with the A/D converters. I'm pretty sure line-level audio signals normally go into the negative voltage range, and 0V is the middle-point. That's unsuitable for the microcontroller's ADC.
If I at least had such a circuit, I could start testing whether it even interferes with the audio line at its input. If it did, I could start thinking about an isolation solution again. But without even this voltage-range-conversion circuit, there is nowhere I can go.
Unfortunately, I am awful and inexperienced with analog circuits.

The firmware side of things

Now that the amplifier has 5 more switchable power outlets, bringing the total to 7, I had to update the firmware and come up with a solution to control all of that with the buttons / remote control.
Of course, when enabling an audio input, the linked power outlet will be switched on accordingly. But when switching away from that audio source, the power will not be switched off automatically, with the exception of the radio tuner, which will always switch off when switching away from the source. Radio tuner doesn't even have a headphone output, so there's not much reason why I'd want it to stay powered on when the audio source is not active. But with other devices, it would be a problem if they were always powered off automatically.

So, I added new functions to two previously-unused buttons: one is used to switch off power to all external power outlets, with the exception of currently enabled audio sources. The other button is used to go into power-switching mode: after pressing that button, pressing the button of one of the audio sources will instead toggle the power outlet state of that audio source.

Since the display supports multiple brightness levels, the audio source segments on the top-status-bar will also illuminate at a dimmer level to indicate enabled power on the input devices that don't have their audio input enabled.

When using the sleep timer, the power of enabled audio sources will be automatically switched off after the timer reaches the end and the amplifier goes to standby mode.

The wake-up timer of course powers on into the previously-used audio source. So, now it can be used with the "TIMER" switches on other Hi-Fi components.
By using the source mixing mode, it is also possible to set a different device for the sleep timer, and later have the wake-up timer switch on into a different source.

photo_2026-06-22_15-50-41.jpg
That's done! In the end, I started on Friday, disassembled the Hi-Fi on Saturday morning, and didn't manage to put it back together until Sunday evening. Of course, I did also have some other things I needed to do in the meantime. Mostly, the shift register issues really delayed it.

Thanks for reading!
  • Love
Reactions: KleinesSinchen

Comments

There are no comments to display.

Blog entry information

Author
IC
Views
25
Last update

More entries in Personal Blogs

More entries from IC