Hi,
Picture1:
Please draw every schematic with signal flow from left to right.
You could make a combined 12V and 24V input without jumper. It's a question of threshold voltage and voltage limiting.
I recommend to use a suitable connector for the sensor. What signals does it need?
I also don't recommend to try to make an overly complex circuit. If you have an 24V system, then design it for 24V.
If you have a 3.3V MCU, then design it for 3.3V.
I also don't recommend to use a LED the way you do, because it has influence on input threshold. (Using a red LED instead of a green LED will move your threshold voltage), it also draws it's current from the input. And depending on input voltage it may be dim and you still don't know whether the MCU sees HIGH or LOW. Do you really need it? Or is it "nice to have" and could be replaced by the MCU (display, interface, ....which tells you what the MCU really sees)
* where do you want the thresholds for the inputs?
* what timing accuracy do you need and what switching frequency do you expect?
Some more information:
Where is your circuit used? Who uses it?
If it's just your hobby project, then maybe a resistor divider is suitable. Maybe add protection (zener, double diode) against overvoltage and reverse voltage.
If it's for a high reliable industrial device you need defined thresholds, defined input impedance, ESD protection, EMI / noise filter, schmitt trigger, rugged against some misuse (24V instead of 12V, wrong polarity ...)
(I use all: from 2-parts voltage divider ... up to 10 or more parts)
I guess this sounds complicated. But you should at least be more detailed with your informations:
* What exact "sensor" do you mean, and what is it used for?
* what exact MCU do you use, and at which supply voltage?
* what exact "device" (driven by your outputs) do you mean? Relay, motor (inductive), electronic device (capacitive), PWM'd? (frequency)
The problem is: We can currently not validate whether the circuit is useful or not. It may work ... or not. It may cause no problem, immediate problem, or longtime problem.
Klaus