Jump to content

Help me with logic gates


Recommended Posts

Hello, I am trying to make a system but encountered an issue. Please help me solve it

 

TLDR 

Spoiler

Receiver is controlled by either signal A or B. How to prioritize signal A and disable the receiver (when the signal from input A comes in), regardless of signals coming from input B

5b4095a548f22_Image015.thumb.png.50226461042b116a321c107b774b76f0.png

 

Its a simplified representation of my system

1. The water from pump 1 is transfered to sieve. At a regular basis pump 1 is controlled by clock. It is not running all the time.

2. From time to time i want to use hotter water in the sieve. As pump 1 has low temperature, water coming from pump 2 has high priority. So if liquid pipe element sensor detects a water coming from pump 2, then the shut off is closed, preventing water from pump 1.

The liquid bridge is to prevent water from pump 2 entering pipes other than towards the sieve.

3. OR gate controls emergency. If automation calls for emergency water (blue exclamation point) then the OR gate tells pump 1 to overwrite signals from the step 1. and run as long as the emergency signal lasts.

Issue: How to tell the shutoff in the system to turn off (block water going to sieve) when the emergency signal from step 3. is detected, regardless of the signal coming from liquid pipe element sensor?

 

Link to comment
https://forums.kleientertainment.com/forums/topic/93195-help-me-with-logic-gates/
Share on other sites

@Parusoid This isn't exactly an answer to your automation question, but it does address the original problem you were trying to solve with it.

You want your Water Sieve to take hot water first, cold water second. You can use Liquid Bridges to prioritize liquid flows, because a liquid bridge's output on a straight pipe takes a lower priority than water coming through the straight pipe.

pipe-priority.thumb.jpg.42b3fabc4ab7d7d37960b532bd0f92dd.jpgpipe-priority-liquid.thumb.jpg.b9a7a2336953127f485d305ad870a476.jpg

So in short, there's no need for the liquid shutoff and the bridge you have placed in the example will already make sure hot water goes first.

7 minutes ago, Sheo said:

Afaik  active signal always overwrites inactive, so simply connect emergency signal to pump. Set a xor gate between emergency and pipe sensor to shutoff

There may be backlash problem, Gates allow sygnal only one way. If you just use automation wires as improvised OR gate, it works perfectly if you have just two input sygnals, but if you have multiple sygnals and multiple Gates it can, sometimes, break logic of scheme.

 

And XOR gate is not solution - it depends on second sygnal, not override it

Sry forget about my post, got logical thinking errors before sending xD

 

But u could build a another shutoff getting signal from emergeny call, water enters first shuttoff but moves to second if theres no emergency, second one just as u showed connected to pipe sensor

Using Boolean Algebra you can work out an equation. https://en.wikipedia.org/wiki/Boolean_algebra

Element sensor = A

Emergency sensor = B

Output to liquid shutoff = O

Truth Table as desired:

+---+---+---+
| A | B | O |
+---+---+---+
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
+---+---+---+

Since there is only one combination that has a state you want the output active for, it's simply:

O = (NOT A) AND (NOT B)

So a NOT gate for A and a NOT gate for B, fed into an AND gate to the output.

But with De Morgan's laws you can simplify it: https://en.wikipedia.org/wiki/De_Morgan's_laws

O = NOT (A OR B)

So an OR gate with A and B as input, followed by a NOT gate to invert it.

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...