DIYstompboxes.com

DIY Stompboxes => Building your own stompbox => Topic started by: knutolai on June 10, 2014, 01:32:52 PM

Title: Relay for pedal bypass
Post by: knutolai on June 10, 2014, 01:32:52 PM
Sooo.. I wanna move to using latching relay-bypassing instead of the noisy old 3PDT mechanical stomp switches. I found the Panasonic TQ2-5V (http://pewa.panasonic.com/assets/pcsd/catalog/tq-catalog.pdf (http://pewa.panasonic.com/assets/pcsd/catalog/tq-catalog.pdf)) relay which looks like the most commonly used, but I'm a little unclear on how to interpret the schematic and I don't want to risk burning the coil.

(http://www.seekic.com/uploadfile/ic-mfg/201231342946749.jpg)

Pins 2, 3, 4 and 7, 8, 9 make up the two toggle switches. Looking at the schematic the TQ2-5V is a "Single Side Stable"-type Relay. Does this mean pins 5 and 6 are unconnected (just part of the relay packaging, not the circuit)? Could I hook it up in a configuration like this? Where Pin 1 is connected to "+V" and Pin 10 to the NPN collector.
(image is a edit of this Geofex circuit http://www.geofex.com/FX_images/ltchrly.gif (http://www.geofex.com/FX_images/ltchrly.gif))

(http://i.imgur.com/DEif98s.png)

EDIT: bad datasheet link
Title: Re: Relay for pedal bypass
Post by: R.G. on June 10, 2014, 01:40:00 PM
Quote from: knutolai on June 10, 2014, 01:32:52 PM
Sooo.. I wanna move to using latching relay-bypassing instead of the noisy old 3PDT mechanical stomp switches. I found the Panasonic TQ2-5V relay which looks like the most commonly used, but I'm a little unclear on how to interpret the schematic and I don't want to risk burning the coil.

Pins 2, 3, 4 and 7, 8, 9 make up the two toggle switches. Looking at the schematic the TQ2-5V is a "Single Side Stable"-type Relay. Does this mean pins 5 and 6 are unconnected (just part of the relay packaging, not the circuit)?
There are three kinds of relay coils that you'll commonly run into. These are (1) single side stable; this version is stable when NOT energized, and pulls to the opposite position when and only as long as you pull current through the coil; (2) single coil latching; stable in both "set" and "reset" positions, and moved between the two by a proper-direction pulse of current into the coil; it remains in the place it was last left until you pulse it the opposite way; and (3) dual coil latching: two coils, pull one of them to make it go "set", one to make it go "reset" and it will stay where you put it until told to go the other way by a pulse on the opposite coil.

If you have a single side stable, then it will stay reset until you pull current through the coil, and then release when you stop the current. Yes, in this relay from that data, 5 and 6 are unused except on the dual coil latching version.

QuoteCould I hook it up in a configuration like this? Where Pin 1 is connected to "+V" and Pin 10 to the NPN collector.
(image is a edit of this Geofex circuit
Yes. That is what that circuit was intended to do.
Title: Re: Relay for pedal bypass
Post by: knutolai on June 10, 2014, 02:03:35 PM
Great stuff R.G.! Yes I had a quick read up on the different types. Some helpful diagrams on the different types can be found below for anyone as (formerly) clueless as me.
http://www.ni.com/white-paper/3960/en/ (1-coil and 2-coil latching)
http://www.ia.omron.com/data_pdf/guide/36/generalrelay_tg_e_3_1_3-4(classifications).pdf (Single side stable, page 2)

I really like the concept of Single Side Stable type as it can be set up to flip to bypass automatically in a incident where the power supply is killed. A smart true bypass  :icon_surprised:
Title: Re: Relay for pedal bypass
Post by: Seljer on June 10, 2014, 02:05:09 PM
Quote
QuoteCould I hook it up in a configuration like this? Where Pin 1 is connected to "+V" and Pin 10 to the NPN collector.
(image is a edit of this Geofex circuit
Yes. That is what that circuit was intended to do.


Err, wouldn't the cap in between the 3rd and 4th inverter only let a short pulse through when you hit the switch?
Title: Re: Relay for pedal bypass
Post by: knutolai on June 10, 2014, 02:12:54 PM
QuoteErr, wouldn't the cap in between the 3rd and 4th inverter only let a short pulse through when you hit the switch?
You are right. I was a little hasty when rearranging the schematic. The original was intended for a 2-coil latching relay. If I understand it correctly the 4. inverter as well as its pull-up resistor and cap should be removed entirely. No?

Like this.
(http://i.imgur.com/3R8myxf.png%5Dhttp://i.imgur.com/3R8myxf.png)
Is there perhaps a smaller chip that will perform the same task as those three inverters?
Title: Re: Relay for pedal bypass
Post by: R.G. on June 10, 2014, 02:51:51 PM
Yep. I didn't notice that. If you're using a single-side-stable, you want the three CMOS gates to be a flipflop and hold the transistor on or off.

Note that you can also put the LED and series resistor across the relay coil.
Title: Re: Relay for pedal bypass
Post by: mth5044 on June 10, 2014, 04:01:14 PM
Quote from: knutolai on June 10, 2014, 02:12:54 PM
Is there perhaps a smaller chip that will perform the same task as those three inverters?

Yap, a microcontroller, and not the hard-learn-C++-code-impossible kind. PICAXE is very simple to use for this kind of stuff and is relatively inexpensive. You cause use the 8pin IC to do it.
Title: Re: Relay for pedal bypass
Post by: Seljer on June 10, 2014, 04:17:48 PM
Or 'borrow' the multivibrator circuit used in the Boss pedals if you have an excess of discrete components.
Title: Re: Relay for pedal bypass
Post by: R.G. on June 10, 2014, 05:01:50 PM
Quote from: knutolai on June 10, 2014, 02:12:54 PM
Is there perhaps a smaller chip that will perform the same task as those three inverters?
There is, but there is a tradeoff in small versus simple.
The single CMOS hex inverter is cheap and available every where, and you get one flipflop as shown with half the chip, two resistors and one cap. Add more resistors and another cap and you have two flops.
It's a 14 or 16 pin chip, true, but it's a remarkably simple solution.

For smaller, you're kind of stuck with some more difficult choices. You can do it all in an 8-pin DIP with a small microprocessor. To do that, you need to be able to program that uC, so there's a first hill to get over, but after that it's easy. There are low cost BASIC language compilers and such to make the programming easier, and very low cost ways to program the PIC family I'm most familiar with. But that also needs some kind of 5V regulator to power the uC (I think this will apply across the board for uCs).

You can do it with opamps; I can conceive of a way to do that three-opamp circuit with a dual opamp, but I'd have to do some circuit design to be surer. Finally, there are two-inverter CMOS chips; unfortunately, they're only available in SMD.

And there is the Boss/Ibanez two-transistors/8 resistors/4 caps/etc./etc. circuit.
Title: Re: Relay for pedal bypass
Post by: knutolai on June 10, 2014, 05:23:55 PM
Yeah I've thought about the microcontroller option. The relay already needs a 5v regulator so it could share the supply, but it feels like a lot of work compared to the analog option.

QuoteYou can do it with opamps; I can conceive of a way to do that three-opamp circuit with a dual opamp, but I'd have to do some circuit design to be surer.

I'd be very interested in seeing that! Kinda feel obligated to give it a try finding a solution with that limitation myself :P

Is the third inverter really necessary? I'm guessing its there for stability
Title: Re: Relay for pedal bypass
Post by: Seljer on June 10, 2014, 05:39:14 PM
Quote from: knutolai on June 10, 2014, 05:23:55 PM
QuoteYou can do it with opamps; I can conceive of a way to do that three-opamp circuit with a dual opamp, but I'd have to do some circuit design to be surer.

I'd be very interested in seeing that! Kinda feel obligated to give it a try finding a solution with that limitation myself :P

I've seen that one "in the wild" in an Engl amp footswitch (though they were using a quad opamp as a bunch of set-reset flip flops, not toggle flip flops)
Title: Re: Relay for pedal bypass
Post by: R.G. on June 10, 2014, 05:58:10 PM
Quote from: knutolai on June 10, 2014, 05:23:55 PM
Is the third inverter really necessary? I'm guessing its there for stability
In a way. It's there to ensure that loading from the transistor drive doesn't affect the operation of the flipflop by loading.  It's probably not needed, but then there are still three unused inverters even after using that extra.  :icon_biggrin:

That's one reason I mentioned the two-inverter SMD device.

IF you do this with a pair of opamps, be sure the opamps have an input common mode range that includes whatever voltage you throw at them. In the simple circuit, this will be rail to rail at the inputs. If you have no such opamps, you'll need to use other components to make the circuit safe for your opamps. You might - and probably would - get by with the single-supply variant of opamp which has inputs that include the minus supply rail. The LM2904 might work, as might one of several dual comparators. These will require futzing around with resistors, input range, and so on that CMOS inverters laugh at.
Title: Re: Relay for pedal bypass
Post by: Seljer on June 10, 2014, 06:14:10 PM
Hmm, in spice I just got the same circuit functioning with two bare NPN transistor inverting stages (emitter grounded, 10kiloohm on the base and a 10kiloohm from collector to the positive supply) + a third NPN to drive the relay/LED without loading everything else down.  Same deal with the 1Meg+capacitor and 100k as in the CMOS inverter circuit.

The 'fancy' multivibrator circuit used in the boss/ibanez pedals has the added benefit of simultaneously generating the negated signal as well as offering smoother transitions right?


edit: haha, decided to redraw it and realized I'm reinventing the wheel
It behaves well in the simulator with the values specified but I'd advise you to breadboard it first
(http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=51218&g2_serialNumber=1)
Title: Re: Relay for pedal bypass
Post by: knutolai on June 10, 2014, 06:17:12 PM
QuoteIF you do this with a pair of opamps, be sure the opamps have an input common mode range that includes whatever voltage you throw at them. In the simple circuit, this will be rail to rail at the inputs. If you have no such opamps, you'll need to use other components to make the circuit safe for your opamps. You might - and probably would - get by with the single-supply variant of opamp which has inputs that include the minus supply rail. The LM2904 might work, as might one of several dual comparators. These will require futzing around with resistors, input range, and so on that CMOS inverters laugh at.

Rail-to-rail opamps are on my next grocery list so I'll give that a go, though I suspect I might require enough components that it's hardly worth the effort.

However!! I did some searching and found a 555 timer circuit which I think might do the trick.
(http://www.555-timer-circuits.com/images/FlipFlip.gif)
Haven't got any of these chips either, but from the description this looks like a T flip-flop which is just what I need. Very low part count too. (The transistor, base resistor and lamp is ofc not necessary)
The description is here: http://www.555-timer-circuits.com/flip-flop.html (http://www.555-timer-circuits.com/flip-flop.html)
Title: Re: Relay for pedal bypass
Post by: R.G. on June 10, 2014, 07:40:11 PM
If you go that way, be sure to use the CMOS version of the 555. The bipolar version has horrible current spikes.
Title: Re: Relay for pedal bypass
Post by: Dave W on June 10, 2014, 08:13:51 PM
http://www.smallbearelec.com/servlet/Detail?no=1253
Title: Re: Relay for pedal bypass
Post by: J0K3RX on June 10, 2014, 08:14:26 PM
http://www.jameco.com/Jameco/Products/ProdDS/321736.pdf  :o

http://www.digikey.com/product-highlights/us/en/linear-technology-timerblox/1523

http://www.maximintegrated.com/en/products/power/supervisors-voltage-monitors-sequencers/MAX16125.html/tb_tab0
Title: Re: Relay for pedal bypass
Post by: J0K3RX on June 10, 2014, 08:41:58 PM
Quote from: Dave W on June 10, 2014, 08:13:51 PM
http://www.smallbearelec.com/servlet/Detail?no=1253


And of course this has been posted here before... hex files are there if you feel like gettin yer prog on :icon_biggrin:
http://stompville.co.uk/?p=260

http://stompville.co.uk/?p=423

R.G. - Whatever happened to Transmogrifox? Like all signs have been wiped from the internet... I have a crap ton of 12f683's and I am lazy :icon_rolleyes:
Title: Re: Relay for pedal bypass
Post by: PRR on June 11, 2014, 01:00:48 AM
>> a smaller chip that will perform the same task....
> microcontroller... the 8pin IC...


Hex-inverter is 14 pins, can do two relays.

I suppose this 8-pin PIC can do two relays also, or maybe there's only one relay, so perhaps it's moot.

I suspect the Hex is still cheaper than a micro. (Maybe less than a buck difference?)

> relay already needs a 5v regulator

No it doesn't. Put a resistor in series.

And here is where antique obsolete CMOS pulls ahead. The classic series works on 3V-18V and really does not care.

Of course it may really come down to finding all the half-buck parts in one place to minimize shipping costs. (When is Amazon going to get those delivery drones to bypass the delivery monopolies? And how can a drone fly cheaper than my share of a 10-ton truck?)
Title: Re: Relay for pedal bypass
Post by: mth5044 on June 11, 2014, 01:21:30 AM
Quote from: PRR on June 11, 2014, 01:00:48 AM
>> a smaller chip that will perform the same task....
> microcontroller... the 8pin IC...


Hex-inverter is 14 pins, can do two relays.

I suppose this 8-pin PIC can do two relays also, or maybe there's only one relay, so perhaps it's moot.

I suspect the Hex is still cheaper than a micro. (Maybe less than a buck difference?)

True, but once you get the basic code idea down, you can very quickly do a 10 relays in all different types of switching schemes easily with a 20pin IC where it might take 5 14 pin hex inverter chips. For something like one or two relays, maybe it's not worth it, but the potential to expand with minimal increase in parts is there.
Title: Re: Relay for pedal bypass
Post by: knutolai on June 11, 2014, 11:18:42 AM
Quote> relay already needs a 5v regulator

No it doesn't. Put a resistor in series.

How would I go about calculating that resistor value?
Title: Re: Relay for pedal bypass
Post by: Seljer on June 11, 2014, 11:41:54 AM
Quote from: knutolai on June 11, 2014, 11:18:42 AM
How would I go about calculating that resistor value?
Measure the resistance of the relay coil (or find the datasheet, but it doesn't hurt to check with a multimeter to be sure). The resistance of the coil is the only thing thats limiting the current after its turned on (the inductance only comes into account when transitioning). Calculate the expected current at the rated voltage, then the limiting resistor to draw the same current at your higher voltage.


For example: 5V relay, 160ohm coil
relay current = U/R = 5V / 160ohm = 0.031A

you need to add a resistor that will drop the 9V supply down to 5V when 0.031A are running through it.
R = U/I = (9V-5V) / 0.031A = 129ohms

So slap a 120ohm in series and it'll the final relay voltage should be close enough: 9V * (160/(120+160)) = 5.14V
The relay itself allows from some leeway regarding over/undervoltage (a typical figure would be 20%) and will still work.

And check the power rating for your resistor: P = U^2/R = (9-5.14)^2/120 = 0.124W
Thats an 1/8th of a watt so you should be fine with normal 1/4watt resistors.
Title: Re: Relay for pedal bypass
Post by: knutolai on June 11, 2014, 12:05:24 PM
Thanks. Thats very clear and in depth. Should have known coils had a resistance :P

QuoteThe relay itself allows from some leeway regarding over/undervoltage (a typical figure would be 20%) and will still work.
So this is why this approach is acceptable? "9 volt supplies" aren't always 9 volt, but with that much leeway I guess it can tolerate a little variation in both the resistor and supply voltage.
Title: Re: Relay for pedal bypass
Post by: Seljer on June 11, 2014, 12:21:23 PM
Inside it just an electromagnet being held back with a spring. The electromagnet doesn't overpower the spring directly at the rated voltage but a good bit before that. It's not a precision electromagnetic balance :D. Relays are rather spartan, no need for a fancy regulated supply for something this simple! They have to tolerate undervoltage if you ever got a really long cable run too. Or 12V automotive relays where the voltage is all over the place.

The only way to be sure or of what the limits are is to find a datasheet to know what exactly you've got. In the panasonic one you linked to ( http://pewa.panasonic.com/assets/pcsd/catalog/tq-catalog.pdf look at page 3)

Pick-up voltage (minimum to reliably switch on): 75% or less of nominal voltage
Drop-out voltage (how low it has to get to reliably switch off): 10% of nominal voltage
Max. applied voltage (how high it can get before it burns up): 150% of nominal voltage
Title: Re: Relay for pedal bypass
Post by: knutolai on June 11, 2014, 07:33:19 PM
Taking a good step back and actually looking at the current draw of the Single Side Stable Relay I've gotta say this is a very current demanding configuration! For the circuit to be active current must constantly flow through the coil (and the series resistor).
9 V/~300 Ohm = 30mA! :icon_redface: I can see why the 1/2-Coil Latching Relays are the preferred alternatives.
Title: Re: Relay for pedal bypass
Post by: J0K3RX on June 11, 2014, 07:43:30 PM
You really should look at a "one-shot" bistable relay circuit of some sort.

Do a google search for the exact phrase below and you will see an awesome designed AVR based system! It's in another forum, of course

Generic I/O board for pedals, with bistable relay
Title: Re: Relay for pedal bypass
Post by: knutolai on June 11, 2014, 08:18:26 PM
Great project! I guess I might land on the MCU route. Thanks for all the effort guys. I feel a lot smarter, or less stupid, now on the Relay-topic. Hopefully other people will find this thread helpful too.
Title: Re: Relay for pedal bypass
Post by: Seljer on June 12, 2014, 04:38:16 AM
Yes, the two state stable latching are much better regarding current usage. They are however, slightly less common to find and require more drive circuitry (and they don't offer the "smart" auto-bypass when you lose power)


But it's only an issue with battery powered pedals, it's really much of a hit when using an external power supply
Title: Re: Relay for pedal bypass
Post by: samhay on June 12, 2014, 04:52:58 AM
FWIW, I use 12V non-latching relays from time-to-time (with a 9V supply). I like them as they are cheaper and easier to find than bi-stable relays, are simple to use, will give bypass on power-off, and seem to draw ~10 mA when on. Current draw is not great for batteries, but not too bad otherwise, and if you are using a uC to drive them, then you will be pulling a lot more than 10 mA anyway.
Title: Re: Relay for pedal bypass
Post by: Liquitone on June 12, 2014, 05:25:02 AM
yeah, I tried bi-stable relays and the circuit and didn't like how the connections to the relay got too cluttered. Although it shouldn't really be a problem with dual layer boards. On the plus side with non-latching relays current draw, it only draws that current when the pedal is not bypassed, which is ok for a wah. Perhaps more annoying with 'always on' type effects like treble boosters and fuzzes, but then you could swap the bypass jumper and effect in/out around to have it 'on' without drawing current.