New life to an old amp


Hopefully, this post will save a few old amps from landfill. There is life in them yet.

I bought a Kenwood 3020SE amp when I was 17 (23 years ago!). It’s junk now, I know – there are examples on eBay for £20 (35 bucks), and they don’t sell…

…but…

  • I have an emotional attachment:
  • With 4 speakers I have found by the roadside the amp sounds great. Better (maybe, I am not music/hi-fi aficionado) than various more modern smart devices we have around the house.
  • The amp does have a certain utilitarian beauty: “It does what it says on the tin” literally – it says Stereo Integrated Amplifier on it. It actually got pretty solid reviews back in the day, punching above its weight in terms of audio quality. Instead of frills (a remote control, elaborate equalisers and lights etc.) Kenwood sunk the effort into quality electronic component innards. I am paraphrasing an old online review

So, I resolved to put my old amp to use – photos below show it modified. From left -to- right:

  • audio signal detected so amp ‘ON’
  • silence detected. If nothing detected in X seconds will go into standby
  • stanby: like turn amp back on if audio detected.

First things first: TLC

I took off the case and blew away all the dust (air compressor plus a paintbrush).

There was some scratching in the sound output when changing the volume. One of the speakers would cut out intermittently. A healthy dose of WD contact cleaner on the various dials’ variables resistors fixed this, flushing away a 25-year build of crud and corrosion.

Some upgrades: Add wireless+

  1. Easy one: A Bluetooth headphone jack dongle. Android (or Apple) takes care of the magic via an old Samsung Tab Pro. Not really an upgrade, just an AUX-IN.
  2. Auto-Power: If music wasn’t playing on the tablet (via Bluetooth), I wanted the amp to turn off, and for it to turn on when I shout, ”Hey Google, play some Bros” into the ether like a crazy.

Auto ON/OFF

I hid an Arduino and some other stuff in the amp.

Circuit

Envelope Detector circuit on one channel of audio signal
  1. The incoming (audio) signal is detected using an envelope detector circuit, see my diagram above. The modulated signal feeds into one the Arduino’s analog pins.
  2. A 5VDC<>240AC relay on one of Arduino’s digital pins as an output. This is wired in series with the original on-off button on the amp and provides control of the (mains) power to the amp. I used an off the shelf relay Arduino board since it includes takes care of back-EMF and give-or-take a couple of $$ is the same price as the requisite parts, minus the soldering.
  3. A couple of LEDs show the status (STATUS_MUSIC, STATUS_SILENCE and POWER_OFF/STANDBY). I had intended to use an RGB led but I blew it up. Humph. The LEDs are on a couple of the Arduino’s digital pins as outputs.
  4. Finally, a physical switch allows you ‘bypass’ the auto on-off function. Again on a digital pin set to input_pullup.

I tried another tactic for putting together the circuit using the wealth of tips in the video below. Worked pretty well.

Code

See below. Self-explanatory. Only things which needs some fine tuning are the various timing and level parameters at the start.

