oxygen generation and storage for large scientific glass torch

I am working on an oxygen generation and storage system for a large torch that I use to make art glass installations. I'll outline the concept and hopefully someone can help me. I am a glass maker not an engineer so hang with me.

I have 5 medical oxygen concentrators that I use to generate pure oxygen. I am running them into a manifold to a vacuum compressor with a 60 gal compressor tank. What I need to do is create a controller that will read the tank pressure and turn the system on and off.

When the pressure transducer reads below 70 psi I need the system to turn on the 5 units one at a time wait 3 or so minutes for the oxygen purity to peak then close a solenoid and turn on the compressor then turn off at 115psi.

I am using an arduino uno with an 8 channel relay and a pressure transducer that reads from 0-150psi and gives an analogue signal of 0.5-5v output respectively.

I have some code written that turns the relays on and off but I am having trouble controlling it from the analogue pressure transducer (A0 input). Can someone give me a template to work from? A simple pressure transducer control code with the "if" function or point me in a direction? All input greatly appreciated!

   int p=analogRead(A0);
   if (p < somevalue1) {
      turn_on_relay();
   }
   if (p >= somevalue2) {
      turn_off_relay();
   }

To prevent the relay (pump) from rapidly switching on and off, use a deadband. That is, somevalue1 is less than somevalue2.

Not a deadband, but hysteresis and state.

Have a variable to keep track of the current state. You'll need this anyway to keep
track of times.

Think what states you have and what readings and timouts should switch between
them and draw out a state-transition diagram.

Typically the pressure going too low is recognised in a different state (normal) to the pressure
going too high (generating), and the set points are different anyway.

Check how to schedule stuff by looking at the blinkWithoutDelay example - don't call
delay, check the time every time through loop.

I am an engineer. Sounds like a neat project. I can't quite understand what you are trying to accomplish exactly. I just wanted to make a note that if you're purifying oxygen, that can be quite risky, especially if your compressing it. If you have read about oxygen safety please ignore this note, if not I recommend you stop and get some oxygen safety training (google oxygen safety).

I work with oxygen cylinders and we have to purchase oxygen cleaned components. I suspect an off the shelf air compressor tank would not be safe for filling with pure oxygen, if that is what your doing.

That being said, we purchase 150 CuFt Oxygen cylinders for $100 from our local gas supply (air products, Delille, Linde Gas, or praxair). You would need a regulator to go with it but it might be a better (safer) solution.

That being said, the previous post should give you a good approach. If you still have questions, post back.

Thanks For all your input! I apologize I didn't post back earlier. Thank you for your concern about using pure oxygen I am extremely aware of the dangers I will be using a new tank and an oiless compressor as well as cleaning anything that comes in contact with the O2 very throughly. I have been using liquid oxygen and am tired of my local gas company and the fees associated, not to mention the dangers of using oxygen under that kind of pressure. The compressor and tank will be kept in a small structure I built on the other side of a concrete wall just in case.

I am going to give the suggestions above a try. If I run into any issues i'll post what I have and see if anyone can set me straight!

Thanks again everyone for your input! I will keep you posted.

Here is my code I am sure it is a mess. when I run it, it just clicks the relays on and off again and doesn't seem to read the analogue input at A0 where did I go wrong?

/*-----( Import needed libraries )-----*/
/*-----( Declare Constants )-----*/
#define RELAY_ON 1
#define RELAY_OFF 0

#define Relay_1  2  // Arduino Digital I/O pin number
#define Relay_2  3
#define Relay_3  4
#define Relay_4  5
#define Relay_5  6  
#define Relay_6  7
#define Relay_7  8
#define Relay_8  9
/*-----( Declare objects )-----*/
/*-----( Declare Variables )-----*/
int waittime; // Delay between changes
void setup()   /****** SETUP: RUNS ONCE ******/
{
  waittime = 1000;
//-------( Initialize Pins so relays are inactive at reset)----
  digitalWrite(Relay_1, RELAY_OFF);
  digitalWrite(Relay_2, RELAY_OFF);
  digitalWrite(Relay_3, RELAY_OFF);
  digitalWrite(Relay_4, RELAY_OFF);  
  digitalWrite(Relay_5, RELAY_OFF);
  digitalWrite(Relay_6, RELAY_OFF);
  digitalWrite(Relay_7, RELAY_OFF);
  digitalWrite(Relay_8, RELAY_OFF);  
  
  
//---( THEN set pins as outputs )----  
  pinMode(Relay_1, OUTPUT);   
  pinMode(Relay_2, OUTPUT);  
  pinMode(Relay_3, OUTPUT);  
  pinMode(Relay_4, OUTPUT);    
  pinMode(Relay_5, OUTPUT);   
  pinMode(Relay_6, OUTPUT);  
  pinMode(Relay_7, OUTPUT);  
  pinMode(Relay_8, OUTPUT);
  delay(4000); //Check that all relays are inactive at Reset

}//--(end setup )---


void loop()   /****** LOOP: RUNS CONSTANTLY ******/
 

