# Replacing two corresponding switches as one with logic gates, to supply power, around a DPDT relay

This is one section of a project I'm working on. A user can choose between DPDT functionality (so having "DeviceI" be a motor that goes forward and reverse) or the alternative option to add another sensor (SensorII).

The DPDT requires two +VccRelays. So the relays on the left can be effectively thought of as Vcc. This is my current design. It works. (I implemented and tested it.) It's for powering interchangeable sensors.

Although, I want the user have less switches to screw up. So I figure there's a way to replace the two switches on the right (SW2 & SW4).

So A⊕B = C = D'?

Without the truth table, intuitively, I think this will work:

I tried to make it easier to understand where the switch labels have corresponding letters (where A matches everywhere with A, and B with B). The user has two options: either change all the switches to position "A" or to position "B" (on each of the four switches). If they choose position "A", they get one DPDT powered device, nothing else. If they choose position "B", they get to power two regular devices.

Like that? Did I go wrong somewhere? (I changed "Device" to "Motor" so it's more intuitive to understand; it's just like switching the polarity of a DC motor.)

If it's kosher, I would buy the CD4070B XOR and the CD4081B AND. Before this section of the project, the user has the option to power the device by either 5 or 12V. My second question is if these (3 V ~ 18 V logic high) gates can handle ~13.5V. Vcc could either be 5 or 12V depending on what sensor the user chooses.

• Adam, I think you have deleted a similar question that had some dialog going in the comments so we have to start again. Your question is still quite confusing. "... having "SensorI" be a motor that goes forward and reverse ..." Sensors are not motors and motors, generally, are not sensors. What is this really about? – Transistor Aug 20 '18 at 19:58
• Yes, there was the mention of using a MUX. I figured it'd be better to start fresh with this new design. An environmental sensor can be swapped out with an actuator, such as a pump or motor. "Device" works just as well. I gave one circuit. This circuit is actually repeated eight times. So a maximum of 16 possible devices can be powered, an extraneous detail. The bigger picture, this project is a PCB interface board. – Adam Uraynar Aug 20 '18 at 20:04
• (1) You should probably change the name then to "IO1", (input-output 1), etc. (2) What sort of motor can you drive from a CMOS gate? (3) Is the circuit just supposed to supply polarity-switchable supply to the sensors or is it supposed to read signals from the sensors? - The question is still hopelessly confused, I think. – Transistor Aug 20 '18 at 20:12
• So it sounds like I can't use logic after all. This section of the project only supplies power. There is no reading of signals. I'll make changes... – Adam Uraynar Aug 20 '18 at 20:13
• That answers neither of my questions. – Transistor Aug 20 '18 at 20:16