Maker Pro
Maker Pro

Relay Priority

Galesh

Oct 10, 2023
3
Joined
Oct 10, 2023
Messages
3
Hi, Can somebody help me with a simple logic?
i have 3 12v relays NO and i need to create a logic board or prioritize a triggering.
Condition are this
  • If relay 1 is triggered by the lowest intensity it releases an output, then relay 2 and 3 can be triggered too and release an output.
  • If relay 2 is triggered by the mid intensity it releases an output, then relay 1 cannot release an output even the relay is triggered, then relay 3 can be trigger too and release an out put.
  • If relay 3 is triggered by the highest intensity it releases an output, then relay 1 and 2 cannot release an output even if it is triggered by low intensity.
the out will be a lights and recorded messages. thanks for the help.:)
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,632
Joined
Nov 17, 2011
Messages
13,632
If relay 1 is triggered by the lowest intensity
Intensity of what?
it releases an output
What do you mean by that? A relay doesn't "release an output", it opens or closes a contact.

Please describe in more detail what you want to do:
- input signal(s)
- output signal(s)
- timing requirements (if any)
 

crutschow

May 7, 2021
833
Joined
May 7, 2021
Messages
833
Will the relays always be energized in sequence (i.e. If U2 is on then so is U1, and if U3 is on, the so are U1 and U2)?
If so, the relay connections below should work:
1696917081068.png
 
Last edited:

Galesh

Oct 10, 2023
3
Joined
Oct 10, 2023
Messages
3
Intensity of what?

What do you mean by that? A relay doesn't "release an output", it opens or closes a contact.

Please describe in more detail what you want to do:
- input signal(s)
- output signal(s)
- timing requirements (if any)
input signal will come from a accelerometer so im using 3 relays to control the output of the alarms such like a voice alarm stating the intensity of an earthquake and light signals.

from accelerometer to relay module.
from the relay module to a logic gates circuit board.

now my problem is how can control the relays using logic gates and from logic gates connected to a microcontroller for the output.

please see the attached file.
 

Attachments

  • SEQUENCE OF LOGIC.pdf
    97.8 KB · Views: 3

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,632
Joined
Nov 17, 2011
Messages
13,632
input signal will come from a accelerometer
Which accelerometer?

1696921404028.png
I don't understand the need for the relays. An accelerometer typically will deliver an analog or a digital output proportional to the measured acceleration. This signal is usually not suitable to drive relays. Since you already plan to use a microcontroller, the simplest way is to use the microcontroller to measure the output from the accelerometer, then decide in software which sound to play.
 

Galesh

Oct 10, 2023
3
Joined
Oct 10, 2023
Messages
3
the relay is for interconnection to other system but the assignment is this
to get the output intensity im going to use the relays.
example :
the relays are 12v
first relay is set to trigger on intensity 3
second relay is set to trigger on intensity 5
third relay is set to trigger on intensity 6

now using those contacts from a relay i must ensured that the alarm from the relay is not simultaneously.

here's the thing about earthquakes the force or the intensity receive by accelerometer is not going to be a flat outcome.
first the the accelerometer will receive low intensity then as earthquake goes it will receive a much higher intensity until it reach its peak movement. so if the first intensity receive by the building is intensity 3 then after a couple of seconds it receive a intensity 5 then afterwards intensity 6 all the relays will be triggered right?. now my theory is to use or make a logic gates circuit board connected to a microcontroller to control the out put. because i dont know how to connect a 12v relay to a micro controller directly. and a condition of alarm like this.

  • If relay 1 is triggered by the lowest intensity give a signal to the micro controller to release an output to a speaker and lights. then relay 2 and 3 can be triggered too for a higher intensity and release a signal to a microcontroller.

  • If relay 2 is triggered by the mid intensity give a signal to the micro controller to release an output to a speaker and lights, then relay 1 cannot give a signal to the microcontroller even if it is triggered by low intensity, then relay 3 can be trigger too for a higher intensity and release a signal to a microcontroller.

  • If relay 3 is triggered by the highest intensity give a signal to the micro controller to release an output to a speaker and lights, then relay 1 and 2 cannot give the signal to the microcontroller even if it is triggered.
