![HiFiLOGIX](images/logo.jpg "HiFiLOGIX") Arduino Control for Your Vintage Stereo # History ``` 28-Dec-2019: Initial Version. Just reads five switches and triggers an output. 29-Dec-2019: Version 0.1 - Added a display. Cleaned up code. Made a repository. 29-Dec-2019: Version 0.1.1 - Added preliminary IR remote support 30-Dec-2019: Version 0.1.2 - Controls ShiftReset and OutputEnable on 595 to prevent random start-up state. 30-Dec-2019: Version 0.1.3 - Removed ShiftReset function. Replaced with reset circuit onboard. 01-Jan-2020: Added license, media, and proper README. 04-Jan-2020: Version 0.1.4 - Changed project name. Removed 1602 display code. Added 128x32 OLED code 05-Jan-2020: Version 0.1.5 - Fixed stupid mistake in hardware. Flipped logic of srEnable for new circuit. ```` # About HiFiLOGIX is an Arduino Sketch to add modern logic control to vintage analog stereo systems. It is being built and developed around my own personal vintage amplifier; the Denon PMA-770. It is written by a guy who knows a lot about analog audio circuits and virtually nothing about Arduino. # About the PMA-770 & Why This Exists The Denon PMA-770 is a high-end integrated amplfier from the early 80's capable of the usual 100 watts into 8 ohms; and somewhere in the neighborhood of 120 to 140 in to a 4 ohm load. It's a DC coupled amplifier of "Direct-A" topology. It's got 3 pairs of output transistors, no capacitors in the audio path, and it sounds outstanding. But it's also got this seriously stupid way of working the input switching that has not only caused failure of most of the inputs; but is silly enough I don't want to bother trying to replace the switches to keep the original method in tact. In order for the audio to make it in to the amplifier, it relies on connecting through the "normally closed" contact on the switch "in front" of it. Well the "normally closed" contact has decided it no longer wants to close and the entirely sealed design has prevented cleaning agents to make it in. To add to the stupidity; this unit features a simple segemented LCD display to display the name of the input. This was a probably a pretty big ordeal in an era where even a single LED lighting up over the name was an entirely new idea. This display is non-standard and relies on even more contacts in each input switch to throw pins to AC. Disabling the input switches would disable this display; but the 128x32 OLED looks like it will fit in the phsical space the existing one does. Taking that in to account, I decided to build a relay board driven by an Arduino that would also drive the display. It also lets me do crazy things like add input selection by remote control...something you weren't getting back in 1981. Additional modifications like motorized pots for volume could further extend the remote control function. # Hardware The basic idea is parallel the actuator contacts of DPDT (or DPST) relays and flip them on one at a time (two for phono). [![Schematic of hardware](/images/schematicsmall.png)](/images/schematic.png) Click for full resolution. Data is shifted in to a 74HC595 and it's parallel outputs are used to control a ULN2803(or 2003) darlington array to in turn drive a relay. Every effort has been taken to ensure only one relay will be fired at a time to prevent damage to other audio components. The output of the 74HC595 is controlled by the microcontroller and an RC circuit on the reset line prevent suprious relays from firing. In version 0.1.5/hardware 1.4 this was slightly modified. A simple transistor logic inverter now drives both the 74HC595 enable pin as well as the ULN2803/2003's ground line. This was done because the 2003 I'm using likes to boot up with every output on even when pulling the lines down. Calculating the relays to draw about 40mA each; trying to sink this through the arduino using the existing logic low for the 595 was probably a bad idea. So the logic in the software was flipped and the transistor now converts the logic-high to "logic low" and is capable of sinking something like 800mA if I read the datasheet right. More than enough for the 80mA I predict I'll need from the thing. While I wanted to keep parts down (and complexity) low; keeping a low number of pins to the micro- controller is the priority and the transistor and two resistors not only aren't expensive, but meet that goal. The 2803/2003 arrays include built in snubber diodes for inductive kick-back protection. If you should deviate from this schematic and use discreet diodes, you must add these diodes to your circuit or you will damage the transistors, shift register, and/or Adruino. The switch matrix consists of a simple resistor based analog method that merely throws different amounts of voltage thru resistors. While this allows us to read all of our switches using just one line, it can cause problems should you want to trigger two buttons. On the PMA-770 this is fine as the original bank of switches are mechanically linked to allow only one to be active at a time. It is possible to read dual inputs as long as the parallel resistance doesn't cause a value close to any indvidual switch. I have included a small utility in the /utilities folder that will display the current ADC integer value to the LCD display. It can be used for just figuring out which resistors to use, or to check behavior of paralelled resistors (two button press scenario). Using one line for the switch matrix is not set in stone and may change depending on needs and availability of pins going forward. The Phono-1 and Phono-2 inputs are the only time the unit will ever fire two relays. This is because on the original unit itself; both of these inputs route the phono-stage preamp to the main amplifier while routing the cartridge input to the phono-stage. An 1838 IR sensor is used for remote control function. An additional utility may be written to help with this going forward but it's possible I may wind up writing a routine for "self-programming". As of Version 0.1.4 we now support the SSD1306 based 128x32 OLED Display. In the future I will be adding some kind of NVRam storage. This will facilitate actually storing configuration options, remote programming codes, and to store the last-used input. I may also use this to store graphic data for the OLED display to emulate the original segmented font display of the Denon. # Software This sketch requires the following libaries: - IRRemote (https://github.com/z3t0/Arduino-IRremote) - U8G2 Display Driver (https://github.com/olikraus/u8g2) Please install them via Library Manager or however you install libaries. Check indvidual project pages for LICENSE info. # Media [![Picture of prototype rig](/images/prototype.jpg "Prototype")*Prototype & Development Build* More recent prototype build. I'm horrible at making videos in general...but I still made an attempt to show things off. Youtube embedding is apparently broken and I don't feel like putting a gig worth of video in the repository, so you'll just have to use links. [First Video: General Overview](https://www.youtube.com/watch?v=I_sLnnsZ7Qg) [Now I've Got A Remote Control](https://www.youtube.com/watch?v=I30OaMii4l4) [OLED, Relay Control, and HiFiLOGIX] (https://youtu.be/vn3nhpWjckw) # License Copyright 2020 Jay Moore Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.