latching relay drivers

Started by arjespen, August 10, 2018, 03:13:59 PM

Previous topic - Next topic

arjespen

Hey.
I'm about to build an amp, in which I'll be able to switch channels using a latching relay - both from a momentary switch on the front, and from a pedal (also momentary switch).
(I want to use the single coil latching relays that stay in place after power is turned off).
I found a nice driver circuit for it, that works off of the 5V winding of the power trafo. So far so good.

However, I realized I want to be able to switch something else too, so I need another relay. As for the pedal, that just means putting another momentary switch in there - no prob...
But I would hate to have to run two jack cables from the amp to that one pedal...

Anyone have a good suggestion for a circuit that can control both relays, but could be done using a simple stereo jack cable???

Regards
Anders

Khulukovski

Try Arduino...  U can done with MIDI / Bluetooth maybe

amptramp

Let's see what your relay driver circuit looks like - some will accept paralleled switches whereas others will not.

arjespen

Here's a link to the circuit of the amp. The driver circuit is on the right.

https://www.dropbox.com/s/yiaovf24a9xfqql/Suburbia%20v03.pdf?dl=0


R.G.

A bit of thinking about your needs:

First, have you breadboarded the driver circuit? If so, does it work as expected in both the simple, one-relay, one switch case, and then in the one-relay, two switches case? If it does, then yes, duplicating it for two relays and two switches can be made to work, assuming that the two-relays version doesn't have side effects on the power supply and ground you're using, and things like that.

Yes, you could use two momentary switches on each relay, using one in the footswitch pedal and one in the amp for each one. And this ought to work in a stereo jack and cable. I don't like stereo jacks and cables in guitar amps, mostly because they're easy to confuse with the ubiquitous mono phone jack cables used for guitar signal, but that's a personal issue. I'm always picking up the wrong cable.   :)

I haven't simulated the circuits yet, so I can't say for sure, but I believe that there may be an issue here with how you say you want the circuit to work. The relays do of course stay in the state they happen to be in when power goes off, and comes back on. But I suspect that the driver circuits always come up in the same state at each power-on. The driver circuit functions as a discrete-components flip flop circuit, where it holds one state until driven to the opposite condition by an input. The momentary switches are effectively a two-input AND gate (well, OK, a negative-logic OR gate) where either input makes the flop flip. The problem that might happen is that flipflops tend to power on in the same state every time.

The power on state of the flipflop circuits depends on the device and component tolerances. So each flop will come up the same way every time. The relay may be sitting in the corresponding on or off condition from the last power of. That would mean that the relay and flip flop may be matching conditions, in which case everything works as you'd like, or opposite conditions, where you'd have to press the switch twice to get the relay to flip to the opposite state.

There is some possibility that the relay and circuit connection would interact some way to make the relay auto-flip to the power-on driver condition, or to have the relay condition affect how the driver powers up. I'd have to do some simulation work and maybe prototyping to see if that happens.

One slick way to force this to happen is if your relay has an extra section that could be used to force the flip flop to power up in the condition the relay is already sitting at upon power-on. Again, this would need some work, as well as an extra pole on the relay.
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.

arjespen

Thanks for your reply.
Shortly - the schematic I put together doesn't work.

The original circuit for one relay works just fine on my breadboard.
Unfortunately I'm struggling to fully understand everything the circuit does enough to be able to adjust it to my needs.
I think I understand the basics of the mosfets and bjt's, and the relay with the cap.
But the combination of the whole circuit does have me scratch my head quite a bit.

I've also been trying to search for other circuits that could do what I need. I found various, but most of them presents me with the same problem when trying to use two switched with a stereo jack. I imagine I'd need a circuit that switches to ground, but I have yet to find one that really works well for it. Also, since i'm using the 5V winding of the transformer, some circuits aren't getting enough juice :-)

R.G.

At times like this, I drop back to first principles.

1. What are you switching? Low voltage (under 100V or so) signal or power (greater than about 0.5A)?
2. Given the answer above, what relay works? If it's signal, you can use a PCB mount DPDT relay that works on low voltage, so you can use CMOS logic chips to run things. Such relays cost about US$2 to US$3 here. If you must switch high voltage or power, you'll have to pick another relay and the drive considerations get harder.
3. If you can use low power relays, the low cost relays I mention can be switched by about 20 to 100ma coil current, depending on what power supply voltage you're getting from your 5V winding.
4. Given that you have maybe 4V to 8V dc from your 5V winding power supply at over a couple of hundred milliamperes, you can do a simple circuit using one or two CMOS logic chips to do the work. I'd even volunteer to suggest a circuit or two to do this.

If you have to switch higher voltage, or higher power/current, it changes only the relays you have to buy, and you would need higher power devices to actually switch the coil current.

The input requirements are that you have two switch inputs, each of which is a hard-metal switch to ground. These switches need to be debounced so you don't get multiple flips per switch activation. Then the switch signals - which are negative-going - must be hooked up so that either switch causes a flip to occur. This describes a negative-logic "OR" gate. The output of this "OR" would then drive a logic flipflop, which changes state once each time either switch is activated. This function comes two in a single IC, as a dual flipflop. The output then can be used to drive the coils directly or through current-boosting transistors.

Unlike using combinations of transistors and such, there is really very little chance the switches and flipflop action won't work.
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.

arjespen

