In the circuit presented in the following, use +5V instead of "12V" --
https://forum.arduino.cc/t/pwm-to-analog-conversion/64990
In the circuit presented in the following, use +5V instead of "12V" --
https://forum.arduino.cc/t/pwm-to-analog-conversion/64990