Author Topic: How to add "discrete" automation to an IR device (Schiit Saga)  (Read 1235 times)

0 Members and 1 Guest are viewing this topic.

Offline rthorntnTopic starter

  • Frequent Contributor
  • **
  • Posts: 400
  • Country: au
Hi,

I have a motorised volume control, source switcher device, I love it's simplicity.

I want to hack it so that I can control the volume via automation.

The only way to control it currently is by IR, I don't want to stick an IR bridge sender in front of it.

Please see the attached PCB image, it clearly has an MCU and Schiit tell me the RJ12 is for upgrading the firmware.  Understandably they're not going to give me the source or a schematic, so just overwriting the firmware would be daft.

Could I remove the IR diode and solder some wires there and bring them out the back to an Arduino that could send the pulses to make the MCU move the volume?

Ideally I could add a serial port, is it possible, what would you do?

Thanks for taking a look.

Cheers
Richard
« Last Edit: May 03, 2020, 09:55:16 am by rthorntn »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12920
Re: How to add "discrete" automation to an IR device (Schiit Saga)
« Reply #1 on: April 30, 2020, 09:01:35 am »
Unless there is a whole mess of SMD circuitry on the underside of the board to condition the signal, I strongly doubt that the IR receiver is actually an IR photodiode.   Its far more likely that its an IR receiver module that only accepts IR signals modulated on a carrier of a few tens of KHz.  The first step would be to closely examine the IR sensor to see if you can identify it and find a datasheet.  Then locate its output and scope the signal while using the remote.

Then you'll be able to determine the best way to intercept the received RC signal - probably cut a track and route it through an Arduino so it can pass on commands from the remote and also insert its own commands.  To aid automation you may also need the Arduino to monitor the LEDs for feedback on the device's current status.   If you want a serial port to control it, I'd mount an Arduino Pro Mini to its board, hook it up to intercept the RC signal and monitor its LEDs and bring out the Pro Mini's programming pins to the back, which exposes a logic level serial port that communicates with the running sketch.
 
The following users thanked this post: rthorntn

Offline magic

  • Super Contributor
  • ***
  • Posts: 6850
  • Country: pl
Re: How to add "discrete" automation to an IR device (Schiit Saga)
« Reply #2 on: April 30, 2020, 02:32:39 pm »
A less invasive alternative is to automate the remote or build something that pretends to be the remote.
 
The following users thanked this post: rthorntn

Offline rthorntnTopic starter

  • Frequent Contributor
  • **
  • Posts: 400
  • Country: au
Re: How to add "discrete" automation to an IR device (Schiit Saga)
« Reply #3 on: May 01, 2020, 04:29:35 am »
Thanks, agreed it's probably an IR module, from the photo it looks like it has at least 3 legs, perfect!

Something like a VS1838 infrared receiver.

Agreed, I doubt there is much (if anything) on the underside of the PCB.

Arduino Pro Mini sounds spot on, I'm not that fussed about audio source selection, volume is what I want, do you have more info on how to cut a track and route it through an Arduino, it sounds really interesting?

Just has a thought, could i just solder some wires to the legs of the module, or IC test clips?

With this help this whole process along if Schiit give me the Saga remote codes and I combine that with the datasheet information on the IR module, I only really need the code for volume up/down.

Newbie question oscilloscope (Tektronix 2465B or Rigol DS1102E) or LA (SLA5032 w/sigrok), probably signal, ground and vcc only so oscilloscope?
« Last Edit: May 01, 2020, 04:57:28 am by rthorntn »
 

Online oPossum

  • Super Contributor
  • ***
  • Posts: 1424
  • Country: us
  • Very dangerous - may attack at any time
Re: How to add "discrete" automation to an IR device (Schiit Saga)
« Reply #4 on: May 01, 2020, 04:47:03 am »
Those IR modules typically have an open collector output, so you can just wire a MCU in parallel with its output. The MCU must also implement an open collector output. This is often done by switching the MCU GPIO pin between an input and an output driven low. Another way is to use a small signal NPN or N channel MOSFET driven by the MCU.
 
