Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Digital Switch Array

Not open for further replies.


New Member
Hi guys,

I would appreciate your help with the design of a basic digital circuit. What I am trying to implement is a 12 input device with corresponding latched outputs. Basically, when one push switch (momentary) is triggered, the output is latched ON and it resets any previous input. A one of twelve selector. I Initially thought of using flip-flops and corresponding logic but this seems cumbersome and over the top. Multiple 555’s could be used in one-shot mode but again additional logic gates are required on the reset lines as well. The additional logic gates (AND/NAND) would be required to inhibit the reset input of the above (by utilising the latched output), or the selected input would reset its self. But, there could be a timing or race hazard error with the above idea as the latched output reset is ‘delayed’ via the inhibit gates.
Basically what I am looking for is a 1 of 12-input/latched-output device, which resets any previous input. The outputs will be coupled to a TTL level input device for triggering MIDI on the computer. Logic level irrelevant as can be inverted or changed in the PC. For those who are MIDI savvy, note/note off. A multiplexor?
Would appreciate your comments and help.

It take it that it is not unlike a self-cancelling switch (which would be an all-mechanical device such as was used in a car radio of the 1960s) that uses simple momentary-contact pushbutton switches for control.

Is it ALWAYS such that one and only one input is selected or would you want two inputs selected at the same time with the push of two buttons simultaneously? Also, is there an instance when you'd want all inputs unselected?

Hi Dean,

Yes, only one input which cancels all others. You are right with one obsevation thou. On initial 'power up' all inputs are required to be off.
Mididig, see the attached circuit. The HC148 priority encoders on the left (1) ensure that only one output can be active at any one time, (2) provide a signal (GS) that goes active when any button is pressed to latch the 1-of-16 decoder on the right, (3) reduces the number of lines that need to be de-bounced from 12 to 4 lines. The HC4515 decoder on the right can drive two standard TTL inputs.

You could use up to 15 switches by adding three switches on the top.

It should power-up with none of the 12 outputs selected at the right. I can't guarantee that, but I am reasonably sure, because the address lines will either be all high, or all low at the time the latch settles. Unfortunately, the decoder does not have a CLEAR input which could be used to guarantee that.



  • switchbank.png
    20.4 KB · Views: 2,815
Hi Willy,

Is a microcontroller out of the question? There's probably a hundred different ways to use a microcontroller for a simple reliable feature-rich single chip solution (full press and release debounce, switch press beep feedback, lighted push button switches, etc.).

Kind regards, Mike



  • Single Chip Solution.PNG
    Single Chip Solution.PNG
    35.3 KB · Views: 7,207
Last edited:
Hi Willy, here's yet a another choice.


  • switchbanka.png
    82.5 KB · Views: 2,244
Hi Gents!
Firstly, big apologies for not coming back sooner. With little initial response, haven’t looked for a few weeks. Many thanks for all your comments and help.
A few questions thou lads.

Could your circuit be modified to allow 24 inputs??
I.e. is there a carry function I could utilise?
Initially I considered 12 inputs to be plenty. Not so! As I said circuit would input to midi on PC and having sorted the software side of things, need more inputs!

A micro-controller is certainly not out of the question. BUT, my limited knowledge of them is a factor in its use! If it was relatively easy to implement then I would look at it but to spend a lot of time studying how to program them etc and the equipment required made me decide to look at a more basic method.

And again Chuck!

Your last Diagram looks more feasible! The 74C922 is one of those units that continually look at a matrix if I am correct? S1-S12 are continually monitored and better still a ready made switch matrix is available. Can this circuit be modified to allow 24 inputs, 2 x12. Can the 74HC154 be cascaded?

Off to Dorset for a week tomorrow (14th Sept) I hope to read your comments on my return at the weekend. Would appreciate them.
Thanks and Regards, Willy.
Hello again, Willy. You are right about the 74C922. The attached, modified, circuit provides 24 keys. It's not a 2x12 matrix, however, which would require a different design route.



  • switchbankb.png
    133.3 KB · Views: 1,933
Not open for further replies.

New Articles From Microcontroller Tips