Arduino has some strange reactions

Try a 100uF capacitor each side of a 1mH choke.
Also put this on the 5V line out from the arduino to the relay board.
You said earlier you have tried to isolate things, how have you tried to accomplish this?

So put a 100uF electrolytic cap on the power supply input (in parallel), as well as the 5VDC out to the relay board the same way? How do I wire the choke in? Thanks for your help.

The way the Pi circuit is shown here.
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html
The inductor is in series with the supply with a capacitor to ground on each side of the inductor.

It would look like you need to get some RC suppressors for the AC Relays. Whenever you switch off a coil you get are probably goint to get some noise - might get lucky and switch at zero crossing but...

They make RC suppressors that you can get from an industrial suppliers. Check for an Allen-Bradley distributor.

Another possible method is to put some ferite beads on the lines running to the Arduino board. ou are getting induced voltage spikes that are affecting the low voltage side of your control box.

Grumpy_Mike:
The way the Pi circuit is shown here.
De-coupling
The inductor is in series with the supply with a capacitor to ground on each side of the inductor.

Thanks for link and info. You mentioned to use a choke on "either side", what did you mean by that? The schematic on that page shows a choke/inductor wired in series with the + side of the supply to the IC, after the cap. Perhaps you meant on the +5VDC out to the relay board as well.

For the relay board, I take it that it would be best to put this at the input terminals, rather than on the arduino output since there is a decent separation of those points in wire length.

I tried even a preliminary try with a 100uF cap that I had with no noticeable difference yet. I will have to buy some different size chokes to try.

kf2qd:
It would look like you need to get some RC suppressors for the AC Relays. Whenever you switch off a coil you get are probably goint to get some noise - might get lucky and switch at zero crossing but...

They make RC suppressors that you can get from an industrial suppliers. Check for an Allen-Bradley distributor.

Another possible method is to put some ferite beads on the lines running to the Arduino board. ou are getting induced voltage spikes that are affecting the low voltage side of your control box.

Thank you for the advice. Perhaps that is what happening and why it is a bit random, depending on where it is switched. In regards to the RC suppressor I will investigate it more. I found a good writeup by S+S, The Official website for all your motor control and protection needs | Sprecher + Schuh

I doubt that I will get this accessory for my contactor, as it isn't as high end as the S+S but I could try to replicate it with individual components.

My contactor is a 24VAC coil.

You mentioned to use a choke on "either side", what did you mean by that?

No it was a capacitor on each side of the choke.

The other advice I have given you before is to use a snubber circuit. That is what cncb is saying.

So I did some more testing and tried a few things. I have to buy some ferrite beads/chokes to play with, but I still wanted to isolate the power sources. This time I took it a step further, which I've detailed below.

  1. The most apparent problems occur when the solenoid is switched off, however the contactor has some less noticeable issues.

  2. Sometimes the AC contactor with no load, being switched “off” resets the arduino or ripples the DC supply enough to reset it. This isn’t noticable by eye but by the way it reacts, it drops all outputs in a way (in my limited experience with the arduino) that could only be done by a reset, and prints the serial in a way that could only be done by reset.

  3. Simple DC/AC Relay switching causes no apparent problems. (IE: Switch + Relay Board + Relay, no Load)

  4. I tried adding an addon Contactor RC Snubber to the coil, no #2 problems with it installed, same as simple LL, LV operation. No resets apparent at all and no half flashes of LEDs on the relay board, it seems perfect.

  5. Keeping the RC snubber in, and powering the dc bus from a bench supply on House Circuit 1, AC Transformer on House Circuit 2, and the rest of the power for the box on House Circuit 3, the problems are just as apparent if not worse than before. Sometimes causing up to 3 cycles on the solenoid inadvertently until it appears the arduino gets enough ripple to reset itself and de-energize the outputs, so to speak.

Any ideas on how this tiny AC solenoid load is causing these problems? Even being isolated on completely different circuits? I'm confident that the RC snubber has alleviated the problems on that side, and I even put a considerably larger inductive motor load on the contactor and it works flawlessly. Everything leads back to these darn solenoid valves! I will try the decoupling circuit when I get some of those components in from mouser.

Even being isolated on completely different circuits?

I think you are not understanding the term isolated. It means that the two systems have no common connections and that includes ground. In order to isolate a controller from the thing it controls you need an isolating circuit. The simplest of these is an optical isolator or opto isolator for short. I don't think you have these and so you can't claim your system is isolated.

how this tiny AC solenoid load is causing these problems

There are two ways that interference can get from one part of the circuit to the other.

  1. Conducted - normally through ground connections or the power supply
  2. Radiated - suppress with snubbers and ferrites

Mike,

I understand what you're getting at but I've isolated the power sources as far as I physically could. So let me describe my latest test results.

  1. I isolated the AC transformer power to a precision lab grade power source, and I isolated the DC bus to another BK precision dc power supply. I left off the 120VAC bus because after that, the pump is the only thing needing AC power.

  2. With the power sources provided as such the problems are just as apparent. I get misfires on outputs, followed by erratic output switching, it really takes a mind of it's own, all while keeping the input switch closed. I get multiple cycles as though it's latching onto the solenoid until the arduino appears to drop all and flicker the outputs on the way out, which I thought was a reset. However, as far as I can see, the "reset" and I use this term loosely is no way by that I can see caused by a ripple in the dc supply.

  3. My earlier statement of this never happening on a LV level is false (just dc relays and arduino, real vanilla). I proved that yesterday and was stunned. I could get 20 program cycles with different inputs (no ac loads) and it works flawlessly. Then randomly it goes through a cycle of bad ones, flickering, misfires, wrong outputs switched etc as described above. Then I will get through a cycle of say 30 button presses, logic works flawlessly. It's completely random, has a mind of its own and has no consistency what-so-ever.

  4. What is consistent and quite constant is that adding any AC coil load such as the solenoid or contactor, pump, severely magnifies that issue. So it's obviously two fold, there is a problem with my microcontroller internally and maybe some downstream stuff I need to deal with too. We are talking about the arduino switching one relay, and that relay switching another relay, two sets of dry contacts. The smaller relay only carries the load of a tiny led pilot light load and a relay coil, it's so small it's inconceivable to imagine that is being affected by flyback. The UNO responds in a way that isn't erratic as noise causes, it literally follows it's own logic, or gets screwed up and follows bits and pieces of my logic that I've written. Outputs aren't just fluttered or flashed, or held stuck open, they follow actual routines. Inconsistent routines, but routines none the less. I also tried a different but similar load inductive load, same problems. I also tested with the same value load but a resistive load, same erratic problems.

