ethernet shield Intermittent error

Hi friends,
I have created a way to auto water my garden by using the ethernet shield and relay shield.

The ethernet shield receives an “on” command from the web browser and then engages one of the relays in the relay shield. And, of course, an “off” command disengages one of the relays. The relay is connected to a 24volt AC solenoid. I also have a water flow sensor just to make sure it really does turn “on”.

The problem I am having is that whenever I have the 24 volt AC power plugged in, it almost always does not respond when I tell it to disengage the relay. However, if i do not plug in the 24 volt AC (which is engaged by the relay) then it’s fine - works as expected, flawlessly. This is what leads me to believe it’s a problem on the Arduino end, not the service end. (I have a ferrite bead on all wires)

On the service side, I’m using php cURL command which, in 3 seconds, returns the error “Connection Reset” when cURL doesn’t get what it expects from the Arduino’s ethernet shield. (this only happens periodically, only sending the off command.)

I’ve included pictures of my project, the code, and the service that turns the Arduino on and off.

Any help is appreciated
Thanks

GardenTimer.ino (6.79 KB)

service.php.txt (9.7 KB)

#7 below:

http://forum.arduino.cc/index.php/topic,148850.0.html

bradburns:
The problem I am having is that whenever I have the 24 volt AC power plugged in, it almost always does not respond when I tell it to disengage the relay. However, if i do not plug in the 24 volt AC (which is engaged by the relay) then it's fine - works as expected, flawlessly.

Looks like poor/wrong circuit design.
Show your circuit schematics!

On the one side you seem to switch an "inductive load" (24volt AC solenoid) with an relay, on the other side you seem to have forgotten all countermeasures in your circuit design against transient voltages that occur while switching off an inductive load.

Transient voltages occurring while switching off an inductive load might either damage your controller hardware or lead to failures during operation, if not handled by proper circuit design.

Beginners information here: http://www.jkmicro.com/inductive_loads.pdf

jurs:
Beginners information here: http://www.jkmicro.com/inductive_loads.pdf

Thanks Jurs for that rebuke. That was well written and kindly put. I have not forgotten, I have no formal experience -- so this PDF is a great vital resource, thanks. I'll see what I can do about getting my circuit diagram once I add the additional parts.

To be sure I understand how it should be properly setup, do you mind if I ask you a few questions?

It appears that I need to put a varistor in parallel with the load rated at (1.5 x 24 volts) 36 volts. Would you recommend one with a URL?

The PDF also says "Relays switching an inductive load may require a capacitor placed across their contacts."
I assume this means in parallel. So I'll grab a 0.1ufd to 1.0ufd capacitor with a 100 ohm resistor and put it in series while putting both in parallel with the load. Correct?

Thanks again for the help. I'll make sure the hardware is setup right before I tackle the inconsistency problem and hopefully that will fix both.

bradburns:
It appears that I need to put a varistor in parallel with the load rated at (1.5 x 24 volts) 36 volts. Would you recommend one with a URL?

Im really not an expert in hardware design.
And you didn't tell how much current your solenoid draws at 24 VAC.
Perhaps I'd give eBay article number 251813954040 a try.
But that's not based on my own experience, only based on Google search results and the only specification "24 VAC" you told about your load.

So you'd perhaps better ask someone who is more experienced in circuit design.

bradburns:
The PDF also says "Relays switching an inductive load may require a capacitor placed across their contacts."
I assume this means in parallel. So I'll grab a 0.1ufd to 1.0ufd capacitor with a 100 ohm resistor and put it in series while putting both in parallel with the load. Correct?

The combination of an resistor and an capacitor to prevent transient voltages while switching inductive AC loads is called "snubber" and consists of special capacitors combined with a suitable type of resistor. Ready to use RC-snubber networks with a combination of 100 nF / 47 Ohm or 100 nF / 100 Ohm or 47 nF / 100 Ohm should be easily available when looking for "snubber".

As far as I know you just need one of the parts to prevent voltage transients:

  • either a "Metal Oxide Varistor", which must be carefully selected for your application
  • or a "snubber" which is not very critical in selection (but more expensive)

But as I told you already: I'm not a hardware guru, I'm really better in writing software than designing hardware circuits.