Mass flow Controller

Hi can anyone help on how wire/program arduino to control mass flow controller to respond to a set point and how to make mfc read set point and respond accordingly.

What MFC? Mass of what? What are you sensors and control inputs?

A PID loop is probably the answer, but without any hard information at all there's little else can be said.

There is likely a voltage that corresponds to a flow rate. Have that voltage go into a board and then have an if statement to compare it to a threshold for the valve to open or close.

You could also use a comparator. http://www.ti.com/lsds/ti/amplifiers-linear/comparator-products.page#p1max=0.00015;0.005

Its a gas mass flow controller I want to keep the flow constant by providing a set point voltage which i am able to do with analogwrite command but my concern is the analog pin read out. I want to know that how can i make it read the voltage which will be in the range of 0-5v and then via PID logic make required change in the voltage signal to the flow controller. My issue is analog pin right give me either some value in mV or straight up 5V this is confusing.

Multiply the analog read by 1024 and that will give you the correct voltage.

The actual voltage is 5 *(analogRead value)/1023

but the accuracy depends on the internal regulator - probably +/- 5%

regards

Allan