This past Christmas I re-purposed an old Car Stereo and built a portable outdoor radio for my Dad. Ultimately what I wanted to do is have it to where it runs primarily off of a computer power supply (EVGA 500 W1 80+, 500W Continuous Power) when plugged into an outlet but when unplugged it can retain all of the presets and audio settings from a connected 12v battery source. I thought I knew how to achieve this but I was definitely wrong and now the radio draws all of its power from the battery instead of the Computer Power Supply. Hopefully I can describe my current setup and one of you can provide some guidance on how I can achieve this.
My current setup: My car stereo has two 12v leads on the harness. One is the constant/battery (yellow) which also keeps the memory for the radio. The other is red which is labeled as Ignition. I took all of the 12v Yellow cables from the Computer Power Supply and connected them to the Red (Ignition) cable thinking that would power the stereo unit. Meanwhile I wired the Car Stereo's Yellow Constant/battery wire to a 12v/7aH battery in order to maintain all my settings when the Power Supply is not plugged into the wall. Based on everything I read online the Computer Power Supply should power the Radio all by itself as long as both the Red (Ignition) and Yellow (Battery/Constant) wires coming from the radio are connected to the 12v yellow wires from the power supply. But as soon as you turn off the power supply or unplug it all the radio settings and stations are gone. Hence why I tried to wire in the backup 12v battery to retain memory.
My Problem: The Stereo unit draws all its power from the Yellow (Constant/battery) wire and only uses the Red (ignition) wire as a switch to let the radio know when the car is on so that it can turn on when the engine starts. Well needless to say the first time out with the radio it played flawlessly until my 12v/7aH battery got too low to power the Radio (4 hours of play).
Question: How can I wire the stereo to where it pulls all its power from the Computer Power Supply when plugged into an outlet but then switches over to the secondary power source (12v/7ah battery) when its unplugged in order to keep all the settings and memory. I do not plan on running the radio when not plugged in if that helps. I just would like to find a way to where I can configure all the settings and then have it to where my technology deficient dad can just turn it on and have everything work.
I've ready about switches, and diodes and other possibilities but my understanding of how they work is just to limited for me to grasp it and conceptualize a solution. Thoughts?