Shop OBEX P1 Docs P2 Docs Learn Events
Sprinkler Sample Code — Parallax Forums

Sprinkler Sample Code

ArchiverArchiver Posts: 46,084
edited 2003-11-06 04:15 in General Discussion
Hi Edward!

It would be very easy by simply adding the "Pocketwatch B" from Parallax from
which you will get an accurate and reliable link onto the actual time, then,
with
the "if...then" command you just have to compare a presetted start-time with the
actual time supplyed to stamp by the "pocketwatch" and compare both, if they're
equal, then the sprinklers start until the next time comparaison or presetted
stop-time.
I have just received my pocketwatch (cat# 27962) and I saved lot of code, time
and
space on the stamp'seeprom.

Have fun!

Rene

Edward a

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-11-04 19:24
    I'm looking for sample code to help me get started on writing code
    for a programmable sprinkler system and drip irrigation system. If
    you could point me to a web link that has the code or a logic diagram
    that would also be helpful. I understand how to turn the sprinkler
    zone on, but I an't quite get a handle on how to deal when to turn
    the sprinklers on based upon a pre-set time, and duration.

    carl
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-05 14:39
    Thanks Rene,

    I thought about the RTC and plan to use it. As far as the presets
    for zone time (on and off), is there a way to have an area in memory
    in which I can store the presets or download new presets when needed
    or would I have to upload an entire program everytime I want to
    change presets?

    Edward
    q127238@y...


    --- In basicstamps@yahoogroups.com, rene genest <rene.genest@q...>
    wrote:
    > Hi Edward!
    >
    > It would be very easy by simply adding the "Pocketwatch B" from
    Parallax from
    > which you will get an accurate and reliable link onto the actual
    time, then, with
    > the "if...then" command you just have to compare a presetted start-
    time with the
    > actual time supplyed to stamp by the "pocketwatch" and compare
    both, if they're
    > equal, then the sprinklers start until the next time comparaison or
    presetted stop-time.
    > I have just received my pocketwatch (cat# 27962) and I saved lot of
    code, time and
    > space on the stamp'seeprom.
    >
    > Have fun!
    >
    > Rene
    >
    > Edward a
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-05 15:38
    I would suggest using DATA statements to define your default programming. You
    can use READ to retrieve this data and WRITE to save changes. By storing your
    irrigation program in EEPROM, it won't be lost during power outages.

    I spent the first 14 years of my professional sprinkler controller development
    for Toro, and even the simplest products required some fairly tricky
    engineering. As I frequently point out in my Nuts & Volts column, starting with
    a solid specification is important. For a sprinkler timer you have to keep
    track of the time, the day, then know when to start a sequence, on what day (you
    may not be allowed to irrigate every day and most cases it's not good for the
    grass to do so [noparse][[/noparse]infrequent watering encourages deep roots]), and in some cases
    you may not have all stations involved in a sequence (you might have one
    sequence for the front lawn, another for the back lawn, a third for shrubs) ...
    and what if it rains? Will you have a rain sensor input that will stop the
    sprinklers when it's raining? In some areas rain shut-down is required by law
    (the easiest way is to break the valve common, but the controller doesn't know
    what's happening).

    Finally ... underground valve wiring is a great "antenna" for radiated energy
    (i.e., lightning strikes, even many miles away). If you move forward I would
    suggest optical protection of your Stamp output pins and really beefy triacs on
    the output stage (look into the MOC3010/3012).

    I hope these thoughts are helpful.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Edward [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=o9y5km1rgRFxGidpCWHwmfXyj47FxcGwl9OIAXCNgnhzZpKoyfEupSyc-6HmnRV_79jhxRJOtDkh]bidder3@h...[/url
    Sent: Wednesday, November 05, 2003 8:39 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Re: Sprinkler Sample Code


    Thanks Rene,

    I thought about the RTC and plan to use it. As far as the presets
    for zone time (on and off), is there a way to have an area in memory
    in which I can store the presets or download new presets when needed
    or would I have to upload an entire program everytime I want to
    change presets?

    Edward
    q127238@y...


    --- In basicstamps@yahoogroups.com, rene genest <rene.genest@q...>
    wrote:
    > Hi Edward!
    >
    > It would be very easy by simply adding the "Pocketwatch B" from
    Parallax from
    > which you will get an accurate and reliable link onto the actual
    time, then, with
    > the "if...then" command you just have to compare a presetted start-
    time with the
    > actual time supplyed to stamp by the "pocketwatch" and compare
    both, if they're
    > equal, then the sprinklers start until the next time comparaison or
    presetted stop-time.
    > I have just received my pocketwatch (cat# 27962) and I saved lot of
    code, time and
    > space on the stamp'seeprom.
    >
    > Have fun!
    >
    > Rene
    >
    > Edward a
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-05 15:42
    Edward,

    Yes, you can store your pre-set values, and can change them via keypad or
    switches or whatever. Even if the power goes out your stored values will be
    fine. No need to connect to a computer and re-program.

    Jonathan

    www.madlabs.info

    Original Message
    From: "Edward" <bidder3@h...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, November 05, 2003 6:39 AM
    Subject: [noparse][[/noparse]basicstamps] Re: Sprinkler Sample Code


    > Thanks Rene,
    >
    > I thought about the RTC and plan to use it. As far as the presets
    > for zone time (on and off), is there a way to have an area in memory
    > in which I can store the presets or download new presets when needed
    > or would I have to upload an entire program everytime I want to
    > change presets?
    >
    > Edward
    > q127238@y...
    >
    >
    > --- In basicstamps@yahoogroups.com, rene genest <rene.genest@q...>
    > wrote:
    > > Hi Edward!
    > >
    > > It would be very easy by simply adding the "Pocketwatch B" from
    > Parallax from
    > > which you will get an accurate and reliable link onto the actual
    > time, then, with
    > > the "if...then" command you just have to compare a presetted start-
    > time with the
    > > actual time supplyed to stamp by the "pocketwatch" and compare
    > both, if they're
    > > equal, then the sprinklers start until the next time comparaison or
    > presetted stop-time.
    > > I have just received my pocketwatch (cat# 27962) and I saved lot of
    > code, time and
    > > space on the stamp'seeprom.
    > >
    > > Have fun!
    > >
    > > Rene
    > >
    > > Edward a
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-06 04:15
    No problems Edward

    The EEPROM map memory get the program code from the bottom to the top
    and writing datas on that eeprom start from the to of the map to the bottom, so
    by using the command "write " , you will wride your start & stop time on a
    "non volatile memory" . You can see it from the menu of your stamp editor on the
    "run" submenu, check for "memory map" or sometime with the command Ctrl+m.

    Hope it will help!

    Rene

    Edward a
Sign In or Register to comment.