Best way to control relays?

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

syn

Well-known member
Joined
Oct 11, 2005
Messages
653
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
 
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
 
Thank you Ian and Gyraf,  any links that you have at hand?
I'll Google but all shortcuts are welcome ;D.
 
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.
 
benb said:
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.
 
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.
 
benb said:
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.
 
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.
 
syn said:
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
 
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.
 
JohnRoberts said:
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
 
Gene Pink said:
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
 
Gene Pink said:
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.
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
 
Gene Pink said:
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. 
 
JohnRoberts said:
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
 
Gene Pink said:
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
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.
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
@ 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
 
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.
 

Latest posts

Back
Top