OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Who accept a challenge to write plugin with soil moisture?
- This topic has 36 replies, 12 voices, and was last updated 9 years, 7 months ago by Mike.
-
AuthorPosts
-
July 30, 2014 at 3:12 pm #23080
ChaoscripTMemberHi,
Who accept the challenge and write plugin that works with soil moisture?
I think that it will save more water no ?Regards.
July 30, 2014 at 6:20 pm #27685
scottshParticipantIt probably would save on watering – the ‘industry standard’ ETO method uses soil moisture as a key part of its algorithm.
How would you propose to get soil moisture data into OSPi? Would you want to have a soil sensor directly provide it over a GPIO pin? Or would you get soil moisture data from a network device? Or from a station on the internet? Would you have one sensor or multiple?
I personally backed the Edyn project in order to do just this – but obviously that device won’t arrive until 2015 (which is a crazy long time but don’t get me started.)
Scott
July 30, 2014 at 6:54 pm #27686
rederikusParticipantI guess doing this would mean running a pair of wires out to each sensor and then connecting each sensor to a GPIO pin. Of course you could use wireless but than means a visible sensor (think lawn mower) to find the sensor to change the batteries once every couple of years.
Whilst I love the idea of soil moisture sensors to regulate watering, this would be a heck of a retrofit for some installations. Nice though.
July 31, 2014 at 3:19 pm #27687
Dan in CAParticipantI have been testing the Vegitronix soil moisture sensors.
http://www.vegetronix.com/Products/VG400/They are designed to be buried in the ground (lawn mower proof) and can operate on 3.3v.
I have some ideas for interfacing them with the OSPi using RS-485 serial which can have cables up to 1 kilometer long. The RS-485 standard also can support a large number of sensors on one serial cable. A 4 wire cable can provide power and carry data (no need to change batteries).
Dan
July 31, 2014 at 6:19 pm #27688
scottshParticipantI’m looking forward to seeing your results, Dan. I’m worried about the long-term reliability of that type of sensor, specifically around corrosion of the part that’s in the ground.
July 31, 2014 at 6:44 pm #27689
Dan in CAParticipantThe sensors themselves are sealed with no exposed metal to corrode. The cable needs to be a type for in-gound use and any connections would need to be protected e.g. with some silicone sealer.
Dan
July 31, 2014 at 7:03 pm #27690
rederikusParticipantThinking about this, it would seem to be a good idea to opto-couple/isolate the sensors before they reach the GPIO pin(s). I could not see any way that the sensors could be connected to a bus so each sensor would seem to need its own 4 wire cable as opposed to a connect to one, then the next and the next type of install. That is a pity as it means a lot more cabling.
Using wireless is OK for plants and beds but is useless on grass with a lawn mower.
Since these sensors provide a variable analog output voltage it would seem possible to be able set a “moisture watering point” for each sensor. This might require some extra hardware to accomplish.
The combination of moisture sensing, water flow control (one flow control, multiple zone measurement) and weather forecasting is a near unbeatable combination for efficient watering.
August 1, 2014 at 1:19 am #27691
Dan in CAParticipantWith RS-485 you can have up to 32 nodes on a single cable. I am looking at using Arduino micro controllers at the nodes. you could have say, 4 sensors at each node at different soil depths. That would give you up to 128 individually addressable sensors per cable.
I purchased some MAX487CPA transceiver chips from Mouser for ~$2.00 ea. There is already software available on the internet to make it work. All I need is some spare time…
Dan
August 1, 2014 at 1:52 am #27692
rederikusParticipantI guess that would put the Arduinos at the nodes (sensors). These would need to be in watertight containers and you certainly would need locally regulated power since you could not just send 5volts over a long distance down a bit of CAT5 (or whatever). An ATTiny 84 would be admirably suited to this task since it has sufficient I/O and is dirt cheap.
Can you design this? Do you need help? Just let me know. I have a number of Adruinos running various lights in my house.
I am now even more worried about lightning strikes, etc. with buried cables, arduinos, power regulation and the sensors all in a watertight enclosure, some buried and some not buried. This is an interesting challenge indeed.
August 1, 2014 at 5:27 am #27693
RayKeymasterIf you are not against using off-the-shelf products, check out my most recent blog post about how to use RPi to interface with a cheap wireless soil moisture sensor:
http://rayshobby.net/?p=9413
All that’s required is a 433MHz RF receiver connected to RPi. I am also working on decoding a few more such sensors and will publish the code soon.If you are into building your own soil moisture sensor, a good starting point is the Chirp (http://wemakethings.net/chirp/): it uses an ATtiny44 and capacitive probe to detect soil moisture level. I was actually working on building a soil sensor myself a few weeks ago. My solution is to use a similar capacitive probe as Chirp used, but a Schmidt trigger to form an RC oscillator, and use Arduino’s pin 5 (counter) to detect the oscillation frequency, hence calculating the capacitance. Now that I’ve found cheap off-the-shelf sensors, I kind of feel it’s a lower priority to build my own.
August 1, 2014 at 2:52 pm #27694
Dan in CAParticipant@ rederikus
If you would like to tinker with the hardware that would be great! I honestly don’t know when I will have time to get into it.Here is a source for RS-485 information:
http://www.bb-elec.com/Learning-Center/All-White-Papers/Serial/RS-422-and-RS-485-Applications-eBook/RS-422-RS-485-eBook-graphics-embedded.pdfand some other useful stuff:
[attachment=0:v9prklle]RS-485.zip[/attachment:v9prklle]August 1, 2014 at 3:21 pm #27695
rederikusParticipant@ray,
I like your idea of capacitance measurement using an ATTiny44. Neat.
I have no objections to using any components either off the shelf or home built. What I would aim for first is a solution that works. After that I’d look for cheap or home brew methods. However my main concern is making a device that can be used outside in all weathers. One variant would need to be lawn mower proof too and that would seem to mean burying it. Ain’t sure right now how to get 433Mhz through 6 inches of dirt. Cables are the obvious alternative. Even if I ignore the problems of in ground reliability of thin cables, there are two major worries with cabling. The first is making reliable connections under the ground. Obviously this can be solved with a decent case but that brings the cost up. Second is the chance of a nearby lightning strike inducing a power spike into the cabling spread out over a wide area – makes a great antenna. MOVs and optocoupler/isolators will minimize this but it will never eliminate it especially if the MOV gets damaged and not replaced.
Having done all the doom and gloom stuff above I will now go an buy a couple of sensors and have a look at how I think this may be done and then I’ll chuck it back to you in here and have you rip it apart. That way we might get a workable solution.
August 1, 2014 at 3:24 pm #27696
rederikusParticipant@Dan,
I am retired so I have some time in between babysitting my two granddaughters.
As I said in my previous post I shall now go and buy some sensors and see what happens. I already have some 433Mhz stuff kicking around. Got a box or ATMega and AT Tiny chips too. I’ll see what I can do in the next few weeks as stuff gets delivered and I cobble it together.
UPDATE: I just ordered two Vegetronix VH400 sensors that you are using
August 4, 2014 at 2:25 am #27697
AndrewParticipantHi all,
I would suggest the better method of reading from the VH400 sensors would be to use 1-wire with a DS2438. We use these to measure voltages from pressure sensors over links of more than 500m and in far worse conditions than you are every going to find in a garden. Lightning has never been a problem except when we stupidly had an earth point 200m from the 1-wire hub on one occasion.
We use standard 4 core underground (direct bury) phone cabling along with gell caps for connections. We also use send 12V down the spare wire and have a local 5V ultra low noise voltage regulator at each sensor, but that is because the pressure sensors absolutely require a 4.72-5.25V supply. The VH400 is very forgiving of supply voltage from the specs on the site.
DS2438 boards are also much cheaper than an arduino, you can address as many as you like and they will survive just about anything.
Andrew
August 4, 2014 at 4:36 am #27698
rederikusParticipantAndrew, Great information. Thank you. I too had been think of using 1-wire. I am still waiting for my VH400s to be delivered so anything I say now is pure conjecture. My first priority when they arrive will be to simply make them work. After that, I will take any advice going.
My son is a member of the Charlotte NC Hackerspace and I told some of the members there that I was looking into this and I now have possibly more help than may be good for me. The software for this little project will be interesting since Once I make a bank of 8 of these things work, they will most likely provide a channel number (0-255) and a value (0-255) giving the moisture level. This will have to be made to turn any sprinkler zone on or off depending on a threshold set in software by the user. I do not think that OSPi currently has a per zone on/off capability.
My plan is to try and provide two types of sensor. Wired and wireless. I need wired so that VH400s can be buried under grass so that the grass may be mowed. Wireless won’t work underground and anyway you would need to find them and to dig them up to change batteries. Wireless sensors are needed for plants and beds where the VH400 can be simply poked into the ground leaving the battery and wireless parts above ground. Clearly the big advantage here is no cables need laying.
I originally liked using an Arduino because I know a little about it and it has six analog inputs so my plan was/is to serve up 6 x 0-255 channels and 2 x on/off. However if there is a better way then we can do that. However I also want to make this as cheap as possible. The VH400s are nearly $40 each when shipped so the 8 channel controller needs to be fairly low cost and, it also needs to be able to be daisy chained.
August 4, 2014 at 6:12 am #27699
AndrewParticipantThe DS2438 actually has two inputs where voltage can be read but generally only one is used as the other is designed for measuring current (it was originally created as a smart battery sensor, hence it also includes a temperature sensor) and I can’t recall if there are any limitations on it’s use.
There is also another 1-wire chip available with 4 voltage inputs. I believe places like Hobby Boards may stock a board with it on it, but I don’t recall it’s chip ID because it had a reputation for not being as reliable as the DS2438. It might be good enough for this usage though as the DS2438 is robust beyond belief. We’ve had enclosures fail and the chip kept working under water with salt build up across connections and everything was fine until eventually a pin corroded away or the buildup shorted the data line or ground to 12V. Truly unbelievably solid units.
I guess what I am getting at is that 1-wire has already solved most or all of what you are looking for and a probe that returns a 0-3V range is nothing more than soldering three wires to a board from the electronics side. A simple program (or maybe ospi.py plugin) that periodically monitors the soil moisture and then tells ospi.py to do a run-once program when needed should take care of the rest. And you can talk to the 1-wire bus through a GPIO pin, a USB or serial dongle or a network hub like the LinkHubE, though personally I’d love to see Ray add a 1-wire header to the OSPi with 5V out (and even better with a 12V pin as well!)…
August 4, 2014 at 2:37 pm #27700
rederikusParticipantI will try hard to make something that will work with the existing hardware. That way existing users can retrofit moisture sensors to their systems. This may limit hardware choices. Like I said earlier, I am waiting for my sensors to be delivered. Only at that point can I seriously begin. Yes, I know it’s only 0-3Voults but it is nice to have the bits on the bench.
Ray needs to be involved from the very beginning. He “owns” the hardware design.
If anyone else wants to either pick up this little add-on project because they have either done it before or, are simply better at it than me, please say so as I am only helping out. There is no ego in this for me whatsoever.
I think the system software is where the main development will need to be as, from what I can see, there is no provision to stop a single zone from working based on outsode input and that will need to be changed. Again dialog with the developer from day one is needed. The mobile app will need to be modified too so that needs consideration as well.
Any help or design you can give is most welcome. More news when I have some bits on my bench.
August 5, 2014 at 4:32 pm #27701
Dan in CAParticipantA plugin for the Interval Program would be the way to go.
For controlling irrigation with soil moisture probes, multiple probes at different depths are generally used at each monitoring location. The frequency of irrigation is controlled by shallow probes and the duration of each irrigation is determined by deeper probes.
I think it would be fairly easy to adjust each station individually using a plugin.
It is exciting to see such interest from folks with more hardware knowledge than I have.
Dan
August 5, 2014 at 6:59 pm #27702
rederikusParticipant@Dan,
I am happy to have a go at this. I will accept any and all inputs from anybody but it is my belief that Ray kinda owns the hardware design for this whole project. I PM’d him yesterday to ask if he had any requirements (I2C bus, USB, etc.) for connectivity and if he had any definite no-nos for hardware connection. When I have his answer, I’ll post it here.
Meanwhile my two sensors have turned up and they work well. You can give them any voltage between 3.3 – 20 and they give a 0-3 volt output depending on how wet they get.
It will be easy to make something read these and to give an output. Initially I will use an Arduino because I have several available and they have 6 analog inputs. This should give me an output to the I2C bus. If I get no further guidance, that is the way I shall go until a better idea comes along. The I2C bus works well because it is available on both the Arduino and the Pi. I2C is also on the Beagle Bone.
There is one very simple way to do this and it is to make a stand alone system that simply manipulates to outputs of opensprinkler. This would then not require any changes to any opensprinkle and would be connected in series with each output. When the desired soil moisture was reached, it would simply cut off that channel until the humidity dropped. This method has the advantage that there is no hardware or software needed. The moisture threshold would be set by potentiometers on each channel The down side is, of course that moisture sensor management would be entirely manual which is not that great.
August 5, 2014 at 9:44 pm #27703
virtusParticipant@rederikus wrote:
There is one very simple way to do this and it is to make a stand alone system that simply manipulates to outputs of opensprinkler. This would then not require any changes to any opensprinkle and would be connected in series with each output. When the desired soil moisture was reached, it would simply cut off that channel until the humidity dropped. This method has the advantage that there is no hardware or software needed. The moisture threshold would be set by potentiometers on each channel The down side is, of course that moisture sensor management would be entirely manual which is not that great.
I think that it would be best to integrate it with opensprinkler. It would be nice and helpful to have access to the moisture levels in the interval program. Then we could easily monitor the humidity and make adjustments to the variables based on how our plants react to different levels of humidity.
August 5, 2014 at 11:08 pm #27704
rederikusParticipantOh, for sure it is better to integrate into opensprinkler. There is not much point in having an internet enabled irrigation system that requires you to stand in front og the thing with a screwdriver in your hand.
I only said that to illustrate that this thing seems to require hardware, software and integration. I have no intention whatsoever of offering a manual solution.
The difficulty is that like any sensor system there are two main parts, detecting a condition and then acting upon it. My belief is that we will end up connecting this to the I2C bust and doing the rest in software. Each sensor (either wired or wireless) needs to end up being connected something that can output a 0-255 variable. If this is passed via the I2C bus to a plugin that can start or stop any given channel (from watering) based upon a plugin set threshold from on the 0-255 variable.
The hardware is fairly simple using an Arduino chip since this has 6 analog inputs and 13 digital ones. Using the 6 analog and two of the digital ones would seem to be a reasonable compromise. Obviously one could use two Arduinos and provide 12 analog inputs but, that would put the cost up.
I am not sure how other sensors output their data so for now I will simply stick to a 0-3V input.
Does that sound a bit more sensible? I hope so…
August 6, 2014 at 5:32 pm #27705
GreenieMember@Dan in CA wrote:
For controlling irrigation with soil moisture probes, multiple probes at different depths are generally used at each monitoring location. The frequency of irrigation is controlled by shallow probes and the duration of each irrigation is determined by deeper probes.
………
Shallow soil moisture is easy to accurately predict from an ET models. Variance over time from ideal will show up in the soil deeper in the rootzone. Also by just walking the lawn most people can tell if the top couple inches has dried out. So I believe that accurately measuring deeper moisture is more important than determining overall average moisture, especially when growing non-annuals (either ornamental or agricultural)
Testing soil probes for accuracy at determining when field capacity is achieved seems like an important early effort. Accurately flagging field capacity allows a reset of the ET model at 100%, zeroing out any drift in the model from reality. This may not be relevant to users with little rainfall, as I assume soils at field capacity are an infrequent occurrence.
Acclaim soil sensor install :https://www.youtube.com/watch?v=W4Wninln-uk
As a long term goal, perhaps accumulating user adjustments is worthwhile. Does a particular user choose more or less water than the model suggests? Do all user have a tendency towards altering irrigation towards more or less water?
December 28, 2014 at 2:05 pm #35085
MikeParticipantIs this activity dead? I just got a BBB and want to incorporate some VH400 sensors into the OSBo (which I don’t have yet). I don’t want to re-create the wheel or start from scratch if work has already been done on it.
Mike
January 2, 2015 at 6:38 pm #35123
Dan in CAParticipantMike,
It’s not dead but as far as I know there has not been any progress in a while.
I am currently working on an experimental modbus network but time is the limiting factor.
Dan
January 4, 2015 at 3:02 pm #35135
MikeParticipantIs there something I can do to help? I’d love to be able to use a method like this http://blog.fastolfe.net/2011/11/project-wireless-solar-powered-garden.html to hook up the sensor(s)
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Who accept a challenge to write plugin with soil moisture?