Pressure Test - Help

Hey guys! New to the forum, and new to Arduino. I am a Mechanical Project Engineer, currently working in the medical device field. Right now i have been tasked with creating a system leak test. Basically i created a system that uses a pump to pressurize a system to a specified PSI (3.5) and then close the system and monitor PSI values over 10 minutes. The ending PSI value determines if the product PASSES or FAILS inspection. I would love to automate this process and ive created a simple flow chart to better explain what I need the system to do. I am completely new to Arduino, ive bought some books but im looking for seasoned pros to point me in the right direction, any information would be much appreciated!

ARDUINO DIAGRAM_ALT.PDF (19.9 KB)

Aren't the < > in steps 4 and 5 reversed? You need to add a power supply to your diagram. Flesh out the diagram with specific parts, what voltage and current each part needs. Are you going to drive the valves with relays or transistors as it is certain that the Uno can't drive them. Are you using relay modules with built in drivers or do the relays need driver transistors (and diodes)?

MEMS pressure sensor should do the trick. A relay board for power controls. All rather inexpensive.

Sensor: here

Relay shield here

Of course, multiple vendors for these things.

Ray

are you incharge of checking the deflation of balls for the NFL?

they really could have used your machine about a month ago!

sramirez6208:
I am completely new to Arduino, ive bought some books but im looking for seasoned pros to point me in the right direction, any information would be much appreciated!

You want to create a "Finite State Machine" (FSM) which has three states:

  • pumping until pressure is ready
  • then waiting for 10 minutes
  • then test is ready

As in all my programming examples I'm using the IPO programming model for the loop() function:

  • Input
  • Processing
  • Output
    I've written those three functions as an example.

Example code which shows some debugging messages on Serial:

// programming demo by 'jurs' for Arduino forum
#define PUMP_RELAY 5 // pin where the relay for the pump is connected
#define TESTDURATION 600  // duration in seconds
#define ON LOW    // relay ON state for 'active LOW' relay
#define OFF HIGH  // OFF state is opposite
const float pressureLimit=3.5;  // PSI pressure limit
enum {STATE_INFLATE, STATE_WAIT, STATE_READY};
byte currentState=STATE_INFLATE; 


long nowMillis;
float pressure;

void input()
{
  nowMillis=millis();
  if (currentState==STATE_INFLATE || currentState==STATE_WAIT)
  {
    // dummy pressure measurement: can be simulated with a potentiometer
    pressure=analogRead(A0)/250.0; // measure pressure here using your pressure sensor
  }
}

boolean pumpIsOn;
unsigned long pumingReadyTime;
long testTime;

void processing()
{
  switch (currentState)
  {
    case STATE_INFLATE:
      pumpIsOn=true;
      if (pressure>=pressureLimit) 
      {
        currentState=STATE_WAIT;   // switch to next step
        pumingReadyTime=nowMillis; // remember time when pressure is reached
      }
      break;
    case STATE_WAIT:
      pumpIsOn=false;
      testTime=nowMillis-pumingReadyTime;
      if (testTime>=TESTDURATION*1000L) // after 10 Minutes = 600 seconds * 1000 milliseconds
      {
        currentState=STATE_READY;
      }
      break;
    case STATE_READY:
      // no further processing needed
      // controller needs a reset for restarting
      break;
  }
}

void output()
{ // set the pump ON or OFF
  if (pumpIsOn)
    digitalWrite(PUMP_RELAY, ON);
  else
    digitalWrite(PUMP_RELAY, OFF);
    
  // show some information on Serial/LCD or as you like  
  if (currentState==STATE_INFLATE)
    Serial.print("PUMP\t");
  else if (currentState==STATE_WAIT)
    Serial.print("WAIT\t");
  else  
    Serial.print("READY\t");
  if (pumpIsOn)
    Serial.print("ON\t");
  else  
    Serial.print("OFF\t");
  Serial.print(pressure);
  Serial.print('\t');
  Serial.print(nowMillis/1000.0);
  Serial.print('\t');
  Serial.print(testTime/1000.0);
  Serial.print('\t');
  Serial.println();
  if (currentState==STATE_READY) // finish with endless loop after final output is done
  {
    while(1); // this is the final endless loop
  }
}


void setup()
{
  digitalWrite(PUMP_RELAY, OFF);
  pinMode(PUMP_RELAY, OUTPUT);
  Serial.begin(9600);
  Serial.println();
  Serial.println("*** Pressure Testing ***");
  Serial.println();
  Serial.print  ("State\tPump\tPSI\ttotal\twait");
  Serial.println();
}

void loop()
{
  input();
  processing();
  output();
  delay(500); // this delay will make timing accurate to 500 ms only!
  // for better accuracy use programming logic without any delay!!!
}

As long as you have no pressure sensor, I've provided a sensor simulation on the A0 analogue input pin: You can connect a potentiometer to it for doing pressure simulation.

Not fully worked out: Perhaps you'd like to have output on a LCD text display instead of Serial.

The example is made for using the "Reset" button on the Arduino board to start the next test.

Perhaps have a look.