LowPowerLab Forum

Hardware support => Projects => Topic started by: TomWS on April 17, 2015, 05:34:04 PM

Title: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on April 17, 2015, 05:34:04 PM
Well, I've finally gotten the Sprinkler Valve deployed and tested and, hopefully, will be successfully maintaining the water level in my stream from now on.

For the moment, I'll post the PDF of the schematic and a snap of the unit.  I'll post more (eagle files, code, circuit/code description) later this weekend.

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: Felix on April 17, 2015, 09:44:33 PM
Another wonderful project-post in the making, thank you Tom, keep up this great work, can't wait to see more!
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on April 18, 2015, 09:56:45 AM
I have attached below the Eagle Files, an Example Sketch that will operate the valve (no radio code is included in the example), and a few photos (as many as will fit) showing some aspects of the implementation.

Project Description

Using Moteino with an RFM69HW radio, I wanted to be able to remotely control a standard irrigation valve entirely from batteries and have these batteries last, at a minimum, an entire season of watering.  At my home I have SOME irrigation that had been installed by the previous owner, but there are areas that are not covered by the existing system.  Obviously I will need to supply water to these areas, but I didn't want to complicate the new installations with the added complexity of supplying power and control wires to each of the areas that needed new valves - basically I wanted the freedom to place a valve anywhere I could access a water supply.

Given that I already have my home, yard, and workshop covered with Moteino networks, this was the first and foremost consideration.

The first step was to figure out how to open an irrigation valve using batteries.  Most valves I had seen were 24VAC valves. These drew a lot of power and, even if they were operable with a DC supply, running on DC would consume even more power.  Then I discovered DC Latching Solenoids.  These solenoids magnetically latch at either open or closed position and you only need a very hefty pulse to overcome the magnetic latch and drive the solenoid to its opposite state.  It takes a lot of power to drive them, but power is only required for the very brief time it takes to trip.

I purchased one of these solenoids to measure its characteristics (irrigation companies do not supply specifications for these) and discovered that I could operate it with a 12 volt pulse as short as 10mS.  To switch state, I simply applied the DC voltage in the opposite phase. I also discovered that the current would peak at about 1Amp.  Not something I wanted to supply from batteries!

Given the need to drive the solenoid with two opposite polarity signals, an H-bridge driver was the obvious choice and, given that I only needed this 12V supply for a very brief period of time, a switching boost circuit was another obvious element.

I considered using a boost regulator to generate the 12V but realized that I didn't need an accurate voltage, I just needed 'enough' voltage.  Also, I only needed the voltage when the Moteino had already concluded that it needed to change the valve's state and it would have nothing to do while waiting for the voltage to be generated so...

The next obvious conclusion was to use the Moteino processor to generate the switching pulses and monitor the resulting voltage until it was 'enough', then simply fire off the H-bridge to trip the solenoid.

So the overall functional block was clear.  I would have a switcher charge up a capacitor to 'enough' voltage and then use the H-bridge to dump the cap into the solenoid in the proper polarity.  Through experimentation, I determined that 470uF was enough to supply the energy needed to trip the solenoid if I charged it to 12 volts.  Being a conservative guy, I doubled this in the final design.  This would take longer to charge, but would be more reliable at tripping sluggish solenoids, and it wasn't too critical how long it took (as long as it wasn't so excessive that it drained my batteries).

The final choice was the choice of the inductor to boost the voltage into the capacitor.  Here I carefully applied the WIHOH(1) method of component selection and chose a 220uH inductor I had used on another project.

With this circuit implementation, then, I could use a simple loop of back to back digitalWrites(2) driving the gate of Q5, first ON to push current into the inductor (via the 33ohm current limiter) and then OFF to have L1 flyback the current into C1, charging -VSOLENOID to a negative voltage until, after so many pulses, the Moteino would do an analogRead of the A0 pin to check on how much charge was available.  The outer loop continued until there was 'enough'.  Q5 was then turned off and Q1 or Q3 was turned on to switch on the high side of the H-bridge.  One of the cross coupled gates for Q2 and Q4 would then be biased on, thereby completing the circuit to drive the solenoid.

In the circuit, Q6 was added simply to open up the current path through the inductor when the switcher was powered down.  Net is that there is literally no current flowing to the H-Bridge or Switcher once C1 is discharged.

Note that the radio uses a PCB mounted Helix antenna.  I used this so that the weatherproof box was truly weather proof with no openings as required by a straight wire antenna.  This reduces the gain quite a bit, but the device still has plenty of signal margin and is a nice compact package.

Notes:
1: WIHOH - What I Have On Hand.
2. digitalWrites were replaced with assembler code (see next post)
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on April 18, 2015, 11:13:18 AM
This post covers some design details that wouldn't fit (or too much detail) in the previous post.

