TRS Cable Detection Circuit

Started by yvarg, August 03, 2014, 09:26:04 PM

Previous topic - Next topic

yvarg

Alright folks, I'm coming to you because I've exhausted my (somewhat limited) knowledge of electrical components and would like to see what creative solutions you electronics wizards can come up with. I have a pedal I made where the first stage of it is a relay switch circuit that simply allows me to toggle between multiple sources with footswitches; an overly-complex ABY box if you will. I run a stereo cable from the stereo output on my guitar into the pedal and use it to switch between pickups. However, not all my guitars have stereo outputs on them, so my goal is to have a circuit that detects whether there is a TRS cable is inserted into the pedal or just a mono TS cable. When I plug a mono cable into the pedal, I want it to bypass the switching circuit altogether. Here's the premise of what I've been trying to work with:


I'm using a DPDT relay with one side of the coil attach to the 9V power supply all the time. The signal from the tip of the TRS cable goes to the common contact of one side of the DPDT while the signal from the ring goes to the common contact of the other side. When the relay is inactive both signals pass on to the rest of the switching circuit. The relay's coil is not grounded, instead it is attached to the ring contact of the TRS jack. The idea being that when a TS cable is inserted into the TRS jack, the ring contact is obviously not present and instead contacts the sleeve (ground), which then flips the relay, sending the signal from the tip onward, skipping past the switching circuit it normally would have passed through. The ring side of the relay is not attached to anything since it is already grounded at this point.

It's probably obvious to most of you that this does not work in reality, because when the ring contact is not grounded, the relay coil with 9V on one end is then sending that voltage onward to the ring signal of the jack, which wreaks havoc on that signal (and totally screws up the functionality of the relay switching circuit following it). So I'm looking for a way to isolate the negative side of the relay's coil from the ring of the TRS jack while still allowing the relay to be activated when a TS cable is plugged in. Of course, this whole concept could be done with a DPDT mini toggle on the side of the pedal that I flip when plugging in a mono instrument, but where's the fun in that?!  :icon_biggrin: I want it to happen automatically! Any bright ideas? I'm open to just about anything!

ashcat_lt

I think you've got the diode the wrong way around, but that probably doesn't fix the problem.  Are there good places to stick big capacitors in series with the audio signal to keep that DC current from flowing?  I'm afraid at least one of them may have to go inside the guitar unless you can fit it into some custom cable, or a second box...

PRR

> I want it to happen automatically!

There is no good way to do this, without modifications to the entire system.

Yes, 9V through relay is way too brutal. Conceptually you use a much smaller "sense" current and threshold voltage. Say 100K from 9V and a 0.5V threshold (transistor or chip). This will flip around 5K: lower ring resistance (short to sleeve) will give one state, higher ("most" pickups and effects in "most" settings) will give another state.

But some things will still mis-detect. Guitar with volume turned to zero is, for practical purpose, a short-to-ground. A few active sources will appear to be very low resistance to ground.

Also there is still significant sense voltage/current which will at least "pop" and could harm components.

Crazy ideas include putting a tone-generator (hypersonic) in each stereo source. Lack of tone means this source is mono. (Or vice-versa.) Power need makes this ugly.

Or equipping your TRS plugs with a "flag" which an optic sensor sees (or not-sees) to make the change.

Or wiring your mono axes with TRS plugs. Same signal on T and R. This trick gives "least surprise".... no "silent solo" because you switched to a pickup you don't have.
  • SUPPORTER

Processaurus

Here's a low tech idea, in your box have two input jacks, a TS input, and a TRS input for the special guitar.  Label them boldly enough the difference will be obvious on a dark stage.

Have both tips and sleeves wired in parallel. 
Use a jack (like this one at small bear) for the TRS that has normalled connections for the Tip and Ring, you'll only need the ring.
Run the TS jack's tip connection to the normaled lug on the TRS jack.

This makes it so when nothing is plugged in to the TRS jack, the regular guitar (TS tip connection) signal gets split and sent to both the tip and the ring on the TRS jack, and onward to the box.

TS jack     TRS jack
T-----\-----0------T---------------Tip in to box
         \----0        R---------------Ring in to box
S-----------0------S----------------Ground

yvarg

Thank you all for your responses! You're offering some suggestions I hadn't thought of (both complex and simple), which is fantastic.

