Once again, I am asking for your inspiration and help.
Use case. On both nightstands, I am planning to have six TP223 Switches.
This would mean, that I needed 12 I/O pins.
Idea:
Let's assume, that only one of the switches gets pressed at once. Therefore, it should be possible to map those 12 signals to four I/O pins. (Four Bits)
The following schematic should allow me to do this.
Please note: all diodes were planned to be LEDs. Primarily, to prevent the current from flowing in the wrong direction and secondarily to help to debug.
Any cut connection is not related to this question. (Mostly PWM outputs)
Issue: The voltage drop over the LED seems to be too large and therefore, no switch input is detected.
Question:
Is my idea just plain stupid and there would be much easier ways to achieve my desire? (I.E. an IC that already does that for me. However, I didn't find one.)
If this idea could work, but only with "proper" diodes, are there any THT Diodes you could recommend to me?
Any other remarks are appreciated as well.
Hardware:
-NodeMCU V3 (The newer larger version)
-TP223 Touch sensor
-3mm LED
The following schematic should allow me to do this.
.
With ordinary mechanical switches, you could connect 12 to 4 pins by arranging them, with diodes, as a charlieplexed matrix. Perhaps that's what you are suggesting?
You can't do that with TP223 touch switches, however.
Yes, port extenders are the most sensible solution here. Dozens of such sensors on just two pins (I2C)!
The touch switches you talk about are probably TTP223, not TP223. Those normally have only one output, not two. If yours are different, do post a link to the actual modules you use.