occasional restarting, relays, isolated

Here is my problem. I have built a batch reactor for a a project at work. The program works, does what it needs to do, stores data, controls feeding, wasting and dilution cycles, controls pH and dissolved oxygen, etc... This was my first big program I wrote, had little experience with programming and circuits.

Now I read about the problems relays can have on the Arduino with restarting. I followed the advice of having the relay board opto isolated from the Arduino. From this website:

https://arduino-info.wikispaces.com/RelayIsolation

My problem occurs when I try and control the pH values. The Arduino will sometimes restart, it seems random. It can switch the relay on, and off 10 times with no problem. Then restart twice in a row.

I don't know if it's needed but here is the code for turning the relays on/off

void checkStates() {
#if NOCHK
  return ;
#endif
  check_pH();
  checkDO();
  automatedCycle();
  return ;
}

void check_pH() {
  if (pH < pH_lowerLimit) {
    pinMode(baseRelay, HIGH);
    delay(700);
    pinMode(baseRelay, LOW);
  }
  else if (pH > pH_upperLimit) {
    pinMode(acidRelay, HIGH);
    delay(700);
    pinMode(acidRelay, LOW);
  }
  return ;
}

void checkDO() {
  if (DO < DO_lowerLimit) {
    delay(1000);
    pinMode(airRelay, HIGH);
  }
  else if (DO > (DO_lowerLimit + 0.50)) {
    delay(1000);
    pinMode(airRelay, LOW);
  }
  return ;
}

I've attached a wiring diagram. I apologize for it, I did my best but it's the first one I have ever made. Hope it makes some sense and is helpful.

The only time that I have a problem is when the acid or base pump is turning on. I can switch all the other pumps on/off to my hearts content with no restarts observed.

I haven't noticed a problem with the mixer (yes it should be connected to the NO on the relay) or the air pump.

Here is a list of the equipment that I am using:

Relay
Arduino
110V AC to 12VDC
5V Converter:
3V Converter:

Please let me know what other information I can provide! I'm sure I left important stuff out.
Thanks for all the help.

Do you have suppression diodes across the pump motors?

Your buck converters are non-isolated, so this effectively disables the relay opto isolation feature because you have a common ground.

I'm suspecting that relay 7 is what controls the pH and that the problem occurs only when this relay is switched OFF.

Relay 7 (R7) should have an MOV connected across the COM and NO terminals. I think this MOV rated at 150VAC and 84J would be a good choice.

dlloyd:
Your buck converters are non-isolated, so this effectively disables the relay opto isolation feature because you have a common ground.

How is there a common ground? Between the Arduino and the power supply for the relays? They are powered by completely different sources. Please educate me, I'm teaching myself all of this as I go along and you all have been a great help on this forum.

outsider:
Do you have suppression diodes across the pump motors?

I do not. I will look into this as well thanks for the info.

I also realized that I forgot to put in the links to the pumps that I have, two are cheap ones, the other three are expensive ones.

Acid/Base
Feed/Waste/Dilution

How is there a common ground? Between the Arduino and the power supply for the relays? They are powered by completely different sources. Please educate me, I'm teaching myself all of this as I go along and you all have been a great help on this forum.

OK, I see you mention USB (wall outlet) on the diagram but didn't mention it in your equipment list. I would test the resistance from Arduino GND to the Relay board GND.

I'm quite sure you also need a MOV ... see my previous (updated) reply.

dlloyd:
Your buck converters are non-isolated, so this effectively disables the relay opto isolation feature because you have a common ground.

I'm suspecting that relay 7 is what controls the pH and that the problem occurs only when this relay is switched OFF.

Relay 7 (R7) should have an MOV connected across the COM and NO terminals. I think this MOV rated at 150VAC and 84J would be a good choice.

Relay 1 and Relay 2 (R1 & R2) are what control pH. R1 controls acid pump R2 controls base pump. R7 controls an air pump.

What you are not seeing on this wiring diagram is the sensor input for PH. Which is the atlas sensor, using the isolated pH with the isolated tentacle shield I also have this setup for DO and temperature. Sorry I should have included this information, I made the diagram late after a long day. I will try and create a full one with everything on it today if that helps. However all of the electrical is on this one. the rest is just sensors, LCD, SD, and RTC

R7 controls an air pump.

Thanks for the details. This is the only circuit with 110VAC and the load is inductive. When the relay contacts break is when there's the most contact arcing, so contact arc suppression is recommended.

I'll bet if you run the system (as a test) without the air pump connected, the problem will go away.

I would:

  • Ensure there's isolation from Arduino GND to relay GND (should not measure low resistance on multimeter)
  • Install MOV (or ferrite core or RC snubber) for R7 (relay 7)
  • Increase the distance from the Arduino to relay module (AC circuit) if possible
  • Use suitable SSR instead of relay 7 if above doesn't work

dlloyd:
Thanks for the details. This is the only circuit with 110VAC and the load is inductive. When the relay contacts break is when there's the most contact arcing, so contact arc suppression is recommended.

I'll bet if you run the system (as a test) without the air pump connected, the problem will go away.

I would:

  • Ensure there's isolation from Arduino GND to relay GND (should not measure low resistance on multimeter)
  • Install MOV (or ferrite core or RC snubber) for R7 (relay 7)
  • Increase the distance from the Arduino to relay module (AC circuit) if possible
  • Use suitable SSR instead of relay 7 if above doesn't work

Ok thanks for all your help. Here is what I have done.

I checked for isolation from relay and Arduino GND, there is isolation

I installed a MOV, I had a comparable one on hand on R7

I don't think the issue is with R7, I can turn it on and off to my hearts content with no problem, I have the MOV in, just in case.

What I did do is hook up the base pump to my dilution pump just to see what happens. They are two different pumps. It works flawlessly. I have been running it for about 15 minutes with no issues of restarting.

Can It be that I need the suppression diode? Is it possible that the waste/feed/dilution pumps have one in them already? i am a bit confused as to how to wire one up. I am not the best at schematics yet.

Thanks for all your help, and education it is appreciated!

Can It be that I need the suppression diode? Is it possible that the waste/feed/dilution pumps have one in them already? i am a bit confused as to how to wire one up. I am not the best at schematics yet.

For each of your 12VDC pumps, the doide (i.e. 1N4007) would be connected in reverse across the pump. cathode to +'ve terminal, anode to -'ve terminal.

Solved! It works great now. I ran it for 15 minutes with the relay switching on/off no issues what so ever.

Thanks for the help. My chemistry degrees don't help me when it comes to electronics =). I'm learning though.