Coding Details

As noted in the original post, the digitalWrites were replaced with Assembler code.

The back to back digitalWrites worked, charging the capacitor reliably, but, when examining the signal at the junction of L1, R3, and D1, I discovered that most of the time the voltage was ringing, meaning that there was wasted energy - no charge being pumped into the cap during the ringing.  (See 1st photo below)

Looking at the loop timing, it appeared that the 'tight' C-coded loop was pretty 'loose', taking a little over 27uS to complete one cycle and, during the 'off' phase of Q5, only about 3uS was actually charging the cap.  This told me that the loop needed to be tighter than I could get with the built-in I/O functions. 

I decided that the easiest thing to do was simply switch to assembler during this phase so that I could control the timing more accurately and with shorter cycles.  After some tweaking, I ended up with about 7uS ON, 7uS OFF as the optimum cycle time.  This was longer than the 3uS/3uS cycle I expected from the ringing trace, but taking the longer time to charge the inductor ended up charging the capacitor quicker and resulting in the shortest overall time.  (See 2nd photo below)

Current Consumption

In terms of current drain on the battery, this Mote spends most of it's time sleeping.  It spends 10 minutes sleeping if it's 'idle' (the valve is not ON) and simply reports into the Gateway its status at the end of every 10 minute interval.  Every hour it adds a complete status block which includes its current transmit level and battery voltage. 

Either of these transmissions to the Gateway may trigger the Gateway to reply that effectively says "I've got 'something' for you".   If the Mote is ready to accept the 'something', then it sends a new packet to the Gateway telling it "Ok, give it to me".   Normally1 this would occur when some daemon running on the home server determines that the Valve should be turned on and had sent the command to be forwarded to the sleeping Mote.

When the Mote receives the command to turn on the valve, it sets a timer based on the default time or a time included in the request, opens the valve, and changes its 'sleep' time to 10 seconds and its 'report' interval to one minute.  This prevents the Mote from snoozing through its turn off time and gives the Gateway a shorter window to command the Mote to override its timer and shut off the valve immediately (within one minute, anyway).  During this time, the Mote reports that the valve is open and the time remaining.

When the time is exhausted or overridden, the Mote reverts back to its 'Idle' cycle times.

Net is that MOST of the time, the Mote is operating just a few mS out of 600 seconds or ~0.02% duty cycle.  With its 3300mAH batteries and <20uA sleeping current, the Mote will rot before the batteries run down due to current drain.

So the worst case load is when turning the valve on or off.  As it turns out, the current required is less than what the RFM69HW radio consumes during transmit, however, the power to charge up the cap takes a lot longer than it takes to transmit the periodic status packet (840mS vs 3mS) (see third photo below) so overall current drain is higher.

Looking at the fourth photo below, which measures the current drawn on the battery during the charge/fire cycle, you can see (in the yellow trace) the current drawn over time.  The scale is 1mA/1mV so the peak, right at the beginning, is approximately 61mA, but quickly levels off to about 29mA for the remainder of the cycle.  If this occurred often, the batteries would drain quickly, but it's unlikely that a pair of cycles would occur more than a couple of times a week.  Using a worst case scenario (one ON/OFF cycle per day) the power consumed would be (2 x 840mS/(24hr/day*3600seconds/hr)) * ~38mA = ~74uA average power consumed.  Add the 25uA for sleeping and the occasional transmission, gives us about ~100uA average current drain, or, with 3300mAH batteries, equals about 'ARLT'2 (3.67years), which exceeds my goal of lasting at least one season by 'enough'...

Notes:
1. The 'got something' may alternatively include a request to download a new code update or command to reboot.  The Mote can reject these if it determines that it's too busy (valve is open) or the battery level is too low to reliably download.  Note that this code is NOT included in the example code.  The example simply shows how to control the Valve electronics.
2. 'ARLT': A Really Long Time

That's pretty much it.  Ask questions if you got 'em...

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: john4444 on April 18, 2015, 01:09:27 PM
Tom, nicely done!
I appreciate that you did things 'good enough' without waisting time/money pushing for 'as good as you could get'. For example: you used the helix antenna (which looks great by the way) instead of trying to seal up a ΒΌ-wave which would have been too large for the enclosure.

Before studying the schematic closely, I was wondering how you swapped the polarity of the "negatively" charged solenoid-capacitor. Your H-bridge delt with that nicely. Also, I think that I would have waisted a lot of time trying to keep the cap charged so that it would trigger the valve right after receiving a on/off signal. Because you don't keep the cap charged, the voltage divider resistors don't drain off your charge and you don't have to keep topping off the cap.

You mentioned that 12-v reliably triggers the solenoid in the valve.
However, I must be mis-reading the scope traces. They appear to show the charge only reaching about 6-v.

