Regulating square wave signals of varying amplitude
There are numerous ways to do that for a signal that is guaranteed to start ot zero volts.

Here are two simple ones.







simulate this circuit &ndash; Schematic created using CircuitLab







simulate this circuit

UPDATE

Sine you are now mentioning this is for an automotive application you would be wiser to use opto-couplers instead of simple passive components.







simulate this circuit

D1 adds some transient suppression on the front of that and protects the LED from reverse voltages.