The following circuit is a simplified version of a more complex system. For testing purposes, the 555 Timer was added to serve as a test signal source with frequencies set by the resistors in series. Each arbitrary signal is indicated by a push button and the Arduino needs to be able to distinguish what button has been pushed. Unfortunately, there can only be 3 buttons and more cannot be added. This is where the problem occurs. How can you reliably indicate which push button has been pressed without interfering with the arbitrary waveform?
At first, my original thought was to have the Arduino sample the signal based on that sample the Arduino would be able to tell which button is pressed.
When button 1 in the pink is pushed the Arduino receives a takes the following sample of the signal.
843
848
849
849
849
849
// Time 0 when button is pushed
532
414
500
373
463
346
425
370
386
476
346
442
642
788
// At t = 0 the Serial Monitor reads zero
998
998
998
998
998
0
0
0
0
0
998
0
0
0
0
0
0
0
0
0
998
0
0
0
0
998
0
0
0
998
998
998
0
998
0
0
0
998
0
0
0
0
Moving the analog input does not make it any easier to distinguish which button was being pushed. Which is why I decided to ask the community on how to deal with this. I have tried using a relay and simply hard coding all of the cases but the result is a system is not very robust and is vulnerable to easily break over time.