Help calculating the value of a smoothing capacitor
Do not use the voltage divider you've shown. A car environment is not the nice 12&nbsp;V environment you assume. 'Load dump', where you switch off a large load like the headlights, can generate a short transient overvoltage, auto electronics makers allow +160 V for this. However in your circuit, R1 and R3 do limit the current that would flow into the protection diodes at the input of the Arduino in that event.

This is rather safer







simulate this circuit &ndash; Schematic created using CircuitLab

The capacitor value is rather nominal. It should be small enough so that it charges reasonably quickly, &lt;1 second or so. It's there to protect against small spikes, and perhaps RF. It's less necessary when used with a zener, due to its low dynamic resistance, but it doesn't hurt to have it there.