12-volt matrix input->output?

I want to turn on 4 lamps in 6 combinations. These are controlled by 3 switches in 6 corresponding combinations of contact closings.
The truth table looks like this
Switches Lamps A B C W X Y Z ----- ------- 0 1 0 1 0 0 0 0 1 1 1 1 0 0 1 0 0 0 0 1 0 1 0 1 1 0 1 0 1 1 0 1 0 0 1 1 1 1 1 1 1 1
While it's straight 3-bit binary count input, how to I translate it to the desired 4 output combinations? What's the best way to implement such an input-to-output matrix?
Input from switches is 12 vdc and output requires 12 vdc, milliamp drive.
I'm ignorant in all things PIC, so prefer to have another solution.
Ideas?
--
John English

<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
On a sunny day (Sat, 24 Feb 2007 17:45:14 GMT) it happened John E.

Program EPROM. swicthes on address inputs. data outputs - resistor - transistor - lamp. Allows for max 8 lamps. And for the smallest EPROM > 1000 switches.
Can also be done with a 4051 (ABC input) 1 of 8 decoder, and some diodes resistors and transistors too. (You take a few diodes to the lamps drivers from 6 of the 8 outputs).
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Thus spake Jan Panteltje:

Sounds very flexible, but again, I'm programming limited, so I think this won't work for me.

I'm interested in single-chip OTS (off the shelf) solutions like this.
The data sheet says: "The CD4051B is a single 8-Channel multiplexer having three binary control inputs, A, B, and C, and an inhibit input. The three binary signals select 1 of 8 channels to be turned on, and connect one of the 8 inputs to the output."
(ref: <http://www.tranzistoare.ro/datasheets/120/109150_DS.pdf )
With my eyes, it looks like it's not what I'm looking for. It simply connects one input to one output. In one possible configuration of this flexible chip, the input is common (which, connected to 12v, would work for my purposes) and depending on the 3-bit binary control, be connected to one of the 8 outputs, which would not work for me, as I need 6 outputs working at once, some high, some low). It is a multiplexer, which might work for LEDs, but I am driving 12vdc relay coils with the output of this circuit.
Or am I missing something... (my default presumption).
Thanks,
--
John English

<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
On a sunny day (Sat, 24 Feb 2007 19:24:37 GMT) it happened John E.

OK, but I'l do only part of the design:

------------------------------------------------------------------------------------------ CD4051 diode LAMP matrix +12V in 1 2 ------------------ a diode k ----------> W' | 3 -------------------a diode k ----- | --a diode k ----------> X'
S1 puldown resistors A 4 -------------------a diode k-----------> Y'
S2 B 5
S3 C 6
So if '2' selected ,as in table above, W goes on. If 3 is selected, both W and X go on. If 4 is selected Y goes on. All diodes 1n914 Can you do the diodes for 5 and 6? Normally 4051 cannot drive a bulb, so we need some amplification.
+12V | bulb A | |---- A' --| | Power MOSFET |---- | ///
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Thus spake Jan Panteltje:

Thanks!
Ah, diode matrix! In the back of my mind (a crowded place, to be sure) such an idea was lurking. Just couldn't bring it to mind.