ashcat_it:
I thought I had the diode the wrong way around too! This is the orientation I've got each relay in my switching circuit wired up like (there's four, apart from this new one I have yet to get operational), and they don't function with the diode's polarity reversed. I figure why mess with a recipe that seems to be working? I'm open to better suggestions here too, though. And capacitors! That's a great suggestion that I hadn't thought of. Now I wonder what that would do to my signal, audio-wise? I have loads of space in the enclosure this is mounted in, so I'll mess around with a few different capacitor values. Do you think that having a DC signal sent to the guitar is going to mess with anything as long as the DC current is prevented from passing through to the switching circuit? I suppose it might make the signal noisier . . . I'm just trying to see if there's a way to avoid putting an extra capacitor in my guitar. Ideally, I'd like to be able to pick up any guitar and plug it into this pedal with no modifications to the instrument necessary. Thanks for your input!

PRR:
The relays I'm using claim to be rated to 30VDC, so I figured that 9V would be fine. If I'm reading your comment correctly, you're saying that the fact that I'm using such a high voltage is the reason the relay isn't working properly? Or are you suggesting to use a more sensitive relay? Sorry, you seem to have lost me a bit there (most likely due to the nature of this whole circuit really being on the fringe of what I understand, haha). The rest of the switching circuit has been running off 9V for quite some time now with no real issues, do you think it's worth it to cut down the voltage sent to those relays as well? Maybe prolong the relays' lifecycle a bit or cut down on little pops when stepping on the switches?

I'd actually thought of something similar to your "tone-generator" idea, but the way I was thinking of implementing it would cut out the tone whenever I stopped playing causing the relay to flip if I wasn't doing something at that very moment. I like the idea of an optical circuit; that's a new one for me. Unfortunately, I have absolutely no idea how I would even begin to implement that. Your idea of wiring my mono guitars with TRS jacks is interesting as well, but then I'm pretty limited to playing that guitar through this pedal only, because if I plugged into any other mono source, the tip and ring being tied together would ground out. Interesting ideas though, thanks for offering your suggestions!

Processaurus:
That is probably the most sensible suggestion I'll get for this project. It's so simple, I almost feel dumb for not thinking of it before. That will probably be my fall back plan if I can't get this thing figured out. There's still something absurdly attractive to me about a pedal that can tell what kind of cable is plugged in, so I'll continue to pursue that path for now. Thanks for the suggestion!

Again, thanks for the ideas everyone. I'm going to be doing some more research on some of these topics and experiment with a few of them and see what happens!

duck_arse

yvarg - check your datasheets for your relays. if they have a (+) and/or (-) marked, they will already have that diode fitted internally. the diode is shown correct for a non-polarised coil, it is a flyback/catcher/quench diode (one or other of those terms may be wrong). also make sure you are not confusing the contact ratings and the coil ratings.

you have seached up the datasheet for your parts, no?
I feel sick.

PRR

> high voltage is the reason the relay isn't working properly?

Hmmmm, I thought the problem was "wreaks havoc on that signal". Yes, 9V DC around small audio is like a flood at the hamster farm.

What if you had a relay that worked on 0.1V? 0.01V? Not a flood but a light dew?

We can't get relays in such low voltages. But we can get transistors or chips which will sense very small voltages, then turn-on a higher voltage relay.

This may be more complicated than you care to undertake just now.
  • SUPPORTER

yvarg

duck_arse:
I have looked at the datasheet, thought apparently not close enough! There does not seem to be a diode within the relay, but the coil itself is actually rated at 5VDC, so I am running it pretty hot it looks like. I'm using this relay (the 5V version) :
http://www.jameco.com/Jameco/Products/ProdDS/2081414.pdf

PRR:
The problem IS that the voltage wreaks havoc on my signal when using the "trs detection" relay shown above, but what is more of a problem is that the circuit above also does not work.

I did not understand your initial statement, but your clarification makes perfect sense. Why not use a transistor to switch on the relay. In theory, the transistor would be powered by such a low voltage that it would not interfere with my instrument signal (and any interference could probably be blocked with a capacitor or two). Complicated for a seemingly simple switching procedure? Sure, but it would make a great learning experience.

Once again, thanks for the input guys! You've given me a lot of ideas to play around with and see what I can learn.  :icon_biggrin: