syn

Best way to control relays?
« on: August 29, 2017, 02:01:36 PM »
Hi
        what would be the best way to control relays?
Simple operation: I need  6 momentary switches connected to 6 relays,  only one relay must be energized at the same time.
When any of the momentary switches engaged   ,  it  energize the relay that is connected to it but switches off all others.
Hope I'm clear  ;).
How would you do it?

Thank you


ruffrecords

Re: Best way to control relays?
« Reply #1 on: August 29, 2017, 02:16:11 PM »
Small micro job. An Arduino would do it. No need to buy any development kit; it is all free and can be programmed via USB.

Cheers

Ian

gyraf

Re: Best way to control relays?
« Reply #2 on: August 29, 2017, 03:11:41 PM »
In the old days, we'd usually use a tv channel selector ic for this... But now, yes, just one of the tiny-small arduinos..

Jakob E.
..note to self: don't let Harman run your company..

syn

Re: Best way to control relays?
« Reply #3 on: August 29, 2017, 03:14:50 PM »
Thank you Ian and Gyraf,  any links that you have at hand?
I'll Google but all shortcuts are welcome ;D.
« Last Edit: August 29, 2017, 03:42:15 PM by syn »

benb

Re: Best way to control relays?
« Reply #4 on: August 29, 2017, 05:21:45 PM »
There's this - order a Uno (or buy one locally if there's someplace near you that sells it, or get a compatible one off eBay) and download the software:

https://www.arduino.cc/

A no-code idea is to use six flip flops (that's about three chips, various logic families have two flipflops in a single package) wired with diodes to pressing a button sets its corresponding flipflop and clears the other five.

Either way, you'll surely need a transistor driver between the logic or Arduino output and the relay coil.

Andy Peters

Re: Best way to control relays?
« Reply #5 on: August 29, 2017, 07:34:06 PM »
Either way, you'll surely need a transistor driver between the logic or Arduino output and the relay coil.

Relay "shields" for Arduino are available at Sparkfun, Adafruit and wherever. I've seen shields with four relays, he needs six and I do not know if they can be stacked.
"On the Internet, nobody can hear you mix a band"

ruairioflaherty

Re: Best way to control relays?
« Reply #6 on: August 29, 2017, 08:26:01 PM »
Maxim make relay driver chips that will take SPI from an Arduino, they even have the protection diodes built in. 

https://www.maximintegrated.com/en/products/analog/analog-switches-multiplexers/MAX4820.html

A friend used it in a design and it works very well.

sahib

Re: Best way to control relays?
« Reply #7 on: August 30, 2017, 06:23:30 AM »

A no-code idea is to use six flip flops (that's about three chips, various logic families have two flipflops in a single package) wired with diodes to pressing a button sets its corresponding flipflop and clears the other five.

Either way, you'll surely need a transistor driver between the logic or Arduino output and the relay coil.

A hex D flip flop, 6 transistors, 6 steering diodes, 14-15 resistors, a few capacitors.

Matador

Re: Best way to control relays?
« Reply #8 on: August 30, 2017, 01:14:26 PM »
If you need a small space and are willing to write some C code, a 16 pin PIC could do this easily for about $1.50 plus a small transistor array.  Some details here.

JohnRoberts

Re: Best way to control relays?
« Reply #9 on: August 30, 2017, 04:52:05 PM »
Hi
        what would be the best way to control relays?
Simple operation: I need  6 momentary switches connected to 6 relays,  only one relay must be energized at the same time.
When any of the momentary switches engaged   ,  it  energize the relay that is connected to it but switches off all others.
Hope I'm clear  ;).
How would you do it?

Thank you
Today the obvious answer is a small microprocessor.

The family I like has internal pull ups so can directly sense switch closures from  six simple SPST switches to ground.

The six input lines can trigger an internal interrupt to clear all set relays, before latching the new one.

Typical cheap processors are low power and low voltage so you will probably need one base resistor and one bipolar transistor per relay  to drive the relay low side (perhaps some diodes and caps to mitigate spikes). 

There are serial to parallel ICs for driving LEDs that might supply enough current for higher voltage relays but unclear if one driver IC is cheaper than 6 bipolar transistors... (if the labor to hand insert them counts maybe).

This is about as cheap and easy as possible to do that  (and programming micros is useful skill for future employment).

JR
John Roberts
http://circularscience.com
Tune it, or don't play it...


Re: Best way to control relays?
« Reply #10 on: August 30, 2017, 06:04:12 PM »
I use L9823 which already has the protection diodes and is designed to handle inductive loads like relays. Look it up on Mouser. Each chip can handle 8 relays and can be daisy chained. A professional solution would use a tiny PIC to drive the chip but for DIY an Arduino or similar is going to be vastly easier because it's got everything you need and more on one little board with a USB connection and an IDE for compiling and downloading a "sketch" into the chip. So you could make a PCB with the footprint for an Arduino, an L9823 and some tactile buttons on the back or edge for direct panel mounting and you're 90% of the way there. The code is probably the hardest aspect for a newbie. I'm a coder by trade, I've written drivers for things and I still use the Arduino. Some folks might think an Arduino is a toy that kids use in school to make robots but the Atmel chips are legit, fully functional and powerful. My last project used a bunch of relays, LEDs (used MAX7221 for that), tactile buttons and analog inputs and it's rock solid. And I actually use it.

Re: Best way to control relays?
« Reply #11 on: August 30, 2017, 07:59:14 PM »
Today the obvious answer is a small microprocessor.

And yesterday, the obvious answer would be a rack of mechanically interlocked push buttons.  ;D

Ya can't get any simpler than push a button, and the one already latched in, pops out. For modest current draws, no relays needed.

Do they still make these?

Gene

ruffrecords

Re: Best way to control relays?
« Reply #12 on: August 31, 2017, 03:51:06 AM »
And yesterday, the obvious answer would be a rack of mechanically interlocked push buttons.  ;D

Ya can't get any simpler than push a button, and the one already latched in, pops out. For modest current draws, no relays needed.

Do they still make these?

Gene

I am not sure if they still make them. You can still buy them but they may be NOS. We used them all the time at Neve back in the 70s but today even the new BCM 10/2 has horrible square things instead which are probably microprocessor operated.

Cheers

Ian

moamps

Re: Best way to control relays?
« Reply #13 on: August 31, 2017, 08:51:05 AM »
A hex D flip flop, 6 transistors, 6 steering diodes, 14-15 resistors, a few capacitors.

https://groupdiy.com/index.php?topic=13226.msg152490#msg152490

JohnRoberts

Re: Best way to control relays?
« Reply #14 on: August 31, 2017, 10:14:57 AM »
And yesterday, the obvious answer would be a rack of mechanically interlocked push buttons.  ;D
and yesterday (actually 1970's) I used a 4 position interlocked switch in a product.  But today is today and I'd use a micro.
Quote
Ya can't get any simpler than push a button, and the one already latched in, pops out. For modest current draws, no relays needed.

Do they still make these?

Gene
Did you get much rain...?

JR
John Roberts
http://circularscience.com
Tune it, or don't play it...

Re: Best way to control relays?
« Reply #15 on: September 01, 2017, 05:44:54 PM »
And yesterday, the obvious answer would be a rack of mechanically interlocked push buttons.  ;D

Ya can't get any simpler than push a button, and the one already latched in, pops out. For modest current draws, no relays needed.

Do they still make these?

Gene

If you don't mind a little bit of bounce, have a look at the following on Ebay

http://www.ebay.co.uk/itm/BANK-OF-14-INTERLOCKING-LATCHING-PUSH-BUTTON-SWITCHES-/320527187824?epid=628168965&hash=item4aa0e8bf70:m:mrD43-j-Xz5Ap3_LDNhpb8g

You can probably chop the mechanism down to suit.

$10,  no major power supply, drive the relays direct and strap diodes across the coils, and no coding. 

Re: Best way to control relays?
« Reply #16 on: September 02, 2017, 01:50:18 AM »
Did you get much rain...?
Not compared to all those poor unfortunate souls closer to the coast. Outermost rain band only, a measly six inches of rain here, and winds strong enough to blow over my barbecue grill. The goats out back were displeased.

The worst secondary effect of it came suddenly, yesterday afternoon (thursday), thanks to the media over-reporting that most Houston oil refineries are shutting down (temporarily). It is 1973 all over again around here. Gas stations out of gas, lines around the block of those that still have some, fistfights between customers cutting in line....  Bunch o' gasholes.

The shortage is complete nonsense, almost as if the media all got together and colluded in some giant sociology experiment on the public. And it worked. The ebb and flow of the fuel supply from the local depot to the stations, is not geared for everybody topping off at the same time, so stations ran out. The media sensationalizes these long lines, adding positive feedback to the situation, making it worse.

It is hysterical how adding hysteresis drives people to an historic level of hysterics. [/topic swerve]

@ madswitcher:

Do we even know if the relays are necessary in this design, whatever it is? Your link shows each switch being DPDT, this should cover most possibilities.

Nice to know that these are still available, for nostalgic reasons, thanks. I tried searching Mouser, but it was a rabbit hole.

@ ruffrecords

What was their function on a Neve console?

Gene

ruffrecords

Re: Best way to control relays?
« Reply #17 on: September 02, 2017, 03:42:42 AM »
...  Bunch o' gasholes.

Brilliant word play!

Quote

@ ruffrecords

What was their function on a Neve console?

Gene

They were mostly used for source selection in monitor sections like on the Kelso which has sveral rows of them:

http://www.proaudioeurope.com/info/wp-content/uploads/2015/06/Neve-Kelso.jpg

and better still in close up:

http://soniccircus.com/neve-kelso-mixer-alt3.jpg

Cheers

Ian
« Last Edit: September 02, 2017, 04:00:11 AM by ruffrecords »

JohnRoberts

Re: Best way to control relays?
« Reply #18 on: September 02, 2017, 10:23:27 AM »
Not compared to all those poor unfortunate souls closer to the coast. Outermost rain band only, a measly six inches of rain here, and winds strong enough to blow over my barbecue grill. The goats out back were displeased.

The worst secondary effect of it came suddenly, yesterday afternoon (thursday), thanks to the media over-reporting that most Houston oil refineries are shutting down (temporarily). It is 1973 all over again around here. Gas stations out of gas, lines around the block of those that still have some, fistfights between customers cutting in line....  Bunch o' gasholes.
ah the good old days
Quote
The shortage is complete nonsense, almost as if the media all got together and colluded in some giant sociology experiment on the public. And it worked. The ebb and flow of the fuel supply from the local depot to the stations, is not geared for everybody topping off at the same time, so stations ran out. The media sensationalizes these long lines, adding positive feedback to the situation, making it worse.
the main pipeline shipping refined product east was shut down briefly but gas demand usually sags after the summer driving season.  They will have to dredge out the main  shipping channel before big ships can come and go.  Refined product will be elevated price for a while but no serious problems AFAIK.
Quote
It is hysterical how adding hysteresis drives people to an historic level of hysterics. [/topic swerve]
at least it keeps them from standing still...  I find it remarkable how few people have died (so far). A lot more people bought it from Katrina.

Glad to hear you are OK, but I expected as much.

JR
Quote
@ madswitcher:

Do we even know if the relays are necessary in this design, whatever it is? Your link shows each switch being DPDT, this should cover most possibilities.

Nice to know that these are still available, for nostalgic reasons, thanks. I tried searching Mouser, but it was a rabbit hole.

@ ruffrecords

What was their function on a Neve console?

Gene
John Roberts
http://circularscience.com
Tune it, or don't play it...

buildafriend

Re: Best way to control relays?
« Reply #19 on: September 22, 2017, 02:18:21 PM »
make sure you use the flyback diode or you won't like what happens.

You need to chose latching or non latching relays.

Some relay coils have a polarity.. don't miss that part!

send relay coil grounds back to the power supply on their own ground, don't share it with audio ground.

you can use a mechanical switch right to the relay OR you can control it from a micro controller by assigning the pinouts and by using conditional statements. You can also use FET or BJT switches but I would only use those for controls from a control voltage. Languages like C, Python, or Verilog work. You can also program with logic symbols from within certain FPGA programming programs. You need to use debouncers in the code though because real mechanical switches actually bounce when switched. You won't need a very serious chip for this unless you're controlling a lot of relays. Check out some TI or Xilinx chips.  Get the conditional statements going.

hope that helps.
« Last Edit: September 22, 2017, 02:26:15 PM by buildafriend »