First question so please forgive any mistakes.

I'm trying to design a system by which multiple LEDs are controlled by multiple switches, but without using as many wires as there are switch/LED pairs. I'm planning to have roughly 20 momentary switches connected to the same number of set-reset latches which control LEDs.

I'd like to know if there are any chips or circuits I can use in order to take these 20 inputs, compress them down into as few wires as possible so that I don't have to cable manage 20 wires (which, for my application, will be unfeasible), then provide the same number of outputs at the other end. The outputs will only need to provide a brief pulse along the correct line, due to the set-reset latches I'm using, and no two inputs will be able to be activated simultaneously.

Thanks all.

  • \$\begingroup\$ You've got 20 inputs and 20 outputs physically distant from each other, and you want to communicate with as few as wires a possible. Now come the questions: what lag are you worried about? What speed? What distance? The easy option is get two micro controllers with at least 20 GPIOs plus serial comms, and you're away. \$\endgroup\$
    – Puffafish
    Commented Jan 11, 2019 at 12:23
  • \$\begingroup\$ Maybe I'm wrong, but I want to say a multiplexer. \$\endgroup\$
    – Tack
    Commented Jan 11, 2019 at 12:36
  • \$\begingroup\$ Please edit your question and add details of the LEDs and a link to the datasheet. What current will be required for each LED? Please read through all the comments and try to answer each point raised. \$\endgroup\$
    – Transistor
    Commented Jan 11, 2019 at 12:52
  • \$\begingroup\$ Also specify the distance, There is a world of difference in the circuit required to bridge two meters or two kilometers. Where is your power source? At the switch side or at the LED side? \$\endgroup\$
    – Oldfart
    Commented Jan 11, 2019 at 13:24

3 Answers 3


You are looking for a serializer/deserializer. These devices are intended for just this kind of thing. They take a large number of parallel inputs, convert them to a high speed serial communication, and then convert back to parallel at the receiving end. A similar problem occurs with the displays on laptop computers...all of the information for the display has to travel through a thin, flexible cable through the hinge.


with the given parameters (20 Switches, 20 LEDs and no simultaneously pushed buttons) Charlieplexing could be a good way to go for you. No need for any ICs or microcontrollers.

You could do the wiring with only 5 wires. The only things you have to consider is to use 2 channel momentary switches and some diodes after them.


  • \$\begingroup\$ I was going to suggest the same thing, but even with that 3 pin Charlieplexing configuration you're using at least 11 pins/wires (3 per 6 LEDs plus 2 for the leftovers). Unless there is a 4 or 5 pin Charlieplexing setup. \$\endgroup\$
    – Stiddily
    Commented Jan 11, 2019 at 13:50

Are you looking to condense the input signals, the output signals or both? Even if you have an IC which handles the inputs, you're still going to have to wire the buttons to that IC. If your micro can handle it, you can read in the 20 inputs and then use something like a TLC5972 which is a 16 channel LED driver with serial inputs and outputs. It is super easy to use, just requiring 1 resistor to set the current. This way you'd only need 3 or 4 wires between your uC and the LEDs.

If you need to condense both ends you can essentially make a grid of buttons. A grid of n^2 buttons only requires 2n pins. For 20 buttons you can get away with 10 wires. I'm not going to draw all 20 buttons, but this 4 button example can be expanded.


simulate this circuit – Schematic created using CircuitLab

Node 1 and 2 are outputs, Node 3 and 4 are inputs. You pull Node 1 high, then check if Node 3 or 4 are high. If they are, then that button has been pressed. You then pull Node 1 low again, and repeat the process with Node 2 high. If you have 10 free GPIO pins on your uC you won't need any external ICs to read the buttons and can get away with half the wires.

Of course, if 10 wires is still too many for the inputs you can do something similar with an 8 to 3 multiplexer and 3 GPIOs by replacing Node 3 and 4 with the inputs to the mux.

Let me know if any of these ideas appeal to you and I can elaborate further if need be.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.