Shop OBEX P1 Docs P2 Docs Learn Events
Basic Stamp Timekeeping — Parallax Forums

Basic Stamp Timekeeping

ajwardajward Posts: 1,130
edited 2013-12-08 15:26 in BASIC Stamp
Hey All!

Just wondering... what sort of timekeeping accuracy, over about 12 hours, can the Stamp manage without the assistance of an RTC? I have a DS3231, but that ==way== overkill for something that will be used once and torn down again.
The thought came about one day as Kari and I were discussing nerdy ways to be lazy. Using a servo or stepper with a timer, to push the power button on the Keurig so we wouldn't have to wait the 30 seconds or so for the water to get hot when we get up. Just to see it work once would be fun. An accuracy of 5 or 10 minutes would be just fine... unreasonable?

And yes, this a project right out of the laboratories of "The Society for Aimless Tinkering and World Conquest" :lol:

Amanda - (Wondering about a Federal grant!!!!)

Comments

  • Hal AlbachHal Albach Posts: 747
    edited 2013-12-08 06:59
    I have two Keurig machines and the momentary power switch on both is quite stiff. Also, the ones I have include an "On" time setting which will do exactly what you wish to accomplish. However, so as not to discourage "aimless tinkering" may I suggest using a solenoid to push a somewhat sturdy spring into the switch? A Stamp probably can manage timekeeping with your accuracy goal, as long as that is all the Stamp is doing.
  • bsjohnbsjohn Posts: 19
    edited 2013-12-08 07:26
    "The Stamp’s ceramic resonator timebase is accurate to about ±1 percent, so the longer the timing interval, the larger the error. A clock that was off by 1 percent would gain or lose almost 15 minutes a day" (http://tinyurl.com/mv7yyvn) You also won't be able to determine time of day accurately without a timing chip unless you reset the stamp at midnight or some predetermined time and counted down to brew time but just to see it happen once you don't really need a timing chip.
  • ercoerco Posts: 20,257
    edited 2013-12-08 13:05
    Amanda, you already know the answer and nobody can stop you. :)

    Of course, with a little calibration, you can easily hit your 5-10 minute goal over a 12 hour period. With more careful calibration, I bet you could consistently get under a minute. There is some variance between Stamps, but any given Stamp will operate consistently under constant conditions. Hopefully your indoor temperature doesn't fluctuate much. Even if it does, you can calibrate around consistent temp fluctuations, like a setback thermostats on a timer.

    I've made a BS2 clock debugging time to the screen. Lots of nested loops. You can get any accuracy you want if you put the time in to experimentally calibrate it. RTCs are for suckers! But they are also getting cheap, I posted about an I2C RTC from Ebay China for under $2.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-12-08 15:26
    The Stamp SLEEP command is fairly accurate for long intervals, due to the fact that the Stamp firmware periodically calibrates the watchdog timer against the resonator.

    So if you go and activate it at 2200 hours for
    SLEEP (9*3600 - 600)
    GOSUB hotCoffee
    that should get it started at about 10 minutes to 7am. Could be tweaked for better results.

    Anything that presses the Start button should be worth a federal grant!

    This is the Murata resonator I use on OWL2pe data loggers:
    Screen shot 2013-12-08 at 12.14.06 PM.png
Sign In or Register to comment.