Very nice write-up to go with the project.
Thanks for sharing, John
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on April 18, 2015, 01:29:13 PM
Tom, nicely done!
Thanks!  I appreciate the feedback!
Quote
<snip>
You mentioned that 12-v reliably triggers the solenoid in the valve.
However, I must be mis-reading the scope traces. They appear to show the charge only reaching about 6-v.
<snip>
Good catch!  I failed to mention that as my 5000 byte limit on a posting was quickly approaching!  In fact, after 'talking' to Lukapple, I decided that the example code should include the parameters to set the voltage at 9V for his solenoid as well as 12V for mine.  In the process of messing about with that, I discovered my solenoid works very well at this voltage also (probably the difference between testing with 470uF cap and using a 1000uF cap). 

I didn't include the scope trace that shows the actual voltage measured (it's 9.76V), but you're right that the voltage is slightly more than 6V below ground, but the + side of the cap is referenced to +VBAT (3.2V nominal, 3.45V in this test) making the voltage across the capacitor that much higher.  As a 'bonus', attached below is the 'missing' trace.

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: Lukapple on April 18, 2015, 01:50:01 PM
Tom,
thanks a lot for sharing this beautiful masterpiece with us. And thanks for sketch example that include parameters for 9v pulse.
It's time to order PCB and components for this project.  :D
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: Felix on April 23, 2015, 10:25:35 PM
Sticky!
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: WhiteHare on August 27, 2015, 05:59:41 AM
Very nice, Tom!  It looks like you made your own PCB.  If you were so inclined, I think you should sell these as a kit.  You're right: being able to add a valve wherever you want without having to run wire is great.  Also, working on your sprinkler heads is a lot easier and faster if you can control the valve wirelessly!

FWIW, I once did have a battery operating sprinkler valve with a latching solenoid.  It was made by DIG Irigation, but it was purely timer based and had no wireless component.  IIRC, it used either one or two ordinary 9 volt batteries, and that one or two batteries lasted about a year.

Of course, the worst thing would be for the valve to run out of battery while in the open position.  So, I guess you must have a way of determining before you open the valve that your system can guarantee it will also have enough power to close it!

Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on August 27, 2015, 09:16:06 AM
Very nice, Tom!  It looks like you made your own PCB.  If you were so inclined, I think you should sell these as a kit.  You're right: being able to add a valve wherever you want without having to run wire is great.  Also, working on your sprinkler heads is a lot easier and faster if you can control the valve wirelessly!
Thanks. They've been working well all Summer long (I've got 4 deployed).  The current version uses my older polling code so I can only change to ON state within a ten minute window.  Once it goes ON, the polling cycle changes to once every minute, but the ON commands are self timed - the polling override is mainly used during testing and sprinkler head setup.  When I get back to my home, I'll update the code to use the ListenMode updates so I can send them commands at any time.
Quote

FWIW, I once did have a battery operating sprinkler valve with a latching solenoid.  It was made by DIG Irigation, but it was purely timer based and had no wireless component.  IIRC, it used either one or two ordinary 9 volt batteries, and that one or two batteries lasted about a year.
Yes, this controller will work with the DIG solenoids.  I'm using Hunter's but made the controller generic enough that the latest version will actually drive the Orbit Expansion Valve (22V, 3A!).  Battery consumption since April has been negligible.  These are running from 2 AA Lithium.

Quote
Of course, the worst thing would be for the valve to run out of battery while in the open position.  So, I guess you must have a way of determining before you open the valve that your system can guarantee it will also have enough power to close it!
Yeah, I anticipated that and won't open the valve if the battery state is marginal.

BTW, the latest version includes a Soil Moisture Sensor so I can monitor moisture at the same point.  I'm not ready to completely close the loop, however.  Too much information goes into the irrigation decision (weather forecast, other moisture sensors, etc) than just localized soil moisture.

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: joelucid on September 12, 2015, 03:22:35 AM
Quote
Using a worst case scenario (one ON/OFF cycle per day) the power consumed would be (2 x 840mS/(24hr/day*3600seconds/hr)) * ~38mA = ~74uA average power consumed.

Tom, this is a really cool project - and I will need to build something similar next summer at the latest. A slight inaccuracy in your calculation makes it even more attractive:

Let's look at the worst case of two switches per day again:

2 x 0.840s / (24hr/day * 3600 seconds / hr) * 38mA = 0.74uA !!!

In other words if one had a suitable booster circuit this project could run for years on a CR2032 coin cell in theory. However the current circuit would quickly lead to brown outs with a run down battery.

This is an example of the more general problem of how to use coin cells for sensors that don't work with 2V. There are ultra low voltage boost regulators that look suitable for this kind of application (e.g. http://www.ti.com/lit/ds/symlink/bq25504.pdf). However I don't have enough space on a Tino.

