Close

i have an idea!

A project log for A cheap capacitive soil moisture sensor

In order to achieve the first stage of precision farming, i want to create a cheap soil moisture sensor with wireless communication.

valentin-ortegaValentin Ortega 09/04/2016 at 16:381 Comment

It has passed some time since i upload a log for this project, a lot has happened in my personal life and in this project too.

First, i finished the prototype of the sensor and i made two of them to compare their performance. I used some servo cables with the white wire cutted, and soldered them . I isolated them with hot glue and i finished the surface of the glue with my hand torch. I still think that an hydrophobic coating is the best option but is to expensive for me to buy it right know. This is the result:

So i tried to test it with my multimeter to see how big the capacitance was, and i got:

That means 35pF, that's really low. Then i tried to see the change on the value of the capacitance when it was out the water vs when it was in the water... no luck!

So then i thought, why not both? I put both of my capacitive sensors together with an elastic band with the plates facing each other with opposite polarities. This allowed more water between the cooper plates, the result is in the next boring video :P

So i got around 14pF of range, which is an small variation. Then i tried to measure the capacitance with an arduino using the simplest "charge and discharge measurement of time" method using this code:

https://www.arduino.cc/en/Tutorial/CapacitanceMeter

and this circuit with R = 50Mohms :

and i got this super noisy readings:

I tried some digital filtering but still, the noise were far bigger than the range i needed to measure. So after some internet surfing and chatting with a friend i realized something.... this circuit is a freaking antenna:

So, i turned off all my RF sources around me, by bluetooth speakers, my laptop wifi, i set my phone on plane mode and this happened:

The values became really stable (after the red line). And i notice that some other people that built capacitive soil moisture sensors had problems like this, for example, miceuz from wemakethings.net maker of the "CHIRP" the soil moisture sensor sold on adafruit.

http://wemakethings.net/2013/06/07/chirp-plant-watering-alarm/

On his words:

So i realize that if i would want many sensors working together communicating wirelessly and not crashing with other RF signals, i would have to try a different approach. Miceuz wrote this about the issue:

So after surfing and reading a lot, i found the blog "Zero characters left" where "drxzcl" talks about the attempt to make a similar sensor. In fact, after reading the 76 comments, i found out that it was that post that inspired miceuz to build his own, at least i think so.

http://zerocharactersleft.blogspot.mx/2011/11/pcb-as-capacitive-soil-moisture-sensor.html

In those comments also there's a lot of people affirming that commercial capacitive soil moisture sensors works above 80Mhz... why? because on those frequencies the effect of soil minerals is way less than in low frequencies. So this means that a sensor working on high frequencies have better chances to sense just the amount of water on its surroundings and no other elements or materials.

And maybe this was luck, but on hackaday main page i saw this:

http://hackaday.com/2016/03/01/color-tv-broadcasts-are-esp8266s-newest-trick/

It seems that the ESP8266 is capable of producing those frequencies using his Integrated Interchip Sound serial port.

Wouldn't it be great if the low cost most famous wifi module/microcontroller could be used to make this project a reality?

Does anybody know how to use that thing? :)

Discussions

greenaum wrote 07/10/2021 at 03:09 point

The ESP sounds good, as it has Bluetooth and Wifi. It's known that it eats up battery life though. It seems like your idea for a probe is bogged with problems. Perhaps a new approach is best? Could you use two separate probes, separated by however far, a few cm up to maybe a metre, and connected by wire?  That would give you much more soil to work with than the tiny bit between two PCB pads. Much more freedom from interference on such a small scale caused by all sorts of natural things, perhaps a worm strolls past one morning.

A second probe would still be cheap, and wouldn't be annoying or difficult for a farmer to implement. Perhaps even several probes, wired back to a control board with a battery and an ESP, Bluetoothing to the farmer's phone, even sending alerts. I would look at it, see what sort of data you can get using more probes. If you had a few, and used them in pairs (in every combination of two of the probes), you could look at the data and see if it's more reliable. Then add water and perhaps compare against a commercial sensor, a known-good one, to see how you're doing.

There's also other ways than capacitance. What about resistance? Using AC, or short pulses, keeping track of polarity so that each positive pulse per probe is eventually followed by a negative one. That's to avoid electrolytic corrosion.

It just seems your single tiny probe idea has too many problems associated with it, that will be difficult to get rid of, and might possibly return when you don't expect it. Obviously this would be a product with crucial importance, it would have to be reliable.

Lots of kudos btw for what you're doing to attempt to improve farming in a poor country. If that's Mexico's business, you should do it well, and use what technology is available.

Actually perhaps you could use a different controller, and have it talk to an ESP through serial when it wants to do some connectivity. That's what the ESP was originally designed for anyway, as a sort of smart modem for simple chips. They only allowed people to run their own code on it when a massive demand appeared.

You probably heard that they ported the Arduino system to ESP. That's what I'd use, if I were using one. I've used Arduinos before but not the ESP version, and it's very easy and straightforward, a surprising lack of problems when you're writing basic simple stuff. I'm the type who gets code to a working state, saves it, then adds features on and kicks them til they work.

  Are you sure? yes | no