/*
* 2020 Jon Robinson
* MIT License
* Arduino sketch which using envelope/peak detector circuit output signal to detect if music playing.
* Opens/ closes a relay accordingly - relay intended to switch amp on and off.
*/
// Two analog pins connected to envelope detector circuits
// one for left channel, one for right channel
int _aSoundPin = A5;
int val = 0; // variable to store the signal read from pins
const int _onoffPin = 7; // manual switch to turn function on and off
/*
* LED show status:
* - green only: music playing (relay closed)
* - red only: no music (relay open)
* - green and red: no musuc playing, will open relay in X seconds unless music detected again
*/
const int _redPin= 4;
const int _greenPin = 5;
const int _relayControlPin = 2;
const int SILENCE_THRESHOLD = 5;
const long SILENCE_TIME_TO_TRIGGER_POWEROFF = 1000*10; // 10 secs of silence turns off amp
const long TIME_TO_TRIGGER_SILENCE = 1000;
const long AFTER_RELAY_CHANGE_DELAY = 300; //ms. To address noisy ground relay seems to cause.
const int STATUS_MUSIC = 0;
const int STATUS_SILENCE = 1;
const int STATUS_POWEROFF = 2;
const int STATUS_UNDEFINED = 100;
int _status = STATUS_SILENCE;
int _oldStatus = STATUS_UNDEFINED;
int _onoff;
unsigned long _lastSilentStartTime = 0;
unsigned long _lastNotSilentTime = 0;
unsigned long _lastRelayChangeTime = 0;
void setup()
{
// Serial.begin(9600);
pinMode(_onoffPin,INPUT_PULLUP);
// rgb led
pinMode(_redPin, OUTPUT);
pinMode(_greenPin, OUTPUT);
// relay
pinMode(_relayControlPin, OUTPUT);
}
void loop()
{
_onoff = digitalRead(_onoffPin);
if (_onoff == LOW){
// Turn off/by-pass control function
digitalWrite(_relayControlPin, HIGH); //open relay
_lastRelayChangeTime = millis();
_oldStatus = STATUS_UNDEFINED;
digitalWrite(_greenPin, LOW);
digitalWrite(_redPin,LOW);
}
//read enveloped sound value on soundPin
if (millis() - _lastRelayChangeTime >= AFTER_RELAY_CHANGE_DELAY && _onoff == HIGH){
val = analogRead(_aSoundPin);
if (val>SILENCE_THRESHOLD){
_lastNotSilentTime = millis();
_status = STATUS_MUSIC; // debug value
} else {
if (_status==STATUS_MUSIC){
unsigned long dt = millis() - _lastNotSilentTime;
if (dt >= TIME_TO_TRIGGER_SILENCE) {
_status = STATUS_SILENCE;
_lastSilentStartTime = millis();
}
} else if (_status == STATUS_SILENCE) {
unsigned long dt = millis() - _lastSilentStartTime;
if (dt >= SILENCE_TIME_TO_TRIGGER_POWEROFF){
_status = STATUS_POWEROFF;
}
}
}
if (_oldStatus!=_status){
switch(_status){
case (STATUS_MUSIC):
digitalWrite(_relayControlPin, HIGH); //open relay
_lastRelayChangeTime = millis();
digitalWrite(_greenPin, HIGH);
digitalWrite(_redPin,LOW);
break;
case (STATUS_SILENCE):
digitalWrite(_greenPin, HIGH);
digitalWrite(_redPin,HIGH);
break;
case (STATUS_POWEROFF):
digitalWrite(_greenPin, LOW);
digitalWrite(_redPin,HIGH);
digitalWrite(_relayControlPin, LOW); //close relay
_lastRelayChangeTime = millis();
break;
}
_oldStatus = _status;
}
}
}

Integration into Amp

The bits I added to inside of the amp. There is plenty of space in there. Made we wonder where the ‘standard hifi unit size’ originated.

I was going to make a little unit and keep the amp ‘stock’, but given the stock unit (a) seems pretty much worthless and (b) is 100% empty inside I decided what the hell:

  • I mounted the LEDs and the bypass switch in the fascia
  • Power to Arduino from an old 5V mains adapter with its mains pins wired into the amps mains input. Bit of a hack but works.
  • The relay is spliced into main power to the amp, downstream of the Arduino-power.
  • The audio signal input to the envelope detector circuit is wired in parallel onto one the amps phono RCA inputs.

Result

Pretty good: 8/10. Amp (and tablet) back in action in the garage/shed.

I ended up having to up the ‘silence threshold’ since the BlueTooth audio dongle I am using seems to switch to a different mode after ~6 secs of silence with a fair bit of background white noise which my setup interpreted as a valid input signal. The downside of this is that long quiet bits of music/ podcast register as silence and can trigger the amp to power off. This is a pretty rare occurrence though and as soon the input gets louder the amp flicks back on. I suppose if you could look into detecting if the input signal is white noise and adjust accordingly.

You need to set your connected old phone/tablet to max media volume but set all system and notification sounds to silent. so the amp won’t wake up every time you get a notification.

A weird rapid-flicking of the relay happens when the amp goes into standby. Some sort of feedback. Dunno. A couple of times this has settled into an endless feedback loop with the relay flicking on and off 2-3 times a second ad infinitum. This is not great and will mean death to the relay in time. Need to fix it.