Toggle double-coil bistable latching relay with ONE momentary switch

Started by KarenColumbo, September 13, 2019, 06:39:07 AM

Previous topic - Next topic

KarenColumbo

After an unsuccessful (disorganized) foray into relay territory I came back to the original idea of switching the states of a double-coil bistable latching relay ((https://produktinfo.conrad.com/datenblaetter/500000-524999/504024-da-01-en-PR_REL_2UK_12VDC_8A_RT2_BIST_1.pdf) ) using a single momentary switch. So I've been combing the web for a solution that ...

a) ... leaves both coils usable
b) ... powers two LEDs to signal the states
c) ... works without programming a micro PC

After sifting through tons of schemtaics I found a circuit that looks sensible to my, alas, very untrained eyes:


It uses DC that I have available, it demands the type of relay I have available and it seems to have debounce circuitry wchich, I gathered, is mandatory. The only fatal drawback: It utilizes two switches. I want to use a single one, because that's ... sexy?

Now the term "flip-flop" springs to mind.

I, once again nose-to-screen, found tons of circuitry that allegedly does what I need. But these circuits look a bit "bloated" to me. And, of course, I don't know how to splice them into above schematic.

Since my type of relay (https://produktinfo.conrad.com/datenblaetter/500000-524999/504024-da-01-en-PR_REL_2UK_12VDC_8A_RT2_BIST_1.pdf) has two terminals for actuating the separate coils, I'd need kinda "toggle circuitry" that toggles the switching DC through two alternating outputs by the press of a single button.

Now the model name "555" sprang to mind.

And that's where I get stuck.

Could you once again help a sinner out?
  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

GibsonGM

There has to be a way to do this using a flip-flop.  Boss does it, after all!   I'd be interested in this as well, for switching internal 'stuff' in amplifiers.   I played with this a little in the past for a different application (model railroad) - I discovered that it's easier to use 2 coils like you have, rather than trying to reverse polarity with one coil!  Gonna watch and see what a switching guru can come up with here, definitely is a design problem to overcome.
  • SUPPORTER
MXR Dist +, TS9/808, Easyvibe, Big Muff Pi, Blues Breaker, Guv'nor.  MOSFace, MOS Boost,  BJT boosts - LPB-2, buffers, Phuncgnosis, FF, Orange Sunshine & others, Bazz Fuss, Tonemender, Little Gem, Orange Squeezer, Ruby Tuby, filters, octaves, trems...

KarenColumbo

I think the above circuit could work. It I only could substitute both of the "Test" switches with transistors wired as switches. On closes on "High" (I guess 5V because there's digital involved), the other closes on "Low". If that were possible, I guess it's an easy thing with a simple logic IC that reverse both states (high and low) at the press of a button, so one transistor switch closes when the other one opens and vice versa. Isn't it?
  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

R.G.

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.

KarenColumbo

Quote from: R.G. on September 13, 2019, 10:37:37 AM



OMFGWTF! Thx, R.G:! <3 There's about every single other solution to be found in the web - except this one. Relays seem to be avoided in the DIY community. At least thats my impression after searching the heck out of this. Only places I almost found similar solutions were in extremely unfriendly german forums where you get burned for asking the wrong question while never knowing which would be the right one ...

Would a 4049 suffice? Happen to have a couple in a drawer :) And the ratings seem to be okay (18V max supply voltage).
  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

R.G.

The CD4049 is what the circuit was designed for. Should work fine. Let me know if you have any problems with it. I've used bits of that circuit in commercial production pedals, and it's pretty reliable. The only funny stuff might be adjusting the pulse timing and the base drive.
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.

duck_arse

Quote from: R.G. on September 14, 2019, 10:43:10 AM
..... The only funny stuff might be adjusting the pulse timing and the base drive.

and don't forget to mention the [not shown] supply connection to the K end of the two diodes. no juice in the coils without it.
" I will say no more "

R.G.

Yep, that's another funny thing.  :icon_lol:

No wonder I had so much trouble getting that to 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.

KarenColumbo

The recent two posts awoke my superstition.

This here won't work, I gather?




Damn :(

So this will have to wait :)



  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

duck_arse

why won't it? if you've added the un-shown positive supply, as seen in your amended dia, to yore bord layout it should work as intended.
" I will say no more "

R.G.

Yes. As D.A.notes, with the added power supply connection, it works.

I have used a variation of that circuit in my commercial pedal work. It is very reliable.
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.

KarenColumbo

The simplicity of this particular solution is almost uncanny - i expected something along the lines of "Nah, Andreas, this can't possibly work because ..." and then either someting glaringly obvious (for you) or highly abstract :)