for a simple explanation there will be a low priority , mid priority and high priority alarm using 3 12v relays.

My question are
1. Is there any electronic device you can offer that i can use for the prioritization of relays?
2. can i directly connect the 3 12v relay to a arduino uno r3 so then i can program an output of recorded messages?
3. or should i create a logic gates circuit board using IC then connected to a Arduino Uno R3 microcontroller?

Or do you have any suggestion?

Your help is very well appreciated man! Thank you!
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,632
Joined
Nov 17, 2011
Messages
13,632
1. Is there any electronic device you can offer that i can use for the prioritization of relays?
You can't connect the relays directly to the accelerometer. You need to evaluate the output from the accelerometer to determine which intensity is present. This is best done by the microcontroller you have anyway.
In my opinion your approach is completely wrong. Why do you insist on using relays? Is there anything in the problem statement that you haven't mentioned? Or am I missing something?
can i directly connect the 3 12v relay to a arduino uno r3
No. The arduino has 5 V compatibel inputs and outputs. As stated above, relays on the input side are useless. To drive a relay on the output side you'd have to use a driver (module). But you don't need the relays at all when you connect the accelerometer directly to the arduino. Here is an example how to read an accelerometer by an arduino.
or should i create a logic gates circuit board using IC then connected to a Arduino Uno R3 microcontroller?
Follow the path mentioned above and you don't need an extra circuit board.
 

danadak

Feb 19, 2021
717
Joined
Feb 19, 2021
Messages
717
Something like this ?

1696941766700.png

mBlock takes the block construction (3'rd window over) and converts it to Arduino code, right hand window.
A graphical way of programming. You drag from 2'ond window/column functional blocks and connect/config
them in 3'rd window. Then hit upload and it uses Arduino programmer to program board/part.

So above initializes some variables, sets user choice for intensity cases, then runs a continuous loop.
First looks for all intensities small, no activity, and keeps all alarms off if no activity. Then looks at each
case to see if any tripped.

I would add delay to control time alarm is on to get a minimum alarm time, easy to do. Above is the basic program
you can modify at will. Also attached.

Interface from micro to relay should look like :

1696940591178.png


Regards, Dana.
 

Attachments

  • Accelerometers State Machine.zip
    55.5 KB · Views: 1
Last edited:

danadak

Feb 19, 2021
717
Joined
Feb 19, 2021
Messages
717
I added the min alarm on time to the code, and cleaned it up a little using
subroutines.

1697020617489.png


Regards, Dana.
 

Attachments

  • Accelerometers State Machine 2.zip
    56.1 KB · Views: 0
Last edited:

roughshawd

Jul 13, 2020
458
Joined
Jul 13, 2020
Messages
458
Will the relays always be energized in sequence (i.e. If U2 is on then so is U1, and if U3 is on, the so are U1 and U2)?
If so, the relay connections below should work:
View attachment 60977
Most relays only fire once. They trigger one switch that is open without power. When the relay is closed, the power supply that keeps it closed is usually part of a feedback circuit that doesn't lose continuity unless it is manually disconnected, that is to say, when the relay is powered, it stays on until disconnect. The circuit requires a secondary circuit to release the power. So your idea is right, but the application is wrong, you generally don't use relays to power other relays, because it takes power to trigger them, and usually power in the switched poles. So your diagram shows 3 dpdt one time switches, that triggers the relays consecutively... You will need two sources of power, one for the relay triggers, and then your circuit.
Providence has a way of making simple electronics really complicated! I tried this idea, and the relay driver ran out of power before the third relay fired.... One and two worked good. The third relay was too much load I think. Think like an oscillator. Where + device - makes a negative source on the relay. Relays don't think they just trigger stuff.
 
Top