Reading S/PDIF inputs andproducing a 12V trigger signal

Hi

I have been researching the possibility of using an Arduino to read the S/PDIF output of a Sonos Connect music player and power on my NAD amplifier via it's 12V trigger inputs.

Connectors on the Sonos Connect:

The S/PDIF output on the Sonos box is transmitted via RCA output, the one labelled coax on the back of the unit. According to Wikipedia the S/PDIF output signal should be between 0 to 1 volt with peak to bottom ranges potentially varying a bit from one device to the next but always remaining consistent and above a threshold when a signal is transmitted. Hence wiring the signal wire to an analog input on the Arduino and then looking for a measured voltage above XX volts should be enough to automate the trigger for the 12V output.

Connectors on the NAD amplifier:

The characteristics of the 12V input on my NAD amplifier is harder to come by. It has a 3.5mm mono minijack and expects a 12V DC signal to turn on and presumably turns off at some cut off voltage although the exact value is not documented. As for current I don't think you need much although again it's not documented. Also because this circuit is effectively just monitored it's resistance might be very low to the point where it's nearly shorted so whatever I use must handle that well.

The first option that came to me regarding the 12V triggers was using the USB output from the Arduino, or a phone charger, alongside a USB step up cable to produce a 12V signal and then using a relay swtich controlled by the Arduino to turn the power going to the amplifier from the USB output on and off when input is detected on the S/PDIF output. I know from googling around that others have been able to use such cables, with the 3.5mm mono minijack, to turn on other amplifiers.

Does this sound like a feasible plan? Also as I am a programmer by trade and don't know an awful lot about electronic relays could anyone clarify what sort of relay I would need to switch the 12V output on and off.

PS: I also plan on creating some sort of timer to delay deactivation of the 12V trigger signal when audio stops in case somebody is just changing the song or switching inputs. I assume a task like that is easily accomplished via software and don't need any extra electrical parts?

Hi and welcome to the forums.

+1 Karma for your first post actually containing embedded pics!

As for your project, it seems totally doable. If the voltage you are trying to measure is between 0 and 1 V, look into using the internal voltage reference for your A/D readings as it will improve the measurement.

As for the 12V signal for your NAD amplifier, I seriously doubt there will be minimal resistance there so you shouldn't have to worry about any large current requirements. It is probably only a few milliAmps. The easiest thing would be to get a 12V wall wart-type supply. This can power your arduino (through its onboard regulator) as well as drive the 12V input to your amp. Just use a transistor to switch the 12V on/off. If you already have a relay, you can use that as well.

As for the timing of a delayed off signal, that would be trivial for the arduino. Just monitor the input and once you detect it is "OFF" you start a timer. If the timer expires, you turn offf the 12V. It you detect input again before the timer expires, you reset your timer. Check out the "BlinkWithoutDelay" example to see how to do that. There is also an excelent topic "Doing multiple things at the same time" here

Thx for the feedback. I mentioned the project to a friend of mine who also brought up the idea of using a transistor to enable the 12V output. I had completely forgotten how they work hence my use of a relay. I reckon that's overkill now :wink:

Thanks for all the other tips as well. They will be a nice starting point for me in terms of getting into this. Now all I need is to find me a 12 DC power supply with a northern European style electrical socket and buy an Arduino board.

I found the data I was missing for the 12V trigger current. Turns out while the tolerances for 12V inputs are not really documented for any NAD amplifier the outputs are. They provide 50mA. Hence that is what I will be targeting for my output as well.

The plan is to tap this current off from the raw 12V input like blh64 suggested. I assume all I need to do this is to is to make a parallel circuit with an appropriate resistor to ensure that the right amount of power goes to the 12V trigger and the rest flows to the Arduino regulator. As far as I can tell there are no dedicated pins inside the Arduino Uno to tap into the raw input. As such would it be problematic if i just did this by soldering a pair of wires directly to the input itself? Also since the flow of electricity in a parallel circuit always remain at the same voltage a that means a 220 Ohm resistor on the +lead going to the trigger output I'm making would do the trick as far as limiting the current right?

The Vin pin is the same as the V+ on the barrel input. If you get a 12V wall transformer with the 2.1mm jack, you can plug that directly into the barrel jack on the uno. You can then tap into the Vin pin on the board as the 12V supply that goes through a transistor or relay to signal the amplifier. You really don't need a resistor in that part of the circuit

"The Vin pin is the same as the V+ on the barrel input." except for that reverse polarity diode between them.

CrossRoads:
“The Vin pin is the same as the V+ on the barrel input.” except for that reverse polarity diode between them.

Does that matter for my use case. Is the diode not just acting as a sort of fuse effectively preventing power to flow the other way if you accidentally mess up your polarity on the power supply?

Also if this Vin pin comes directly from the raw input, through the diode, does that mean the ground pins are connected directly to the ground of the raw input as well?

You will get a slight voltage drop across the diode so if you have +12V on Vin, you will get about 11.3 volts at the regulator.

And yes, the ground pins are all tied together. There are schematics available for the different Arduino boards.