Anyway: thank you gents, yet another step forward for this one :)

BUT: In my PCB layout I had to rip apart the switching circuit and the relay circuit itself. The last ground reference is at the transistors' emitters, which are situated on the "switch pcb". The "relay pcb" has no ground, so I give it some via the 4-pole-connector. Which makes my head spin.

Shouldn't I move the transistors from the switch to the relay pcb after the 10k resistors? Including ground from the switch pcb ...
  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

R.G.

Quote from: KarenColumbo on September 21, 2019, 01:27:40 AM
BUT: In my PCB layout I had to rip apart the switching circuit and the relay circuit itself. The last ground reference is at the transistors' emitters, which are situated on the "switch pcb". The "relay pcb" has no ground, so I give it some via the 4-pole-connector. Which makes my head spin.

Shouldn't I move the transistors from the switch to the relay pcb after the 10k resistors? Including ground from the switch pcb ...
Good! You're thinking about the right things, which is an important milestone for beginners.

Electricity can only flow in complete loops. This is where the use of the English word "circuits" comes from, current flowing in a complete circle. We mostly make our closed loop circuits be a bunch of partial circles which all include passing through one "power supply" link.

In driving a relay with transistors from an IC, there are three loops to worry about. One is the loop from the power supply to the relay coil, through the transistor's collector and emitter, then back to the power supply. This loop contains the high(er) current of the relay coil when the transistor is on, zero current when the transistor is off, and the sudden, sharp edges when the transistor is turning on and off.

A second loop is the power to the IC which drives the transistor. This is generally a quiet, low current loop in CMOS ICs, but it can be noisy in things like the bipolar 555 timer.

The third loop is the loop which contains part of the IC's incoming DC power, through the IC to the output pin, to the transistor base, back from the transistor's emitter to ... what, exactly? It ultimately has to get back to the power supply return to complete its loop, but it comes out of the transistor's emitter, mixed in with the relay coil current. The simplest thing to do is to let it return back to the power supply with the relay coil current by providing a conductor from the transistor emitter directly to the power supply.

The lowest-noise way to wire this (in perfect-world mental concepts) is to have the relay coil power supply and return to the power supply on a single pair of wires, ideally a twisted pair. This does two things for you. One is to make the loop containing the sudden sharp pulses of the relay coil on/off changes have the smallest possible area. The magnetic signal caused by any current loop is proportional to the area of the loop, so making the tiniest possible loop by supplying the relay coil and transistor with a power-in, power-out pair of wires is as quiet as you can make that. (note that at radio frequencies, other issues crop up, but this if for your low-frequency, audio case).

The second thing is does for you is to make sure that the return current from the coil doesn't share a wire with the other circuits. That means that the resistive loss of the wire returning power to the power supply cannot cause a  <click> when you change the current in the coil by causing a "ground shift".  I would take four wires to the relay board: power, ground, and two transistor-base wires. The power and ground signals would return to the power supply. [It's a little difficult to make distinctions in power and ground paths on such tiny circuits, but you'll need to know this stuff in the future, I promise.] It also makes sense to put a "temporary power supply" very near the relay - an electrolytic capacitor which acts like a "bucket of electricity" for the coils when they switch. I would put a 10uF to 100uF electro cap as close to the relay and transistors as I could reasonably get it, ideally on the relay board. Low-profile electros make this easier.

Now, back at the driver IC. That CMOS CD4049 uses vanishing-small microamperes, and it has good noise immunity on its inputs. In (my own, internal) ideal world, it would be right at the relay too. Is there some reason you have two PCBs? Can this all go on the same PCB, right at 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.

KarenColumbo

Quote from: R.G. on September 21, 2019, 12:55:17 PM
Quote from: KarenColumbo on September 21, 2019, 01:27:40 AM
BUT: In my PCB layout I had to rip apart the switching circuit and the relay circuit itself. The last ground reference is at the transistors' emitters, which are situated on the "switch pcb". The "relay pcb" has no ground, so I give it some via the 4-pole-connector. Which makes my head spin.

Shouldn't I move the transistors from the switch to the relay pcb after the 10k resistors? Including ground from the switch pcb ...
Good! You're thinking about the right things, which is an important milestone for beginners.