Uh, I think so (c:

I see no output current spec in the data sheet. Is this simply presumed to be a low value? Not 10 mA? (I'm driving relays with the circuit.)
Thanks for making this reasonalby understandable by a good tech, but poor designer.
--
John English

<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
On a sunny day (Sat, 24 Feb 2007 20:21:07 GMT) it happened John E.

I remember Ron is < 150 Ohm or so... I think it will not drive a relay. The MOSFETS are only 2 \$ or so, and will drive a relay if yu use a flyback diode.
+12V | |---------- k | diode [ \ ] relay coil a | |---------- | |---- A' -----| | Power MOSFET | |---- resistor | 100k /// | | <- connect to output 7 of the CD4051
If you connect the thing as above, you save 4 diodes by connecting all resistors that hold the gates down to output 7 of the CD4051, so if output 7 goes high, then all MOSFETS are powered, and all lights go on. You need these resistors anyways.

You are welcome.
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Thus spake Jan Panteltje:

Sort of using 4015 output pin 7 as a pull-down resistor for the MOSFET's gates?
What MOSFET would you recommend? I might want to power 2 relays in parallel with each of the 4 MOSFETs... Is this 60v N-channel one, with 1.2 ohm on-resistance an appropriate choice? :
<http://www.jameco.com/Jameco/Products/ProdDS/256031FSC.pdf
And it includes a diode (which will act as a flyback, yes?)
And about input conditioning: mechanical switch contacts will be "not clean", probably causing problems with bouncing, noise, etc. Best way to clean up these inputs?
Thanks,
--
John English

<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
On a sunny day (Sun, 25 Feb 2007 10:05:46 GMT) it happened John E.

That one is already 'on' at .8V, I'd rather use one that was on at about 6V :-)

The flyback would be positive, maybe above 60V in this case. That intrinsic diode only limits negative swings. Some MOSFETS have avalanche protection diodes that way (the intrinsic diode then zeners), not this one I think.
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
On a sunny day (Sun, 25 Feb 2007 11:49:46 GMT) it happened Jan Panteltje

Seems I misread that, it opens at 2V, so that should be OK in both circuits, 4051 or 4028, but you still need the flyback diodes.
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Jan Panteltje diagrams:

Just to clarify...
The 2, 3, 4, 5, and 6 outputs connect to the 4 MOSFET gates via diodes. The 7 output connects to each of the MOSFET gates via resistors (instead of diodes). The resistors serve dual purpose of isolating (the term "open-collector" comes to mind) the gates from the outputs, and act as pull-down resistors also.
Thanks,
--
John English

<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
On a sunny day (Sat, 24 Feb 2007 20:33:47 GMT) it happened Jan Panteltje
+12V | |---------- k | diode [ \ ] relay coil a | |---------- | |---- A' -----| | Power MOSFET | |---- resistor | 100k /// | |----< connect to output 7 of the CD4051 | 3300 Ohm pull down resistor. | ///

Small correction, you then also need a 3300 Ohm resistor to ground from output 7 of the CD4051 (see modified diagram above). This because the switch to output 7 is normally open, and _something_ should pull the resistor network to ground if 7 is not selected. With max 2 bulbs on, in the other cases then 7, the divider would be 50k / 3k3. And the voltage it would see about 11.3 V. That gives a max off voltage at the MOSFET gates of about 0.7 V. The current would be (if on) 12 / 3300) = 3.6 mA. The internal switch in the CD4051 is max 150 Ohm and would hardly dissipate anything. Or use a CD4028 BCD to decimal decoder, as Joerg suggested, as it has a true zero output. I personally have a whole lot of 4051 / 4053 switches around, as they can make any logic, modulators, decoders, what not... So that was my natural choice...
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Thus spake Jan Panteltje:

If I use CD4028, I will not need 3300 pull-down resistor? But the rest of the circuit will remain the same?
Thanks,
--
John English

<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
On a sunny day (Sun, 25 Feb 2007 11:41:52 GMT) it happened John E.

Yes. http://www.ee.washington.edu/stores/DataSheets/cd4000/cd4028.pdf
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

If the current requirements were within CMOS or CMOS plus transistors, you could use that to produce a regular 1 of 8 output, then diode-OR to drive the lamps. But you didn't say the switches had to be single- pole. If switch A is single-pole double-throw, switch B is double- pole, double-throw, and switch C is 4-pole double-throw, that combination also produces 1 of 8 output, that can handle any current the switches can.
Since you don't need outputs 0 and 1, switch C need be only triple- pole double throw.
Your output table is: W= 2 or 3 or 5 or 6 or 7 X= 3 or 7 Y=4 or 5 or 7 Z=6 or 7
Using 1 of 8 decoders and diode-OR, that would be 12 diodes. But using the switches, the input poles of switch C are already (2 or 3) (4 or 5) and (6 or 7). So using those connections, you only need 8 diodes to run the 4 lights.
What does this logic actually do?
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Thus spake Bob n.:

The existing 3 input switches are simple on-off SPST.
--
John English

<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
John E. wrote:

As others have suggested this can be done using a decoder and diode to wire up the desired lamp combination. Instead of analog muxes you can also use the CD4028 and use only the A, B and C inputs. Wire D to ground.
Digikey has it in stock even in the old DIP version, 52 cents a pop. If you need more than a milliamp or so you could use a driver from the ULN series.
--
Regards, Joerg

http://www.analogconsultants.com
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Thus spake Joerg:

I've looked at the data sheet. Fewer pins to deal with (no inhibit, no input/output control) -- looks more straightforward...
--
John English

<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
John E. wrote:

Yep, keep it simple :-)
BTW we just brought a couple back from church and his name is the same as yours. He is a retired mineral engineer. I told him and he said that he never met another person with that name. At least not in the last nine decades or so and this guy has been all over the world.
--
Regards, Joerg

http://www.analogconsultants.com
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

W = C or B X = B and C Y = ( not B ) or (A and C) Z = A and B

with those specifications the 4000 series CMOS logic family sound good, they're inexpensive and will run from 12V just fine.

it's going to take three chips
the easist way would be a 4071 (that has 4 or gates) a 4081 (that has 4 and gates) and a 4069 ( that has 6 not gates - a hex inverter) the three should come in under \$2
get ones in DIP package unless you have a goos reason ot to.
it'll cost you more in circuitboard than chips
4071 datasheet 4069 datasheet 4081 datasheet
and it'll find you a PDF that explains how to use the chips.
Bye. Jasen
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

...
Jasen, I really appreciate the fresh approach of looking at the inputs as logical inputs and using a Boolean solution, but I think I'll stick with the 1-chip solution (and a few diodes and resistors and MOSFETs).
I've seen several of your creative suggestions in these groups. Maybe I'll be able to utilize one next time...
Thanks,
--
John English