How do I make a button switch off all other outputs upon activation

Thread Starter

Asaidubz

Joined Oct 17, 2024
9
Hi all, new to the forum, I was hoping I could get some advice please.

I'm prototyping a device that controls 4 relays.

I want to have 6 toggle push buttons on a 433mhz remote transmitter, which will set various configurations on which of the 4 relay coils are energised at the same time.

This means I need each toggle push button on my transmitter to turn off all other relays that aren't included in the configuration of the said push button.

For example:

Button 1) de-energise all 4 relay coils.

Button 2) only relay #4 to be energised, all others de-energise.

Button 3) relay #1 & relay #3 to be energised, all other relays to de-energise.

Button 4) relay #3 to be energised, all other relays to de-energise.

Button 5) relay #3 & relay #4 to be energised, all other relays to de-energise.

Button 6) relay #2 to energise, all other relays to de-energise.

These buttons could be pressed in any order at all depending what configuration the end user wants at the time, I want the effects above to take place when the said button above is pressed. If a certain relay coil is already de-energised, and the next push button pressed also requires it to be de-energised, then it should remain de-energised.

Is there a way I can do this without programming arduino or raspberry pi? I've managed to make the device without any of those development boards and I'd rather it remain that way for simplicity.

I know I'm asking a lot and I'm new to the forum so haven't contributed yet, but any help would be greatly appreciated and I'll do whatever I can to help other with my limited knowledge.

Thanks all.
 

LesJones

Joined Jan 8, 2017
4,511
You will need to provide information on the remote relay unit that you are using . The 4 channel units I have seen only have 4 buttons on key fob so the only way thy can work is to toggle a channel on and off from each button . You would need to start with a unit that had an on and an off button for each channel. (A total of 8 buttons) I am assuming that you DO NOT plan to build the whole unit from scratch.

Les.
 

Thread Starter

Asaidubz

Joined Oct 17, 2024
9
Hi guys, Ive made my own module for the relays, I have brought a superheterodyne 433mhs transmitter and reciever set with 4 signal outputs integrated on the PCB, wired to a ULN2003 to convert the signal from D0, D1, D2, D3 to I/O outputs to supply the relay coil circuits, I also have made another prototype using a superhet 433mhz transmitter and reciever with a single data pin, a HT12E&D, CD4017 chips and transistors to switch the outputs, I don't mind which prototype I need to go with to make this work but the one with the ULN2003 is the cheapest to make and smallest in size.

I cant use a standard or premade 4 Channel reciever with inbuilt relays because the relays are usually cheap and have varying contact resistance from unit to unit which doesn't work for the application I need. I also actually have 6 relays in total, but there are 2 pairs of them with coils wired in parallel, and the remaining 2 relays on their own, I just said 4 relays in my original post for simplicity, as the function will be the same if 2 are wired In parallel, but there are essentially jsut 4 relay coil supply circuits. Hence why I can't use a premade module.

I will be making my own housing for the remote and the reciever, and can add any buttons I want or need. I'm willing to make everything separately and then make the pcb a smaller size and pay a company for mass printing, I just need to know how to get this function to work for my needs, then get a friend to design and 3d print the enclosure for the parts.
 

LesJones

Joined Jan 8, 2017
4,511
Looking at the datasheets for the HT12E & D You could have each of the 6 buttons connected one of 6 address lines so that when one is pressed it will give a coresponding pulse on the receive end. At the receive end you could have 4 set/reset latches. The received pulse could be routed to the set or reset pins of each of the 4 latches. You would need a 6 input OR gate on each set and reset inputs of the latches of the latches so that the signal from the 6 outputs of the HT12 could set or reset each of the 4 latches to the required state.

Les.
 

BobTPH

Joined Jun 5, 2013
11,533
So, ignoring the fact that two of the relays are doubled, you have 4 outputs and four sets of relays. The state of the four outputs completely sets the state of the four relay sets. There is no need to tun them off with a separate button. Each button should just send the four bits that fully specify the new configuration. Any that should be off would simply receive a zero.

