Convert digital 12V/7V inputs to 3V3 levels
Here is an example of a robust design I have used in industrial product designs that allows interface of sensor inputs that range over a wide voltage swing to safely interface to 3.3V microcontrollers. In this example the reference threshold voltage is set for about 2.4V so that the inputs can accept signals with swings from 0-&gt;3.3V up to 0-&gt;15V.

Whilst this design does provide a good bit of noise isolation for the MCU from the input signals it is still necessary for the highest level of robustness to provide for higher level ESD filtering before the inputs to this circuit.
For your inputs that swing from 7V to 12V you may want to check to see if adding a pulldown resistor of a few K ohms would lower that 7V idle level to closer to GND. If not then you could replace the input 2.2K resistors with a pair as a divider that brings that 7V level down way below the 5V clamping action and then possibly raise the REF_IO voltage a little.