Need help interfacing with Alicat Mass Flow Controller

Some code snippets to get you started....

#define alicatSerial Serial1

Or use software serial...

To initialize the connection to the Alicat(s):

String unitID = "A";
alicatSerial.begin(19200);
alicatSerial.print("\r\r");
delay(100);
alicatSerial.print("\r\r" + unitID + "0\r"); //put setpoint at 0

Be sure to set the Alicats to Serial communications on the front panel and check the unit ID in RS232 comms. You can have multiple units on the same serial line with different addresses, so change as needed.

Setpoints are set as fraction of full scale*64000. So (flow_set/max_flow)*64000. For a unit with a max flow of 5 and a set point of 0.5, you will send a value of 6400.

float flowSet = 0.5;
float maxFlow = 5.0;
float adjustedFlowSet = (flowSet/maxFlow)*64000;

alicatSerial.print("\r\r" + unitID + (String)adjustedFlowSet + "\r");

To get status info from the MFC, send the following command:

alicatSerial.print(unitID + "\r");

This will return a string with the following values: Unit ID, Pressure, Temp, Vol. Flow, Mass Flow, Setpoint, Gas -- which you can then parse.

See page 35 of the manual: http://www.alicat.com/documents/manuals/Gas_Flow_Controller_Manual.pdf