As you found out I think with small inductors it just takes high frequencies to drive a boost converter in continuous mode. So running the 328p at say 128khz for low power consumption would not really work as far as I understand. And with a coin cell you probably need to use a very high duty cycle for the boost switch to harvest only the beginning of the flyback spike - again even higher frequencies needed.

Anyway - food for thought ... Any ideas?
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: joelucid on September 12, 2015, 05:15:55 AM
Quote
So running the 328p at say 128khz for low power consumption would not really work as far as I understand.

Actually as I look at your 14uS periodicity I guess that would almost be doable with 128khz and fast PWM on the 328p. Run at 256khz to be on the safe side and account for the lower voltage and you'd have very little power waste at the 328p (about 0.2mA).

Of course the other problem is surviving the charging periods voltage wise. Probably use very small charging periods (say 5ms and measure VCC and stop before you drop below 2V). Then let VCC recover and repeat until target voltage reached.
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on September 12, 2015, 08:18:26 AM
Given the progress we've made with the coin cell motes, it is tempting to look at doing a prototype design just to come up with something that would be useful where it's necessary.  In this particular case, however, I had plenty of room for 2 AA Lithium primary batteries (~15 times more power than a coin cell) and the risk is too great if the battery isn't 'ready' to close an open valve...

I purposefully avoided a separate booster circuit in this case just to prove that the AVR can provide the excitation necessary to boost to 25V 3A pulse.  All I needed (besides the usual collection of inductor, cap, etc) was a couple of FETs.  And you know how much I LOVE using FETs.   ;D

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on September 12, 2015, 08:43:31 AM
This is an example of the more general problem of how to use coin cells for sensors that don't work with 2V. There are ultra low voltage boost regulators that look suitable for this kind of application (e.g. http://www.ti.com/lit/ds/symlink/bq25504.pdf).
...
Anyway - food for thought ... Any ideas?
Yeah, TI has been doing some interesting stuff in energy harvesting.  For a Landscape (or Pond  ;) oriented Mote, this device coupled with a solar cell & super cap would literally work forever without a battery.  Of course, if it is was in a Pond you'd have to periodically clean off green slime and dead fish.

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: joelucid on September 14, 2015, 05:24:38 AM
Quote
The risk is too great if the battery isn't 'ready' to close an open valve...

We'll make it work. Just imagine the satisfaction of seeing your sprinkler come on and knowing it was switched on (and will continue to be for the next decade) by a single cr2032. Watering your lawn will never be the same ...
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on September 14, 2015, 08:56:56 AM
We'll make it work. Just imagine the satisfaction of seeing your sprinkler come on and knowing it was switched on (and will continue to be for the next decade) by a single cr2032. Watering your lawn will never be the same ...
Sure, and it will fit right at the very top of the Solenoid itself:
http://www.hunterindustries.com/sites/default/files/styles/product_header/public/null/valves_slider_00_pgv-solo-shots.png

No wires, no nothing.  Just screw the replacement Solenoid into your existing Irrigation valve, configure wirelessly from your laptop, and voila, another Sprinkler zone added to your system.  Easy-peasy...

When the battery is dead in ten years, unscrew the solenoid, toss it, and screw in a new one.    :D

Of course, there is the small matter of the 1000uF@16V cap needed to store the charge.  Perhaps 8 x 0.01F@2V supercaps...

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: WhiteHare on September 18, 2015, 02:27:45 PM
@Tom:
You might find this interesting:  http://intelligentsprinklers.com/products/sprinkler-valves/
They made each sprinkler head both individually controllable and solar powered.
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on September 18, 2015, 02:39:21 PM
@Tom:
You might find this interesting:  http://intelligentsprinklers.com/products/sprinkler-valves/
They made each sprinkler head both individually controllable and solar powered.
Interesting.  Do they spec minimum hours of sunlight to guarantee operation?  Presumably you would turn on the main valve to the loop and then program these to operate within that time window...  Interesting concept, I didn't consider control per spray head.  Certainly makes upgrading an existing installation easy.  This would work well with my stream side irrigation - very localized control.

Why don't you get a couple, tear them down, and take a lot of photos?

Tom
UPDATE:  Looks like these are still in the prototype stage, 3D printed enclosure that don't look NEMA 4 rated to me.  Also, no 'where to buy' info.  That said, seems like a great idea to build from...  The photos look like they're using BLE, which would make sense.  Do you know?

UPDATE: Looks like they cancelled their Kickstarter campaign within a month of starting it.  Someone bought them out or naming conflict with a certain landscaping company in Louisiana?


Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: Felix on September 19, 2015, 09:13:59 AM
This is awesome, I like 2 things :)
- You "save the earth"
- in their range world 100m = 900ft
Who's not sold?
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: WhiteHare on September 19, 2015, 10:10:19 AM
  The photos look like they're using BLE, which would make sense.  Do you know?


