Author Topic: Driving watering electronic timer with Moteino  (Read 20410 times)

Lukapple

  • Full Member
  • ***
  • Posts: 202
Driving watering electronic timer with Moteino
« on: April 04, 2015, 06:02:29 AM »
Hi.
I bought electronic timer for watering the garden. What I want to do is controlling it with Moteino.
Timer module can be seperated from the part with valve. Those two modules are connected with cinch.
I've connected multimeter to that cinch connector on timer module and measured voltage when ON/OFF button is pressed
However, my multimeter doesn't support "max peak measuring", so on the attached pictures are seen approximate measuring results (ON = +0.5V, OFF= - 1.5V).

Any idea what kind of valve is used in watering timers? What is the best way to control that valve with Moteino? Can it be done only with Moteino or do I need any additional electronic components?

Here are some photos of the electronic timer:






« Last Edit: April 04, 2015, 06:04:37 AM by Lukapple »

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: Driving watering electronic timer with Moteino
« Reply #1 on: April 04, 2015, 08:23:28 AM »
Typically those valves are controlled by a low voltage DC motor that drives a gear train which brings the speed down to a couple RPM and increases the torque needed to open a ball valve.  The tricky part is knowing EXACTLY when the valve is open and when it is closed.  On the devices I've taken apart, the shaft of the ball valve had a cam that tripped a microswitch so the controller knew exactly what state it was in.  Unless there is some electronics in the valve housing, I'm not sure how the controller knows that the valve is open or closed.

Since you only have a meter (not a scope), it would be difficult to know exactly what protocol is used.  However, since a low power controller is unlikely to operate above 5V and most logic these days will operate with 3V signals, you might be able to experiment to see if it uses some DC state to control the valve.  Given that you get both positive and negative signals, the controller signal might be capacitively coupled to the valve.  A simple experiment might be to use a 10-100uF and a 3volt battery.   Tie the - side of the capacitor to your valve input and the - side of the battery to the common terminal.

To turn on the valve, try connecting the + side of the capacitor to + side of battery, leave it there for a couple of seconds (so the capacitor charges).   
To turn it off,  take the + side of the charged capacitor to the common (- side of the battery).  Does the valve turn off?

If you were in the US I'd offer to scope it for you (because I'm curious myself), but I see the French packaging so that would be difficult and expensive to send back and forth (unless you are in Canada).

Tom

Lukapple

  • Full Member
  • ***
  • Posts: 202
Re: Driving watering electronic timer with Moteino
« Reply #2 on: April 04, 2015, 02:39:29 PM »
Hi.
Thanks for your answer. Next week I'll get osciloscope and will do some measures and post results. I'll also take apart valve module, to see what's inside.

Lukapple

  • Full Member
  • ***
  • Posts: 202
Re: Driving watering electronic timer with Moteino
« Reply #3 on: April 08, 2015, 02:22:40 PM »
Update:
Here is how does ON/OFF signal looks like:



Any hints how to create that signal with Moteino ?
« Last Edit: April 09, 2015, 01:04:36 AM by Lukapple »

Lukapple

  • Full Member
  • ***
  • Posts: 202