As said above these bits must be latched. Is there a click signal sent along with the data to indicate that there is a change? You need that to clock the latches.

You may be able to replace the ULN2003 with a chip that can latch the inputs as well as drive the relays. Someone here may know of such a chip. What is the current requirement?

On the transmit side, a diode encoder can set the 4 bits for each button.
 

sghioto

Joined Dec 31, 2017
8,634
receiver set with 4 signal outputs integrated on the PCB, wired to a ULN2003 to convert the signal from D0, D1, D2, D3 to I/O outputs to supply the relay coil circuits,
I see four discrete outputs but there are six button presses with six different configurations. How are button presses 5 and 6 configured on the output of the receiver if trying to use the ULN2003 circuit?
 
Last edited:

BobTPH

Joined Jun 5, 2013
11,533
I see four discrete outputs but there are six button presses with six different configurations. How are button presses 5 and 6 configured on the output of the receiver if trying to use the ULN2003 circuit?
Four outputs gives you one bit to control each of the 4 relays (actually 6 with 2 sets of 2 in parallel.) I suggested using diodes to map the 6 buttons onto the 4 outputs, i.e. each button selects a different 4-bit configuration. I think that is what the TS is asking for.
 

AnalogKid

Joined Aug 1, 2013
12,143
Starting with the output signals from the radio system, what you want is a combination of what is called a "radio-button" circuit followed by a bunch of steering diodes. The radio button circuit does what it sounds like - when any button is pressed, that button's output is latched and all other outputs are deactivated. Following that, each signal goes through a diode for each relay it activates. For example, signal 5 would to through diodes to relay#3 and relay #4.

Radio button circuits are available with a google search, and there are many past threads on this and other forums.

ak
 

Thread Starter

Asaidubz

Joined Oct 17, 2024
9
Four outputs gives you one bit to control each of the 4 relays (actually 6 with 2 sets of 2 in parallel.) I suggested using diodes to map the 6 buttons onto the 4 outputs, i.e. each button selects a different 4-bit configuration. I think that is what the TS is asking for.
Yes correct, this is what I'm asking for, I'll look into it today now that you've given me this basis to go off, it makes sense, thanks for your help! I will let you know how I get on
 

Thread Starter

Asaidubz

Joined Oct 17, 2024
9
Starting with the output signals from the radio system, what you want is a combination of what is called a "radio-button" circuit followed by a bunch of steering diodes. The radio button circuit does what it sounds like - when any button is pressed, that button's output is latched and all other outputs are deactivated. Following that, each signal goes through a diode for each relay it activates. For example, signal 5 would to through diodes to relay#3 and relay #4.

Radio button circuits are available with a google search, and there are many past threads on this and other forums.

ak
Thankyou, I'll look into this today too, I did find a post about radio buttons yesterday but it didn't make much sense, it seems a bit clearer now, thanks for your response! Much aporeciated
 

Erebos05

Joined Sep 14, 2024
4
For example:

Button 1) de-energise all 4 relay coils.

Button 2) only relay #4 to be energised, all others de-energise.

Button 3) relay #1 & relay #3 to be energised, all other relays to de-energise.

Button 4) relay #3 to be energised, all other relays to de-energise.

Button 5) relay #3 & relay #4 to be energised, all other relays to de-energise.

Button 6) relay #2 to energise, all other relays to de-energise.
Unless I've missed something you take four set/reset latches and a few OR-gates. Depending on how many inputs those OR-gates have you will need to nest them. You put those OR-gates in front of the set and reset inputs and just connect the signals from the buttons however you need.
For Button 1 you just connect the signal to each OR gate leading to the reset of all four latches.
For Button 2 you connect the signal to the set gate of the fourth latch and the reset gates of the other three.
I think you get the picture.
This may not be the most elegant solution but it certainly works and is fairly simple. You just have to look into how many ICs you'll need.
 

Thread Starter

