Isolated remote logic signal w/ opto-something?

Started by nickcordle, October 05, 2019, 11:17:10 PM

Previous topic - Next topic

nickcordle

Hi all ... I'm having an exciting Saturday night experiment ... let's imagine I want to bring a remote logic signal into an effects box on the tip of a 1/4" cable, as an input to some 9V CMOS logic inside my effect.  I want to keep the remote ground isolated on the possibility that there could be lots of these between lots of boxes eventually, and I don't want ground loops everywhere.  So, I use a plastic jack, a shoulder washer, or whatever (let's assume that's solved) ...

And now I need some kind of optocoupler / photocoupler / photorelay, right?  I haven't messed with these before now.  What I had in my head naïvely was something like a photo-FET output type thing with insanely high off resistance, like H11Fx, where I could do something like this:



... in which I can use a really big resistor value and keep the current on the output side really tiny.  Okay, but these are kind of expensive.

Next thing I see is something with a logic output, like H11L1, and I thought it was perfect ... until page 4 of the datasheet where the turn-on threshold current is 1.6mA (max).  That's quite a bit higher than I had hoped.

So I'm noticing at this point that Mouser lists a zillion parts with NPN outputs, they're cheap, etc.  Can I wire it up like the FET one, minding the collector dark current so that it doesn't drive the gate input high, and then choose the LED current with an eye on the current transfer ratio?

What are the pitfalls here?  Are there NPN-output couplers that are well behaved at lower LED currents like I'm envisioning?  Or is there a fundamental reason that this question is addressed by FET and logic couplers, and I'm just asking for trouble?  Or some other well-established way to do this?

(p.s. Speed isn't really a concern for this.  I'm not thinking of a digital data line or anything like that.  More like a bypass state / mode selection state kind of signal.  Priorities are just low current and low cost.)

PRR

Light is power. 2mA is not a huge current.

MIDI uses several-mA current to LED couplers and gets "infinite" ground isolation. True, MIDI developed in context of line-power boxes.

If you need to run on a micro-battery, just blip the coupler and use a flip-flop to toggle on and off.
  • SUPPORTER

anotherjim

MOSFET couplers exist I think to be used as switches that have no ground reference, such as a series control or "high side" as your sketch, although there is no reason they cannot be used to take a logic input high or low.
The BJT ones are more common to interface to logic. MIDI inputs use them. They are used as open-collector drivers so the collector resistor has to be a pull-up and the control to the logic will be Low when the LED is lit.

You must ensure the LED cannot get an excessive reverse voltage which is easily mitigated by fitting a diode "backwards" across the LED so that it only conducts if the feed polarity gets accidentally reversed and so it clamps the voltage across the LED at an ordinary diode drop.

If the LED is allowed to turn on or off slowly, you can get jitter through to the logic, so the coupler transistor ideally controls a Schmitt trigger logic input.


Rob Strand

FYI, there's nothing wrong with using a BJT opto pulling up to +V.  Connect C to +V, E to Output.   The output won't swing all the way to +V but most circuits will handle that, no problem.  The key for thing for any BJT opto ckt is having enough LED current to drive the load.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

nickcordle

Appreciate these comments ... and Paul, I do take the point about light == power.  Ultimately I probably can rearrange other stuff in the idea to where LED current doesn't have to be so extremely constrained.  I just was hoping not to :)

So I think I'm gonna get hold of a few different BJT types and take some measurements, and see how far down I can get the LED current and still get reliable behavior w/ some tweaking of resistor values & hysteresis.  Will post measurements if I find anything cool ...

amptramp

It's best not to play brinksmanship games with how low you can go on power and still get a signal.  In cold operation (if the unit just came in from your tour van in the middle of winter), you may not get reliable operation from a phototransistor set up to operate at room temperature.  Similarly, high temperatures may mean you do not get enough LED output to do what the unit can do at room temperature.  Various parts of a vehicle can get up to very high temperatures and that may mean the unit does not work right until it cools off.

