How to make a momentary switch deliver a pulse on one circuit, while also closing another circuit until it is pressed again

Thread Starter

Elusive

Joined Nov 1, 2020
3
It has been over a decade since I've done anything circuit related, and I found out the hard way that I have forgotten basically everything.
I am trying to make a buttonpanel acting as an input interface for PC using an arduino. I want to have 32 different momentary inputs in a 4x8 matrix.

My issue is lighting the switches. To make it as hard for myself as possible, I decided on RGB LEDs for customisation possibilities. This require me to use the Arduino Mega, because too many inputs. I do know that the Mega isn't directly compatible as a PC User Interface, but thumbs up for "wants" over "managability".

What would I need to do to make a momentary switch (I'm using both toggle switches and push buttons, SPST) send a momentary input to the pc/arduino, and at the same time activating an RGB-LED and keeping it on until the switch is pressed again?

My first thoughts on solving this:

- Add a relay for each switch/LED.
- Do some coding on the arduino to activate a location on a LED matrix.
(Can RGB LEDs be set up in a matrix without sacrificing individual colors and activation?)
- Start crying and move on to a different project.

Any help is greatly appriciated!
 

MrChips

Joined Oct 2, 2009
23,565
Welcome to AAC!

If you need to use 32 push buttons in such a complicated manner the simple solution is to use an MCU (or Arduino) connected to the switches. Use software to detect when the button is pressed and released and generate any behaviour that is desired.
 

Thread Starter

Elusive

Joined Nov 1, 2020
3
Welcome to AAC!

If you need to use 32 push buttons in such a complicated manner the simple solution is to use an MCU (or Arduino) connected to the switches. Use software to detect when the button is pressed and released and generate any behaviour that is desired.
Thanks a lot MrChips, I will try that!
Honestly, that should probably have been obvious to me in the first place, istead of trying to multi-circuit things...:rolleyes:
 

MisterBill2

Joined Jan 23, 2018
8,806
A simple cheating trick would be to use alternat action pushbuttons and use a series capacitor to deliver the momentary pulse. That is the very simplest that I can imagine: one additional component.
 

Thread Starter

Elusive

Joined Nov 1, 2020
3
A simple cheating trick would be to use alternat action pushbuttons and use a series capacitor to deliver the momentary pulse. That is the very simplest that I can imagine: one additional component.
Thanks MisterBill2!

For now, I will try to use the solution mentioned above, as that is probably the easiest for me to accomplish. Im way better at coding than electronics, and I really dont know why I didnt think about solving it with code in the first place.

But for future projects, how would your solution be done? As in how would the capacitor deliver only one pulse when it is constantly powered by the button being on? As I said, I've completely forgotten close to everything related to electronics.
 
Top