Several switches connected to the same pin.

tablet:
Hello, I want to connect several switches to the same pin interrupt.
Each switch has this schematic:
(upload://j5MzfXoPVvk5NrxSaaoLTCcNrh0.jpeg)]
But my switches are NC, normally closed, then, the arduino can not detect the interrupt of several switches. It can only detect if there is one switch connected.

Can anyone tell me how to solve this? How can i connected several switches NC to the same pin?

Thanks,
Regards.

Simple, you wire all your NC switches in series (and using no external resistors) and ground the far end of the switch array. Then you enable the user interrupt pin's (pins 2 or 3 on a Uno) internal pull-up resistor with a pinMode(pin#,INPUT_PULLUP); in your setup function. Then when you enable the interrupt with a
attachInterrupt(interruptNumber, functionName, RISING); command a interrupt will be generated when any switch is pushed.

Note that this is just the logic behind the method. In reality you need to deal with switch contact bounce which can be a bit tricky when dealing with switch generated interrupts, but that is another subject for another time.

Lefty