Rob Strand

#6
QuoteSo I think I'm gonna get hold of a few different BJT types and take some measurements, and see how far down I can get the LED current and still get reliable behavior w/ some tweaking of resistor values & hysteresis.  Will post measurements if I find anything cool ...
For the BJT types there's "high CTR" optos (CTR= current transfer ratio).  The higher the CTR the more collector current for the same LED current.   Or spinning that the other way around for the same collector current you require less LED current.

Another aspect is speed, where there's three loose categories:  generic/slow,  fast, v fast.   Some of the fast ones aren't too expensive but the price can go up quite a bit for the v fast ones.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

nickcordle

re. amptramp ... yes, okay, copy that.  Heat gun and freezer testing will happen.

re. high CTR - yeah so the first thing I'm gonna play with is a few Darlington types.  If I could get it to behave with 4N33, that'd be -awesome-, and if not, that's probably a good indicator that cheap and low-current isn't going to happen.

R.G.

All good advice. Count on LED currents of a few milliamperes. There are probably devices that use less, but they will be rare and probably expensive. As PRR says, blip it and capture the millisecond blips. One scheme to be very low power is to pump up a capacitor over some time to have it ready to power the LED, then discharge the cap into the LED. You can charge at a very low rate, discharge quickly, and then have a while to recharge it. Average power goes way down.

You don't mention what you're doing, but it sounds very like a scheme to make the pedals sensitive to bypass signals in the pedals so you can do a remote controller that does not run the audio to the controller to minimize noise and wiring issues.

There are a few other options. One is using pure differential signaling and a diffamp with a large common mode range on the receiving side. The old current-input opamps could do diffamps with virtually unlimited common mode range. You'd need a three conductor cable, but those exist. Another is transformer coupling. Spitting switching signals across a galvanic boundary at low speed only needs very cheap transformers. Cheap modem transformers would do fine, and these can be very cheap - and small - in bulk. Shoot, if you had to, you could use plastic air hose, squeeze bottle switches and pressure switches in the receiving end.

I was thinking of using bluetooth for much the same thing, left it unimplemented largely out of laziness.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

nickcordle

Quote from: R.G. on October 08, 2019, 10:27:52 AM
You don't mention what you're doing, but it sounds very like a scheme to make the pedals sensitive to bypass signals in the pedals so you can do a remote controller that does not run the audio to the controller to minimize noise and wiring issues.

Yeah, something like that.  The present thought is a controller brain in a box, an MSP430 which reads program changes from a MIDI input and switches effects on or off through a bunch of isolated 1/4" outputs which go to "remote control" jacks on the effects.  Wasn't trying to be cagey about it, just staying open to the plan mutating as I'm working out the pieces.

The thing about sending a blip as a toggle ... I understand the power argument, but I've used rigs that switch like that on tours & festival stages before, and it was a scarring experience.  I'm imagining MIDI PCs coming into the controller which select a state for the entire rig.  PC 1 might mean "tubescreamer on, noise gate off, chorus off, delay off", PC 2 might mean "TS off, gate off, chorus on, delay on" ... so for the controller to do that with a signal that means "toggle", the controller has to already know the state of every effect, right?  And that's problematic, because something -will- go wrong and the controller & effect states will get out of sync, and then all hell breaks loose.  It's inevitable.  A tech for the next band will trip on a power cable on the back of the stage, supply voltages will drop for a tenth of a second, and half the gear will come back up in a different state.  So for me as a guitar player to not be neurotic about it, I want the signal on that remote control cable to indicate state directly, not through a flip flop the controller can't see.

I did briefly think through using stereo cables to either send two different signals ("turn on" and "turn off") or allow the controller to read back a flip flop on the effect, or something like that.  But that would be the only place in the entire rig where I need stereo cables.  I'm already carrying 735473642 mono 1/4" cables so I'd really rather use them.

R.G.

