0
\$\begingroup\$

I have an automotive 12V project that has 3 momentary push buttons and they all have to operate individual relays. (3-4A)

The problem is I need only 1 relay to be active at a time while toggling between 3 buttons.

I need the function of button push to disconnect other 2 relays first, so no 2 or 3 voltages cross at any time and then activate its assigned relay. Any ideas?

\$\endgroup\$
  • 3
    \$\begingroup\$ Hi and welcome to Stack Exchange. You should attempt to show what you have done with this project so that you can ask a specific design question. As it stands now, as written, this is in risk of getting closed. \$\endgroup\$ – Michael Karas Feb 14 '19 at 3:24
  • \$\begingroup\$ Are you trying prevent make before break or enforce break before make or not to exceed some mA limit? Or reduce EMI or why? \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 14 '19 at 17:15
  • \$\begingroup\$ There are some creative solutions to a poorly-defined requirement. Is momentary overlap an issue? If so why when a Cap can supply that? Is duplicate button press possible? if so then what? \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 16 '19 at 19:50
2
\$\begingroup\$

You have two very good reasons that you should use a microcontroller board to implement the logic for this.

  1. You have momentary buttons and it takes a latching function to ensure that the corresponding relay for each switch stays on.
  2. The logic to handle the exclusion between your three switches can be very easy to implement in the software of the microcontroller.
  3. The microcontroller easily can adjust the switching dead time between relays.

The switches can very easily be implemented as low voltage directly into the microcontroller where software can then take care of debouncing the switches and implement a simple state machine that accepts the most recent switch press and only drives the singular relay coil that corresponds to that switch.

You will almost certainly require a driver circuit to buffer the microcontroller outputs that go to the relay coils. If you choose to use some off the shelf ready-made microcontroller board (arduino comes to mind) you can also find a ready made relay board that will work with the microcontroller and include the necessary buffer circuit right on the relay board.

The ready-made hardware is a great way to build up a one-off type project or to get a prototype concept proven out. If you are then actually making a production product you can then transcribe the prototype design into circuit boards of your own making to get to the desired product configuration.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Original idea was to use it (and will be using for other features) but the boot up time is not acceptable (have not looked in to power consumption yet but it seems a bad idea to run arduino/raspberry 24/7). So my options are only to redesign to 3 position switch or optimise the boot time and start controller during door unlock. \$\endgroup\$ – kala konto Feb 14 '19 at 3:39
  • 1
    \$\begingroup\$ @kalakonto - You have to be joking about boot up time right? A simple microcontroller board can have current requirements in the few 10's of mA. As far as boot up time the MCU can be ready to go in such a short amount of time that the user has not yet even begun to move a finger toward the first button to press! There is absolutely nothing wrong with having an MCU run 24/7 as long as you comprehend the life of your power source, if that is a battery. and manage it properly. It really sounds like you need to step back some and think outside the box some. \$\endgroup\$ – Michael Karas Feb 14 '19 at 3:49
  • \$\begingroup\$ I had searched for arduino and raspberry boot up times ( 3 seconds is considered really fast), i hope we are not missunderstanding each other. If running these boards 24/7 is possible i am afraid of the fire hasards still (may be irrational, not enough experiance but worryed about my car). I sure have a lot to learn but thats why im asking :) \$\endgroup\$ – kala konto Feb 14 '19 at 12:53
  • 1
    \$\begingroup\$ @kalakonto - Yeah you would not want to use a rPie for this. They run an embedded Linux and they do take some time to boot up. An Arduino in my experience should not have any kind of long boot up time once you have flashed your program into it and disconnected it from the host development PC. Sure it takes time to load the Arduino development suite on the PC but that surely is not needed for the MCU board to run standalone. \$\endgroup\$ – Michael Karas Feb 14 '19 at 13:24
  • \$\begingroup\$ Arduino with no bootloader starts practically instantaneously. Reset goes high, internal oscillator goes thru a few cycles, program starts. An 8-pin part, with power, gnd, 3 input, 3 output, is all you'd need. Code would be simple: if ((digitalRead(input1) == LOW) && (digitalRead(input2) == HIGH) && digitalRead(input3) == HIGH){ digitalWrite (output1), HIGH; } 3 checks: 011, 101, 110. The HIGH output drives a N-channel MOSFET (AOD508 for example) to sink current thru the relay coil. Maybe add a little delay after a good read to energize the coil (for a minimum time?) before change allowed. \$\endgroup\$ – CrossRoads Feb 14 '19 at 15:09
2
\$\begingroup\$

He're a novel solution with no active components.

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Three interlocked relays.

How it works:

  • RLY1 to 3 coils are rated at half supply. So for a 12 V supply, 6 V relays are used. (5 V "Arduino" relays may be easier to come by.)
  • R1 to R3 resistance is equal to the relay coil resistance (or 7/5 times the 5 V coil resistance).
  • When any button is pressed the associated relay is energised and latches via its own contact.
  • Meanwhile, the diodes connected to that button conduct and reduce the voltage drop across the other two relay coils to 0.7 V. This will cause the other two relays to drop out and unlatch.

