How to switch ground alternatively to IC pins using momentary spst switch

Thread Starter

patrick398

Joined Sep 16, 2019
24
Hey, first post so let me know if there's any house keeping i need to address.
I've been playing around with a LTV-847 optoisolator on the breadboard to see if i can get it to perform the task of effect pedal circuit bypass.

I've numbered the LED's just for clarity. So LED 1 is always on. When the cathode of LED 2 is grounded and cathodes of LEDs 3 & 4 are left floating signal goes from input jack to output jack and the effect is thus 'bypassed'.

With cathode of LED 2 left floating and cathodes of LEDs 3 & 4 are connected to ground signal goes from input, to fx input, to fx output, to output jack and the effect is 'on'.

What i'm after is a way of alternating the ground connections to LED 2 and LED 3 & 4 using a momentary spst switch. I've been looking into flip flops but can't figure a way of switching ground while leaving the other connections floating so i'm hoping to enlist the help of the hive mind :)

Hopefully my rambling made some sense
Thanks in advance
LTV847-BYPASS.png
p.s - sorry for the long post!
 

LesJones

Joined Jan 8, 2017
2,319
Just use an NPN transistor on each one. Emitter to ground. Collector to the LED cathode. And it's base via a current limiting resistor to the output of the flipflop. Are you sure the photo transistors in the opto isolator are capable of switching the signals ? (You have not given any details nature of the signals.)

Les.
 

Thread Starter

patrick398

Joined Sep 16, 2019
24
Just use an NPN transistor on each one. Emitter to ground. Collector to the LED cathode. And it's base via a current limiting resistor to the output of the flipflop. Are you sure the photo transistors in the opto isolator are capable of switching the signals ? (You have not given any details nature of the signals.)

Les.
Thanks for the reply Les, that makes sense. Although if i tie both bases of the transistors to the flip flop won't that just ground cathode's 2,3 and 4 as opposed to alternately grounding 2 and 3&4? Sorry if i'm misunderstanding.
The signals are guitar signals so basically the whole audio frequency range and no i'm not entirely sure if these opto's are suitable for the task but i was curious to see if i could get it working.
 

crutschow

Joined Mar 14, 2008
23,334
Below is the LTspice simulation of a CD4013 FF alternate-action circuit controlled by a push-button switch.
R1 and C1 provide a debounce function to keep the FF from changing states more than once for each button push (simulated bounce shown in the first PB push, blue trace).
You can also use a small N-MOSFET, such as a 2N7000 (requires no gate resistor).

What is the supply voltage you have?

upload_2019-9-17_8-9-42.png
 

Thread Starter

patrick398

Joined Sep 16, 2019
24
Below is the LTspice simulation of a CD4013 FF alternate-action circuit controlled by a push-button switch.
R1 and C1 provide a debounce function to keep the FF from changing states more than once for each button push (simulated bounce shown in the first PB push, blue trace).
You can also use a small N-MOSFET, such as a 2N7000 (requires no gate resistor).

What is the supply voltage you have?

View attachment 186398
Amazing, thank you very much. That looks perfect. Can't wait to try that on the breadboard.
When you say i could also use a 2N7000 do you mean instead of the BJT transistors? It would be nice to keep parts count and space taken up down to a minimum so being able to omit 2 resistors might be worth it.
Effect pedals are usually powered with 9v. There's usually a V/2 somewhere on the board and occasionally a 5v regulator if that's of any significance

Thanks again
 

Thread Starter

patrick398

Joined Sep 16, 2019
24
Yes, in place of.
9V is fine.
The circuit will operate from 5V to 15V.
Excellent, thanks so much for your help.
When i was previously playing around with mechanical relays for this task i was using a 555 timer to flip the states of the relay. I'm thinking i might be able to use this configuration with the 2N7000 and a 555 timer. Would save a little bit of extra space.
Here's a link to the schem...sorry can only provide a link at the moment:
https://www.instagram.com/p/Bpse3QZnTVI/

I think the 555 is performing the same task as the 4013 no?
 

Thread Starter

patrick398

Joined Sep 16, 2019
24
Actually, thinking about it, the 4013 works here because it's a dual chip. The 555 has a single output doesn't it. Dang
 

Thread Starter

patrick398

Joined Sep 16, 2019
24
Also (sorry for the deluge) am i going to run into problems feeding large audio signals through the photo-transistors on account of the 0.7v emitter diode? Is passing signals of say 1-2vpp going to cause clipping?
 

LesJones

Joined Jan 8, 2017
2,319
The photo transistors are not suitable for switching AC signals. I think using solid state relays such as VO14642AT would be better for switching audio.

Les.
 

crutschow

Joined Mar 14, 2008
23,334
the 4013 works here because it's a dual chip. The 555 has a single output doesn't it.
That's not the only difference.
The other problem is that the 555 is a latch, not a clocked FF, so it's difficult to make it into an alternate action FF.
am i going to run into problems feeding large audio signals through the photo-transistors on account of the 0.7v emitter diode? Is passing signals of say 1-2vpp going to cause clipping?
It's not the emitter diode drop that's the problem as that's not in the signal path, it's that BJT's don't carry bipolar signals equally well in both directions, like MOSFETs can.