I've purchased another UNO that I will try Monday, but I'm baffled. Again I love the arduino and I'm not trying to state that it's the source of the problem but I want to rule it out. I'm totally open to suggestions, I think I've tried just about everything on my list.

The UNO responds in a way that isn't erratic as noise causes, it literally follows it's own logic, or gets screwed up and follows bits and pieces of my logic that I've written. Outputs aren't just fluttered or flashed, or held stuck open, they follow actual routines.

Yes that is noise induced erratic behavior. What happens is that, say a register, probably the program counter, gets a corrupt value in it and that sends the code off executing from some other place in the program. When a processor goes wrong it goes wrong in a big way not just fluttering outputs.

but I've isolated the power sources as far as I physically could

Maybe it is not enough?

I've purchased another UNO that I will try Monday

It could be you have a faulty processor, but I still think it is a interference problem. What about the case? Is that grounded to a solid mains ground?
What you are seeing is not usual but it is not unique either.

However, as far as I can see, the "reset" and I use this term loosely is no way by that I can see caused by a ripple in the dc supply.

Often this can be difficult to actually see. You need a good storage scope to catch the impulses. Have you probed round the rest of the circuit to make sure the waveforms are as you expect them to be?

There is only a limited number of things I can suggest remotely, it might be time to get a good consultant in to actually examine your system.

May want to try this:
Add a 10uF cap between the reset pin and ground on the Uno board.

Grumpy_Mike:

The UNO responds in a way that isn't erratic as noise causes, it literally follows it's own logic, or gets screwed up and follows bits and pieces of my logic that I've written. Outputs aren't just fluttered or flashed, or held stuck open, they follow actual routines.

Yes that is noise induced erratic behavior. What happens is that, say a register, probably the program counter, gets a corrupt value in it and that sends the code off executing from some other place in the program. When a processor goes wrong it goes wrong in a big way not just fluttering outputs.

but I've isolated the power sources as far as I physically could

Maybe it is not enough?

I've purchased another UNO that I will try Monday

It could be you have a faulty processor, but I still think it is a interference problem. What about the case? Is that grounded to a solid mains ground?
What you are seeing is not usual but it is not unique either.

However, as far as I can see, the "reset" and I use this term loosely is no way by that I can see caused by a ripple in the dc supply.

Often this can be difficult to actually see. You need a good storage scope to catch the impulses. Have you probed round the rest of the circuit to make sure the waveforms are as you expect them to be?

There is only a limited number of things I can suggest remotely, it might be time to get a good consultant in to actually examine your system.

Mike,

Thanks for the info, still new to this microcontroller tech and appreciate your advice. Other than using a battery to "isolate" the dc bus what would you do for true isolation of the arduino / relay board supply and the solenoid? (In a way that would be theoretically impossible to cause inductive issues)

I think the next thing will be getting in there with a probe and as you said try to capture different problem areas to get a better idea of what it's doing. I feel like I'm so close that I can't give up now. 8)

n3qik:
May want to try this:
Add a 10uF cap between the reset pin and ground on the Uno board.

From what I think I remember reading in the past this keeps the board from resetting on com port usage? What did you have in mind with this for this situation? Thanks!

Long shot, but maybe some of the interference is triggering the auto-reset circuit.

Thanks for the suggestion, I tried it for kicks with the same results. Just the contactor coil even causes arduino resets when switching off the load.

I really want to say it's being reset because the arduino drops the outputs without logic or input to do so and prints this in the serial monitor:

"Water TýSystem Initialized"

It's sort of a half baked between Water Tank, and my serial begin printLN "System Initialized".

What else could cause this to happen if not a ripple in the supply? If the DC supply was perfect with no dip, are there any other things that can cause the uno to show that?

Hi,
These EMC problems are hard to debug!

Here's some possible help from http://arduinoinfo.info

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

I think you need transient suppression across that solenoid coil. A MOV (Metal Oxide Varistor) would be good. A series combination of resistor-capacitor may work. Try .1 uf (rated at 400V or more) in series with 47 ohms to start...

Also I tried a new arduino for kicks, mostly because I wanted a second one and needed an excuse. Same things but I kind of expected that. My problems still lie within the system as a whole.

terryking228:
Hi,
These EMC problems are hard to debug!

Here's some possible help from http://arduino-info.info

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

I think you need transient suppression across that solenoid coil. A MOV (Metal Oxide Varistor) would be good. A series combination of resistor-capacitor may work. Try .1 uf (rated at 400V or more) in series with 47 ohms to start...

Thanks for the links. I've tried a redlion suppressor module with the same values you mentioned, in the past and it didn't seem to help at all. The contactor with a suppressor on the coil seemed better, but the water solenoid wasn't phased by it.

Hm....

Wither Ground? How are you powering Arduino? Is the ground side of Arduino connected to "Building Ground"? How?

If it's just back through a USB cable, that can be trouble. Ground can be bouncing..