I have no affiliation, so your guess is probably better than mine.  Their website made mention of LoRa, though not sure if that referred to this product, some other product, or all products.

After thinking about it a bit, I'm not actually keen on their sprinkler head solution.  The others may be fine though.  For the individual sprinkler head, it appears to have a big blue dome-like pad, presumably to hold down the nearby grass so it doesn't block the sun near the solar cell (?).  However, that would mean you have big blue blobs visible in or near your lawn, which is a non-starter if you ask me.  Even if they were green in color (a more sensible idea), I expect it might be an eyesore.  But that's me.  Perhaps there's a different use case where it's a fit.  Also, would it be a tripping hazard?  Or a mowing hazard?

You raise a very good point about the directness of available sun.  Would shaded ambient light be enough to power it?  You would know.  If so, then maybe there's a pony in there.
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: WhiteHare on September 19, 2015, 12:16:15 PM
Anyhow, the reason I brought it up is that your battery operated wireless solution could avoid those shortcomings.  The solar component wouldn't be needed, so it could sidestep the drawbacks I enumerated above.  While you're at it you could incorporate a soil moisture sensor in each one.  Then you'd get a map of your distribution uniformity, which you could feedback to adjust the next irrigation cycle at each of the valves.  Then it would be smart.

What would it cost to make such a thing?  COGS, I mean.
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on September 19, 2015, 01:46:31 PM
After thinking about this I realized one major problem with their approach (at least from a retro-fit perspective).  In their case they are adding a valve between an existing plumbing fitting mounted in the ground and a commericial spray head.  Even adding a straight coupling between the two would raise the spray head about 7/8" - to one inch.  Adding a valve has to add even more than that. Now the spray heads only come in a fairly limited set of sizes so, without digging out the existing fitting or adding a swing joint, the spray head is bound to be a lot higher (or lower) than the original.

So, to your point, bumps in the lawn and potential damage by lawn mowers.

Of course, to Felix's point, you are saving the world.

But, niggling about the flaws in an unfinished product is not productive or worthy.  I do really like the concept of individually controllable spray heads and, to your point, batteries, 'chemical' or otherwise, have a certainly predictability that I find useful in irrigation systems...

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on September 19, 2015, 01:52:20 PM
What would it cost to make such a thing?  COGS, I mean.
Are we using Felix's prices?   ::)

Depends on volume.  In low qty the valve/electronic housing would be a killer.  In my limited experience, 3D printed material is great for a show and tell, but wouldn't have a prayer standing up to the pressure, weathering, or a Sprinkler Installer cranking down on the threads - there's a reason they use SLIP fittings...  In high qty, everything is cheap, but getting there is hard.

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: WhiteHare on September 19, 2015, 07:04:32 PM
After thinking about this I realized one major problem with their approach (at least from a retro-fit perspective).  In their case they are adding a valve between an existing plumbing fitting mounted in the ground and a commericial spray head.  Even adding a straight coupling between the two would raise the spray head about 7/8" - to one inch.  Adding a valve has to add even more than that. Now the spray heads only come in a fairly limited set of sizes so, without digging out the existing fitting or adding a swing joint, the spray head is bound to be a lot higher (or lower) than the original.

There's a workaround for that: http://www.hitproductscorp.com/products/sprinklers/900T.pdf

Anyhow, without any cost numbers to go by, my WAG is that buried dripline would be more cost effective though for getting better uniformity and saving water and probably lower maintenance as well.  I guess maybe I'll look into that instead: http://www.rainbird.com/landscape/products/dripline/XFS.htm

Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on September 19, 2015, 07:50:38 PM
There's a workaround for that: http://www.hitproductscorp.com/products/sprinklers/900T.pdf
Sorry, I'm failing to see what the 'workaround' is... please explain.

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: WhiteHare on September 19, 2015, 11:09:41 PM
Telescopic spray heads.  You can get a higher stem height in the same size body, or use a shorter body and still get a comparable stem height.
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: EvanR on July 30, 2018, 03:16:34 PM
Hi Tom,

This solution is exactly what I need.  After almost two years do you have improvements or optimizations?

Evan R.
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on July 30, 2018, 03:21:00 PM
Hi Tom,

This solution is exactly what I need.  After almost two years do you have improvements or optimizations?

Evan R.
Well, I'm probably on Generation 5 at this point, so yeah.  Would you like me to post the design files?  I won't post the code since I don't use the existing libraries and some of it is not my code to share.
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: EvanR on August 02, 2018, 10:19:23 AM
Hi Tom,

