Measuring voltage from automotive PWM dimmer circuit
Your analysis of the operation is correct but I would be concerned that the output of your averaging filter would vary quite a bit with engine revs since the '12 V' will vary with engine revs, etc.







simulate this circuit &ndash; Schematic created using CircuitLab

Figure 1. A couple of options.

The circuit on the left is a simple Zener clamp which, without C1, gives a 4.7 V PWM signal independent of the actual 12 V supply voltage. The R1 / C1 values will have to be selected to suit the oscillator frequency.

The circuit on the right does the same thing but opto-isolates the PWM signal from the micro-controller.

Getting the low-pass filter right is your biggest challenge and it may get a bit more complicated than I've shown it here.