using capsense to measure soil moisture?

Started by WhiteHare, September 25, 2015, 10:58:25 AM

TomWS

Quote from: jarrods on November 25, 2015, 02:13:02 AM
I would have to look at his code again but he is running at 8mhz.

As for the i2c and wire. It has been hit and miss but I am going to be testing http://products.conwire.com/item/product-catalog/ow-cap-foil-braid-shield-ul-cm-ul-style-2919-cable/5922-cl it looks very promising. I got good results from cat6e but the airspace in the shielding allowed water in even after best efforts to seal it :(

This consolidated wire cable is only 12.5pf per foot and is uv resistant. The only bummer is that you have to order 1000 feet to get the 4 and 6 conductor.

BTW there is a version of his sensor in github that uses rs485 instead of i2cand he has a spreadsheet with the bom as well as the Gerber files. I didn't use it cause rs485 has a constant power draw and requires chips that are almost expensive as the processors.

My goal is to build my own (I have the PCB done and flowed still working on software) that will use a modified version of SDI-12 that will work at 3v. That way you could have of to 63 devices on a bus and up to 200 feet of cable. Once that is working i am going to figure out how to include LVDS (low voltage differential signaling) with my modified sdi12 then I should be able to get up to 1km of cable just like rs485.

This way from a single Node I could support 60 + sensors per bus spread across rows of trees and vines.
It sounds good.  Let us know when you complete your testing.  Will you sell the probes or, at least, release the design?   
BTW, you might look into outside burial cat6.  It's messy as all getout (it's filled with silicone grease) but there is NO water problem with it.  Very heavy outside jacket too to handle abuse from rock and such - this, of course, is a double edged sword, it is not very flexible.  In my case I'd want to fully bury the entire probe (wire transmitter as well as sensor).

Tom

jarrods

I might... But to be honest miceuz's hardware design is much better at this point. His latest rev is really good and my PCB skills are quite basic compared to yours and his :)

I have been looking at his board and just seeing if I can reprogram it to communicate the way I need. If i could do that i would release that is it would be comparable to comercial units out there. However this is a low priority at this point.

The only thing that is better with my design is that I am using the attiny841 which is an awesome chip. It functions much like it's bigger brother (atmega) and I want to use it to build a Moteino "Mini" much like your and Joes. The fuses and programming was a real pain to figure out but now that I have you can program it the same way you do a regular chip except for automatic upload via the arduino IDE. Don't quite have that working but I will eventually.

The atmega is overkill for just about everything I work on as I rarely need more the a few pins on each node. And since I am trying to deploy a LOT of nodes,  building a cheaper smaller node is something I will have to eventually do.

If your interested I can write up getting that chip working abd some sample code to see if you guys want to use it to build a node with it  ;)

http://www.atmel.com/Images/Atmel-8495-8-bit-AVR-Microcontrollers-ATtiny441-ATtiny841_Datasheet.pdf

TomWS

What PCB design tool did you use to make your own prototype?  We can probably work with that.  I like the low pin count of that processor but I'm too wasteful of program/data memory to be able to use it. Like Kobuki-san, I want more memory!  OTOH, Joe could probably install a RESTful client on it and have it posting to his Google cloud account... and, of course, running on harvested energy with no battery forever.

Tom

KanyonKris


TomWS

Quote from: KanyonKris on December 01, 2015, 07:49:37 PM
I read about homemade gypsum soil moisture sensor as part of the Vinduino (a
vineyard irritation system) project, which won a Hackaday prize -
https://hackaday.io/project/6444-vinduino-a-wine-growers-water-saving-project

More details about the soil moisture sensors -
http://vanderleevineyard.com/1/post/2012/11/gypsum-sensor-calibration.html
http://vanderleevineyard.com/1/post/2013/12/gypsum-sensor-casting.html
Cool, thanks!  I really like the one referenced from that blog:
http://unpuntilloalambre.blogspot.com.es/2014/01/gypsum-block-for-soil-moisture-sensor.html

Now that is creative (and very simple).  This could be inexpensive enough to be replaceable after a couple of years.  In fact, the plastic parts could be reusable if you're careful taking the old one apart.

Tom

jarrods

Tom,
I used Eagle to design the board.


As for the Gypsom block sensor, I strong recommend against that.


  • Gypsom is Hrydroscopic, meaning it holds onto water and so it can show a much higher value then is really present in the soil. depends greatly on soil type
  • Corrosion will cause it to loose resolution and eventually fall apart. In some cases I have seen them fall apart in 1 season with acidic soils
  • Salinity affect the readings greatly. This means if salt forms (adding soil amendments to balance PH) then the reading will change

Honestly the best sensor for the DIY market at this point is the Capacitive. They are non-reactive and so if sealed properly can be in the soil for a very long time (5-10 years). Dont forget to take in consideration installation time. If you have to replace then every 1-2 years then that means having to dig new holes. Not sure what labor costs are near you but in California it is insane (15 USD an hour in some places). So it costs more to install the sensors then it does for the hardware. So I have to make sure the sensors will last more then 5 years for ROI and in some cases I will install an extra one in the hole in case there are issues with the others.


BTW - I started with this sensor: https://oshpark.com/projects/b9RIJ6S9 it works pretty well as long as you keep the leads short and use low capacitance wire (CAT 5E for example).


TomWS

#51
Quote from: jarrods on December 02, 2015, 10:43:42 PM
<snip>They are non-reactive and so if sealed properly can be in the soil for a very long time (5-10 years). <snip>
Really?  Which one is that?  I've not seen a single electronic sensor last anywhere near that long.

I've had Watermarks in the ground for 5 years and, other than some tweaks to the sensitivity, they've worked reliably. However, Watermarks aren't Gypsum, but are a similar, more durable technology.  Gypsum is supposed to block salinity, at least for the first few years of their life, but Salinity isn't an issue where I live in any case.  I'm looking for something that really won't corrode and will last for 5 years or, at least, not cost $50 plus labor to replace.

Tom
PS: Don't mind my grumpiness.  I'm PO'd at discovering its been my stupid Roku 3 that's been killing my WiFi performance... but that's another story. Stupid ^%$^%#@# POS!

PPS: Thanks for sharing the design, I appreciate it!

damonb

I think the point about salinity is more general than salinity in the water supply: gypsum block sensors work by measuring the resistance between the electrodes. The resistance is a function of not only how much water is present to support the passage of electrons, but also how many other ions are present in that water. Ions come from all kinds of dissolved salts, i.e. salinity from impure water, and components of fertilizer added deliberately. So the resistance vs moisture curve varies every time you fertilize. The gypsum block reduces but does not eliminate the effect of dissolved salts on the calibration.
Capacitive sensors avoid this problem.

jarrods

Quote from: TomWS on December 02, 2015, 11:47:37 PM
Quote from: jarrods on December 02, 2015, 10:43:42 PM
<snip>They are non-reactive and so if sealed properly can be in the soil for a very long time (5-10 years). <snip>
Really?  Which one is that?  I've not seen a single electronic sensor last anywhere near that long.
Tom,
We should chat offline. This is a key part of my business as I have a way of sealing my sensors. They are still in testing but so far I have 1 year on early models. I am working on a install for January that will use the 3rd version of my setup and hopefully will last 5+ years (except for battery)

Quote from: TomWS on December 02, 2015, 11:47:37 PM
Tom
PS: Don't mind my grumpiness.  I'm PO'd at discovering its been my stupid Roku 3 that's been killing my WiFi performance... but that's another story. Stupid ^%$^%#@# POS!

Would you mind sharing what you found in a separate thread? I have a Roku and have been fighting performance issues but never though the roku might be involved

-Jarrod

joelucid

QuoteOOK TX a low level 'whatever' MHz radio you've got, with TX driven into the ground probe, similar to the latest PCB probe design of the Chirp and you should have a fairly reliable, albeit desperately needing calibration, moisture probe.

Based on reading a couple of papers I'm starting to doubt that we can drive 430Mhz or even 900Mhz into the sensor and get good results. It would be optimal to use such a high frequency because it almost completely does away with salinity or soil composition effects. But at those frequencies the sensor is electrically very long and its inductance will play all kinds of tricks on us (like interference with returning signals etc).

Instead one could still use the 32mhz oscillator in the radio - with some salinity effects remaining.

joelucid

This strikes me as a really smart way to measure soil moisture: https://www.google.com/patents/US7135871

ABSTRACT
The moisture content of soil may be determined using a swept-frequency microwave-based process and device. The process includes the steps of: producing a primary microwave signal with a varying frequency, splitting the primary signal to provide first and second microwave signals, which first signal is transmitted through an electric conductor in the soil where it will be delayed in proportion to the dielectric constant of the soil, while the second signal provides an internal reference signal, receiving a third signal which includes the first signal after it has passed through the electrical conductor, mixing the third signal together with the second signal, generating a mixed signal, filtering the mixed signal to remove upper side-band interference signals, generating a filtered-mixed signal, measuring the frequency of the filtered-mixed signal and calculating the moisture content of the soil.

I guess this could approximated by using the RFM69HW as signal generator, using gaussian FSK modulation to generate the frequency sweep. That will not create a constant speed sweep and therefore no constant frequency output signal. But one could measure the maximum output frequency using the 328p.

Still pretty complicated.

TomWS

Quote from: joelucid on December 08, 2015, 07:31:33 AM
This strikes me as a really smart way to measure soil moisture: https://www.google.com/patents/US7135871
<snip>
Unless, of course, you're considering making a commercial or even open source project and not interested in paying a license fee...
:-X

Tom

joelucid

QuoteUnless, of course, you're considering making a commercial or even open source project and not interested in paying a license fee...

You wouldn't believe how many patents exist in this space. Even chirp seems to be affected. But yeah, hopefully this can be done differently. All that's needed is a phase detection mechanism to measure the delay of the signal that traveled through the soil. Which works at 900 Mhz.


WhiteHare

#59
Quote from: jarrods on November 25, 2015, 11:48:18 PM
I might... But to be honest miceuz's hardware design is much better at this point. His latest rev is really good and my PCB skills are quite basic compared to yours and his :)

I have been looking at his board and just seeing if I can reprogram it to communicate the way I need. If i could do that i would release that is it would be comparable to comercial units out there. However this is a low priority at this point.

The only thing that is better with my design is that I am using the attiny841 which is an awesome chip. It functions much like it's bigger brother (atmega) and I want to use it to build a Moteino "Mini" much like your and Joes. The fuses and programming was a real pain to figure out but now that I have you can program it the same way you do a regular chip except for automatic upload via the arduino IDE. Don't quite have that working but I will eventually.

The atmega is overkill for just about everything I work on as I rarely need more the a few pins on each node. And since I am trying to deploy a LOT of nodes,  building a cheaper smaller node is something I will have to eventually do.

If your interested I can write up getting that chip working abd some sample code to see if you guys want to use it to build a node with it  ;)

http://www.atmel.com/Images/Atmel-8495-8-bit-AVR-Microcontrollers-ATtiny441-ATtiny841_Datasheet.pdf

@Jarrods:  Is cost of the attiny841 truly the main reason for your preferring it over the atmega328p?  I don't know if you've shopped for atmega328p's recently, but these days you can buy an entire atmega328p Pro Mini for $1.50.  To me, that's cheap.  Just hook up Vin and Ground, and it's ready to rock: even the bootloader and fuses are already burned for you.  If you want low power, you can get the 8Mhz 3.3v version and then simply remove the voltage regulator and one or more LED's. 

On the other hand, from the datasheet you linked to, it looks as though the Attiny841 can run at 1mhz at very low power: 
 Active Mode: 0.2 mA at 1.8V and 1MHz
 Idle Mode: 30 µA at 1.8V and 1MHz
For some applications, that might be interesting.  Are you doing that?

[Edit: Silly me.  I just now noticed that the atmega328p has comparable specs at 1Mhz:
 Power Consumption at 1MHz, 1.8V, 25C
̶ Active Mode: 0.2mA
̶ Power-down Mode: 0.1µA
̶ Power-save Mode: 0.75µA (Including 32kHz RTC)

Being able to run the RTC at 0.75uA rather than the WDT might solve some issues (i.e. might it avoid the WDT's 8 second limit between wakeups?).  ]