I would very much appreciate the design files.  I am a software guy who dabbles in electronics. So software is easy, hardware is usually a challenge.

Thanks,

Evan R.
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on August 02, 2018, 10:45:37 AM
Hi Tom,

I would very much appreciate the design files.  I am a software guy who dabbles in electronics. So software is easy, hardware is usually a challenge.

Thanks,

Evan R.
I have two different current designs.  One is for a standard US sprinkler valve using a DC Latching solenoid - I use Hunter (PGV-101G with 458200 DC latching solenoid - you have to buy separately for some reason), but there are a few others that would probably work (depends on trigger energy required to trip/release the solenoid).  Stay away from Orbit, they require a huge amount of energy and I have experienced reliability issues with them.

The second valve is made in Germany (Gardena 1251) and is very solid, but more expensive than US valves - it also has BSP thread vs NPT threads and that needs to be dealt with. There is a newer one Gardena 1278, but this has integrated electronics and I don't know if it can be modified - it appears to be potted.  In any case, let me know which one you're thinking about and I'll zip of the design files.

I presume that you would want Eagle files.  I've recently switched to Kicad and the original design is Eagle, but I can export to Kicad pretty easily.

Let me know.
Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: EvanR on August 02, 2018, 10:36:01 PM
I think I would like the Kicad files.  This will give me a chance to study the design in hopes of learning something. 

I envision converting these to what ever format I can send to the Chinese folks who make PCB.   I've watch videos about this but didn't take notes so I'll go back and get the details.

Again, thanks for the help.

Evan R.
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on August 04, 2018, 04:52:40 PM
Sorry for taking so long on this, I got distracted  ::)

I decided to include both Eagle (v7.7) and Kicad files as there maybe someone else interested these updated files.

Note that the circuit includes a Temperature Probe and Soil Moisture circuit.  You can leave these unpopulated if you don't want to use them.  The temperature probe would be a water tight DS18B20 One Wire probe and the most successful moisture sensor I've used is the Watermark sensor.  The temperature probe is mechanically coupled to the moisture sensor so that you can perform temperature compensation of the probe - necessary if you have widely varying temperatures.

I'll answer questions about the design, but this is made available on an as-is basis, without any implied support or warranty.  I will also not guarantee that it doesn't infringe on any patents - I'm not making a claim one way or another, but I wouldn't recommend copying this circuit for a commercial application.

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: EvanR on August 05, 2018, 06:14:25 PM
Thanks for the files, I'll take a look at this next weekend.  My week has shaped up to be a monster.  This is not for a commercial design. I have some property an 1 hour away from my home.  I need to water some trees I planted.  I have water but no electricity on the property.  This project looks like the right solution.

Evan R.

Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on August 05, 2018, 06:53:14 PM
Thanks for the files, I'll take a look at this next weekend.  My week has shaped up to be a monster.  This is not for a commercial design. I have some property an 1 hour away from my home.  I need to water some trees I planted.  I have water but no electricity on the property.  This project looks like the right solution.

Evan R.
Great!  How will you power your controller/gateway?  Solar?

BTW, I did not create Gerber files in the Kicad set - for two reasons.  One, it was yet another thing to do and more files, two, Oshpark has told me they're working on the direct interface to Kicad 5.  They have Kicad 4.07 support, but not quite there on the V5.  Since it was only released on July 22, I'll give them a bit of a leeway  ;)

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: ecliptic on September 09, 2018, 05:21:28 PM
Hi TomWS,

I saw this thread, and I've actually completed my own battery operated sprinkler valve.  I took a different approach though.  I used a voltage regulator with an ENABLE pin and a few other components (I'm a software engineer by trade, and I couldn't quite wrap my head around using "raw" components).  I used the same PGV Hunter valve as well, and I also had my own PCB printed; however, I am using BLE instead of the Moteino RF.

I like your enclosure, and I was wondering if maybe I could PM you to get some feedback on your enclosure.  Let me know if that's ok.
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on September 09, 2018, 05:39:08 PM
I think the enclosure you're referencing is a Bud PN-1321-C, available from Mouser (and elsewhere) as: https://www.mouser.com/ProductDetail/Bud-Industries/PN-1321-C

But I think the variation with the mounting flange is easier to mount: PN-1321-CMB

That enclosure is great.  I've never had a single one leak.  I recently made a mistake of using a cheaper 'equivalent' from China Inc and the gasket doesn't fit as tightly and there has been an accumulation of condensation inside the box.  Fortunately, I started using Corrosion X about a year ago and, even with the flood of condensation the circuit is still working fine (as he knocks on wood).  I'll replace that enclosure this fall when I have some down time.

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: ecliptic on September 09, 2018, 06:38:13 PM
Thanks for the link!  This will be my first attempt at weatherproofing an MCU (and my first board all together).  My questions are:

