ATtiny Watering Timer Turns off the Water When You Forget

ATtiny Water Timer

A pal of [Kyle's] was regularly leaving his sprinkler on for too long. He also had forgotten to turn the water off while topping off his pool a couple of times, an embarrassing and wasteful situation. Being such a good friend, [Kyle] offered to make him a water timer. This isn’t a regular water timer that turns the water on and off at the same time every day. This device allows the user to push a button to have the unit switch on a solenoid valve, permitting water flow. After a predetermined amount of time the unit removes power to the solenoid valve which stops the water flow, successfully preventing pool overflows and excessive watering.

[Kyle] started off his design using a 555 chip to do the counting. He quickly became worried that timer lengths over 10 minutes would cause inconsistent functionality due to the leakage current of the capacitor and the charge current of the resistor. There are ways around this, but rather than complicate the design he switched to an ATtiny microcontroller. The added benefit of the ATtiny is that he could connect up a potentiometer to adjust the on-time without replacing parts or making a new unit. When the potentiometer is turned, the on-board LED will flash a number of times which corresponds with the delay in minutes. Ten flashes means a 10 minute delay. It’s a simple and clear interface.

As if the home etched PCB wasn’t cool enough, [Kyle] 3D printed up a case for the unit. The case permits access to the screw terminals and has provisions for the indicator LEDs. Check out the integrated flap in the top of the case. When this portion of the case is pushed in, it presses the PCB-mounted on/off switch.

If you are interested in making one, all of the files and code are available on [Kyle's] site.

via [dangerous prototypes]

17 thoughts on “ATtiny Watering Timer Turns off the Water When You Forget

    1. Haha, not at all but it was intended to be installed with the pool pump, heater, and other controls where water won’t be a problem.

  1. wut? You just put a 4020 (ripple counter) on the output of the 555 in astable mode and take your pick of the output bits. Wire the chosen output back to the 555 reset and it becomes a one-shot timer. And, uh, you know you can control the speed of a 555 with a pot, right, it being an RC timer?

    1. Exactly. I think things get overly complicated/overly engineered anymore. Slap a few components together and learn all that they can do. That’s not the mentality these days though. Quickest way to get to an end result and done. I will give a thumbs up that he designed a PCB instead of leaving it a mash of wires though.

          1. As my mentor taught me, a great engineer can do for a quarter what a run of the engineer does for a dollar.

    2. I always feel the biggest douche chills every time someone posts a “why didn’t you complicate things to show how smart you are” comment. Get over yourself.

      1. It may be cheaper. But the way the post was written makes it seems like he just gave up and switched gears. I have no problems switching to an ATiny when code is needed. Don’t get douche chills, it is just different strokes different folks. I guess I just hack and combine differently.

        1. I think the objection isn’t doing things differently, it’s coming in and acting all baffled and asking “why didn’t you just _____??” like W did, giving the distinct impression he’d never even considered tastes other than his own.

          Analogy: it’s the difference between “Does this accomplish a task or was it purely for fun?” versus “What’s the point?” One of these is a fair question; the other is a “complex question” that takes a certain philosophy as axiomatic.

  2. A small transformer or Plug pack (WallWart) or even an el cheepo USB charger along with an opto-couple could have made this thing safe to some degree.

    As it stands there is absolutely no chance it would pass safety requirements in the country where I live.

    No offense to Kyle, he knows what he is doing and will mount this in a way to compensate for it’s limitations, however for those who do not have such experience, don’t try this at home.

    1. Bob – it must be a strange country you’re living in since one on those common light dimmers wouldn’t pass the safety requirements there either. With no isolated psu’s or optocouplers in them, using a pot as user interface and having mains in/out controlled by a triac they’re basically the same (but with a quite bit less parts and different functionality).

      So I don’t see the big issue here. The circuit has a fuse for protection against catastrofic failures and overloads. If the dump resistor power handling capability is correctly calculated there’s enough cooling (the cooling requirement goes for a light dimmer as well) there’s no reason for being a bad design at all.

      Of course it needs to be mounted in a suitable casings, but so does a light dimmer and also your proposed solution – using a low voltage UI doesn’t remove the hight voltage relay/triac part from the design.

      1. Any metal or conductive material (or capacitively reactive) accessible from the external side that also enters the internal side must be earthed. That’s easy for the screws in the back but impractical for the screw terminal block. That’s why terminal points always have a secondary cover.

        The vent holes in that back are too large to be approved without a grille as live circuitry is far too close. The vent’s in general would mean that it cannot be approved for outdoor use.

        A light dimmer has a plastic shaft on the dimmer pot. No conductive materials go from inside to outside. The screws on the wall plate are also covered over with plastic. This in itself is ‘isolation’.

        When I said ‘will mount this in a way’ I was assuming there would be a complete secondary cover. My point was that if a person isn’t aware of the need for a secondary cover then they shouldn’t attempt this.

        As it stands, even contact with the 5 volt rail for the MCU or even the MCU’s ground will result in a high voltage shock.

  3. Use water flow sensor, so you can activate it simply by turning the water on :) However i am not sure how to tell if water was stopped only by solenoid or also by regular valve, so solenoid can be safely open to allow next use cycle…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s