Manipulating 0-5V Pressure Regulator via PWM

Assuming you have the regulator version that will control pressure with a 0 to 5 Vdc input:

You need to use the analog output command. Note: even though the command is "analogoutput" it does not generate a real analog output. It generates a Pulse wave of about 500 Hz. This output is ON (high) an amount of time proportional to the analog output value.

for example, for a 4V output the PWM will be high 80% of the time. And because in this case "high" = 5V, the AVERAGE output voltage is 0.8 * 5 = 4V

From the regulator data sheet, they note the power to the valve must not have any ripple voltage, so I will assume the control input has a similar sensitivity. So the output pulses must be averaged by some circuitry.

Because we don't know how much ripple the valve will accept on the signal I would suggest a 5k resistor to a 10 µF cap. Might be a little slow but will get you started. These values are not critical so use what you have.

Also we don't know the input impedance of the valve signal so we may find the 5K is too large but is a place to start.

Be aware the Arduino outputs do not go to 5V but some value slightly lower. For this reason you may not be able to reach the max pressure of the valve.