Asaidubz

Joined Oct 17, 2024
9
Unless I've missed something you take four set/reset latches and a few OR-gates. Depending on how many inputs those OR-gates have you will need to nest them. You put those OR-gates in front of the set and reset inputs and just connect the signals from the buttons however you need.
For Button 1 you just connect the signal to each OR gate leading to the reset of all four latches.
For Button 2 you connect the signal to the set gate of the fourth latch and the reset gates of the other three.
I think you get the picture.
This may not be the most elegant solution but it certainly works and is fairly simple. You just have to look into how many ICs you'll need.
Thanks dude, I'll certainly look into it with all the options everyone has given me, I'll probably make all of them just for fun and to increase my understanding of everything, I usually work as an industrial electrician doing 230v & 400v with some occasional PLC driven 24v instrumentation and control wiring, so all of this is extremely new to me and I really do appreciate the input everyone has given to this post, I will no doubt have more questions in the near future regarding this post, should I make a new thread or continue on this one if I have more questions? Is there a certain time limit on this post?

Thanks all
 

Thread Starter

Asaidubz

Joined Oct 17, 2024
9
Unless I've missed something you take four set/reset latches and a few OR-gates. Depending on how many inputs those OR-gates have you will need to nest them. You put those OR-gates in front of the set and reset inputs and just connect the signals from the buttons however you need.
For Button 1 you just connect the signal to each OR gate leading to the reset of all four latches.
For Button 2 you connect the signal to the set gate of the fourth latch and the reset gates of the other three.
I think you get the picture.
This may not be the most elegant solution but it certainly works and is fairly simple. You just have to look into how many ICs you'll need.
I don't suppose you could give me and part numbers for the IC's and the set/resets I need so I can study the data sheets? Or tell me the terminology so I could find some similar wiring diagrams to study? I understand if you're busy I know I'm asking a lot but I really appreciate the help
 

Ya’akov

Joined Jan 27, 2019
10,243
Welcome to AAC.

Your HT12E encoder can produce any 4-bit output, so you can easily combine buttons (e.g.: reset is 1 + 4 at the same time) or have a button wired to more than one input. You can use a 4-to-16 mux on the receiver side to get the output as 16 discrete lines.

As far as the logic goes, I would be inclined to use a small MCU with enough pins to handle the four relays (e,g,: ATTinyXX) and rather than the mux, read the 4-bit code from the decoder using it, then set/reset the outputs however you’d like. This adds a great deal of flexibility and potentially reduces parts count.
 

BobTPH

Joined Jun 5, 2013
11,533
You can use a 4-to-16 mux on the receiver side to get the output as 16 discrete lines.
Why? He only needs four and he already has 4. My only question is how these get latched? Does the decoder chip do that or does it supply a strobe or clock signal for an external latch?

I am assuming the transmitter sends a single serial message for each button press. I guess the decoder chip would have to latch them now that I think about it.

Also, TS mentioned “toggle buttons”. I hope he means momentary buttons, toggles would really not make sense as you would not want more than one active at a time.
 

crutschow

Joined Mar 14, 2008
38,529
Below is the LTspice sim of a radio push-button type circuit using an octal flip-flop for up to 8 inputs and ouputs that may be of use:
When a Trig signal is applied, it resets the previous output and latches the selected one high
The outputs can be diode-or'd to relay drivers to activate the desired relays for that Trig input.

1729260031821.png
 

MisterBill2

Joined Jan 23, 2018
27,587
Really, the whole thing is very simple IF you can use a small PLC (Programmable Logic Controller ) and generate the exact functionality in ladder logic. Certainly aPLC will be a bit larger than one of those little processors, but it will be a Program, Plug-in,and Play project with no need to struggle with the hardware after you finally get the logic worked out. And the relays are all industrial class, so they will last a very long time. The least costly PLCs will be from Automation direct, and the programming software is free.
The requested logic functioning listed in post #1 will be very simple in ladder logic.
 
Top