Automatic audio amplifier switch strange behaviour

Looking for some clues to where to start looking for the source of a strange issue that I have. I built a simple automatic switch to turn on an audio amplifier whenever a signal is detected on the audio inputs. It works fine, turns on as expected and automatically switches the amp off after a minute of no audio input.

The switch is based on a Nano with a relay for the actual switching, and is allbuilt into the amplifier case, together with its own power supply. Obviously, to work properly both the Nano and the amp need to be powered all the time.

The problem is that when there is no audio input (ie the PC that provides it is switched off), the Nano turns itself and the amplifier on roughly every two minutes, then realises there is no audio input and shuts down after another minute as it is supposed to do.

Does anyone have any idea what might be causing this odd behaviour? My initial thinking was that it was noise on the audio inputs, but I would expect this to be more random. It might be some kind of heat build up, but it works perfectly when music is playing and I can't see why it should heat up more when off than on.

I'm stumped, so any suggestions will be very welcome! Thanks


perhaps you could post a circuit diagram and your code to give us a hint...