R1, 2 and 3 will have full voltage across them when one of the other relays is on so they must be rated adequately for power dissipation.


Response to AaronD's comments:

Of course, this requires a relay with multiple contacts. The other contact(s), not shown here, power the load.

Nope. The loads can be powered from the button / contacts.

schematic

simulate this circuit

Figure 2. Loads can be connected as shown.

... and it only works with DC control logic; the diodes don't work the same say with AC).

The OP specified "automotive" so this will cover most vehicles.

The contacts shown here never see more than a diode drop across them, regardless of the power supply (unless it's just powered on and you haven't pushed a button yet) so they're not suitable at all to control a load directly.

I don't understand this comment.

That said, I'm not convinced that a second button press will actually do anything, as it's only shorting a forward-biased diode. Is that enough to grossly change the current balance and make the circuit switch?

If RLY1 is energised then pressing B2 will forward bias D3 shorting out RLY1's coil, causing it to drop out and remove the 12 V power from R2. RLY2 will now have 6 V across it and will pick.


It's tough in here!

@AnalogKid: Nothing in the circuit guarantees no cross-conduction. As above, relays open more slowly than they close, so the possibility of two relays being momentarily closed at the same time is very real.

@AaronD: I'm tracing from a closed B1/RLY1, through D1, and back through RLY2's de-energized coil. Thus, the node below B2/RLY2 sees V+ minus D1's drop. Drawing current from that node risks turning RLY2 on when it's not supposed to.

schematic

simulate this circuit

Figure 3. In a desperate attempt to salvage his answer, @Transistor adds D7 to 9.

Adding in D7 to 9 resolves both of these problems, I think. The buttons can't power the loads directly and the energised relay must drop out before the next one can pick. The back-feed problem is solved.

Have I missed anything else?

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Of course, this requires a relay with multiple contacts. The other contact(s), not shown here, power the load. This stuff here is only for control, so it can be made small and low-power. (and it only works with DC control logic; the diodes don't work the same say with AC) The contacts shown here never see more than a diode drop across them, regardless of the power supply (unless it's just powered on and you haven't pushed a button yet) so they're not suitable at all to control a load directly. \$\endgroup\$ – AaronD Feb 14 '19 at 19:26
  • \$\begingroup\$ That said, I'm not convinced that a second button press will actually do anything, as it's only shorting a forward-biased diode. Is that enough to grossly change the current balance and make the circuit switch? \$\endgroup\$ – AaronD Feb 14 '19 at 19:30
  • \$\begingroup\$ See my response in the answer. \$\endgroup\$ – Transistor Feb 14 '19 at 19:44
  • \$\begingroup\$ Nothing in the circuit guarantees no cross-conduction. As above, relays open more slowly than they close, so the possibility of two relays being momentarily closed at the same time is very real. \$\endgroup\$ – AnalogKid Feb 14 '19 at 19:46
  • 1
    \$\begingroup\$ @nekomatic: He's changed the circuit since I said that. D8 used to be between RLY2 and D3, and likewise for the other two channels. Now I think it'll work, but I'd have to see it, either physically or in simulation, to be completely sure. \$\endgroup\$ – AaronD Feb 18 '19 at 22:04
1
\$\begingroup\$

Because relays, especialy DC relays with a simple diode across the coil for spike suppression, take longer to release than to pull in, driving them with nothing more than clocked latches probably will cause cross-conduction paths.

An alternative is to have three debounced switches connected to the latches such that the press transitions are OR-ed together to reset all three latches, and the release transition sets one of them individually. For example, if the flipflops have a positive-going edge-triggered clock input and a negative-true reset input, the parts count will be minimal.

The switch press debounce time period will be longer than the relay release time, guaranteeing no cross-over.

Here are two Tyco app notes on coil suppression and relay release time.

Relay Release Times

Relay Reliability

EDIT: Here is a first-pass schematic, adapted from a previous design. The positive-true reset required an inverter.

enter image description here

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Discharging 10uF capacitors through the switches could eventually degrade the switch contacts. \$\endgroup\$ – Michael Karas Feb 15 '19 at 11:42
  • \$\begingroup\$ Thought about going into that level of detail; depends on the switch. Never been a problem in my past. Note - "first-pass". \$\endgroup\$ – AnalogKid Feb 15 '19 at 12:10
  • \$\begingroup\$ On the other hand if not gold plated, 10uF will continually "wet" the contacts which is an excellent solution for cheap switches. +1) for the 10ms master Reset and delayed set on release in 50ms. possible could be reduced to 1ms and 5ms for button switches with smaller caps. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 17 '19 at 19:40
  • \$\begingroup\$ @MichaelKaras I had a similar problem with P&B 30A relays that had non-gold plated 1A sense contacts for a remote SCADA system I designed in the late 70's with 96 power relays in a box. It sounded like a gattling gun that stuck and misfired when I ran a sequential drive>sense OK, >next relay>repeat... test until I added 22uF solid Tantalums across the 10k pull-up R for TTL sensing. Wetting current needs to be 10% of rated current but perhaps 5% switched Joule rated is a better figure of merit. to break thru the oxide. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 17 '19 at 19:54
1
\$\begingroup\$