The following users thanked this post: rthorntn

Offline rthorntnTopic starter

  • Frequent Contributor
  • **
  • Posts: 400
  • Country: au
Re: How to add "discrete" automation to an IR device (Schiit Saga)
« Reply #5 on: May 01, 2020, 05:09:01 am »
Thanks, could you provide a bit more info?

The MCU must also implement an open collector output, I take it Arduino doesn't?

Small signal NPN or N channel MOSFET driven by the MCU, is there an example circuit for this (if I need it for Arduino)?
 

Offline rthorntnTopic starter

  • Frequent Contributor
  • **
  • Posts: 400
  • Country: au
Re: How to add "discrete" automation to an IR device (Schiit Saga)
« Reply #6 on: May 01, 2020, 05:17:08 am »
I'm reading if you leave the pin in the low state, you can emulate an open drain by alternately selecting input and output mode. 

void setup ()
{
  digitalWrite (pin, LOW) ;
}

void loop ()
{
  ...
  pinMode (pin, OUTPUT) ; // drive pin low
  ..
  pinMode (pin, INPUT) ; // hi-Z state
}

Being a bit of a newbie, I'm getting bits of this.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12920
Re: How to add "discrete" automation to an IR device (Schiit Saga)
« Reply #7 on: May 01, 2020, 05:35:37 am »
Yes that's how you 'fake' an open collector / open drain output using an ordinary I/O subject to the limitation that the pullup voltage on the line must be less than or equal to your MCU's supply voltage.  It gets more complicated if you want to use your MCU's internal weak pullup as on AVRs (i.e. most Arduinos) the pullup is controlled by the same register as the level when its an output, so to avoid bus conflict glitches you have to turn on the pullup immediately after making the pin an input and turn it back off so the pin will go low when its made an output, before making it an output.

Yes, you can parallel open collector signal sources, but if either sends a command while the other is sending a command, the commands will be corrupted and will either be ignored, or cause an incorrect command which may be wildly different from the commands each source tried to send.

For the purpose of learning the commands of the remote, you can simply tap in a MCU I/O pin at the IR receiver output  and if its for manual control, where the user can judge if the desired action has been performed, you can switch that pin between input and low output to emulate an open collector output, as oPossum suggests.

However if you want reliable automation e.g. to set a specific volume control level rather than just louder or quieter, you need to keep track of all commands sent to the original MCU and cant afford to loose any to corruption.  You'd implement that by cutting the track and using two I/Os, one as input from the RC reciever and the other output to the RC input of the original MCU, so your added MCU can step the volume to its minimum limit on powerup, to find the zero limit ,then back to the desired level (possibly restored from internal EEPROM) by counting volume up steps, and thereafter relay volume up and down commands from the remote while keeping track of the level, so that when an automation command to set a volume level is received over the new MCU's serial port, it knows how many steps up or down it must make to reach the desired level.
 
The following users thanked this post: rthorntn

Online tooki

  • Super Contributor
  • ***
  • Posts: 11806
  • Country: ch
Re: How to add "discrete" automation to an IR device (Schiit Saga)
« Reply #8 on: May 02, 2020, 03:03:42 pm »
I have an old Sony stereo system that supports an alarm clock feature with preset volume level, and it solves it exactly like that. First it operates the volume motor long enough to return to zero, then turns on the speaker relay and source, and then turns the volume back up to the preset level.
 
The following users thanked this post: rthorntn, Ian.M

Offline rthorntnTopic starter

  • Frequent Contributor
  • **
  • Posts: 400
  • Country: au
Re: How to add "discrete" automation to an IR device (Schiit Saga)
« Reply #9 on: May 02, 2020, 11:01:20 pm »
Thanks all!

Cutting tracks and adding wires is very invasive, not sure I want to do that, I just checked these Saga's go for AU$920 locally, they are US$400 (AU$625) so the local guys are having a bit of a laugh.