It's a tough set of design requirements. If you want to really be sure about not getting out if sync, you're probably going to have to put some intelligence into the pedal as well, and have the thing that goes across the connecting cable be messages with some kind of error checking and feedback. I did look into some of the ramifications, and needing message passing was one of my conclusions. You can get probably 85-90% of what you want with simple off/on LED/optos, but putting error toughness into it will require more intelligence.

It's good that some controllers use  very little power. I use PICs more than the TI stuff, but you can get nanowatt performance out of baby PICs as well. It leaves the problem of having to modify the pedals with some kind of thing that's stuck into the pedal. Not a biggie if you make the pedal, but you'll have to come up with quick and easy retrofits for pre-existing pedals.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Rob Strand

QuoteYou can get probably 85-90% of what you want with simple off/on LED/optos, but putting error toughness into it will require more intelligence.
Error checking might not work if the power is pulled since the effects could power-up in different states.  If you design the pedal then you can force the requirement of powering-up in the off-state.  That way the controller knows the state of the remote devises after power-up.   However, brown-outs + devices with large supply caps can still cause confusion as not all devices power off and reset.   So one trick would be to have a special signalling for reset so the controller can force the devices to a reset state.   After that some robust signalling would help ensure each end was in sync.   Beyond that you would need a back signal so the controller could read the state of the remote device and send a blip (or whatever) to put the remote device in the correct state at will.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

nickcordle

Quote from: R.G. on October 08, 2019, 05:58:50 PM
I use PICs more than the TI stuff, but you can get nanowatt performance out of baby PICs as well.

The MSP is just because I already have a bag of them here and some experience programming them.  Just off the top of your head if you don't mind, what PIC variant would you look at for this?  I don't know them at all really and wouldn't mind educating myself.

ElectricDruid

Seems to me this thread is getting heavily over-thought with this talk of error checking and intelligence in the pedals. There's really no way we need to build some single-master-multiple-slave bidirectional comms system just to turn a few pedals on and off. IF we wanted that kind of thing, we've already got MIDI, and you could put a opto+little uP in each pedal and then send program changes directly to everything - no central brain required. But that's massive overkill.

We're talking about some "remote switching" jacks, right? And we just need some logic signal to come out at the far end.
I'd organise the "pedal" end with a pull-up on the input of a Schmitt trigger or similar. The final logic signal is the output form the Schmitt. Then your remote input is a simple short-to-ground type signal "Shorted=On, Open=Off". You can plug a footswitch on a cable into this and it works. You can connect a transistor across the remote input and use a voltage to switch it on and off. That transistor could be in an opto-isolator if we're really concerned about ground loop isolation. I'd put the control processor and several optos in the main box, and then you just run mono jack cables to each pedal. Simple. The main processor will use some current since it'll be running several opto LEDs, but we're only talking 10s of mAs, not 100s.




nickcordle

+1 ElectricDruid that's pretty much my lean until I try it and discover some reason why it won't work.  Having to build microcontrollers into every individual unit is a can of worms.

There's a crossover point though, somewhere between here and where I want to build a preamp with like 20 different remotely switchable parameters or something.  Then we're probably into uC's at both ends + more than two conductors.  Haven't designed this yet.

Won't have parts for a few days still ...

amptramp

There are always latching relays and polarized relays.  They only consume power when the state changes and since they are isolated from the circuit, the optoisolators are not needed and no power is drawn from the effects unit.  You can get spare contacts to report back to the main controller what state they are actually in.

But I see the continuous optoisolated control signals from your first post as being your best choice.  Yes, you could use a microcontroller but somehow a Fuzz Face with a microcontroller inside seems to be a clash of technologies that would require a lot of filtering to keep digital chatter out of the audio.  If you are worried about the battery consumption in the various pedals, keep in mind, the LED power does not come from the pedal, it comes from the control unit.

R.G.

Let me explain a bit.

First, uCs are very small and very cheap. What I had in mind was the PIC10F320. It comes in a six pin SOT package and costs $0.50 in ones. It uses under a microwatt internally in most configurations. It is literally the circuit complexity of two transistors.