Hey.
Thank a lot for your inputs.
You can see the schematic earlier in the thread. One relay is switching in the components that bypass the tonestack (C9,c10 and the boost tone pot) on one side of the dpdt, and also switching the grounding of the tonestack. I think that would qualify as low voltage signal. The other switch is changing the bias resistor on the second stage, so that should be the same.
As mentioned earlier (I think), I already have these panasonic TQ2-L-5v relays lying around, and decided I wanted to use them for this project.

You're more than welcome to suggest circuits. I was hoping to not have to order new components though, if I can avoid it - I do have a small supply of bjt's and mosfets, and hoped to be able to simply use them.

R.G.

TQ2-L-5V will do fine. I'll try to gen up something.

Actually, the flipflop circuit from the bypass switching of the tube screamer pedals might be made to work. That would require a lot more parts than an IC solution, though.
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.

arjespen

Hmm.. I actually did see a circuit with hex hex inverters. I do have a bunch of 4049's lying around, and tried it out on the breadboard - working just fine.
Problem still was the same though, I couldn't make it so I could control two relays using only three wires.

arjespen

Quote from: R.G. on August 16, 2018, 07:40:17 PM
TQ2-L-5V will do fine. I'll try to gen up something.

Actually, the flipflop circuit from the bypass switching of the tube screamer pedals might be made to work. That would require a lot more parts than an IC solution, though.

Ok, I looked over the flip flop circuits I could find, and after a lot of fiddling I managed to come up with something that seems to work on the breadboard.
Here's the current circuit:
https://www.dropbox.com/s/4au5uqi3nzm40y5/flipflop%20realy%20switch.pdf?dl=0

It does work, but I had a bit of trouble getting the relay to switch. I could see that the circuit flipped, but the relay didn't switch. I guess it didn't get enough current. Changing some of the resistors and caps, and particularly changing the cap to ground from the relay up to 100µF seemed to help.
It does do some hickups if I switch too fast though.
Any suggestions for changes/upgrades/optimizations?


R.G.

Good work on that.

I thought about it a bit and had a few minutes to play on the circuit simulator.

First, the original circuit doesn't work. It can't. The BS170 mosfets specified are P-channel devices, and you need to make them N-channel devices to get it to work. 2N7000 works in the circuit as shown. That still leaves the problem with the switch closure being non-grounded.

I was actually about to post that, and some work I'd done on using the two-transistor flipflop as you've shown when I saw your last post. What transistors do you have available? Do you have or can you get something like 2N7000 n-channel mosfets? I think implementing the circuit you've show with those might work.

I'll go check it out on the sim.
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.

R.G.

.... a little sim work later.....
What does work is the circuit you've set up, but with a second MOSFET to ground, with its drain connected to the source of the "top" MOSFET, and its gate tied to the collector of the left-most bipolar. Eliminate that pull down diode; the NPN transistor can't pull the current and also work as a flipflop very well.

You must use N-channel MOSFETs, not the P-channel BS170. I could try to work out how to do it with P-channels, but that's another circuit variation.
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.

arjespen

#14
Quote from: R.G. on August 18, 2018, 08:22:33 PM
You must use N-channel MOSFETs, not the P-channel BS170. I could try to work out how to do it with P-channels, but that's another circuit variation.

I'm quite convinced that it must be me who's missing something, but...... I would have thought the bs170 was an n-channel?
https://www.onsemi.com/pub/Collateral/BS170-D.PDF
The transistors I used on the breadboard are 2n3904's

bluebunny

???    I use 2N7000 and BS170 interchangeably in all my M-2 bypasses (albeit spun 180o).
  • SUPPORTER
Ohm's Law - much like Coles Law, but with less cabbage...

R.G.

My bad. I actually did what I'm always telling people to do - look at the datasheet - and it is indeed N-channel.

That mistake corrected, I still can't get the PNP/n-channel complementary latch from the original schemo to work using 2N7000 models. And on top of that, it uses a floating switch.

I stayed with a discrete solution, as requested by the OP, and used the bypass flipflop from the Boss/Ibanez pedals.  This is a reliable (albeit complex) flipflop with a switch to ground to flip it. Then I used MOSFETs  to pull the relay up and down. I tried using n-channel for both pull up and pull down devices, but that resulted in a soggy, weak pull up. So I subbed in a p-channel for the pull up and tied its gate to the same flipflop collector as the n-channel pull down, and got solid, reliable pulls up and down.  I had to put a 100K in series with the gates of each MOSFET to keep their gate capacitances from fouling up the flipflop switching.

A good device for the p-channel might be one of Diodes Inc. ZVP3306A ($0.60, Mouser) or ZVP3310A ($0.66, Mouser), Microchips VP2106N3-G ($0.50, Mouser) or TP2104N3-G ($0.60, Mouser).

It is also likely that a darlington like the MPSA13/14 (about US0.30) works for the pull down and a PNP pull up. They'll probably even be OK with a 100K series resistor to the base for isolating and limiting their base current, small as it is.


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.

arjespen

Awesome - it works! THANKS!!
I used a BS250 that I had lying around for the p-channel.
Here's the current circuit on my breadboard:
https://www.dropbox.com/s/ovupz32de9jy6w2/relay%20flipflop.pdf?dl=0

Although it works I'm having a little trouble leaving well enough alone.
Mostly because most of the component values in the flipflop are a mix of values thrown in from what I've seen in other schematics.
Any thoughts/comments or optimizing of them?

arjespen

Quote from: R.G. on August 16, 2018, 07:40:17 PM
Actually, the flipflop circuit from the bypass switching of the tube screamer pedals might be made to work. That would require a lot more parts than an IC solution, though.

I wonder if it would be possible to get the same functionality with one hex inverter like the 4049?