I'm thinking that reverse engineering the board would be better, it's so simple, I could get a new board made with the I/O I need (I would probably get rid of the valve and some of the inputs I don't use).

The Saga has a funky relay-switched stepped attenuator volume control that I like, it makes relay clicks as you turn the volume (or increase the volume using the remote) from Schiit:

"The Resistor series is I believe seven resistors that are simply put in and out in various combinations using the relays. If I'm recalling correctly it minimises the need for a bunch of resistors in favour of using more relays."

I think they're talking about the six relays on the RHS of the PCB, this looks *very* similar, maybe I will just mod this to give me two audio inputs and two audio outputs as well as the I/O I need for automation.

http://jos.vaneijndhoven.net/relaixedpassive/index.html

Thanks again!
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12920
Re: How to add "discrete" automation to an IR device (Schiit Saga)
« Reply #10 on: May 03, 2020, 07:04:15 am »
Fair enough on a high value board, though anyone with decent soldering skills could make the mod easily reversible, e.g. rather than cutting a track, remove the IR sensor, bend out its output lead then refit it.

Its probably not worth doing a switched relay attenuator volume control as modern digital volume control chips introduce less noise and distortion than the relays do once the contacts start to wear a bit - metal oxides and light to moderate contact pressure tends to form non-linear junctions at the contacts, with the possibility of severe distortion from diode action.   Why not post your exact requirements and let the community here come up with suggestions of the easiest way to do it solid state?
 
The following users thanked this post: rthorntn

Offline rthorntnTopic starter

  • Frequent Contributor
  • **
  • Posts: 400
  • Country: au
Re: How to add "discrete" automation to an IR device (Schiit Saga)
« Reply #11 on: May 03, 2020, 10:17:10 am »
Thanks Ian.M, I could possibly even socket the IR receiver.

I could be missing some vital piece of info, I link my USB DAC RCA's to my power amplifier via the Saga, so I'm pretty sure I don't have much volume voltage to play with, that's why I went with a passive volume, I don't actually need input or output switching, I could do it with manual switches as my other input is a turntable, my other output is a headphone amp so I need to go to the music cabinet to put a record on or grab the headphones. 

Maybe I could do the volume control with socketed relays so they're easy to swap out when they start to sound crappy, or maybe I do it completely with lots of resistors?

So requirement is a "passive" volume circuit (it could function with no power at a default level) that can be controlled by an MCU, pot and some sort of remote for WAF, and the circuit should be able to report back to the MCU the level that it's set to...

« Last Edit: May 03, 2020, 10:59:53 am by rthorntn »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12920
Re: How to add "discrete" automation to an IR device (Schiit Saga)
« Reply #12 on: May 03, 2020, 11:18:01 am »
Look at the PGA2320 stereo volume control IC.   Its suitable for direct use on line level signals, is SPI controlled for easy MCU interfacing, and can provide from +31.5dB gain to −95.5dB attenuation in 0.5dB Steps, with better than 0.01% THD.  The only flys in the ointment are it needs dual supplies in the +/-5V to +/-15V range dependent on the max. output level + a 5V digital supply, and if your source impedance is over 600R, needs input buffers.

For your passive bypass requirement, I'd advise a gold plated contact 4PDT (or pair of DPDT) miniature relay to totally bypass the volume control if its powered off.  If you are willing to compromise slightly on THD in bypass mode, you can get away with a single DPDT relay, which only puts one contact pair in the signal path, however  then you must put series resistors in front of the buffer amps to minimise their loading on the signal source when powered down.

The rest of your requirements are just a matter of the right MCU peripherals and user controls.
« Last Edit: May 03, 2020, 02:40:57 pm by Ian.M »
 
The following users thanked this post: rthorntn

Online tooki

  • Super Contributor
  • ***
  • Posts: 11806
  • Country: ch
Re: How to add "discrete" automation to an IR device (Schiit Saga)
« Reply #13 on: May 03, 2020, 01:21:32 pm »
If you don't wanna permanently modify the thing, why not just put an IR LED inside it with velcro or zip ties or whatever, and then use the Arduino to send the IR commands?
 
The following users thanked this post: rthorntn, Ian.M


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf