Go Down

Topic: HiFiLOGIX (formally: HiFi Input Control) (Read 489 times) previous topic - next topic

nq4t

Jan 03, 2020, 05:42 pm Last Edit: Jan 06, 2020, 06:26 pm by nq4t Reason: New Project name and repository address.
Hi all,

So I've been doing electronics for a number of years and the concept of microcontrollers weren't new to me, but I dont consider myself a programmer so I never thought I'd go down that route. I was usually interfacing to something already written. I dabbled in some Python with a RPi project I designed and decided I needed to take the plunge and see if I could learn some Arduino.

Meet what I think I'll be calling HiFiLogix



This is just the development version which has most of the hardware Im using. Here is a (mostly complete) schematic to study before I get in to the details.



So here is thr situation; my vintage early 80s stereo has this rather stupid method of using a series of switches to get audio in to the main board. Now while switches are expected for the vintage equipment, its now they did the switches. They are not in parallel but are in series; the NC contacts of each selection are connected to the wiper/actuator of the next switch. At most it means audio has to move through 5 sets of contacts. They're also entirely sealed...no amount of soaking with Deoxit has helped. As a result, I have no source selection.

So my idea was to parallel the actuator of a bunch of relays instead. The relays are physically driven by a ULN2003/ULN2803. This is driven by parallel data from the good ol' 595 shift register.

Now this seems excessive for what I need, I could easily use simple logic to achieve what I want. But this unit has a custom segmented LCD that is set up by additional contacts on the input switches (they are 6PDT). Rather than try to work out how to drive the existing LCD, replacing it with a 128x32 OLED seemed like an easier option.

Of course, if Im doing that, why not add a remote control? So I did. By this point it was clear that I was basically adding logic control to a vintage stereo, so I have plans to obtain motorized potentiometers that I'll integrate at some point.

My source code as well as links to YouTube videos are on my git repository (which has an unoriginal name I'm considering changing):

https://gitlab.com/dewdude/hifilogix/

The prototype is currently just showing me the parallel output with LEDs and is using the I2C version of the 1602 display. I should have a bunch of parts waiting for me when I get home from work, so I'll start working on the 128x32 OLED code as well as building a fully functional prototype on something besides a messy looking breadboard.

Overall I was impressed I got the code working.my programming background is very limited amounts of Python; and diving in to Arduino wasn't anywhere near as bad as I thought. Rather than the several weeks I expected to be learning code, I spent just a couple hours over a couple days getting things written.

Thanks for reading. 73.
-Jay/NQ4T

nq4t

Hello again,

There have been some pretty drastic changes in this project over the last few days as parts have rolled in and I've gotten a bit better with the programming.

The project is now actually called HiFiLOGIX.



I now spread the thing out across three breadboards just to make debugging a bit easier. The relays I acquired were mislabeled and aren't actually the double-pole that I need. In fact this pinout was completely unfamiliar to me and I wound up confusing what I'm used to being the coil connection to the common and blew up a voltage regulator on an external power supply. But I went ahead and built most of the circuit just to assist in debugging what the actual operation would be like.



The major change since the last version is the addition of a single-transistor logic inverter. Even when I pulled down the inputs of the ULN2003 I'm using; it still wanted to fire up every single relay when powered on. The only solution I found to this was by controlling the ground connection to the 2003. I was already pulling a line low for the 595's enable line; but this wouldn't be suitable in this application since that would be sinking current off the IO pins, my measurement of the relays said they pulled 40mA, and I needed to fire two for some inputs.

So now the srEnable pin goes high after boot and is converted to logic low/ground. With the current rating of the transistor being about 800mA...it shouldn't have any problem with the 80mA I'll be asking from it. It's also easier to stuff two components in to a board than 7 resistors..so there's that. I almost wish I had thought of this when I was doing the design/debugging between the Arduino and 595. I almost don't even need the power-on reset circuit or even worry about the state of the 595 on boot if I can control the 2003 this way and get the same net effect.

It's something I'll play around with.

There was also a bunch of code re-write after I re-wrote a function to use arguments to set inputs rather than a dedicated function for every input.

The address of the repository has moved: https://gitlab.com/dewdude/hifilogix - I have updated the URL in the previous post.

-Jay

nq4t

I've made some real progress on this project in the last week.

The biggest change is I worked out all the code to use the EEPROM to store the last-used input. There's a routine to write the initial defaults so valid data gets passed to the program. I'm using a hardware interrupt on pin 2 that activates on the falling edge. The idea is I will connect this to the power supply running the relays and have a lot of capacitance on the Arduino/MCU. Pin 2 should drop when power is cut before the cap discharges under the 45mA draw of the Arduino...which is more than enough time to update the EEPROM entries. I calculated it out that if a user happen to make two updates to the EEPROM address a day; then those addresses would last over 100 years. IF someone happen to power the stereo on and off in a way that made 8 writes a day...it'd still last for a little over 20 years. I know a lot of guys who rarely change inputs..and some have a crazy habit of flipping it back to where they started. You can totally bypass the auto-save and just use a default by leaving pin 2 disconnected.

The array that contained the strings for the input names now resides in program space rather than SRAM.

I moved a bunch of code around and tried to keep program size and memory usage down.

Go Up