The problem
Handle digital inputs on a MCU, the input could be 5V, 12V, 24V or an open collector.
My solution
My approach is based on jumpers, given the fact that the inputs dont change behavior in time (if the input is 0v or 5v it will be that always and never will change to 12v or 24v or open collector), so I set the jumpers one time in my circuit to work with the desired voltage. This is the most smart way i can think to solve this.
How it works
If the input is 0V and 12V, I set JP2 to 1-2, JP3 to 2-3, JP5 to 1-2 and JP7 to 1-2. If the signal is open collector; I set JP2 to 2-3, JP3 to 1-2, JP4, JP5 and JP6 dont care and JP7 to 2-3.
This seems to me the best way to go, but I don't like the amount of jumpers in my circuit, what do you think? what will be your approach?