Design using logic gates with the switches.

enter image description here

Logic gates drawn so they show the correct circuit behavior. So these symbols are correct being the Demorgan equivalent to the NAND gate symbols that you will find in the data sheet. The gates all fit within two packages because the 74HC00 has four gates in the package and the 74HC10 has three gates in the package.

Not shown here is the spare 2-input NAND gate that should have its two inputs tied to GND unless it is put to use someplace else in the system. Also not shown are the power supply pins for the gate packages. These would be the Vlogic and GND.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ This looks like how I imagined the state-controlled XOR output but one can always defect this by accidentally pressing 2 buttons at the same time then an edge & State sensitive design is needed to determine who came ON first and OFF last, along with switch debounce. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 16 '19 at 19:44
  • \$\begingroup\$ @SunnyskyguyEE75 - The things you mention are exactly the reason that the MCU based solution is so much better. Debouce, exclusion, multi-press, relay cycle dead time and rate throttling are all easily addressed in that type of implementation without adding heaps if extra components components to cover all the edge cases. \$\endgroup\$ – Michael Karas Feb 16 '19 at 20:23
  • \$\begingroup\$ Of course then add EMI suppression, filters, shielding. But the USE case definitions or input specs are incomplete. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 16 '19 at 20:25
  • \$\begingroup\$ There is nothing in this circuit to guarantee that two sets of relay contacts never are closed at the same time. In fact, at the gate-delay level, the currently-closed contacts always will open after the newly-closing contacts close, causing cross-conduction in the output circuits (whatever they are). \$\endgroup\$ – AnalogKid Feb 17 '19 at 22:40
  • \$\begingroup\$ @AnalogKid - I agree that there is not mutual exclusion of the relays provided by this circuit. As I said above to Sunny the MCU solution that I originally proposed is the best way to achieve that rather than trying to bandaid up a circuit like that above. \$\endgroup\$ – Michael Karas Feb 18 '19 at 2:35
0
\$\begingroup\$

This can easily be solved with 3 latches where all 3 are Reset by any of the switches by Cap discharge with bias R to opposite rail, then the trailing edge of the button press = release to clock in a 1 to edge set.

Alternative is to use any switch into OR’d to master reset and SET individual Relay after RC delay.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I need to rechearch to understand this fully but that seemes like the solition i was thinking of. Thank you and i will let you know when i figured it out \$\endgroup\$ – kala konto Feb 14 '19 at 12:56
  • \$\begingroup\$ Actually this could be done without any R/C delays. You would just need a package of 74HC00 2-input nand gates and a package of 74HC10 3-input nand gates. Use these gates to make three sets of cross-coupled nand gate latches. Each latch is constructed from a 2-input gate and a 3-input gate such that it has one set input and two reset inputs. The output of the 2-input nand gates can go to resistors and the NPN transistors to drive the relay coils. Each of the three switches is setup to connect to GND when pressed and has a pullup resistor. (continued) \$\endgroup\$ – Michael Karas Feb 14 '19 at 13:17
  • \$\begingroup\$ (continued from above) Each switch also hooks to the set input on one latch and to the reset inputs on the other two latches. Pressing any one switch activates its corresponding relay and deactivates the other two relays. \$\endgroup\$ – Michael Karas Feb 14 '19 at 13:19
  • \$\begingroup\$ I agree By sharing 2 Resets/switch x 3 switches , shorts out all three Resets , and thus 3 switches must be Isolated Resets 3 input OR or 3 input NAND \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 14 '19 at 13:24
  • \$\begingroup\$ Not according to the diagram I made here. I wonder just what you are thinking about. \$\endgroup\$ – Michael Karas Feb 14 '19 at 13:26
0
\$\begingroup\$

MicroController design, pretty basic.

schematic

simulate this circuit – Schematic created using CircuitLab

Regarding poor fuzzy images with low resolution and high compression above using 0.13 Megpix PNG = 17 kB disk storage

Below is screen copy 1 Megpix > colour reduced from 24 bit to 1 bit then back to 24 bit since SE does not support that image format, but with max compression (9) on PNG is only 10kB or 41% reduction. enter image description here This could be copied to EE.Meta site for further discussion.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Why do the schematics here always look kind of fuzzy? \$\endgroup\$ – CrossRoads Feb 14 '19 at 15:38
  • \$\begingroup\$ They should not @CrossRoads but jpg is lossy so fine print gets lossy and a bit fuzzy after anti-aliasing pixel scaling which also acts as a LP filter to sharp font \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 14 '19 at 16:31
  • \$\begingroup\$ It should’ve be fuzzy and certainly isn’t limited by retina resolution smart screens, but it is a site imperfection on image quality that could easily be improved without increasing site memory for the image \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 14 '19 at 16:39
  • \$\begingroup\$ rather it shouldn't be fuzzy and my trick is to increase pixel size then compress more in .png or jpg instead of default compression ratio \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 17 '19 at 19:57
0
\$\begingroup\$

This is an alternate version of my previous schematic. It turns out that there is no need for three debouncing capacitors. C1 now debounces all three switches.

Note - I'm posting this as a separate answer so the previous schematic remains available.

enter image description here

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.