0

I want to make multiple AND gate input device. I have 4 locks (3 wires each; common, lock and unlock state) I want to monitor those states from locks and connect them to inputs (IC inputs) so when I have all 4 locks in the same state (all lock state or all unlock state).

This is what AND gate is for, to have one active output if all 4 conditions are same. Basically I need two IC, (AND groups) one for LOCK, and another group for UNLOCK. I want to make it as simple as possible. If anybody can suggest how to connect it, drawing, power supply is 12V and I output needs to control small 12V relay. What IC is the best for this?

Thanks in advance!


Table 1. Truth table for relay logic. OP to edit.

A  B  C  D  | RLY1  RLY2
------------+------------
0  0  0  0  |   1     0
0  0  0  1  |   0     0
0  0  1  0  |   0     0
0  0  1  1  |   0     0
...
1  1  1  0  |   0     0
1  1  1  1  |   0     1
Transistor
  • 168,990
  • 12
  • 186
  • 385
Inteli
  • 13
  • 6
  • A relay! =-D... – Tyler Apr 09 '19 at 00:01
  • The AND gate is only "for" saying that all its inputs are high -- not that they are all high or all low, and certainly not that they are all equal. You may want to make that part of your question into -- a question. – TimWescott Apr 09 '19 at 00:07
  • Tyler:I know about relay but I can not use it, complicated I need to use same output later for lock and unlock state – Inteli Apr 09 '19 at 00:10
  • TimWescott: thanks, I will add that I need two IC, AND group for LOCK, and another group for UNLOCK. – Inteli Apr 09 '19 at 00:12
  • Is there any time when Lock=Unlocked={12V or 0V} from one source? Where is datasheet? – Tony Stewart EE75 Apr 09 '19 at 02:51
  • @Inteli: I've added a truth table for you to edit. We can't figure out whether you have one relay or two. Please clarify. – Transistor Apr 13 '19 at 18:39
  • Table is correct. 2 relays: first row 1 on RLY1 and last row 1 on RLY2. everything in the middle both relays 0. – Inteli Apr 14 '19 at 23:11

6 Answers6

2

Once you get the logic worked out, if you implement it using CD4xxx chips, they should work at 12V. Then you can drive the gate of a MOSFET to drive your relay.

TimWescott
  • 44,867
  • 1
  • 41
  • 104
1

Reading between all the lines, I'm gathering you have four SPDT switches, which may either be in the LOCK or UNLOCK position. So the following circuit may be appropriate and relatively simple and very cheap. So how about using no ICs? Instead, just four BJTs and four resistors and two diodes.

I've chosen to use the Omron PCB G2RL Relay as a proxy for your \$12\:\text{V}\$ relay. It has a coil resistance of about \$360\:\Omega\$ and a coil inductance (based upon the datasheet switch timing I read) of \$1.8\:\text{H}\$. Most relays are designed to engage at 70% of their specified voltage, so the small \$V_\text{CE}\$ drops of the saturated BJTs should not be a problem. Of course, your relays can be something different. If enough different, the following circuit will need to be modified. But you'll have to pick a relay, first.

schematic

simulate this circuit – Schematic created using CircuitLab

I had not tested the design through simulation before writing it out. But just to be sure it works, I did plug it into LTspice and used a 4-bit Gray code for activating the switch changes to provide coverage for all 16 permutations. (Using Gray coded switching helps avoid having to deal with "glitch" events during simulation.)

Here's the circuit I used for simulation (the two coils have a parasitic resistance equal to the relays mentioned above -- evidenced by the peak currents indicated.)

enter image description here

Here's the resulting information (including the state of each switch and relay):

enter image description here

A paltry bit of basic imagination, if I understood you well enough. I may have missed your meaning, though.

jonk
  • 77,059
  • 6
  • 73
  • 185
0

you can build a consensus detector like this:

schematic

simulate this circuit – Schematic created using CircuitLab

  • Thanks for answer, this seems to be the easiest way, most economy way. Do You know what is the output voltage and current on AND1, AND4? – Inteli Apr 11 '19 at 23:43
  • Thx Jasen, this circuit is the closest what I had in mind. I just needed somebody to put it all together from input to relays in the end. Somebody who is sure, or test similar thing before, that it will work when I solder it all together. – Inteli Apr 14 '19 at 14:24
0

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Two relays are used to provide ALL UP or ALL DOWN indication. With switches in the position shown the ALL UP relay will be energised.

The diodes prevent backfeeds.

There are a couple of points to watch:

  1. The diodes will cause about 2.1 V drop so your relays need to be able to energise on reduced voltage - 10 V or so.
  2. When not all switches are aligned the relays will have 6 V each across them. They therefore need to be able to drop out at 6 V otherwise the last one energised will remain on.

schematic

simulate this circuit

Figure 2. Modified circuit for 5 V relays. With switches in the positions show the ALL DOWN relay will be energised.