1) Do you use any coating (nail polish, etc.) on your Moteino?  Or is the Corrosion X the same thing?
2) Have you had any issues leaving the valve completely exposed to the elements?
3) It looks like you have a wrap around your wires going into the enclosure.  Do you mind going into detail on what you're using?  I've found some cable glands with a polycase + knockouts, but I can't quite tell what you're using.

Thanks TomWS!
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on September 09, 2018, 07:23:31 PM
Thanks for the link!  This will be my first attempt at weatherproofing an MCU (and my first board all together).  My questions are:

1) Do you use any coating (nail polish, etc.) on your Moteino?  Or is the Corrosion X the same thing?
I've used spar varnish and a variety of other sealants to keep water out, but have never found anything as completely effective as Corrosion X.  It was highlighted in a link somewhere in this forum and I can attest, water does not go through anything coated with this messy stuff!  I just spray a small puddle into the corner of an enclosure and use a cheap brush to 'paint' the circuit board, battery terminals, and connectors of everything inside the enclosure before sealing it.  This stuff gives off an odor that effectively fills the void with this moisture barrier.  I've never seen anything like it.  It's very messy, but very worthwhile.
Quote
2) Have you had any issues leaving the valve completely exposed to the elements?
I no longer do that, mostly because it's ugly.  I generally place a valve box over it.  This mostly keeps UV from crazing the plastic enclosure, but it also makes the spiders feel cozy inside the box.
Quote
3) It looks like you have a wrap around your wires going into the enclosure.  Do you mind going into detail on what you're using?  I've found some cable glands with a polycase + knockouts, but I can't quite tell what you're using.
On some projects I use direct wire cables with cable glands (PG7 or PG9), but I think what you're seeing are some water proof connectors I got from a Marine supply house.  These are very good, with good seal and thick gold plating, IP68 rating, but they are expensive.  If you look around for IP68 Panel connectors, you'll find a world of choices.

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: ecliptic on September 09, 2018, 09:58:46 PM
Thanks for the great feedback!  I'll definitely try out Corrosion X!  One last question:

It looks like you have a hose connected directly to your valve.  What kind of hose are you running from your supply to the valve?  Or are you using piping now (since you mentioned valve cover)?
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on September 10, 2018, 08:34:32 AM
It looks like you have a hose connected directly to your valve.  What kind of hose are you running from your supply to the valve?  Or are you using piping now (since you mentioned valve cover)?
I'm using standard (albeit good quality) garden hose for all the 'remote' Sprinkler Valves I have installed, so the fittings are either 1" MPT to 3/4" MPT PVC with 3/4" FPT to 3/4" MHT or 3/4" FHT Swivel depending on the end or, I have one valve box with a  four port 1" Manifold and that mates directly to the input side of the Valve bodies, with the same stackup on the outside.

It's important to use a female thread (3/4" FPT) on the Brass hose fitting when mating to a PVC fitting.  Brass Male to PVC female will split.

Last count I have a total of 8 valves installed around the property.  The home originally had standard in-ground plumbing for lawn irrigation (for the most part this is still operating) and the previous owners had invested a lot in Polyethylene Drip lines for the shrubs, etc.  The Moles and Squirrels really enjoyed that, they found it very tasty.  Fortunately they haven't bothered with the garden hose even though it's covered with Mulch.  It's also easy to drain when the weather turns cold.

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: DonpK on September 10, 2018, 09:20:07 AM
I'm not sure whether this is of any use. For an outdoor soil moisture sensor using a Moteino and a capacitive soil moisture probe, I used this  Silicone Modified Conformal Coating (https://smile.amazon.com/MG-Chemicals-Silicone-Modified-Conformal/dp/B07BSK5S7B/ref=sr_1_1?ie=UTF8&qid=1536584672&sr=8-1&keywords=Silicone+Conformal+Coating) designed for electronic circuit boards. The Moteino is enclosed in a waterproof project box and doesn't need the coating. However, the soil probe has a PCB on the top part and is directly exposed to moisture. After coating the circuit part of the probe, it still worked fine when submerged entirely in a cup of water.
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: ecliptic on September 10, 2018, 10:41:53 AM
Thanks for the feedback!  I was concerned about using a garden hose from the supply to the valve since they generally don't hold up well under constant pressure/extreme temperatures.  The last thing I want is a supply leak although I have also developed a battery operated water flow module as well :)