Re: Driving watering electronic timer with Moteino
« Reply #4 on: April 09, 2015, 04:47:15 PM »
Update:
In valve module there is just dc motor.

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: Driving watering electronic timer with Moteino
« Reply #5 on: April 10, 2015, 05:26:56 PM »
Sorry for not replying sooner, I thought I had, but I guess it was the time I found myself face down, sleeping on the keyboard (bnbnbnbnbnbbnbnbnbbnbn).  :-[

It looks like the 'motor' isn't a motor at all and is a DC Latching Solenoid!  Cool!  How much does this valve/controller cost???

In any case, have I got a circuit for you!  I haven't deployed this project yet, so the SW isn't final, but attached is a schematic that will generate the voltage (12V for my solenoid but can easily be shifted in SW to 9V) AND give you a healthy pulse to drive the solenoid to one state or the other.  It takes the Moteino about one second to charge up the cap to 12V and only 10mS to trip my solenoid (Hunter DC Latching).

I'll post the complete design some time next week.

Tom


Lukapple

  • Full Member
  • ***
  • Posts: 202
Re: Driving watering electronic timer with Moteino
« Reply #6 on: April 11, 2015, 04:07:00 AM »
Hi Tom.
Woow, you're genius! It's true, valve is using DC Latching Solenoid (like part from old pinball machine).
I went deeper and disassembled that valve.
Here are additional details:





There is some rubber seal attached on solenoid and it seals hole on that white square part, so water stops.

Here is video of that solenoid in action  ;D

That water timer was not so expensive, abut $30.

Thanks a lot for schematics, I'll study it and will be back with more questions :)

L

Lukapple

  • Full Member
  • ***
  • Posts: 202
Re: Driving watering electronic timer with Moteino
« Reply #7 on: April 13, 2015, 03:34:58 PM »
Hi Tom.
Any updates on your project yet? :) Can't wait to order components and put pcb board together.
Could you explain to me how does your circuit diagram work?
How much current does that "healthy pulse" need?

Thanks

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: Driving watering electronic timer with Moteino
« Reply #8 on: April 13, 2015, 05:01:09 PM »
Hi Tom.
Any updates on your project yet? :) Can't wait to order components and put pcb board together.
Could you explain to me how does your circuit diagram work?
How much current does that "healthy pulse" need?

Thanks
I just started debugging late this afternoon so haven't made much progress on it yet.  It'll be a couple of days yet.

The large capacitor is charged to the solenoid voltage and then dumped into the solenoid so all the heavy current is supplied by the large cap, not the battery.  IIRC the peak current from the battery was less than 65mA, but I'll have to measure it again, once it's running.

Tom

Lukapple

  • Full Member
  • ***
  • Posts: 202
