Shop OBEX P1 Docs P2 Docs Learn Events
SX Sprinkler / Irrigation Controller — Parallax Forums

SX Sprinkler / Irrigation Controller

John CoutureJohn Couture Posts: 370
edited 2008-03-08 19:16 in General Discussion
As part of my upcoming course (Spring 2008) and a proliferation of Irrigation Valves around the house, this thread will be about the trials and tribulations of building a Sprinkler / Irrigation Controller using the SX.· Nelson, a fellow SX experimenter in Florida also wants to do a similar project, so there will be at least two of us.

The beginnings of a spec will have to follow (I'm too tired now) but in so many words:

SX Chip
- able to handle at least 6 standard irrigation valves (home depot/Lowes, $10)
- scalable up to 64 valves (with multiple SX's)
- able to handle a complex watering schedule due to municiple codes (even / odd days, full moon, fifth tuesday, you know the drill)
- maybe a connection to the PINK so everything can be handled from a browser
- future wireless for multiple locations
- logging capability
- maybe some smarts with the weather (don't water during a rainstorm, although, here in California, that is not a problem but I imagine it to be a problem in Floridia)


EXPERIMENT #1

Successfully turn an irrigation valve on and off using an SX chip.

I imagine this to be similar to an LED on/off program except that there will have to be something like a ULN2803 in there and a relay or transistor.

Check out the clever design that Jon Williams came up with at www.efx-tek.com

http://www.efx-tek.com/topics/prop-sx.html

Also look at his DC-16 board.·

Electrical Charistics:
Inrush volt-amps· @ 24VAC 8.5VA
Inrush current··· @ 24VAC 0.35amps
Holding Volt-Amps @ 24VAC 5.5VA
Holding current·· @24VAC 0.23amps

My guess is that it will take a SOLID STATE relay or a TRIAC. Still working on this part of the design.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture

San Diego Miramar College
«1

Comments

  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-15 06:09
    Irrigation valves run from 24 VAC so, yes, you'll want to use triacs. You don't have to do anything fancy, unless you're going to derive your DC supply from the 24 VAC transformer and have a common "ground" point between the AC and DC signals (this is what happens with common irrigation controllers). You'll need to add an external EE to store your schedules and valve assignments, and it would be helpful to have a battery-backed RTC as well. One final note on irrigation control: valve wires act like big antennas and can pickup radiated energy that makes it back to your triac; it is useful to put an MOV on the outputs to protect the triacs and the rest of your control circuit.

    Back in my old days at Toro, I was the Senior Product Manager for irrigation controllers. Two of my patents are for a controller that is still on the market today, the Toro ECx (a smale-scale, scalable controller), and that it's still kicking after all this time makes me very happy.
  • ProfessorwizProfessorwiz Posts: 153
    edited 2007-08-15 11:47
    This is what is so neat about this forum, I was just telling the wife 2 days ago, I wanted to do something like this.· I figured it'd make a neat display in the front and still get the job done!· I'll be watching this, and hopefully adding anything I find as well.· I plan on using the same Home depot valves, with the anti siphon.· I was planning on using a standard ac converter and using the solid state relays sold on Parallax, I was going to power the SX by a 9V battery for a while, then use a standard 9v transformer later.· I do have one concern, and that's how long those valves will last opening and closing all the time.



    Russ
  • pwillardpwillard Posts: 321
    edited 2007-08-15 13:13
    Gah!· I feel so dense...· I just made the Jon connection when he said he worked at Toro...· sneaky guy.


    This is a cool project idea.· I'm interested as well since I live in Ga and summer has not been so nice to my lawn.· The "rules" said we could water at night, but I have no timer and manually forgot often enough that I have more brown than green in spots.· I'd love to see how this progresses and even help out if I can.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    There's nothing like a new idea and a warm soldering iron.
  • John CoutureJohn Couture Posts: 370
    edited 2007-08-15 18:46
    Jon,

    On the Metal Oxide Varistor (MOV), do I just look for one that has a voltage rating of 24VAC or do I have to go much higher to handle spikes.

    For example, Jameco has two; one rated at 20v (rms ac) and one at 130v (about $1 ea).

    Thus the 24v power line would be too high for the first one (stk# 261286 ) but it is bad to have TOO HIGH of a voltage rating? (stk # 261294)

    BTW, I looked up your Toro controller, very kool!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-15 19:00
    Go with the 130; if lightning strikes in your area the potential pulse on a valve line will be high than that (I'm not talking direct strike; your controller will blow off the wall if that happens, and the components will look like technocolor, electronic vomit -- I've seen it). Also, use a triac that is beefier than you think it needs to be.

    FWIW: In golf controllers, we put three layers of protection on the triac output: a transorb, an MOV, and a gas-discharge tube. The idea is that the first is very fast but can't absorb a lot of energy, but it starts the process and allows the [noparse][[/noparse]slower] MOV to get going; likewise with the gas tube -- it's the slowest of the group but can absorb the greatest amount of energy. I wouldn't do this on a home sprinkler controller because you don't have thousands of feet of wire running out in spaces with lots of trees (lightning attractors).

    Post Edited (JonnyMac) : 8/15/2007 7:06:10 PM GMT
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-15 19:09
    A hint on time and time math: when your read your RTC convert the time to minutes past midnight (hrs * 60 + mins); this will give you a value of 0 to 1439 and it's easy to work with. Your sequence starting times should be stored in this format as well; it's the easiest two-byte format to work with when dealing with time offsets (versus one byte for the hours, another for the minutes).

    You may also want to provide a test mode on your controller as well; this would activate all valves, one at a time and in order so that you can check to make sure that the valves and heads are performing properly. Your irrigation schedule should run during the wee hours of the morning (when your snug in bed and not checking valves and sprinklers); this is when the soil is cool (less chance of creating a petri dish for bad bugs) and the winds generally low, so most of your irrigation water will make it to the roots and little lost to evaporation.
  • CCraigCCraig Posts: 163
    edited 2007-08-15 23:47
    Just to add some to what Jon said. IF you have zones, test each zone by itself. Again, to make sure the test pressure is close to actual run time pressures.

    HTH, Chris

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I'm not scared of your robot. I'm covered by Old Glory (youtube)
  • ProfessorwizProfessorwiz Posts: 153
    edited 2007-08-16 00:01
    Is there a reason I couldn't couldn't or shouldn't use Crydom D2W203F Solid State Relays? Of course with the correct diode protection.


    Russ
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-16 00:49
    That's an expensive option -- but an option nonetheless. On the very high-end [noparse][[/noparse]golf course] systems I worked with we created 4-channel triac boards with opto-coupling and as much triac protection as we could squeeze in. So even if the triac module failed, we could usually protect the $3000 controller running it -- except from direct strikes, of course (those really make a big mess...)
  • pwillardpwillard Posts: 321
    edited 2007-08-16 03:38
    The MOC3010 seems to still be in production and might not be a bad opto to use since it's designed to drive a triac.· You were saying that you used 3 kinds of surge protection.· I understand Gas and MOV types... what's a transorb and how does it work?

    pete



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    There's nothing like a new idea and a warm soldering iron.
    619 x 271 - 21K
    MOC.jpg 21.4K
  • John CoutureJohn Couture Posts: 370
    edited 2007-08-16 16:06
    Jon mentioned "You don't have to do anything fancy, unless you're going to derive your DC supply from the 24 VAC transformer and have a common "ground" point between the AC and DC signals". I don't understand this.

    I was indeed going to come from 120VAC to a irrigation wall wart (26vac) to the triacs. Then sip power off of the 26vac through a wheatstone bridge (to convert to DC) then to the 7805 to drop it down to 5vdc.

    Hmmm. Now that I say all of that, are they going to have different grounds?


    I'm sooooo confused! smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-16 18:37
    Retail irrigation controllers typically use half-wave rectifiers and have a common ground for AC and DC; this is what makes [noparse][[/noparse]direct] triac switching tricky... something about quadrants (that I am not versed in). If you use optical coupling this becomes a non-issue.
  • John CoutureJohn Couture Posts: 370
    edited 2007-08-17 22:52
    Ok here are the results of the first experiment and I need help from you electronic gurus.

    The datasheets, schematic and program are attached.· The reason for the TLP630 optoisolator and 2N6071A triac are that I happen to have them on hand.· If swaping out the parts will solve the problem, that's fine too.

    Referring to·R3 on the attached schematic:

    ···· value·· ON········ OFF

    R3· 20K· chatters·· full off

    R3· 10K· full on······chatters



    Thus, my problem is that the valve chatters.· If I use a 20K resistor, it chatters in the ON position, if I use a 10K, it chatters in the·OFF position.· Using a POT does not seem to make any difference, it just exchanges behavior at about 12K.

    It seems the chatter means that the resistance is too high to be fully on but not high enough to be off.·

    The·optoisolator alone is 256 ohms.

    Thus, do I need to put another transistor in there?· I tried a 100uf cap between pin 4 and 5 of the optoisolator but, as you can tell, THAT was a shot in the dark (I had to feel like I tried SOMETHING).· All that happened with the 20K resistor it just chattered in both positions.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-17 23:23
    Could it be it's because you have a transistor switching your triac? It's common practice to use an opto like the MOC30xx to do that (I used the MOC3023 in the FC-4 as only needs 5 mA from the SX.
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-08-17 23:52
    I am with JonnyMac in thinking that your opto-isolator may not be driving your triac sufficiently. To test this hypothesis you could try substituting a manual switch in place of the opto-isolator output. That should help identify it as the problem or rule it out.

    - Sparks
  • John CoutureJohn Couture Posts: 370
    edited 2007-08-18 02:55
    Guys you're the BEST!

    Sparks, you're right. I tried that (10K resistor) and it did work perfectly.

    I did learn quite a bit with this though. I'll break down and buy the PROPER chips and then move on to experiment #2.

    Jon, the more I look at your EFX boards, the cheaper they look (grin). Your FC-4 is pretty neat! Thank you for sharing that schematic.

    One of these days I'll start another thread about stage lighting and heavy duty triacs (i.e. 35A) but for now I need to stay focused with the task at hand. Ken Gracey's words keep ringing in my ears. He was talking about the early days of developing his walking robots and said something like learn how to do something and then perfect it. The result for him was each version of his walking robots were better and included more innovations.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • John CoutureJohn Couture Posts: 370
    edited 2007-08-18 02:58
    EXPERIMENT #2

    Program the MCU to handle six buttons and six valves. For each button that is pressed, turn off all valves, then turn on the corresponding valve, reset the timer for 5 seconds at which time, turn off all of the valves.

    [noparse][[/noparse]Editorial Note: The reason for SIX valves is that CAT5 cable can be used to power the valves. (24vac, and six valves = 8 wires) This gives you power to the remote valves in case you want to trigger them at the valve site.]

    [noparse][[/noparse]Second Editorial Note: I'll publish the schematic for experiment #1 as soon as I get the PROPER (grin) components and test it.]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • markistuffmarkistuff Posts: 20
    edited 2007-08-18 06:56
    Hi all,·
    funny this topic was brought up.· thats a cool idea for making an sx controlled timer.··some commerical timers have wireless rain detectors for them. but what would be cooler is have something that senses·how wet the ground is·and weather it needs watered or not.

    ·currently im working for a company installing sprinklers for resdential and large scale commerical grounds. (please excuse my spelling)· The thing that costs alot of money on the large jobs is the copper.· its over 200 bucks for 500 feet of 7 strand direct burrial copper wire.· and figure your running·5 or·6 valve boxes that each need thier own wires,· thats alot of money.· we came up with the idea a few days ago·on one job site to use the a couple of·sx's.· put one in were the timer is, have it connected to all the outputs from the timer.· use it as an encoder,· then run·2 or 3 wires to all the valve boxes. just one set of wire that goes to·everything. then have another sx at each box that acts as a decoder.·· this way you can cut the amount of wire needed drimaticly.· now most common valves are AC power· so 2 of the wires you run to the boxes one for common and the other is the ac power.· use a dioide brindge and voltage regulator to get power to run the sx.· and then have the sx run a small relay that will basicly connect whatever valve is being triggered to the power.· and the third wire is used for the the digital signal.· now becuase its going very long distences from one sx to another running serial data at high speeds most likely will not work but maby if eash pulse is like for 1 second or somehting like that, and also on the encoder sx have it go through a transistor to boost the power or somehting like that.· now thats using 3 wires.· i know you can overlay an AC signal on a DC powerline and isolate it.· but could you do the opposite.· just run the serial data as a DC signal over the AC power line to each box?· if so then the wires needed will drop to 2.· unless you can make the whole thing wireless and have a really good battery.·· tell me if any of this makes sence or not.· my boss told me to make a prototype to see how it would work.· any ideas or sugestions?·
    ·
  • pwillardpwillard Posts: 321
    edited 2007-08-18 14:35
    I believe you are describing something similar to the X-10 System: http://www.smarthomeusa.com/info/x10theory/

    In the case of X-10,·a signal riding on the AC wave is actually data that is interpreted by a receiver.· The X-10 protocol decoder has been implemented with PIC controllers in the past so it seems likely an SX can do it.· At some point though, it needs to be determined if the cost of the solution outweighs the cost of 100ft of low gauge 2 pair for RS232 signals.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    There's nothing like a new idea and a warm soldering iron.
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-19 00:26
    There are irrigation system that use "AC decoders" -- they're mostly used in golf irrigation in Europe and are not cheap; the decoders are powered from the 24 VAC that will run the valve on the head (most golf sprinklers have their built-in valves).
  • John CoutureJohn Couture Posts: 370
    edited 2007-08-19 17:54
    Interesting idea. On a "wireless" system the biggest problem is power .... where does it come from (i.e. battery, solar, etc). What if you were to run two wires (24VAC) to a bank of six valves as MARK suggests.

    Then have something like a 433mHz radio receiver (about $3). The SX decodes the radio signal and decides if the message is for it, and if it is, lights up the valve via the lessons learned from experiment #1.

    To make the logic simple, the SX would receive a signal to turn on valve 101-03 (Bank 101, valve #3). The SX would light up the valve for one minute and then turn it off. If a second command was received within the minute, it would reset the timer and leave the valve on for another 60 seconds. That way you have a fail safe and you don't have to send out a continuous carrier.

    The transmitter might be a little more powerful but still within the legal limit (not sure what that is but my guess is 100mW). This would cost probably about $50-$75 but it could control up to say 256 banks of 6 vales .... Hmmm. The trick is the receiver would need an antenna (which would probably get mowed over or knocked over with a golf ball). Also, golf courses are pretty big and have a lot of surrounding interference (in California, we build golf courses surrounded with houses with huge picture windows, goes to show how smart we are! wink.gif

    On the other hand, you might be able to get a license for a stronger transmitter (say 5W).

    The X10 protocol is a good idea but it doesn't go that far. I have these thing throughout my house and distance that the signal has to travel is a real consideration. However, having said that, the power line in a house has to share with many noisy devices. The irrigation system would only have valves on it.

    TO ALL:

    In Jon's FC-4 design (schematic above), he uses an H11AA1 to detect the presense of the 120V power (I think that was the purpose). Is there a similar type of chip that could connect to the 24AC line at both ends that would work something like the RS-485 protocol? I guess I'm thinking of something like a cheap, single chip design that will allow you to place a signal on the AC line one one end and take it off on the other end.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • John CoutureJohn Couture Posts: 370
    edited 2007-08-19 18:40
    In partial answer to my own questions, here is a good article on "Powerline Carrier" which talks about trying to get a digital signal to ride on top of a AC power line.

    http://www.epanorama.net/links/tele_access.html#powerline

    Hmmmm. I wonder if there is an X10 "chip" that will work on 24VAC lines and can produce a reliable digital signal?

    some info on X10

    http://www.zorinco.com/zweb?page=spix10detail


    Other things I ran into were:

    Model Railroads use a powerline carrier to control the little trains and accessories. However, those are not designed for hundreds or thousands of feet of wire. Would have been a kool solution though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2007-08-20 16:25
    John J. Couture

    TO ALL:

    In Jon's FC-4 design (schematic above), he uses an H11AA1 to detect the presense of the 120V power (I think that was the purpose). Is there a similar type of chip that could connect to the 24AC line at both ends that would work something like the RS-485 protocol? I guess I'm thinking of something like a cheap, single chip design that will allow you to place a signal on the AC line one one end and take it off on the other end.



    I would also like to know·this as well
    ·I have a project in mind if there is some like


    In Jon's FC-4 design (schematic above), he uses an H11AA1 to detect the presense of the 120V power· . Is there a similar type of chip that could connect to the 24AC· and do same thing

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • John CoutureJohn Couture Posts: 370
    edited 2007-08-23 05:50
    Ok, here is the working experiment #1.· I got the Metal Oxide Varistor (MOV) in place but if someone could check me out on its placement.· This circuit works, I just don't know how to verify that the MOV (IC3) ·is working.

    This is a cleaner design than the previous one in that it has a single connection to the power supply for the valve and the other connection is switched.· This mimics how standard wall outlets are wired, one neutral and one switched hot.

    The blue box on the bottom is just because I keep forgetting what pin is what on the triac.

    Ok, gang, now we need some ideas as to how to build up this irrigation controller.· What features do we need?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
    869 x 703 - 14K
  • John CoutureJohn Couture Posts: 370
    edited 2007-08-23 06:27
    Hey gang, speaking of powerline carrier for irrigation control, look at this product. It uses the X10 protocol and control valves.

    http://www.wgldesigns.com/rain8.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-23 14:55
    John,

    The MOV is in the right place. There's really no way to test it outside of applying an over-voltage -- but then this degrades the part (do don't!).
  • John CoutureJohn Couture Posts: 370
    edited 2007-08-24 01:42
    As this is a learning environment and I recently got an email about why I used a triac ....
    The purpose of experiment #01 was to power on and off an irrigation valve running at 24VAC.
    The operative thing in that sentence is the "AC" as in "alternating current".

    Let's start with "DC" (direct current) which most of you are familiar with.
    DC runs in one direction.· If you hook up an LED properly it will light.· Reversing the leads on the LED·will not·light it up.· This is because the LED is designed to only let current travel in one direction.

    To switch an LED on and off you could use a transistor.· As shown in figure 1 below, if you press the switch, it energizes the base of the NPN transistor (i.e. 2N3904) which allows current to flow from the collector to the emitter and thus completing the circuit (and lighting the LED).

    The 24VAC valve requires current to travel in BOTH directions.· If you used a transistor to switch an AC device it would not work properly because it is only getting current HALF of the time because the AC changes direction 60 times a second (in the U.S.) The TRIAC is like a transistor except that it allows current to flow in BOTH directions.· However, remember that a TRIAC is itself an AC device.· If you have been following this thread, you will notice in a previous·message that I goofed and tried to switch the TRIAC with a opto-isolator that had a transistor in it.· This caused the TRIAC to switch on and off 60 times a second.· Jon Williams got me back on track and I substituted in an opto-isolator (MOC3023) that had an LED on one side and a "triac driver" on the other side.· In other words, I can use normal 5vdc on one side and be able to switch an AC load (very SMALL load) on the other side.

    Ok, so we know to switch AC loads with a TRIAC.· The catalog has TONS of them, which one do I use?· The answer to the question is how much current and what it the maximum voltage.· Well most TRIACS are rated in hundreds of volts, so all we have to worry about is current.· The 2N6071A that I show in the schematic can handle 4AMPS at 200VAC.· Remember we are using an irrigation valve that was spec'd out in the first message as having an inrush of 0.35 amps and a holding current of 0.23 amps at 24VAC.· So we are well within specifications. TRIACS come from many manufacturers and some have markings like Q4004.· These are Teccor brand and they work great also (400V, 4A).

    I got started on this TRIAC kick a while back when I was trying to create a nice QUIET speed control for a ceiling fan.· Ceiling fans work fine on full speed but often at the medium or slow speed then hum pretty loudly and when you are trying to sleep that is not good.· Somehow I have a hard time parting with $200 for a fan when I can get a nice cheap one for $14.95 from Home Depot (ok, that was two years ago on sale but still!).· Anyway, at that time I was introduced to QUADRACS ... but that is a whole new discussion someday! Finally, Gunther, one of the three "gods" of the SX (the others being Jon Williams and Bean), has a thread·about IGBT's which are devices designed to switch heavy loads electronically.· Good reading!


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College

    Post Edited (John Couture) : 8/24/2007 3:32:59 PM GMT
    218 x 252 - 8K
  • Jim BJim B Posts: 4
    edited 2007-09-25 22:56
    John,

    I was wondering how your Sprinkler / Irrigation project is coming?· Are you going to have a display on that shows things like time of day, when various zones are coming on, etc.?

    Jim
  • John CoutureJohn Couture Posts: 370
    edited 2007-09-25 23:09
    (grin)

    We can have anything we want. I haven't seen much activity in this topic so I assumed no one was interested.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • ProfessorwizProfessorwiz Posts: 153
    edited 2007-09-25 23:36
    I'm still very much interested! Have you gotten much further?!?
Sign In or Register to comment.