How to design universal analog input circuit
Hi,
I'm designing a PCB that can get 8 digital inputs and 4 analog inputs. But these inputs can be range from 3.3v to 24v. For the digital inputs I have used universal logic shifter method using comparator where I can give any voltage range of digital inputs and I get 3.3v digital output for the stm32 controller. Likewise, is there any method to get analog inputs with that flexibility. I have tried op amp with attenuating method but each time I have to change the resistor values according to the voltage I'm giving. Is there a method to get analog inputs to stm32 ADC pin with the flexibility to use 0-24V voltage range analog inputs without changing any hardware like the digital input circuit?

