Dynamic range of voltages for ADC input controlled by software
You could build a programmable resistive divider with a fixed "top" resistor and several "bottom" resistors connected to GND via FETs. The MCU would control the FETs. Of course you will need to protect the circuit if the voltage gets too high, or the wrong configuration is selected.







simulate this circuit &ndash; Schematic created using CircuitLab