Capacitive Soil Moisture Sensor V1.2 - Garden Test!
HTML-код
- Опубликовано: 7 ноя 2024
- Looking at the principles of operation of the Capacitive soil moisture sensor, testing its output in wet to dry conditions, and taking it out to the garden for a real soil test!
These sensors on Amazon (affiliate links):
Amazon.com: amzn.to/2LJ6kLS
Amazon.ca: amzn.to/2JnQDrV
Capacitive Sensor References:
Capacitive-Based Liquid Level Sensing Sensor Reference
Design
www.ti.com/lit/...
The Fringe-Capacitance of Etching Holes for CMOS-MEMS
www.mdpi.com/20...
Patreon: / gadgetreboot
Pinterest: www.pinterest....
Twitter: @GadgetReboot / gadgetreboot
I looked into the datasheet of the IC and didn't understand how this works. Thanks for the explanation. This circuit design is really cheap, but effective. Amazing how people solve some problems :)
Yeah I learned a lot when researching this sensor. Now that spring is here, maybe I will have more projects with it coming up.
@@GadgetReboot Maybe I find the time to integrate this sensor into RIOT OS :) Would make it simpler. So that I can use CoAP over 6LoWPAN. Creating a nice app to get all sensor data combined into one application.
Excellent video. You demystify what's going on very well and actually make it interesting.
Thanks!
Thanks for this great video. I'm using one of these in my garden, connected to an ESP8266 but I am getting erratic values. Sometimes it is steady and decreasing just a little at a time, which is what I would expect. Other times it jumps up or down by 50%. If I move it just a little then it definitely changes big time. Any thoughts on how I can stabilize the readings?
Excellent test and a real electronics explanation. Wonderful tutorial.
The output range in these things seems to change once you hook up a relay and pump. nice test btw, thanks.
I just bought 10 of these and I was looking for a video to teach me about them. This was very helpful. Do you have a video on just the 555 chip?
I am actually going to be doing a 555 video sometime soon, not sure exactly when it might take a couple of weeks because I’m going to mix it in with some other things like a hex inverter oscillator and maybe a few other logic circuits with individual gates and a 4017 counter etc. Getting back to the pre-Arduino days.
Have you tried if you see a difference after a few days? Once the water sets around the soil, I'm wondering if the values of "humid soil" actually work. Soil that you just watered is not the same a few hours later
thank you! finally i understood how it really works
Finally! This is the sensor Ive been waiting a month for so far! Come on ali!
I was hoping to test it out a lot sooner and now I guess the ground is going to be frozen in a couple of months so it was now or never! It seems to be very useable from preliminary testing.
Thank you very much for the tip about epoxy. Gonna order that from something closer to home!
Very well explained, thank you very much!
putting epoxy around the components and socket on top? And maybe a transparent heat shrinking tube, too...
Yeah I could use epoxy but I also wondered if I could use something else that can be removed with a solvent if I ever needed to access the components for some reason but for the cost of the probe I probably don’t need to worry about that.
hot glue then... easy removable... lifehacker.com/5676237/use-rubbing-alcohol-to-remove-hot-glue-from-nearly-anything
hi, how long does it take to get a reading? we'll need to know this when using it with a microcontroller. thx!
If the sensor is already powered, it is always giving out an analog voltage that can be read immediately but if the sensor is going to be powered up only when it’s time to take a reading, that would have to be measured. If I can remember, I’ll see how long it takes to stabilize when powered on.
5 times the output rc time constant to reach 98% the value. Should be good after 5 seconds of powering the sensor.
I usually see programmers using water and air as the 2 extremes (wet and dry) to calibrate the sensor, but that's not entirely correct. As far as I understood the capacitive sensor, it deppends on the conductivity of the medium in which it is inserted right? Pure water (or water with food colouring as well) has not a great conductivity, at least not as high as water + soil because of minerals. So while calibrating like this, you might see moisture levels in wet soil higher than pure water, which would be weird. Am I correct? (Sorry for bad english)
The capacitive sensor operates on the dielectric properties of the medium rather than the electrical conductivity but similarly I’m sure the dielectric of soil is going to be different from air or water so the sensor would need to be calibrated probably even in different sections of a landscape where some might have clay soil and some might be store-bought potted soil mix. Now that it is summer here again I plan to continue the experiments so hopefully more will be learned.
@@GadgetReboot Thank you for your answer. May I ask something else? I tried to understand how the capacitive sensor works but I really can't make it; if it deppends on the medium, how putting a plastic bag around doesn't prevent it from obtaining the humidity? When I search for capacitors I get the classic picture of 2 plates with a dieletric in between, but this sensor has only one probe. Shouldn't the soil be somewhere between the plates?
The electric field between the two plates consists of two sections. The first is directly side-by-side flat on the board which is what you are familiar with, you just have the two copper strips beside each other and there is air in between and whatever coating on the circuitboard, but then there’s the other electric field radiating actually out of the board from one conductor in a semi circle coming back to the other, similar to the lines of flux on a magnetic field diagram radiating out in circles away from one part of the structure and coming back to another part of the system.
And that’s where the soil gets to interfere with that portion of the electric field radiating out from one plate and being obstructed as it tries to return to the other plate, changing the dielectric properties.
is it possible to read the capacitance of the probe using dc out? I need that value for my program to work
Hi Can you convert the analog signal to digital?
Reading the analog signal with an op amp comparator configuration would convert it to digital where the output changes low to high when a certain analog input threshold is reached. Using hysteresis gives even better results (noise immunity).
www.ti.com/lit/ug/tidu020a/tidu020a.pdf
Isn't it more important to get the reference values from actual dry and moist soil? The ratio of the dielectric constant of water/air is probably quite different than moist soil/dry soil. So for calibrating this using a micro controller, I would find some soil I define as dry, note the value, and water it to make a definition of moist. Then I'd use those values for the micro controller to determine when it's time to water the soil. Thank you very much for this explanation. I see that I've bought the crap kind of sensor, the electrolysis one with two prongs with exposed copper.
Yeah exposed copper is probably not going to do well in the long run.
This was overall more of a first experience with the sensor to get an idea how to use it. even within the same environment, maybe the sensor needs to be observed for the most dry and most wet conditions a certain section of a garden may experience with various sun and shade conditions. There’s a lot of variables so it just needs to be characterized for every unique installation.
Next project is to add an opamp to rescale the voltage for 0 to 10 V to represent 0% to 100% moisture content.
Why? You can do this on the side of the mcu. :)
hello, thanks for this video.
I wanted to ask you if by chance you could explain to me more precisely the internal circuit of the sensor
There is a 555 oscillator that feeds signal to voltage divider formed by a 10 k resistor and the reactance of the probe
arduinodiy.wordpress.com/2020/08/24/soil-moisture-sensors/
And
arduinodiy.wordpress.com/2018/06/28/a-capacitive-soil-humidity-sensor-part-4/
Useful video
should we seal the sensor of its sides??
Yes because water can get in so I used epoxy
So if I were to use this for low powered applications, the 555 timer would drain the battery, no?
If I wanted a low power design I would design a load switch circuit whether it’s just a MOSFET high side driver or an actual IC load switch that I can come out of sleep mode occasionally and power on this sensor, take the reading, then power it off and go back to sleep.
I don’t need to constantly know what the moisture is, maybe once per hour or less often is good enough. Even just once per day if I plan to do watering only at a specific time like early in the morning or just when the sun is going down take the reading and then choose if I need to water, and maybe one or two readings throughout the day when the sun is supposed to be out just to make sure what happens between the day and the night.
I used an n-mosfet for such as a load switch contolling the ground by the Gate of the mosfet controlled by the MCU ( esp32 ). Thanks for the verification.
Thank you for asking about the low power application. This channel has lots of good plans.
You would switch the supply on to the probe just before you take the ADC sample, say 5s on, 3595s off, sample the ADC after 4s. Sample the soil moisture 24 times a day.
Could you epoxy the whole sensor (components) to make it waterproof?
Iow is epoxy harmful to the smd components?
I might do some testing to check different ways of waterproofing later but I’m not sure if there’s any adverse effects in terms of chemical interaction with the components or issues with thermal dissipation and all of that. When I get into researching that I’m sure there’s going to be a lot of info to look at.
Gadget Reboot tx and tx in advance.
Will this work with stonewool?
Experimenting would be best, it would depend how it holds moisture, if it's uniform enough and stays distributed similar to soil. Since the sensor can detect levels for completely dry air and a wet glass of water, as long as there's some amount of moisture around it, it could work after some observation of the output levels between wet and dry material it's in.
i would love more videos about those.
Thanks for good explanation.
very good , thanks
Don't forget the sensor is very non-linear. In my testing, it is much less sensitive in the top half, which is impractical.
Hi, will length /width of the cable influence readings from sensor? Typically you do not want to have electronics near to the soil, that is getting water. So if you place your measuring device (ESP, Arduino, RaspPi, etc) 10-15 meters away, there will be long cable. I am testing this sensor with ESP32 runnign Micropython, but so far do not get reliable result. My cable is about 3 meters long. Curiuos if anybody has this reliably working in their gardening projects.
I haven’t tested it with long cables from the output to the Arduino input but it’s possible there could be some noise pick up if it works at shorter lengths.
Three things I might try are
1.Twist the signal wire with the ground wire - A spare ethernet cable would have several twisted pairs in it so a certain pair could be used for signal and ground.
2. Try a cable that has an extra ground shield, certain audio cables or maybe even an old coax cable might work, connect the signal on the normal conductor and connect the outer shield to ground only on the measuring ESP side. If the shielded cable has two conductors inside plus the shield wire, run signal and ground through it and connect the shield only to ESP side ground.
3. Maybe a simple RC filter on the receiving signal input would help filter. No specific values in mind but maybe a few tens or hundreds of ohms in series with the signal line coming in and then a capacitor to ground after the resistor, right at the ESP input. Maybe 1 nano to 1 uF experimentally.
If I can find some long wires here, maybe I can try to duplicate the set up and see if I get a difference between long and short wires and if I can fix it.
@@GadgetReboot Thanks, will try different cables, and will keep testing.
can we put in 5v pin in arduino?
The sensor output can go to the 5 V Arduino analog input.
We built a circuit on the breadboard and measured the frequency. When we measured the frequency in front of the Cprobe, we had about 250 kHZ. For your information, we excluded the 3.3 regulator part. I'm worried because 370kHZ is not coming out. Please give me some advice if possible!
the 555 has all kinds of different variations from different manufacturers and they all may have different maximum frequencies, and the frequency on the PCB version of a circuit might be better performing than a breadboard version in general as frequencies increase, so it’s hard to say if there’s anything that can be done on the bread Board to match the PCB performance even if the same version of 555 chip is used.
www.quora.com/What-is-the-range-of-output-frequency-for-a-555-timer-IC
Gadget Reboot Thank you for your answer!
*THX*
the guy knows his shit..
In what 555 voltage input?, its getting 3.34v output.
Thanks
The sensor has a 3.3 V regulator so it takes 5 V in but then runs lower.
@@GadgetReboot
Yes i see, but how much lower?
The regular output it 3.3v volt ,and the output 555 in leg 3 also 3.3v ,so it should be little higher
With 5 V power, the 555 power is 3.3, output dry is 2.8, output wet is 1.5.
how do you connect the sensor to the voltmeter
Using DuPont jumpers and alligator clips, I had the meter on the analog sensor output and ground and taped it so it wouldn’t fall apart while transporting.
@@GadgetReboot thank you too much
thanks
I got a couple of them, unfortunately only one works. The others all have a similar erratic behaviour. I double checked output Volages with Multimeter. So I know. 100% is 1.2V and 0% is 2.1V. now when i put the unit in water or in air, I get appropiate stable readings. But at the moment I put it into the earth it starts to act unpredictable, putting out instable Voltages between 3,5 and 1 Volts. I disconnect the Data from the A/D converter and measure output voltage and can confirm the strange output of the moisture sensor. Now i am thinking moisture and conductivity, so I enclosed the entire device including the now soldered on wires in epoxy, still have the same erratic behaiour when in earth. I am so tired of this shit.
Do you have an estimated area this sensor is capable of measuring?
To cover the electronics, you can you use something like this: www.thingiverse.com/thing:2952434
I doubt you can use the map funcion: esp32.com/viewtopic.php?f=19&t=13235&p=52339#p52339
Yeah it may not be linear but I just look for empirical thresholds that work in different settings such as indoor potted vs outdoor in ground and trigger a watering session. I am planning more follow-up experiments, this one was just more getting started with using the sensor.
maybe I need an outdoor meter. Yuck. LOL :-)
That sensor has a ground plain on the backside