Second, >>something<< will need to be added to the controlled pedal. Fuzz Face clones are typically wired up with hard footswitches. It's really difficult to tell a dumb footswitch to change states with any kind of logic signal other than a shoe. Relays, JFETs, MOSFETs and opto-relays are probably next up, although the workhorse CD4053 does a nice job and only uses microwatts itself.

Really, this is the big problem with remote switching schemes. There has to be something inside the pedal that will take that incoming switch signal and re-route the signals. Most of the pedals I've designed professionally already have internals that need only an external signal to do it, the switching point is just not brought out to a jack. Some other pedals I know of have points that could be suborned for this, as in Boss and Ibanez; but substantially no DIY pedals or boutique pedals do. No matter how clever, cheap, or effective the master controller is, you have to somehow get the pedals' owners convinced to buy and install the "something" to let the remote master control the pedal.

Third, you have to choose simple and limited, simple and flexible, or complicated and unwieldy. I think my advice was interpreted as the third choice. Instead, it's really number two. I really like Uncle Albert's (Einstein) advice; everything should be as simple as possible, but no simpler.

Of course, that conflicts with my engineering view that too much is not enough.   :icon_biggrin:
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

nickcordle

Quote from: R.G. on October 09, 2019, 11:51:51 AM
Second, >>something<< will need to be added to the controlled pedal.

The stuff I'm immediately building for is already using either JFET or CMOS switches and momentary stomps controlling a toggle latch made of inverters.  So this just adds a switching jack like a 12A to either listen to the internal toggle, or to whatever's coming in through the jack.  Then there's a few inverters left over to generate the opposite phase to control the JFETs or whatnot.  This much I have already prototyped, works pretty cleanly so far.  Just not isolated yet.  I'd probably be thinking thoughts of relays if I cared about true bypass but that ceased to be the right option for my own stuff a while ago :)

As for modding true bypass things ... yeah that might be a little more hairy.  Will worry about that when I get there.

R.G.

OK, makes sense. If this is just for you, and you control what's inside the pedals, sure a simple one-bit activation can work fine. I'm always after solving the general case.

However, ...  :)  ... a 10F320 only needs CMOS input currents to receive a "switch" command, and would happily flip the internal switching, including doing short time pulses if you like latching relays, or just holding it switched if you use other-than-hard-contact switching.

You could also do a couple of different things to make it ground isolated. If you're dealing with sending microsecond pulses to make it switch (@ reviewers, yeah, yeah, I know, that's not simple   :)  ) then even the most trivial transformer would couple the pulse. A few turns of magnet wire on a 1/4" ferrite toroid ought to do it. I suspect that I could get an opamp to sense the differential between the shield and signal of the incoming signal line if you isolate the incoming shield jack. You might even be able to do it with a transistor diffamp, given that there's not all that much voltage between the two grounds.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

ElectricDruid

Quote from: nickcordle on October 09, 2019, 07:02:28 AM
There's a crossover point though, somewhere between here and where I want to build a preamp with like 20 different remotely switchable parameters or something.  Then we're probably into uC's at both ends + more than two conductors.  Haven't designed this yet.

There is definitely a crossover point. For something like your proposed preamp, I probably would use MIDI control changes. Why MIDI? Because it exists already, because it would give you compatibility with lots of other stuff, because it's already solved the isolation problems, because you don't have to work out you own control protocol, etc etc.
Most MIDI gear that has on/off options uses CC values 64 or above as On, and 63 down as Off. This splits the 0-127 MIDI range neatly in half, and makes the code simple, since you only have to test the highest bit of the data.

Another advantage of MIDI is that because other things use it, you can test your preamp with something else (that you *know* works) and then when you've got the preamp receiver-end working ok, you can move onto your MIDI controller for it. The worst thing about debugging comms between devices is not knowing which end is causing the problem, so if you can have one known-good device in the system, it makes life a *lot* easier.

And it's only three wires! Two for the loop, and a shield connected at one end only.