how can I control 4 relays with 3 buttons?

First of all, I'd like to say I'm new here... Not just to this board but to programming and electronics. I've only one homemade electronics design/build project under my belt- I'm very well versed in electrical and mechanical, but woefully inept at circuit design and programming.. But I'm a quick learner, so wish me luck.

I've read through you guys' forum and, noticing there are some great minds here, feel optimistic about my project.

So for the question:

I am trying to build a vacuum control unit that has one vacuum source and four valves. The problem is that instead of 4 individual actuator outputs (to relays, solenoids, etc), I need to control them using multiple combinations of 3 inputs (like some sort of 3-to-8 --> 16-to-4 setup...). (I will be also be controlling 4 more relays (conventionally), 1 servo, and 1 DC motor (with PWM)).

I am mostly just trying to find out if it can be done, but any further help with the how would be greatly appreciated as well! (Below is a diagram (truth table?) of the relationship between the inputs and outputs.)

inputs outputs
from to
program transistors/relays
A B C 1 2 3 4

1 0 0 0 = N/C- same as (5)
2 0 0 1 = 0 0 1 1
3 0 1 0 = 1 1 0 0
4 0 1 1 = 1 0 1 0
5 1 0 0 = 0 0 0 0
6 1 0 1 = 0 0 0 1
7 1 1 0 = 1 0 0 0
8 1 1 1 = 1 0 0 1

THANKS!! :slight_smile:

sam85iroc:
I am mostly just trying to find out if it can be done

Based on your truth table, yes.

but any further help with the how would be greatly appreciated as well!

Read all the switch state into seperate variables and either use if/else if statements, or KMAP that truth table and use combinational logic.