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?

Reply to
John E.
Loading thread data ...

On a sunny day (Sat, 24 Feb 2007 17:45:14 GMT) it happened John E. wrote in :

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).

Reply to
Jan Panteltje

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: )

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,

Reply to
John E.

On Feb 24, 12:45 pm, John E. wrote:...

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?

Reply to
Bob n.

On a sunny day (Sat, 24 Feb 2007 19:24:37 GMT) it happened John E. wrote in :

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 |---- | ///
Reply to
Jan Panteltje

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.

Reply to
John E.

On a sunny day (Sat, 24 Feb 2007 20:21:07 GMT) it happened John E. wrote in :

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 /// | | Thanks for making this reasonalby understandable by a good tech, but poor

You are welcome.

Reply to
Jan Panteltje

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.

formatting link
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.

Reply to
Joerg

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

google for

4071 datasheet 4069 datasheet 4081 datasheet

and it'll find you a PDF that explains how to use the chips.

Bye. Jasen

Reply to
jasen

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? :

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,

Reply to
John E.

Thus spake Joerg:

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

Reply to
John E.

...

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,

Reply to
John E.

Jan Panteltje diagrams:

Reply to
John E.

Thus spake Bob n.:

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

Reply to
John E.

What's wrong with relay logic, apart from the cost? No input or output interface problems, (potentially) no PCB needed, no electronics!

Graham Holloway (Electronics Designer)

Reply to
Graham Holloway

If you are already using relays then I think this can be done with 3-off 4-pole changeover relays.

.-------------------. NC | NC | NC / | / | / / | / | / 12v---A1 | 12v---B1 '---C1 NO---' NO--------------NO---> W output

NC NC NC / / / / / / A2 12v---B2 .-------C2 NO NO---' NO---> X output

.--------------. NC NC---' NC | / / / | / / / | 12v---A3 .-------B3 .-------C3 | NO---' NO---' NO--+> Y output

NC NC NC / / / / / / 12v---A4 .-------B4 C4 NO---' NO---. NO '---------------> Z output

/|\ /|\ /|\ | | | A-contacts B-contacts C-contacts

A-----. B-----. C-----. | | | ___|___ ___|___ ___|___ | | | | | | | CoilA | | CoilB | | CoilC | |_______| |_______| |_______| | | | 0v----+---------------+---------------+

Reply to
Tony Williams

On a sunny day (Sat, 24 Feb 2007 20:33:47 GMT) it happened Jan Panteltje wrote in :

+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...

Reply to
Jan Panteltje

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,

Reply to
John E.

On a sunny day (Sun, 25 Feb 2007 10:05:46 GMT) it happened John E. wrote in :

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.

Reply to
Jan Panteltje

On a sunny day (Sun, 25 Feb 2007 11:41:52 GMT) it happened John E. wrote in :

Yes.

formatting link

Reply to
Jan Panteltje

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.