For a project I'm working on I need to read more inputs than I have analog pins on my Arduino Nano, and all my digital pins are already spoken for. In a nutshell, my Nano needs to communicate with 5 Raspberry Pi Zeros.
After reading up on several options (R2R network, shift register, etc...) I came up with the following.
Each analog input (5x) will need to read either the press of a button, or a pulse coming from one of the Zeros. Because of the resistors, I'll read 4.47V for the pushbutton, and 2.25V for the pulse from the Zero. When both are active at the same time, I'll get 4.48V, which is OK, as the button has precendence over a pulse anyway (for my project).
I added the diodes to prevent current flowing from the Nano to the Zero and vice versa, but since all devices are powerd by the same source, I don't expect huge differences between both 5V lines from the Nano or the Zero.
In my opinion, this should work, but I'd like to know the opinion of others before I start building this project. Is this a good way? Is there a better, easier way to achieve the same goal?
Thanks in advance!