Electricity can only flow in complete loops. This is where the use of the English word "circuits" comes from, current flowing in a complete circle. We mostly make our closed loop circuits be a bunch of partial circles which all include passing through one "power supply" link.

In driving a relay with transistors from an IC, there are three loops to worry about. One is the loop from the power supply to the relay coil, through the transistor's collector and emitter, then back to the power supply. This loop contains the high(er) current of the relay coil when the transistor is on, zero current when the transistor is off, and the sudden, sharp edges when the transistor is turning on and off.

A second loop is the power to the IC which drives the transistor. This is generally a quiet, low current loop in CMOS ICs, but it can be noisy in things like the bipolar 555 timer.

The third loop is the loop which contains part of the IC's incoming DC power, through the IC to the output pin, to the transistor base, back from the transistor's emitter to ... what, exactly? It ultimately has to get back to the power supply return to complete its loop, but it comes out of the transistor's emitter, mixed in with the relay coil current. The simplest thing to do is to let it return back to the power supply with the relay coil current by providing a conductor from the transistor emitter directly to the power supply.

The lowest-noise way to wire this (in perfect-world mental concepts) is to have the relay coil power supply and return to the power supply on a single pair of wires, ideally a twisted pair. This does two things for you. One is to make the loop containing the sudden sharp pulses of the relay coil on/off changes have the smallest possible area. The magnetic signal caused by any current loop is proportional to the area of the loop, so making the tiniest possible loop by supplying the relay coil and transistor with a power-in, power-out pair of wires is as quiet as you can make that. (note that at radio frequencies, other issues crop up, but this if for your low-frequency, audio case).

The second thing is does for you is to make sure that the return current from the coil doesn't share a wire with the other circuits. That means that the resistive loss of the wire returning power to the power supply cannot cause a  <click> when you change the current in the coil by causing a "ground shift".  I would take four wires to the relay board: power, ground, and two transistor-base wires. The power and ground signals would return to the power supply. [It's a little difficult to make distinctions in power and ground paths on such tiny circuits, but you'll need to know this stuff in the future, I promise.] It also makes sense to put a "temporary power supply" very near the relay - an electrolytic capacitor which acts like a "bucket of electricity" for the coils when they switch. I would put a 10uF to 100uF electro cap as close to the relay and transistors as I could reasonably get it, ideally on the relay board. Low-profile electros make this easier.

Now, back at the driver IC. That CMOS CD4049 uses vanishing-small microamperes, and it has good noise immunity on its inputs. In (my own, internal) ideal world, it would be right at the relay too. Is there some reason you have two PCBs? Can this all go on the same PCB, right at the relay?
Thank you R.G., again, for making this thing visible to an outsider.

In my mind I thought that the transistors kind of function as a "valve" between all the current coming through the relay coil and ground. As long as the "valve" is closed the relay coils are somehow "suspended in mid-air", floating, so to say, the way from V+ to ground is barred. So the circle is open, no current in the coils. The circle closes when the transistor opens its "valve" and lets the current(s) flow to ground, thus activating the coil.

As you kindly asked me: When I really think about this, there is no argument against merging those two boards into one as you suggested. I thought the smaller footprint of TWO boards would let the whole amp seem less cluttered on the inside. Which it won't because I have to connect those boards with a lot of wires. But I also thought that there's probably a lot of current running through the relay (it's a tube amp, after all, and with one of the planned two relay constructions I will switch a complete gain stage in and out), so i wanted to keep this phat amperes and volts away from the intricate CMOS logic.

I will try and Eagle up a board with your suggestions.

(Do you have a book suggestion that explains electronics the visual/metaphoric way? I have quite a collection, but they're straight to the scientific point - I need quite a lot of "Eselsbrücken" (dict.cc says "aide-memoire") to translate all this via my visual imagination.)
  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

KarenColumbo

Well, I came up with a single board.



Ah, forgot: this is the pinout of my relay (https://produktinfo.conrad.com/datenblaetter/625000-649999/629513-da-01-en-MINIATURRELAIS_HFD2_012_S_L2_D.pdf): (It's seen from the solder side, obviously. Strange ...)



I have two questions remaining:

1. As you suggested, I put in a "reservoir" or "bucket" cap – C6 in the PCB layout above – right at the relais. The only position for it I could find, was right at V+ of the coils. Is that correct?

2. Are the connections "set" and "reset" of the relay interchangeable? As far as I see it, they just determine the position at first power-up. Is that so?


  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

chbeer

If you'd only need one of the 2 switches, you could use the other one to switch the coils.

KarenColumbo

  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"