A FET SSR as Les referenced, or an opto-coupled FET, such as the H11F1M, should work for that purpose.

Below is a simulation with the H11F1M switching a 2Vpp audio signal.

upload_2019-9-17_15-42-2.png

P.S. Why do you think you need an optoisolator for this function?
 
Last edited:

Thread Starter

patrick398

Joined Sep 16, 2019
24
The photo transistors are not suitable for switching AC signals. I think using solid state relays such as VO14642AT would be better for switching audio.

Les.
Why is it that photo transistors aren't suitable out of interest?
I looked into SSRs originally but i would need two of them i think

EDIT: Sorry Crutzchow i didn't see your message before Les's. Thanks again for doing that sim :) The reasoning behind trying to use opto's is that most other methods of signal bypass have some noise associated with them. A pop or click usually. I played around with relays for a while and could never get rid of the slight pop.
There is a method of bypassing which does use the H11F1M i believe. It uses a mechanical DPDT switch and i think it uses the opto to make the switching silent. I haven't seen a schem so can't tell you much more than that.
I'm pretty set on using a momentary SPST so hopefully i can make this work using your above FF and a few optos :)
 
Last edited:

Thread Starter

patrick398

Joined Sep 16, 2019
24
Perhaps a couple of these would be better suited to the task?
https://www.mouser.co.uk/ProductDetail/Broadcom-Avago/ASSR-1228-002E?qs=sGAEpiMZZMv%2B25x33JEohD0Uj8vh6LnoKtNikgL%2B7ag=

On the mouser website it lists the continuous load current as 20mA but i think maybe that's a typo as it states 0.2A on the manufacturers website. 200mA should be plenty for my purposes though

There's also: https://www.mouser.co.uk/ProductDetail/Panasonic-Industrial-Devices/AQW282EHA?qs=sGAEpiMZZMv%2B25x33JEohIzVIuFMTmfnIJNuWmjCfTI=

Trouble with the H11F1M is that i'd have to use 4
 

crutschow

Joined Mar 14, 2008
23,334
Perhaps a couple of these would be better suited to the task?
Either of those DPST MOSFET optos should work.
I played around with relays for a while and could never get rid of the slight pop.
Clicks or pops are usually caused by a slight DC bias signal change when the switch changes state.
A series capacitor to block any DC will usually eliminate that.
 

Thread Starter

patrick398

Joined Sep 16, 2019
24
Either of those DPST MOSFET optos should work.
Clicks or pops are usually caused by a slight DC bias signal change when the switch changes state.
A series capacitor to block any DC will usually eliminate that.
Excellent, thank you so much.
Most circuits have something like a 1M resistor on the input and 100k on the output to ground to pull down any DC leakage from input and output caps that can cause a DC offset that may be heard as a pop when a switch is activated
 

crutschow

Joined Mar 14, 2008
23,334
Most circuits have something like a 1M resistor on the input and 100k on the output to ground to pull down any DC leakage from input and output caps that can cause a DC offset that may be heard as a pop when a switch is activated
So I don't see how using a optocoupler will be better in preventing pops than any other type of switch. :confused:
 

Thread Starter

patrick398

Joined Sep 16, 2019
24
So I don't see how using a optocoupler will be better in preventing pops than any other type of switch. :confused:
I think a good deal of switching noise in pedal circuits is the clunky 3PDT mechanical footswitches which are used. They have become ubiquitous and are often cheap and poorly made. They also have a relatively high failure rate compared to monetary SPST switches and experience a good deal of contact bounce.
If i can eliminate DC offset using pulldown resistors it should leave me very pretty silent switching i'm hoping.
 

Thread Starter

patrick398

Joined Sep 16, 2019
24
I've been playing around with this set up for about a month now and it's working nicely and is pretty damn quiet...but not silent as i hoped it could be. Even with no DC on the audio lines i'm still getting a slight click or blip when switching. It's easy to hear when turning the volume on the guitar right down and the amp fully up.
Since the flip flop is opto-isolated from the audio signal i can't see how that could be causing the click. And with no DC on the audio lines i thought it would be silent. My question is, where is this noise coming from? Do i need something that can do zero crossing switching?
Completely silent switching must be achievable, but i fear it's beyond the reach of my feeble mind
 

crutschow

Joined Mar 14, 2008
23,334
You might try slowing the switching speed of the Opto which should minimize the click (circuit modification below).
You can adjust the value of C1 to vary the switching time.

upload_2019-10-9_9-34-3.png
 
Last edited:

Thread Starter

patrick398

Joined Sep 16, 2019
24
Thanks again for all your help and patience Crutschow, i will try this tomorrow if i get the chance. I did think this was what i needed to do and tried caps in various places, both to ground and in series, i'm not sure if i tried from base to ground so fingers crossed.
I've also been looking at dedicated switching ICs like the MAX4544. It addresses issues of popping when switching by implementing break before make and has shunt resistors on it's ins/outs. If i can't get this working maybe that's another avenue to explore. Only trouble is they only come in SMD packages so i wouldn't be able to breadboard
 
Top