Shop OBEX P1 Docs P2 Docs Learn Events
Dip switches or write to EEPROM or ? — Parallax Forums

Dip switches or write to EEPROM or ?

BullwinkleBullwinkle Posts: 101
edited 2006-05-10 23:47 in General Discussion
I am designing an irrigation controller. Apart from the date and time, which will be maintained by a RTC chip, it needs to the know the current water restriction level. This is simply a number between 1 and 5. This number will control when it is legal for the controller to irrigate. I want to make this value persistent, to cater for any power interuptions. I don't water the unit switching to stage 1 restictions (minimal) in the heat of summer when we are on, say, stage 3 restrictions after an accidental power interuption. Apart from the increased water usage, heavy fines can be imposed.

My choices are:

1 - write the single byte stage value back to EEPROM whever it is changed. This value may be changed several times each summer.

PROS: No additional hardware required.
CONS: Limited number of writes to EEPROM ( but only a few writes a year so shouldn't be an issue )

2 - Use 3 DIP switches to store the value 1 thu 5

PROS: Persistent and robust
CONS: Requires extra hardware, and uses 3 extra I/O pins

3 - Another solution that just occured to me. Make the default restriction stage STAGE 5, which means DO NOT IRRIGATE.

PROS: Simple, cannot accidentally breach the regulations
CONS: Annoying if we get a lot of power interruptions, which we don't.

I think I have answered my own question! lol.gif

KISS is always the best solution.

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-09 01:16
    I used to work for Toro irrigation and have a lot of experience with irrigation controllers (was product manager for them for several years) -- have fun with your project. If you're using a backed-up RTC like the DS1307 you can store the current restriction level in its RAM.· If the level is not going to change frequently then you can in fact use the Stamp's EEPROM without any problems.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • BullwinkleBullwinkle Posts: 101
    edited 2006-05-09 01:39
    Jon,

    That is an idea I had not considered. I am using a battery backed DS1307 RTC in my design. How much RAM is available, and how do I address it? Time to download yet another datasheet. cool.gif

    This is soooo much fun! smilewinkgrin.gif
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-09 01:54
    Indeed, time to check the data sheet -- especially if you intend to use that part.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • BullwinkleBullwinkle Posts: 101
    edited 2006-05-09 02:14
    Woo Hoo! jumpin.gif

    56-byte, battery-backed nonvolative RAM for data storage.

    That's more than the BS2 has AND it will survive a power interuption!

    Thanks Jon - what a brilliant idea. yeah.gif

    And it will help me with my memory problems. I am currently struggling for RAM with my controller program. This will give me all the room I need and more. scool.gif

    Post Edited (Bullwinkle) : 5/9/2006 2:22:20 AM GMT
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-09 02:25
    Send me a box of cookies -- I live in Hollywood.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • BullwinkleBullwinkle Posts: 101
    edited 2006-05-09 03:34
    I don't think it's legal to send food internationally.

    I live in Australia! lol.gif
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-09 04:02
    Really? Some pals from Belgium sent me a HUGE box of beer (many varieties); thankfully only a few bottles broke in transit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • BullwinkleBullwinkle Posts: 101
    edited 2006-05-09 04:36
    Aha, it's only perishable foodstuffs that are prohibited.

    Except, your country prohibits all alcoholic beverages! shakehead.gif

    According to http://www.auspost.com.au/Pdfs/DangerousGoodsGuide.pdf

    D2.3.1 – Alcoholic beverages
    ...
    Subject to D10.10 – Liquids, Australia Post accepts in the post an alcoholic beverage of 70% (or less)
    alcohol by volume, contained in primary receptacles of less than 5 litres capacity. Exceptionally, The
    United States of America prohibits all alcoholic beverages
    .
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-05-09 04:40
    Thats only because distributors want a cut of all the alcohol commerce. Personal posts will typically go through because customs can only check so many packages.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1+1=10
  • BullwinkleBullwinkle Posts: 101
    edited 2006-05-09 04:49
    Cool! scool.gif

    I'll send you a beer Jon!
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-09 17:25
    Not XXXX, though, my Aussie friends tell me it has that name because they couldn't but the "s" word on the cans!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • BullwinkleBullwinkle Posts: 101
    edited 2006-05-09 23:58
    They called it XXXX because Queenslanders can't spell BEER! smile.gif

    I'll send you a Coopers. Best beer in the country!
  • NewzedNewzed Posts: 2,503
    edited 2006-05-10 00:12
    Almost the best.· The real best is Foster's lager.

    Sid
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-10 00:26
    Fosters is for tourists! wink.gif It has been too long since my last trip "down under" -- there is good beer in Oz, I just can't remember the names of what I liked.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-05-10 02:41
    Awww, you mean Foster's isn't Australian for beer? Man my bubble is burst [noparse];)[/noparse].

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1+1=10
  • NewzedNewzed Posts: 2,503
    edited 2006-05-10 11:55
    I lived in Melbourne for three years, so I had ample time to try all the beers.· I'll still take Foster's.· Cold.· Relax, Coriolis, your bubble is intact.

    Sid
  • BullwinkleBullwinkle Posts: 101
    edited 2006-05-10 23:47
    Sorry Newzed, Jon is right. Fosters is for tourists. Just about the only place you will find it is in tourist traps or airport bars. Real pubs rarely have it available. Victorian beers like Victoria Bitter and Carlton Draught are hugely popular around here. But I prefer a bit more flavour in a beer. In this regard Coopers Sparkling Ale is the best in my opinion. It uses the top fermentation method, in the bottle, which results in a slightly cloudy appearance. Also they don't use any additives or preservatives.

    I'll send you one of these Jon, just as soon as I find a sturdy enough shipping container.
Sign In or Register to comment.