Adding the Zener diodes of Figure 2 and using popular 5 V relay coils should solve the hold-on problem.

  • With the switches aligned the energised relay receives 12 V - 3 x diode - 1 x Zener = 12 - 3 x 0.7 - 5.1 = 4.8 V or so.
  • With switches unaligned the relays will get \$ \frac {12 - 2 \times 5.1}{2} = 0.9 \ \text V \$ each which should be enough to guarantee drop out.
Transistor
  • 168,990
  • 12
  • 186
  • 385
  • 1
    I saw the first diagram a while back and immediately worried about your intent putting the two relays in series with each other. (And I didn't like it, at all.) The new one with the zeners also has a problem. Do you see it? (Aside from using 5 V when the OP wants 12 V.) Or, at least, I think it does. – jonk Apr 09 '19 at 22:31
  • Go on - what have I missed? I assumed the 12 V relay was negotiable. – Transistor Apr 10 '19 at 06:10
  • I think: 12V-4.7V-4.7V > Must release voltage – Huisman Apr 10 '19 at 06:22
  • @Transistor There's still substantial current in the relays when they are supposed to be inactive. (Not enough to engage them, I grant.) Perhaps 15 mA or so? – jonk Apr 10 '19 at 07:15
  • Not enough to engage them and, typically, not enough to hold them. I did cover that point in the last sentence. Thanks for the review, chaps. – Transistor Apr 10 '19 at 07:53
  • You did. I'm not disagreeing. I just still consider it to "be a problem" that was worse in the first schematic and better in the second, but not good enough that I liked it. I hope you don't mind that it bothers me, but I just don't like seeing all that waste taking place despite its cuteness. I'm also not above such odd things as you may remember from [this](https://electronics.stackexchange.com/a/257133/38098). – jonk Apr 10 '19 at 17:31
  • TNX for interesting solutions, this is solution but I would prefer OP because it should be less power distribution... – Inteli Apr 11 '19 at 23:46
  • @Inteli, sorry, I don't understand "*... but I would prefer OP ...*". What is "*power distribution*"? – Transistor Apr 12 '19 at 07:19
  • I was thinking IC, for example CD40XX could do the same thing and it would be less complicated to make it? Correct me if I am wrong – Inteli Apr 12 '19 at 12:58
  • CD40xx + circuit board + pull-up resistors + decoupling capacitors + relay driving transistor + base resistor + relay snubber diode. Or solder my diodes onto the switch terminals. Your choice. – Transistor Apr 12 '19 at 14:04
0

Now that I understand better what circuit function is desired, I have created two new ones. Figure 1shows a series connection; when all switches are in the up position relay one is on. When they are all in the down position relay two is on. The switch connection and D1 and D2 prevent either relay from acting with any other switch combination. Figure 2 shows a parallel connection; with all switches to the right relay 1 is on; with all to the left relay 2 is on.enter image description here

EinarA
  • 897
  • 5
  • 5
  • I think yours is potentially better than mine because I think the OP wants *the one* relay to be energised when all switches are in the same orientation. You can accomplish this by omitting RY2 and connect the two collectors together. – Transistor Apr 12 '19 at 14:08
  • That is the function of the circuit I described in my first answer which he seemed to disagree with. – EinarA Apr 13 '19 at 18:33
-1

When I first read the question l thought that a circuit I think of as a "4 input XOR gate" would work here. The output is high or low if all inputs are high or low. These don't exist as ICs, but can be made from resistors ,diodes and a transistor. After some thought I realized I don't know what the OP is doing, so I don't think this circuit is correct for his use.

EinarA
  • 897
  • 5
  • 5
  • But I need indication only if all inputs are "closed contacts" for LOCK state, other ways it can be one close another open etc. in that case i don't need any indication, not active relay on the output. Same thing is for UNLOCK, all 4 another pair of contacts needs to be closed, that is why I mentioned another pair of GATE-s, if any of lock did not reach position, stuck in the mid position I don't need active relay on output. – Inteli Apr 09 '19 at 00:40
  • Inteli: sorry I have no idea what you are talking about. – EinarA Apr 09 '19 at 00:44
  • Thany You any way! It is quite simple, maybe I did not explain it well: I have 4 locks, each have 3 wires, common, lock and unlock contact. Each state lock or unlock I need to connect to separate IC (like quad 2 input and gate 7408). I need drawing how to connect it on 12V supply, and on output to trigger simple 12V relay. – Inteli Apr 09 '19 at 00:54
  • It sounds like you just need an AND gate to drive a relay but I am not sure. If you are using Google translate it is coming through as mostly gibberish. Sorry. – EinarA Apr 09 '19 at 01:04
  • Anyway. Look at listings of CD4000 ICs. You can find a four input AND gate there that will work with 12V. They can also be made from diodes and a FET. – EinarA Apr 09 '19 at 01:08
  • That;s not what a 4 input XOR does. – Jasen Слава Україні Apr 09 '19 at 01:39
  • It might well not. That's more my name for the circuit I was thinking of. Which doesn't seem to be what the questioner needs. – EinarA Apr 09 '19 at 01:46
  • I have edited my answer to correct my misunderstanding of the question. – EinarA Apr 09 '19 at 07:09