Re: Driving watering electronic timer with Moteino
« Reply #9 on: April 16, 2015, 10:51:34 AM »
Hi Tom.
Few questions:
- why do you need BATT1 (2xAA). Is this the power for Moteino? If yes, then it should be probably connected to PWR Moteino pin (currently it's connected to 3.3v output)?
- you're using D5 pin to open Q5, and when Q5 is in open state, C3 is charging. With D5 you control how much V you charge Q5. Is that right?
- C1 and L1 are there for protection, right?
- v_solenoid is voltage of C3, which is dumped into the solenoid, right?

Could you explain to me why did you choose that approach. It would be probably easier, if you use just that transistor H-bridge, with gates connected to Moteino and power solenoid with 9v battery (for my case) and then controlling pulse length with software timer in moteino? Would that work?
What is the advantage of using your version with caps?

Thanks

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: Driving watering electronic timer with Moteino
« Reply #10 on: April 16, 2015, 07:36:31 PM »
My posting for this project will explain the updated circuit, but a couple of answers below...
Hi Tom.
Few questions:
- why do you need BATT1 (2xAA). Is this the power for Moteino? If yes, then it should be probably connected to PWR Moteino pin (currently it's connected to 3.3v output)?
If you look at the note inside the Moteino Module block, you'll see that I remove the VR from the module so that I can drive the 3.3V pin as a power input and, yes, the 2XAA drives the Moteino directly.
Quote
- you're using D5 pin to open Q5, and when Q5 is in open state, C3 is charging. With D5 you control how much V you charge Q5. Is that right?
- C1 and L1 are there for protection, right?
- v_solenoid is voltage of C3, which is dumped into the solenoid, right?
Nope, Nope, Nope. C3 is simply a filter cap on the power supply (VBat).  Q5 supplies current into L1 when D5 is low and that current is blocked by D1. When Q5 is turned off, however, that's when the interesting stuff begins... Think about it...
Quote
Could you explain to me why did you choose that approach. It would be probably easier, if you use just that transistor H-bridge, with gates connected to Moteino and power solenoid with 9v battery (for my case) and then controlling pulse length with software timer in moteino? Would that work?
What is the advantage of using your version with caps?
'Work' is a matter of definition.  Yes, it would work.  Would it be easier?  Sure.  Would it be efficient?  Not at all.   Think about what power this device needs and when.  The device needs ~3.3V ALL the time.  It needs a High Voltage some of the time (rarely, actually, a few seconds every few days).   What is the mAH rating of your anemic 9V battery, most of which is being thrown away regulating down to 3.3V.  What is the mAH rating of a couple of hefty AA batteries, which can supply the power directly to the Moteino without conversion or loss...
Quote

Thanks
You're welcome...   :D
Tom

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: Driving watering electronic timer with Moteino
« Reply #11 on: April 17, 2015, 05:40:07 PM »
FYI, I started the description of my Sprinkler Valve in its own thread: https://lowpowerlab.com/forum/index.php/topic,1046.msg6718.html#msg6718

I should be able to provide full documentation over this weekend.

Tom

Lukapple

  • Full Member
  • ***
  • Posts: 202
Re: Driving watering electronic timer with Moteino
« Reply #12 on: April 17, 2015, 05:45:22 PM »
Hi Tom.
Thanks for answers and for sharing your work with us. Can't wait for full documentation.
 :D

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: Driving watering electronic timer with Moteino
« Reply #13 on: April 18, 2015, 02:21:23 PM »
Well, as luck would have it, my own hose water timer died just as we're having this discussion.  It didn't 'die' exactly, but it began leaking out of the housing.  The unit is an Orbit Single Dial Water timer (http://www.amazon.com/Orbit-62061N-91213-Single-Dial-Water-Timer/dp/B004INGS8S) and I replaced it with a Nelson Large Timer w/ LCD Screen (http://www.amazon.com/gp/product/B007FG7TWO).  As far as I can tell, the two units are identical except in appearance and quality - the Nelson appears to be better quality (despite its lower price) - it's more solidly built and has a metal coupling in the inlet side vs plastic on the Orbit.

In any case, I replaced the Orbit and, having had this discussion, decided to take it apart (I probably would have done that anyway, but was even more 'inspired' now).

Four very interesting discoveries:

1. The place where it was leaking was actually poorly assembled and after reseating the cover on the valve (and generous application of silicone grease) the unit no longer leaks and is still usable.
2. This (and the Nelson) use a DC Latching Solenoid as well!!!  My, my.  I thought these were like another valve I took apart that had gear motor driven ball valve.  Nope. 
3. When I took the valve apart to reseat it (and learn about its insides) I was surprised to find that the metal plunger inside did not 'toggle' between two magnetic ends as I had imagined.  The plunger moved freely inside the coil shell with only a spring to keep it closed.  Hmmmm, is it powered all the time it's on?
4. Nope!  It has a similar type of bipolar drive as the DC Latching solenoid I've been testing recently and the type Lukapple discovered in his own device.  A lot higher voltage and current than my valve, but bipolar nonetheless!

After learning #4 above, I've concluded that the plunger must get magnetized from the heavy pulse and, consequently 'sticks' in the open position until it's demagnetized (or reverse polarized) by the close pulse.  Regardless, my conclusion is that a similar type of drive as I use on my own sprinkler control could be used for this type of solenoid as well.  The only caveat is that the voltage and current is much higher.

I measured pulses that peak at about 22 volts and over 3 1/2 Amps!  That's a lot of energy!

Attached below are my measurements.  Yellow trace is current at 1A/V and the blue trace is voltage (10V/div).

Tom

EloyP

  • Jr. Member
  • **
  • Posts: 58
Re: Driving watering electronic timer with Moteino
« Reply #14 on: April 19, 2015, 02:45:14 AM »
Well, as luck would have it, my own hose water timer died just as we're having this discussion.  It didn't 'die' exactly, but it began leaking out of the housing.  The unit is an Orbit Single Dial Water timer (http://www.amazon.com/Orbit-62061N-91213-Single-Dial-Water-Timer/dp/B004INGS8S)

[...]

In any case, I replaced the Orbit and, having had this discussion, decided to take it apart (I probably would have done that anyway, but was even more 'inspired' now).

[...]

After learning #4 above, I've concluded that the plunger must get magnetized from the heavy pulse and, consequently 'sticks' in the open position until it's demagnetized (or reverse polarized) by the close pulse.  Regardless, my conclusion is that a similar type of drive as I use on my own sprinkler control could be used for this type of solenoid as well.  The only caveat is that the voltage and current is much higher.

I measured pulses that peak at about 22 volts and over 3 1/2 Amps!  That's a lot of energy!

Attached below are my measurements.  Yellow trace is current at 1A/V and the blue trace is voltage (10V/div).

Wow. Just wow! I can't believe my luck and how timely this is! :) This forum is great for sharing ideas and knowledge.

For a long time (a couple of years, on and off, but definitely for *too* long) I have been working on a DC latching solenoid-based water valve controller. The valves have always being made by Orbit. Initially, they were of this type:

http://www.amazon.com/Orbit-62035-Extra-Watering-System/dp/B0016HQOYC/

About 8 years ago I bought two Orbit kits, each with a couple of these valves and a timer. These valves are now discontinued, and while the timers are pretty decent, their limitations (mainly that I hated when it rained in the middle of the night and there was no way for the timer to know there was no need to turn on the valves right before sunrise) is what planted in me an obsession to built a better controller for the type of water valves that can be operated by batteries, i.e. DC latching solenoid-based water valves.

So, about two years ago I started to research, standing on the shoulders of giants, how to drive the above valves:

http://blog.chapus.net/orbit-62035-redux/

Using data from this research I started the design of my own controller. Along the way I found out that the above valves were discontinued and replaced by the valves that (I think) your valve controller drives, Tom. Am I correct to infer that your controller drives valves like these?

http://www.amazon.com/dp/B002HJOUYY?psc=1

Because my original valves were discontinued, I designed my project (borrowing ideas from some other people's work) so it could handle both types of valves (either/or) -- one side of the PCB would handle the old valves, and the other side would handle the new valves. My thought was that eventually my old valves were going to die and I was going to have to replace them with the new generation valves, so I decided it was better to design for the future.

Fast forward to today and you will find me doing "field tests" of this project. The problem I ran into is that things "kind of" work, meaning the valves (the new generation, which starting this year I am using exclusively) would open/close "most of the time". This is obviously catastrophic in this scenario -- imagine a valve that fails to close when you are not around to notice.

Why do I think I am so lucky and the timing of Tom's post is perfect? Well, I can't find any major flaws in my design, both hardware and software (perhaps some of you will, and I'd love to hear about it). And yet, the darn valves won't activate sometimes, so I have been scratching my head for a while. My next move was going to purchase a timer that can control the new generation valves to scope the output and make my own controller behave the same way. In fact, I was planning to go to Lowe's this weekend to get me one of these controllers. But, that won't be necessary now because Tom has just provided the measurements that I need!

Is that time base 4 milliseconds, for a pulse length of about 16  milliseconds,Tom? If so, I think my problem is too low initial voltage and two long of a pulse (I was using around 18 VDC, and afraid of going higher out of fear of damaging the valve, and 20 milliseconds), which are easy to change by modifying my device's configuration.

Once I am sure everything is working well 100% I will publish the software, the Eagle files, and documentation. As a preview, I am attaching a PNG of my design (it does not use a Moteino but the next generation will), a picture of a partially assembled board and a board before going into the reflow oven, and a picture of the board I have in the yard for my field tests (the twisted pair wires are for measurements with a scope on the other side of the brick foundation).

Thanks again Tom!

Cheers,

Eloy Paris.-
« Last Edit: April 19, 2015, 03:25:06 AM by eloy »