...Vehicle electrical systems, when the engine is running, have a "load dump transient" of several hundred negative volts.
...Bosch [among others] may have specs on the expected envelope for this "dirty" power.
...You'll need power conditioning at a system level for your circuitry; diodes, chokes, capacitors, maybe an IC regulator.
Allowing the transistor to turn on in high-Z state is not the issue. You don't want to exceed the max input voltage to the IC, which in this case would be 12V with a pull-up resistor.
My poorly worded comment, I meant a breakdown (zener) diode from the input pin to ground to clamp the input voltage. This may be a circular argument, because if we believe the premise of the purpose of this type of clamp, then it would mean the transistor would never turn off. I would like to experiment some with this just to see what happens.
Allowing the transistor to turn on in high-Z state is not the issue. You don't want to exceed the max input voltage to the IC, which in this case would be 12V with a pull-up resistor.
In figure two, didn't the OP just make a mistake in his schematic, leaving the switch, which represents his uC output, high. In the verbage, he has the output being low, which would work, wouldn't it?
No, if the output is low, he is correct in saying that it will never turn off. The base is never more positive than the collector. What if you flipped the transistor in figure 2 upside down so that the emitter is connected to ground. then the base-emitter drop is dependant on the uC, not the source.
But the NPN emitter will always be about 0.7V lower than the base. With a 3.3V supply on the UC, the emitter will never go above about 2.6V, regardless of the voltage on the collector.
They are MosFet Push-Pull outputs not bipolar transistors. When in Hi-Z mode the P and N channels MosFets are turned off but still connected between the Output, Vdd and Ground. MosFets have an intrinsic diode between the Drain and Source terminals that will conduct if the pin is driven above Vdd or below Vss by more than 0.7V.