{
 int p=analogRead(A0);
   if (p < 511.5) {
  //---( Turn all 8 relays ON in sequence)---
  digitalWrite(Relay_1, RELAY_ON);// set the Relay ON
  delay(300);              // wait for a second
  digitalWrite(Relay_2, RELAY_ON);// set the Relay ON
  delay(300);              // wait for a second  
  digitalWrite(Relay_3, RELAY_ON);// set the Relay ON
  delay(300);              // wait for a second
  digitalWrite(Relay_4, RELAY_ON);// set the Relay ON
  delay(300);
  digitalWrite(Relay_5, RELAY_ON);// set the Relay ON
  delay(300);              // wait for a second
  digitalWrite(Relay_6, RELAY_ON);// set the Relay ON
  delay(300);              // wait for a second  
  digitalWrite(Relay_7, RELAY_ON);// set the Relay ON
  delay(300);              // wait for a second
  digitalWrite(Relay_8, RELAY_ON);// set the Relay ON  
  delay(300 * 4);   // wait see all relays ON
   }
if (p >= 818.4); 
  //---( Turn all 8 relays OFF in sequence)---  
  digitalWrite(Relay_1, RELAY_OFF);// set the Relay OFF
  delay(0);              // wait for a second
  digitalWrite(Relay_2, RELAY_OFF);// set the Relay OFF
  delay(0);              // wait for a second  
  digitalWrite(Relay_3, RELAY_OFF);// set the Relay OFF
  delay(0);              // wait for a second
  digitalWrite(Relay_4, RELAY_OFF);// set the Relay OFF
  delay(0);
  digitalWrite(Relay_5, RELAY_OFF);// set the Relay OFF
  delay(0);              // wait for a second
  digitalWrite(Relay_6, RELAY_OFF);// set the Relay OFF
  delay(0);              // wait for a second  
  digitalWrite(Relay_7, RELAY_OFF);// set the Relay OFF
  delay(0);              // wait for a second
  digitalWrite(Relay_8, RELAY_OFF);// set the Relay OFF
}
/code]

int p=analogRead(A0);The above reads the analog input. Print out the result, so you know what values are obtained.
if (p < 511.5)Above you are comparing an integer and a floating point number. Don't do that.
delay(0);              // wait for a secondThis is a delay for zero milliseconds.

It is possible that you are having power problems with the relays, interfering with the Arduino. Can you post a schematic diagram (a photo of a pencil drawing is fine) showing how the relays are connected to the Arduino, and how they are powered? A link to the product page or data sheet would help.

check out array's and loops

#define RELAY_ON 1
#define RELAY_OFF 0

const int relay[] = {2, 3, 4, 5, 6, 7, 8, 9} ; // note the array is zero based

void setup()
{
  //-------( Initialize Pins so relays are inactive at reset)----
  for (int i = 0; i < 8; i++)
  {
    digitalWrite(relay[i], RELAY_OFF);
    pinMode(relay[i], OUTPUT);
  }
  delay(4000); // give relays time to settle
}


void loop()
{
  int p = analogRead(A0);
  if (p < 511.5)
  {
    //---( Turn all 8 relays ON in sequence)---
    for (int i = 0; i < 8; i++)
    {
      digitalWrite(relay[i], RELAY_ON);
      delay(300);
    }
    delay(300 * 3);   // wait some extra time
  }
  if (p >= 818.4)
  {
    for (int i = 0; i < 8; i++)
    {
      digitalWrite(relay[i], RELAY_OFF);
      delay(1000);
    }
  }
}

I am not an engineer, either. Two years I bought an nitrogen generation system that works identical, but opposite, to your oxygen generators. Only mine was industrial size and sold with the ability to generate 99.999% pure nitrogen at our required LPM flow. The company gave me the money back and removed all the equipment because it would do one requirement or the other, but not both at the same time.

Based on how that equipment was designed, I have to ask if you have determined how well the oxygen generators will work when outputting into a vacuum. You wrote they went to a manifold, then a vacuum pump and storage tank.

Our system would give the best N2 purity when working into a back pressure so the gas in the media beds remained there for a longer time. I suspect your O2 generators work the same.

Our system monitored the N2 purity by using a O2 sensor to detect the residual O2 in the N2 stream. We could visually monitor the value computed and change the flow if is was not in range.

Do the O2 generators have their own O2 storage tanks? I suspect they do, in order to give a continuous O2 output with a pulsed O2 input from the generator mechanism. You will have to monitor that pressure to be sure your compressor does not reduce it too much. Something else for the Arduino controller! Can you gain access to the tank and add a pressure sensor?

Paul

I want to thank everyone for all the input. I apologize i haven't been able to respond in a timely manner but I am listening and appreciate all the info.

Thanks for the interest Paul! There is a sieve bed that scrubs the nitrogen probably exactly the same mechanism as with nitrogen just like you said opposite. The medical units I am using I do believe have an internal storage tank. They vary in their O2 production from 8LPM-3LPM (I am using 5 of them) so what I did was adjust their internal pressure regulator to run them all at 10psi. Having them all run at 10 PSI eliminates any back pressure to the units from the manifold. There is a waste gate solenoid that is a normally open solenoid to allow less pure oxygen out then close when the compressor is engaged.

It would be awesome to be able to read purity levels but I am assuming the units produce pure oxygen I am trying to keep it simple and purity is important but not paramount in my application. If the O2 isn't quite pure it will just melt glass a little slower. I am very new to this programming stuff so I figure simple is best when it comes to my skill set.

Thanks robtillaart I will try the array suggested tonight It looks like it would work great. Thanks again everyone.

This video link is what I am trying to emulate so if anyone is struggling with the concept I may not have described it quite as accurate as this video does.

I did watch the video. A bit scary, no knowing if the various hoses and valves and regulators are actually rated to carry oxygen or not. Be sure you use devices that are designed for O2 and not just compressed air.

Paul

Huge thanks to robtillaart for the code. It worked great! exactly what I needed. I appreciate the concerns about my safety but I assure you I will be just fine. Thanks again for everyone's input and thoughts! I am forever indebted to you all.

I have been tinkering with the array and it is almost perfect my only concern is I need a pause after the first 5 relays turn on of 3 minutes (allow the oxygen concentrators to reach purity) before the last 3 turn on. I am unsure how to adjust the timing in an array pattern for individual relays.