My current "standard" timer uses a steel braided water hose connector from the supply to the valve, but those can get a little pricey.  I may try one of those R/V hoses (I assume that's a good quality hose).

However, the soil probe has a PCB on the top part and is directly exposed to moisture.

Just curious, how long have you been running your PCB outdoors like that?



Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: DonpK on September 10, 2018, 10:50:24 AM
I have been using the moisture probes with the coated circuit boards outside for several months this summer. Remember, the Moteino is inside a waterproof plastic project box and therefore shouldn't need any moisture protection. Only the moisture probe circuitry which is inserted in the soil has the coating.
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: ecliptic on September 10, 2018, 10:56:38 AM
Only the moisture probe circuitry which is inserted in the soil has the coating.

Ahh got it!  Thanks for the input!!
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on September 10, 2018, 11:12:14 AM
the Moteino is inside a waterproof plastic project box and therefore shouldn't need any moisture protection.
Come back next year and give us an update.

I will mention that even my best waterproof enclosures did not prevent humid air from leaking in as temperature differentials created pressure differentials.  I've never had an enclosure that, by itself, prevented corrosion inside the box (excepting full epoxy potting, of course).   The beauty of the Corrosion X is that it forms a continuous microscopic seal to keep moisture off the metal surfaces and it does not dry, shrink, or separate from the coated components.

Oh, and to be clear, I have no business interests in this product.

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: DonpK on September 10, 2018, 11:20:08 AM
My Moteinos in their "waterproof" boxes have only been outside for several months this  summer.
Quote
I've never had an enclosure that, by itself, prevented corrosion inside the box
Where on the Moteino board would you expect to see the first signs of corrosion and after what period of time, roughly (I'm sure it depends on  the actual conditions of the specific installation).
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on September 10, 2018, 12:31:24 PM
Where on the Moteino board would you expect to see the first signs of corrosion and after what period of time, roughly (I'm sure it depends on  the actual conditions of the specific installation).
Corrosion is only noticeable when it starts to affect the behavior, so the most obvious places are connector pins and battery contacts.  However, the first places it starts to 'grow' is where it begins to bridge between nearby metal surfaces that have a different electrical potential on them - the most obvious is the processor's pins.  After about a year or so, depending on the humidity and temperature extremes, without protection, you'll see 'hairs' growing on and between the pins. 

I can post photos in October - I don't have access to those at the moment.

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: DonpK on September 10, 2018, 12:38:44 PM
Quote
I can post photos in October


Please do. I'm sure many of us are working on outdoor projects.
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: ecliptic on September 28, 2018, 09:44:36 AM
Another question if you don't mind.

It looks like your PCB is supported inside of the case; however, the drill holes do not line up with the case (from what I can tell).  Where did you end up putting your battery holder/batteries inside of your case?  My assumption is that it's underneath your PCB, but I wasn't sure if there was some part that helps support the PCB when the stock drill holes do not align.  Thanks!
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on September 28, 2018, 04:18:45 PM
Another question if you don't mind.

It looks like your PCB is supported inside of the case; however, the drill holes do not line up with the case (from what I can tell).  Where did you end up putting your battery holder/batteries inside of your case?  My assumption is that it's underneath your PCB, but I wasn't sure if there was some part that helps support the PCB when the stock drill holes do not align.  Thanks!
The module is just held in place by gravity, supported by the battery case which is mounted on the back side of the PCB.  Since the valve box is held fairly solidly on the ground, there isn't any problem with the unit being loose in the enclosure.  There is no vibration or movement to affect it.

Tom
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: ecliptic on September 30, 2018, 12:45:29 PM
Again.. thank you!
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: lowpowerfarm on July 12, 2019, 02:20:23 AM
Hi,

Firstly, thank you Tom for making your design available. Its awesome (from whatever little hardware knowledge I have :P)

I am thinking of using your design on my farm (details [1]). In my setup, I have a cluster of 3-4 valves that I need to control, and was wondering what will it take to incorporate the ability to control one of these in your design. The alternative is to just have one Moteino per valve -- which seems to be an overkill, given that these 3-4 valves are all in close proximity.

(Warning: I am *not* a hardware person by trade), Do I need an analog demultiplexer (something like these [2]), that can dump the triggering pulse (~12V/2amp?) to appropriate output (controlled by another set (2 for 4 outputs?) of control lines to the demux from the moteino)? If so what would be the appropriate way to wire this? Or is there are better/cheaper ways to do the same?

Thanks in advance for your advice/thoughts!

[1] https://lowpowerlab.com/forum/rf-range-antennas-rfm69-library/please-help-selecting-rfm69hcw-vs-rfm95_lora-for-outdoor-agriculture-field-use/msg26492/#msg26492
[2] https://www.mouser.com/Semiconductors/Logic-ICs/Encoders-Decoders-Multiplexers-Demultiplexers/_/N-4s67o?P=1yvcyi3Z1yzmm1d
Title: Re: Moteino Based Battery Operated Sprinkler Valve
Post by: TomWS on July 12, 2019, 07:27:02 AM
Sent a PM to iron out details.