Hello, I have been trying to connect the Omega Mass Flow Meter (FMA-2600/FVL-2600 SERIES) to my Arduino to receive pressure, flow, and temperature data on the serial monitor, however upon connecting it, I just keep receiving zeros for all the 3 data outputs. The Flow Meter's manual is in here. Page 10 in the manual shows the necessary pins, and I am only using Pin 8 (Ground) and Pin 3 (RS232 / RS485 Input Signal), since I only need to read the data from the flow meter. The code that I am using is as follows:
`#include <SoftwareSerial.h>
#define RX_PIN 0 // Arduino RX pin (receive)
SoftwareSerial deviceSerial(RX_PIN, -1); // Create a software serial object
void setup() {
Serial.begin(19200); // Set the baud rate for Arduino's serial communication
deviceSerial.begin(19200); // Set the baud rate for device's serial communication
}
void loop() {
// Read the pressure, temperature, and flow from the MiniDIN connector
float pressurePSIA = readPressure(); // Read pressure in PSIA
float temperatureC = readTemperature(); // Read temperature in Celsius
float flowSLPM = readFlow(); // Read flow in SLPM
// Display the values
Serial.print("Pressure: ");
Serial.print(pressurePSIA);
Serial.println(" PSIA");
Serial.print("Temperature: ");
Serial.print(temperatureC);
Serial.println(" °C");
Serial.print("Flow: ");
Serial.print(flowSLPM);
Serial.println(" SLPM");
delay(1000); // Delay between readings
}
// Function to read pressure from MiniDIN connector
float readPressure() {
deviceSerial.println("P"); // Send command to request pressure value
// Wait for response
delay(100); // Adjust the delay based on the response time of your device
// Read the response from the device
String response = deviceSerial.readStringUntil('\n');
// Parse and convert the response to a float value (pressure in PSIA)
float pressureValue = response.toFloat();
return pressureValue;
}
// Function to read temperature from MiniDIN connector
float readTemperature() {
deviceSerial.println("T"); // Send command to request temperature value
// Wait for response
delay(100); // Adjust the delay based on the response time of your device
// Read the response from the device
String response = deviceSerial.readStringUntil('\n');
// Parse and convert the response to a float value (temperature in Celsius)
float temperatureValue = response.toFloat();
return temperatureValue;
}
// Function to read flow from MiniDIN connector
float readFlow() {
deviceSerial.println("F"); // Send command to request flow value
// Wait for response
delay(100); // Adjust the delay based on the response time of your device
// Read the response from the device
String response = deviceSerial.readStringUntil('\n');
// Parse and convert the response to a float value (flow in SLPM)
float flowValue = response.toFloat();
return flowValue;
}`
I would appreciate any assistance on this matter. Also would I need to use RS232/RS485 shield?