As we don't live on the surface of the sun the moisture does not need to be measured multiple times per second. Limiting measurements even to once every 5-10minutes increases the lifespan of the cheap sensor drastically as the lack of constant dc current means the copper corrodes much slower. Of course the time frame between measurements could be increased even more for a longer lifespan.
Water and other things in the soil will react with the metal even when no current is flowing, so a capacitive sensor is a much better option as it is 'non contact'. But you are correct the lifespan can be increased.
WKD: what you say is right but to be sure to stop the galvanic corrosion you should electrically disconnect the sensor when you do not take the measurement, this should be done using another Arduino channel and maybe a bipolar relay
To extend the lifespan of the cheap sensors, you can use 2 analog pins one as a digital output to power the sensor and one as analog input, you take the reading and then turn off the output pin. On the next measurement you just swap the pins. This way you are simulating an AC behavior. The copper will eventually corrode for chemical reactions over time, but it will not be accelerated by flowing current.
thesimbon - The copper (plus the other metal that's plated onto the copper, if you're lucky it's tin, if not, it's nickel and there's a much greater chance for the latter) will not only corrode, but also leach into the soil. Sounds like just the right thing to make your plants happy....
thesimbon - Well, soil moisture sensors are usually used in order to be able to water plants properly. Which kinda presumes that the goal is to make the plants thrive and avoid poisoning them as much as possible, don't you think? I mean what else would you use a soil moisture sensor for?
After a heck of a lot of failed tests, I went to an AC drive detection scheme initially seen from National Semiconductor in the later '70s. My version drives a Ti electrode at around 100khz and 12v peak to peak capacitor coupled (a 555) - neither value is too critical - and senses via a voltage doubler (or a few of them for water level in a tank) consisting of two diodes and two .1uf caps loaded by 100k and directly driving an arduino or ESP logic input for water level, or with different loading to suit your electrodes, an a/d converter. Water has a dielectric constant around 80 - so here we are using the capacity change as water is more or less present between the electrodes. I'm using titanium wire for those (pure) as in most cases it wouldn't corrode even electrolytically, and have had one system (for cistern water level) in continuous use for around 10 years now with no maintenance required. Nothing else ever survived even a whole year - floats stick, optics cloud up, any DC stuff corrodes and so on. Sadly, I didn't do a full documentation on this yet - it's so simple I just remember it, maybe I should and share it - or maybe Andreas can, he'd do a nicer job. Nice pics/plots of what I did do are here: www.coultersmithing.com/forums/viewtopic.php?f=59&t=904&p=5584&hilit=water+level#p5584
@@DCFusor Great article - thanks for writing that up, and sharing it here. One point that I'm not clear on: You use alternating current (ac) to drive your "water tank capacitors", and you use titanium wire as the "conductive plates" of those capacitors. The ac will stop electrolysis - as long as the driving current has no dc component. Does the titanium stop some other from of corrosion that is unrelated to electrolysis?
@@seamusdemora5598 Yes, it's nearly immune to pretty much all corrosion from water based chemistry. It's widely used in things like salt water for that reason. FWIW, while mine grows a little fuzz (algae?) now and then, it's good as new after more than a decade. Nothing else ever came close to that level of reliable longevity.
Resistive measurement works perfectly fine. I use two Stainless steel rods that are sampled for 1ms every hour. Inbetween sampling there is no voltage. It is running for 5 years now without issue.
In analytical chemistry for cunductometry this whole issue is managed by the use of alternateing current (and platina electrodes but stainless steel, copper or graphite should be fine for this). I don't know a damn about eletronics but why don't they just use alternating current, it reverses every chemical changes it makes? Sorry for the spelling.
I to did the same thing. Using Stainless steel rods have worked in my soil for years now. I also did not want add more circuity (even though I like the capacitive approach) to my project design. I have my Microcontroller pulse for a few milliseconds make a ADC read then average these raw reads, off the rest of the time. No electrolysis effect.
I also use stainless steel rods, the only issue I have with resistive measure is the dependence from temperature, anyway I don't know if the capacitive have same issue
Electrolytic corrosion is the death of almost all electronics. That is the reason why it is important to block direct current. Those cheap moisture sensors are actually a nice learning tool and included in almost all arduino-kits. And the rapid electrolytic destruction is a feature, it shows beginners the importance to think about these problems and how to avoid them. :) The naive approach is, to add a resistor to make a voltage divider and put them between Vcc and GND and measure the voltage drop with the built-in ADC. This makes them corrode away in no time. The next less naive approach is to put the voltage divider between a port-pin and GND and enable them only a few times to measure the value. This slows it down but doesn't solve the problem. Third approach is, putting it between two port-pins and to take measurements they are driven with alternating current ( alternate between high and low on those two port-pins, always one pin high and the other low and taking measurements in between). This remove almost all direct current, but some direct current might be still present if the program takes longer when one specific pin is high (i.e. when taking a sample only in one code path). Then you can fix the program, maybe add a capacitor in series with the voltage divider and so on. Then you might introduce the capacitive sensor. It is a learning tool. :) And when all flowers are dried up, you can build electric neon flowers: ua-cam.com/video/rbrjkzMEpPU/v-deo.html www.bigclive.com/nixie.htm (and they don't need water) Edit: The other thing I wanted to mention is: Conformal coating helps a lot and it is extremely easy to retrofit, just get a spray bottle of kontaktchemie plastik 70 (or similar product), clean the PCB, and spray it (be careful with connectors). Conformal coating could be done in the factory, it is very cheap but it isn't done to increase the chance for water damage. Water damage means no warranty and the customer has to buy a new product and that is what some vendors of some products want (Especially the vendor of particularly hard to repair laptops that get turned into a PC when a corroded trace or pad is replaced with a wire). The easy way to make your own, and more robust, moisture sensor is a screw terminal with two nails in it. I mean the screw terminals used to install light fixtures (They are called Lüsterklemme in German, this should give good results in google image search).
Now I have mentioned it. Maybe it helps some readers. :) I also edited the comment and mentioned conformal coating that can cheaply added. You mentioned it too, but isn't that plasti dip stuff really thick? That is why I mentioned a product that is especially made for conformal coating and it is old, very old, I know that I used the kontakt chemie stuff almost 20 years ago. ;)
Wow. That big yellow/blue can with its big letters worked perfectly. It kept the better suited, but less prominently presented, product under the perception threshold... Somebody should tell this to the marketing people from electrolube. ;)
making the learning curve steeper, while this is not needed ? i think these subjects are some of the basics of electronics, making a battery, galvanic properties, etc...
Well explained. I have made various moisture sensors, including resistive sensors and capacitive sensors. Both have their pro' s and cons. You already mentioned most of the disadvantages of the resistive sensors. Those can be minimized by interrupting the power to the sensor and only switch it on for a few milisec when you measure and that can be done say 4-6 times/day. More than enough. I also do not use copper, but Iron. This way sensors last several seasons I found the capacitive sensors (made with 555 or HC14) a bit sensitive to surroundings, apparently their wires pick up stray capacitance. I was surprised about your sensor working with a plastic bag around it, it will, but probably not well with so much airspac around it. I tried with heat shrink.... that didnt really work. Lacquer and plastidip (expensive) do. One more thing about that various resistive models. If you use the analog output, the 'module' that comes with it is usually superfluous,as it connects directly to the sensor
I thought iron starts to rust. No problem with that? Or do you use stainless steel? Concerning the plastic bag: Plastidip arrived too late for the video:-( But as you saw, it worked with the bag.
Usually galvanized I use. Yes it builds up some corrosion, but I just wipe it down end of season, doesn't really influence the reading throughout the season. Yes I saw it worked. I used a plastic bag too during some tests, but I never expected it to still work with so much air in between :-) My bad
Hi Andreas! You can not imagine how valuable this video is for me! I know programming but almost nothing about electronics. I have started about a month ago and your videos are helping me a lot (I still don't understand a lot but it's a way to know what to study). I will try to reproduce your sensor and connect it in an esp32! Again thanks a lot!
Dear Andreas, your study is priceless. Saved me tons of work and some money (and I'm afraid a friend of mine is not going to receive any payment of a device he was going to build me...) Thanks for this. A Venezuelan exiled in Lima, looking to come back soon to my country, once freed. Cheers!
Interesting tangent opportunity here, doesn't the ESP32 offer onboard capacitance sensing intended for touch detection? I imagine it wouldn't be too much of a rework this for a buried soil probe along the lines of what Andreas came up with. I might give this a shot when mine arrives!
@Andrew Sanjanwala Yeah, that should be possible. I believe the working principle is the same, except that with a capacitative touch sensor, one of the plates of the capacitor is your finger (or whatever you're touching the sensor with), and with soil moisture sensors, you have to put another plate.
capacitive sensing is a good idea. Also: Don't forget to protect the whole sensor, including the electronic components with lacquer, not only the sensing part.
Great video! Ive learnt new things. Anyway, instead of using capacitive sensors, what about using graphite as sensor probes? Graphite are used in many electrolytic cells as electrodes so they won't corrode away like copper does. Plus, i think graphite can be cheap too as it can be found in pencils.
I did something like this a while ago. I only measured every 15 minutes, using the AC measuring method with an arduino. The sensor itself was very reliable and basic, just two stainless steel rods stuck into a pair of screwable wire connectors. The system was running for a year with no loss of accuracy and absolutely no damage to the rods. The rods were 4mm diameter and 10cm in length.
What about using AC to measure the moisture? I would expect that the simple sensors should life much longer. Also a pulsed current, only measuring the moisture a few milliseconds every hour or so should help. It is not neccessary to measure all the time. What do you think?
AC will not remove the corrosion which the metal electrodes will experience in the soil. The DC current only accelerates this degradation - even without DC current a copper trace in soil with or without tin plating will be gone after a very short while. And copper salts - while an essential micronutricient - will kill your plants quickly.
Uwe: I was thinking the same thing. Copper in high concentrations is bad. And coming from a PCB, that is probably high enough concentration to weaken the plant. Especially if you replace the sensor every month. Frank: Pulsed DC is exactly what Andreas showed in his example with the last sensor and the signal generator. It create a capacitance effect. Pretty neat in how that works considering there isn't any touching parts.
To avoid corrosion I used two stainless screws for probing, and alternating current for measuring. That means instead of connecting them to VCC/GND they-re connected between two GPIO analogue pins, and switch polarity 10 times/second. That also allows keep both "legs" at same gnd voltage between measurements. It needs no circuitry, one gpio pin is configured input-pullup the other as output low so there is a measurable voltage on the input pin. In a few ms program swaps them and averages last 10 read values.
One more minute to see the finished protected sensor with the material you mentioned would have been a nice touch. Overall it was a very interesting and informative video. Thank you.
Another thing that should be considered is how long these suggested protective coatings will last. And if they will release toxic substances in the long run. I doubt this would matter for decorative plants but if used for edible plants/vegetables it might. Of course this applies for the stuff that would be released from the exposed PCB also.
I know this has been awhile. But I came up with a probe that works really well, is super cheap, and easy to make. I simple put three long pieces of coax cable snugly into a 1/2" pvc pipe. The probe is sealed with simple pipe caps. I found that putting a bolt through the bottom for grounding made it more stable. All this stuff is super cheap and easy to work with.
They ll corrode anyways but a little bit slower and switching wont help until you saturate the soil with copper salts. Additionally platinium would be a much better choive then gold.
The green stuff is Copper. I just took 2 big steel nails put them into an 2 wide luster terminal strip (Lüsterklemme). The trick to avoid electrolysis is to not connect to DC but to an arduino output and just give it power while reading the sensor for a millisecond.
@@AndreasSpiess don't want to read all comments since I'm building a circuit right now. Were they positive about this method? For me it works perfectly.
Great video! I've had this problem a few years ago with water level detectors. Even with small voltages the electrodes disappeared after a few days. I tried replacing them with stainless steel electrodes, it appeared it didn't corrode, at least not as fast, but I now realize it might create even more toxic waste as a result because of chromium. I wish I knew about the capacitive sensors back then.
I don't really know plant biology. But I think some copper ions dissolved in the soil will be harmless or even necessary/beneficial. Although too much coppper in the soil will change the pH or reach toxic levels. And some species may be more sensitive than others (for better or for worse).
I dont think so, because copperoxide(s) are not green. The copper somehow goes into some kind of copper-salts, maybe copperchloride/carbonate/hydroxide... they are all nice greenish colors
@@paulg.3067 tap water would have some chlorine so copper chloride, and hydroxide would be likely. the plating will probably be tin so you might get some stannous chloride as well (not sure if you can get tin hydroxides, not a chemist).
Hello Andreas, this is an excellent video. I am Electronic Engineer but never had the opportunity to practice it. I love how you explain the principle with the electronic schema. This video has been very useful for me since I was doing the same type of research as you by comparing different probes. I am typing to make a wifi watering system (possibly solar) and this was very helpful. Now, I have heard that the consumption of this device was abnormally high and that better solutions should be found (unless you don't mind about consumption).
I do no more remember the consumption. But maybe a small solar panel can help. And you do not need it on the whole time. One or two measurements a day should be ok.
Dear Andreas, we make a fabric able to sense humidity. It's resistive sensing element is made of stainless steel. We think its main advantage is to be able to measure humidity right in between the plant roots and not only in the surface of the vase. Let me know in case you want to test it.
So far I have no plans for a additional video on this topic. Did you make scientific tests to prove that it works? Because so far, nobody was able to show a correlation between real and measured humidity of such sensors (resistive or capacitive)
The green stuff should be copper oxide, which is classified as a hazard to the environment. Considering though, that there are a lot of copper pipes out there that also oxidize, I guess it's not all to bad. Fun fact: the statue of liberty is made of copper and oxidized over the years, that's what gives it its distinctive green color
I have solved this problem years ago by using a capasitor in series with the sensor and using alternating current for measurement. The capasitor eliminates the DC component and prevents corrosion.
An informative video that points out the short comings of the different types of commercial sensors that can be purchased. It would of course be easy enough to elongate the life of these but because they rely on conductivity, they do need to be exposed to the soil, whereas a capacitive sensor, does not so can be coated to protect it. 2 nails would suffice to replace the copper electrodes if you wanted longevity, or because of the price of these types you could just replace them every year. Thanks for the video, it gives people insight into the different types to use
Hi, I really like your videos. But this time I am a little bit disappointed. I thought you will bring a "real" solution. I got the same problem like you and I found a way to solve the problem forever without any toxic stuff (plastics, softener, etc). And without having any materials that can corrode. I took two graphite electrodes, printed a holder for them and connected them to a controller of the cheap china sensor. To prevent any way of electrolysis it changes the polarity of the electrodes every 24h. I take data once every 10minutes. To get perfect values I did the following: I took 500g soil and put it in a compartment dryer about 48h around 60°C that it is 100% dry. In the next step I took 30g of the soil and put water in it. After it was saturated I took the values from the 100% wet and the 100% dry soil - each with 30g of soil. Then it was time to get some values between these measurements because it does not change linear. Here are my resultes (6cm dipped electrodes, 5mm diameter) : Moisture // Value 0% // 1024 20% // 634 40% // 339 60% // 321 80% // 307 100% // 260 It shows, that I need to repeat this measurement with moisture values between 0% and 50% in smaller intervals. But if we think about the resilience of nature it isn't so important. Anyway: Thank you for your great videos and explainations.
Good work! Maybe you follow the interesting link in Craig’s comment (above). The studies there suggest it is hard to get reliable measurements from resistive and capacitive sensors. This is what I experienced and why I gave up to increase accuracy. I accepted the results because to keep home plants healthy it should be ok. But it seems you got pretty good results with your sensor.
I have this setup in use for 3 months now for my peppermint. I have tested it with soil from it and the values are nearly the same (+/-1% - condition: same temperature, same water, etc.). The main reason for this is that the surface of the electrodes does not change. No corrosion etc... In addition: the problem with metal electrodes is, that they solve in postitiv ions under electrolyse. This changes the conductivity of the soil and the result is: BAD measurements. So just use inert electrodes like graphite (quiet expensive, but for food, its a better choice)
What i understand of Adreas's test, is that the galvanic/resistive "way" may be not the correct "road" to travel on, (somebody already tried aluminium electrodes ?) due to corrosion, maybe one should use silver electrodes because silver oxide is a conductor :) (hence use on switch contacts) in theory copper oxide stops oxygen from further corrosion, but will be a isolator, doing it the capacitive way seems a better solution, otherwise ultrasone ? the sound travels faster through water, i can't think of a better way then Andeas found in this test. and doubt if there is.
A channel named "Flaura - Smart Plant Pot" has a video titled "Capacitive Soil Moisture Sensors don't work correctly" that you might find interesting. He includes video clips directly from your tests, and mentions the need for a 3V regulator in-circuit to get reliable, repeatable readings. Some boards exclude that regulator (shunting that connection with a 0-ohm resistor, for example, if the regulator's footprint is actually on the board).
Muchas gracias profe, muy educativo e interesante el video, para este tipo de sensores tan útiles. El sensor de patas delgadas y macizas es útil para una ecualización del riego en la fase de diseño, por su características físicas, permiten una fácil penetración a la tierra, pero no dejarlo expuesto por periodos prolongados, debido a lo que usted expone en el video, y el sensor recubierto si sera útil para dejarlo en la tierra, claro incluyendo la mejora que usted menciona, recubriendo el borde, para así garantizar un riego proporcional a la humedad del suelo en todo momento. Saludos.
An AC Bridge might reduce corrosion and can be used to reduce noise. So I used two optocouplers with the transistors configured as a half bridge to drive one electrode with a square wave. The LEDs of the couplers are connected anti parallel and connected on one side to a voltage divider, which also limits the LED current. Connecting the other side to GND or the supply voltage one or the other LED are switched on, but never both. This circuit also minimizes crosstalk and noise. The other electrode of the moisture sensor is connected to a second voltage divider and an analog input. For the measurement a digital output controls the LEDs and the analog input is measured with the values being reversed if the digital output is high. At the end I average over many cycles (e.g. 16) This way a very basic synchronous detection is implemented greatly reducing noise. Not bad for a circuit with 4 resistors and 2 couplers. I use stainless steel wires for the sensor to further reduce corrosion and a gypsum cast around them to measure soil water tension which allows for different soil types, rather than moisture If there is interest, I will create a github page with schematics etc. What do you think about this circuit?
It's just a simple comparable testing between contact(conductive) sensors and non contact(capacitive sensors). But contact sensors are still being used because it might comfortably to replace on ecah crop cycle or it's in needed for short critical growing period.
All the sensors I use for soil profile moisture sensing rely on frequency or time domain reflectometry. They last forever. However, I know there are also capacitive sensors on the market suitable for science or agricultural use...now I know how they work. Thanks very much.
As a proponent of KISS, I simply don't use any of those sensors. It's just an ESP that opens/closes a solenoid and starts/stops a pump according to a schedule. The schedule can be changed in a web interface hosted on the ESP. Look how much water you use with watering cans and the output of your pump. Then you know how to match your schedule. I also write the schedule to the ESP and time gets synched. So if power loss happens, everything will keep working like nothing happened.
I think this will also work. You even could combine it with Google calendar as I did in one of my videos. Then the user interface is also quite simple and the ESP has no data stored.
You can solder some stiff copper wire onto the legs of the cheap sensors so the PCB tracks are not in the damp soil, but this is only a partial fix. I noticed that when the temperature drops at night the conductivity of the soil changes and of course this makes it difficult to set accurate limits. Another problem is that when you add liquid fertilizer like "Miracle Gro" the conductivity of the soil increases as does the chemical reaction on the wires. Basically then Andreas' suggestion with the capacitive sensors and waterproof dip is the only reliable way to go.
The "chemistry" that happens when one leg of your humidity sensor dissolves, is the oxidation of your anode. To prevent this, you can combine the following two strategies: (1) use metals that form a stable anode (gold, platinum, titanium, nickel, carbon) which means that when using PCB technology, your limited to ENIG and more advanced plating technologies, and (2) apply as little as possible voltage between the legs of the sensor, which means use as little current as possible to measure the resistance and amplify the voltage with e.g. an instrumentation amplifier. I agree that the capacitive sensor is a much more elegant and robust approach though! The working principle reminds me of the good old Theremin :)
Dear sir, I exactly understood what you meant. No electrical current as it will do electrolysis function, within different metal, different electrolyte, or even different potential differences in a circuit. The capacitive way is I will always like. Thank you for this enlightment. Thought it was just that simple to measure soil moisture. Thanks again.
By maintaining the polarity of the legs and having a constant current running through them you are literally deplating the metals from the positive electrode (anode) and inefficiently plating on the negative electrode (cathode). There are at least 2 things you can do to greatly improve the sensor life. Only turn the power on to the sensor long enough to make your measurement, and change the polarity of the sensor each time. It is a little more complicated, but your sensors should last a very long time. Thanks for the video!
There were quite a few proposals in the comments to avoid a fast dead of the sensor. Changing polarity was one of them. But it dis not help everywhere...
@@AndreasSpiess Well, of course, you should start out with good sensors. Perhaps 200 microinches of electroplated watts semi-bright nickel, plated after etching to ensure all exposed copper is covered. Any exposed copper at all is going to go away in fairly short order with or without electric current. :-) Still, I suspect the capacitive sensing has the potential to last longer if you coat the entire assembly in a good thin conformal coating. Except for the connectors of course, to which I would apply a generous helping of silicone dielectric grease. Have a great day!
I have some humidity sensing electrodes that are gold-plated, I assume to minimize the electrolytic degradation processes. I'm curious how long I should expect them to last due to the more inert gold plating. Though obviously the capacitive circuit is the best way to go for long-term monitoring. Thanks for pointing out this solution.
I assume gold plated material lasts longer. But I do not know how gold interacts with other chemicals. Some commenters reported heavy corrosion with different materials.
Fetid Tuna ok Erin brockovich, I suppose I'll die as the massive current going through stainless bolts erodes them entirely. And leaches into my tomatoes 🍅. Cool
Thanks for the analysis. I am about to install moisture sensor in my home garden (30-40 of them) and waned to understand the difference between all types of moisture sensors available in the market before i place the bulk order. This 10 min video saved me from going through all of their datasheets. One info missing from this video is the resolution of these sensors.
I just saw a longtime study of the capacitive sensors. Pay attention your protect them with and additional layer. Especially the side which is completery unprotected
@@AndreasSpiess True. There are several concerns around directly inserting these sensors in soil. The best solution i could find is to put these sensors in plastic zip lock bags. This will not only protect the sensor but also prevent any toxic chemical from sensors eroding into the soil and then sucked in by the plant. It will probably reduce sensor's resolution but since its just a astable NE555, I should be able to fix it.
Years back I built an analogue system to water my plants. I found that my mild steel nails used as sensors would just rust away. I then used graphite rods from a lab supply shop. They are more fragile than the nails, but they don't corrode and don't give off any toxic oxides.
Your observations are shared by a few other commentators
4 роки тому
Dear Andreas, Take a look at the Irrometer 200SS app note. It uses a pseudo AC current with muxes for multiple sensors. If you are only using one of this or even a leaf wetness sensor, you can connect it in series with a known resistor and connect both ends to two digital output pins. Of course you connect an analog input in between. By running a small sketch pulling the pins HIGH and LOW and then LOW and HIGH, you generate an AC from the sensors point of view. That way you do not have galvanic current corroding the plates. Cheers Namensvetter!
I've just got the capacitive soil moisture sensors shown in the video. And I already thought that insulating sides and the exposed circuitry is needed. Does anyone know of a coating that would not poison the plants in pots? Are those two options ("Plastic Dip", TRV) suitable for gardens? Any of them have no chance of contaminating the soil? Thanks for the answers. Very happy that you came to conclusion on the sensors i just bought, they were not that expensive on the "usual platforms". Will have to see how they work long term.
I'm testing now DCA/SCC3 Conformal Coating from ELECTROLUBE. It's a spray and you must hang the sensor in the air to let all spare dropping off. Avoid any contact at the bottom for 24hours. One sensor is now in the soil for a month and looks quite good
I've tested nail polish for a week, and some of it came off on the sides. But I had a different problem that these sensors were staying in the same range, slightly increasing over the days. Might be my mistakes, but if i tested it not in earth, but putting in a glass of water it went from 0 - 100%, but as I said in the earth it didn't really decrease, but rather increase over time. How Are your readings? Are you using these capacative sensors ? Yeah, I'm on vacation and this project is now at a stop for a month.
The bare conductor sensors will not give the same reading without frequent calibration, even if you have a material that will not corrode. This is caused by change in fertilizer salt from spring to fall and different soil ion exchange capacity from location to location. I use a conductivity meter to measure the concentration of hydroponic solutions because at low concentrations the conductivity has a linear response to dissolved solids. Though even this is only accurate in comparing 2 batches of the same formula, as different salt formula have different conductivity slopes. I don't know how the capacitor sensor reacts to ion concentration.
I used the striped sensor as christmas tree water sensor, it corroded in only 2 weeks totally. Thanks for the video, really concise and clear information here!
I have the same experiences with both sensor types. The capacitive sensor, however, still has a problem. If the soil changes from wet to dry, a permanent gap in the soil can develop there, which makes further measurements useless. Of course, it depends heavily on the soil conditions. Maybe high-frequency radio waves are the solution. I did a first experiment with a Bluetooth tracker and measured the dBm. Looks promising. I have packed it waterproof and buried about 15cm in dry soil. Then I irrigated the soil bit by bit and found noticeable changes in the dBm.
You are right. Measuring moisture seems to be an art. These sensors are just ok for detecting the time to water plants. Not more. They are not very accurate, but also quite cheap.
Hi Andreas, I try to use a shrinkwrap with glue inside to seal the capacitive sensor. But I do not if it was issued by the head or by the shrink tube. The analog read was 370-714 without the shrink tube and now 680-714. Therefore the shrink tube is currently not a good idea, but It would make it very simple. I orderd some new sensors to do more testing. My other died like you described by water coming in from the side.
I'm thinking about designing a sensor which fits into those petling (small Pet Tube), where do you think are the limits in wall thickness for this kind of measurements? I'm planning a whole package with an LiFePo Cell, ESP8266 and the sensor itself. Maybe i can heat and press the pet tube at the lower sensor part together to get a better smaller gap to the water. This package would be 100% waterproof :)
Super simplified explanation: Even without any "power" at all, "dissimilar" (different) metals give up their electronic charges at different rates, as metal gives up its electronic charge, it completely breaks down (corrodes). Even without any power, when you connect dissimilar metals with a conductor (e.g. - wire or water or humidity), the electronic charges move from the weaker metal (anode) to the stronger metal (cathode). When you add electricity, it increases the flow and causes the process to speed up rapidly. Even without electricity, even the tiniest bit of humidity in the air allows this process to happen naturally which is why you when you calibrate the device, you will never see a "zero" reading. When you calibrate it, you're testing for *your* environment with *your* water (and your water's electrolytes, metals, etc.) to see how much voltage is conducted when "dry" versus "completely submerged in water" to estimate a range in between. That's why these must be calibrated on site with the same water that is used to water a yard. Bonus info 1: Since boats sit in water and are full of humidity (both are conductors), we try very hard to make sure all metals are similar (e.g. - all the same steel with similar compositions). As a "fail safe", we attach a plate of zinc underneath the boat because zinc is an extremely weak metal and will usually give up its charges to other metals so that it rusts instead. Then we replace the zinc plate as needed. Bonus info 2: This process is the entire basis for how a batter works - one cell is loaded with a cathodic (+) material and the other is loaded with an anodic (-) material. pomametals.com/wp-content/uploads/2018/03/galvanic-series-chart-metals.png
Thank You! I went through EXACTLY the same problem. There is an ON-OFF trick how to slow down the unavoidable corosion, but all attepmts will lead "everyone" to capacitive sensors. Thank You again and more, more, more videos.
Great video! For those of you that wanna know more about the topic there's a good overview of various soil moisture sensors in elektor magazine that was just recently uploaded. It's called 'Moisture Sensors for Watering Systems' by Peter Tschulik and is pretty instructive
@@AndreasSpiess There are a bunch of scientific papers comparing different soil moisture sensors, for example 'assessing the applicability of low-cost soil moisture sensors' from April 2020 by Abdulla Alshahri
Green stuff is copper carbonate which is caused by corosion and electrolysis speeds up the corrosion process on your electrodes. Same thing when people remove rust using electrolysis but the object that needs derusting is grounded.
In electromagnetic depth-sounding, especially in magnetotellurics, corrosion is not only a problem because it destroys the electrodes, but the reaction also affects the measurements. One solution is to use Ag-AgCl-electrodes, which are a bit on the pricy side. I think controlling the on and of time of the sensor, as a lot of people mentioned, is probably the most efficient solution for plant-watering, as you really dont need continous measurements.
Andreas look up Ox/redox reactions. Basicly one side you are stripping copper ions and the other side you'll be disposing ions present in the water on the other electrode. This is a classic reaction and the bassis or battries and currosion. That blue green is most likely a mix of copper 2 ions and other ferrous complexs in the water.
Hi Andreas, thank you for the video, very informative, do you think the plastidip would take away from the sensitivity much? what if the capacitance sensor was coated in several coats? would it loose it's ability to sense through the porous rubber like coating?
Hello,very good explication about the sensor(most of the channels that made a video about the moisture sensors didn't said anything about the dangers of the cheap ones) but can we can we solder a the cooper exposed terminals with a layer of solder?What do you think?
You could just plasti-dip or varnish one of those cheap resistive sensors, and then build a small board using the design @7:24. It's on my project list, anyway.
@@AndreasSpiess Excellent point sir - those prongs are pretty far apart, so capacitance values will be lower than the design normal for this sort of sensor.
Grüessech Andreas! Merci vil mol für das Video! I don't understand how your self-built capacitor still works inside of a plastic bag. Is it detecting the humidity of the plastic? Could you provide a quick explanation?
Through its electrical field it measures the properties of he material between its electrodes. But not only exactly between the electrodes. The field also hits other parts. Electrodes in capacitors always are completely insolated. ( en.wikipedia.org/wiki/Capacitor )
I know that this is an old video but another factor is overlooked. The composition of the soil can affect the capacitance, So you must calibrate your sensor to your soil. I.E Measure dry soil and then add an optimum amount of water. Also the chemical mask up of the water will be another viable. I.E. Tap water VRS rain water they will have different TDS that can affect the sensor.
You are right. Unfortunately I did not find any studies using such sensors where we could see how accurate they are and how they compare with other sensors :-(
Your connections to your simple circuit indicates that one of the blue wires is directly inline with the other, therefore both ends of your home-made capacitor would be receiving the positive pulse of the waveform simultaneously, as it is not connected to ground as it should be and therefore could affect better measurements.
I hook up the sensor power to a gpio output pin and turn it on once every 2 hours for one reading. On for about 3.5 seconds every 2 hours. Extends sensor life. Plant moisture levels drop very slowly, no need for an always on plaint moisture sensor.
And I just ordered the same sortiment of sensors from China, trying to find out exactly whether this would happen. Measuring with AC instead of DC would make the effect much slower, as would reducing the times the humidity is actually measured.. but bare copper in moist soil will always oxidize, even without external voltage. That's why copper or brass flower pots turn green over time. Regarding "the green stuff" - it's just copper dioxide, "Grünspan". It's not poisonous, and the plants shouldn't worry about it in these small doses, but it's still not useful to the planned goal.
I didn't realize there were generics of the capacitive sensors now! From what I've heard they are a lot more accurate than the resistive ones. Just so you know though, you can prevent the destruction of the resistive sensors by only applying power only for a few milliseconds at a time whenever you need to take a measurement. I used to just connect the +5v pin to an output pin on my MCU and turn that output on when I need to take a reading.
I noticed that there is a picture of a cheap temperature & humidity sensor in the early part of the video, and had a thought: could you not put one in a buried upside-down cup (or w/e) and measure the soil temperature and humidity that way? An external one would monitor the ambient temperature and humidity to provide a control.
Moisture and humidity are measured completely differently. There are a few discussions on the internet about that topic, because of Sparkfun and some Chinese selling humidity sensors as moisture sensors.
I'm using one of the same principle of these sensor to measure water level. While working on initial prototype, I found that the rate of electrolysis is high and decided to measure the water level on demand (mostly for 2-3 second for 2 times a day) and it is more than a year I am able to preserve the sensor probes working. Chemical produced is Copper(II) Hydroxide : en.wikipedia.org/wiki/Copper(II)_hydroxide
The DC on the legs of the sensor causes the metal to migrate from one leg to the other. Feeding the bare metal sensor with AC (via a capacitor) instead of DC helps. The AC will balance the voltage in the legs to avoid the metal migrating.
How about using the graphite probes instead? Graphite anodes are commonly used for cleaning rusted steel pieces through electrolysis because they decay far slower than iron.
Excellent video, Andreas! However - if I think about the dozens of plants in separate containers in my parents winter garden - I really hope for a follow up video where you will show a clever method how to collect the values from a large number of these sensors without rolling out a few hundred meters of wires. Is there a way to attach a cheap wireless data link to them that could for example operate on coin cell batteries and send the values a few times per day to a central receiver in the same room?
Likely someone already explained the green foam in the water, but to keep it fresh, a brief explanation. The green "gunk" is the de-plated copper from the sensor. Copper turns green when combined with oxygen, forming copper-oxide. (The Statue of Liberty was once copper colored, but exposure to the environment turned her "skin" green.) Wow, that one was staring me right in the face and I should have realized these cheapo bare copper sensors simply won't work! I know what's happening because I use a similar method to extract gold from computer electronics. The method I use eats away the copper holding the gold on the surface of a chip. The copper underneath the gold is dissolved by acid, leaving nothing for the gold to bond to. The gold then floats away for collection. The bath I use turns exactly the same color of what's floating in your glass. And here is the silly thing staring me right in the face. You don't put copper in a moist environment that contains acids and salts and then run a current through it. (AKA soil.) That is an anode and a cathode. All that's needed is even the slightest bit of juice and some O2 in the environment and out goes the copper! Do that in reverse with a bit of acid and you can plate things to copper- that's how the gold gets deposited on electronics. The "teeth" in a stick of memory are copper underneath. Run that through an anode cathode setup and your memory comes out golden. (Fun fact- the ancient Egyptians figured this out! MANY of the "solid gold" trinkets dug up by archeologist are gold plated lead.) As to toxicity... Copper oxide is seriously poisonous. Best throw that cup away. But it does exist in dirt. (Never eat dirt.) Plants need trace amounts of copper in the form of copper oxide. You actually consume copper when you eat plants- but it is bound up in no toxic forms. With the plant in the way to filter the copper, I would guess there is no real harm. You touch copper oxide all the time on coins. But as to the what else is on those sensors? God himself knows. The people who make these devices live in the single most polluted country in the world. If it were coming out of Europe or the US, the chemical purity of the copper would be assured. And the strata that the copper bonded to would be food grade- because this is going into gardens you might be eating from. But somehow money makes that go away. Maybe it is safe, but i would only use these as a demonstration sensor. I hate to be mean, but this is the same place that "recycles" human hair from barber shops to make sure the dog food we buy meets certain levels of biotin and other biological tests. And let's not forget the "plastic baby milk" incident... Babies all over Europe came down with kidney stones and some may have died because the company located in in the same country where these sensors are made was putting melamine, the chemical that makes plastic flexible, into baby formula to fool the regulatory testing agencies in Europe. The people doing this made millions of course. (Melamine is not dangerous if it is in plastic. But in food? Gives you massive kidney stones...) Point is, most things are worth what they cost. If it is a super good deal, you should ask wise. Thank you for bringing this to my attention- before I bought any.
Thanks Andreas! If I'm studying to develop a lora connected watering system for my plants is only because of you. Thank you for inspiring and explaining things in a way that is both fascinating and simple!
Hi Andreas, a series-capacitor with the 555 ckt would have ensured that absolutely no DC enters the electrodes - I'm surprised that the original circuit doesn't have this.. as for the corroded copper and tin (assuming that the PCBs are lead-free tinned) - the products (copper-hydroxide) are reasonably harmless for plants. The patina on the Statue of Liberty is partially copper hydroxide (and mostly carbonate).
In the schematic at 7:37 , the upper sensor-electrode is GND. Pin3 of the 555-timer outputs a ~square-wave. The average voltage at pin-3 shall then typically be ~60% of Vcc. This goes directly to the lower electrode. At this point, the only insulator for the DC is the (thin) solder-mask on the PCB. In my experience, while the mask is an insulator against casual contact, it is not a long-term waterproof coating. To achieve that would need a specialist-grade epoxy. In my experience, the presence of DC shall also corrode the coated electrode, albeit starting a lot slower. An easy cure would be to add a series capacitor upstream of the electrode. This virtually guarantees that no DC is visible to water (due to the extremely high dielectric resistance of the capacitor), even after the water permeates the solder-mask. For a few cents, the life of the sensor would increase manyfold.
Hi Andreas thanks for your time spent to show this for us. Could you do a test? Change the plated electrodes to Iron Galvanized Wire... maybe you have little bit more resistance but it will last.
The xiaomi plant sensor seems to be a cost effective solution. It supposedly works with the capacitive method. Some sources refer that it is fulffilling "Soil Probe EC5 Standard." Googling that returns some capacitive sensors. The sensor also shows no clear traces. However the price bumped up bit a while ago
Thank you Andreas for your interesting videos! Why not to use stainless steel electrodes insted of standart wich modules come with? Seems it will work much longer? What do you think?
Thanks for the Video, Andreas. In a proper industrial solution the driver for the sensor is always alternating current. This prevents unwanted electrolysis even if the sensor is capacitive and the isolation gets damaged. With leakage detection and indication you know there is a fault, distorting your measurement. A possible easy solution can be to couple a PWM signal out with a capacitor and feed back the sensor over an rectifier + capacitor/lowpass. Sounds complicated but are less components than a NE555 based oscillator and most of the components are used in the DC application anyway + Micro-controllers love to PWM. At all you have to think about if a capacitance touch-less measuring method is the best for you: You get a phone call and your plant gets water ... this can happen;) Using the direct contact method with AC coupling is the stable (homebrew) method i think. In addition what Eman Retzun(Nutzer Name?) said: there shouldn't be any component in the sensor path, including the amplifier if one is needed, that draws more current than an Arduino can switch, and on/off times for plant moisture measurements can be very sporadic. Where's my copper gone?!?: From the one electrode to the other, negative electrode:) ... but other stuff can get in solution that was bound with or was under the copper. So don't use permanent electrolysis on your potatoes. What happens in a fault situation?: Your house gets messy and the expenses are far more than a 3$ sensor. Ever thought about the magic of the capillary effect? -> You build a closed system, where only so much water physically can get in what's needed. High-End space material like terracotta does the rest. If you can't withstand, than you can put a moisture sensor outside of that all as secondary safety measure. And this one can always be dry, yelling an loud alarm if it gets wet:)
As we don't live on the surface of the sun the moisture does not need to be measured multiple times per second. Limiting measurements even to once every 5-10minutes increases the lifespan of the cheap sensor drastically as the lack of constant dc current means the copper corrodes much slower. Of course the time frame between measurements could be increased even more for a longer lifespan.
Water and other things in the soil will react with the metal even when no current is flowing, so a capacitive sensor is a much better option as it is 'non contact'. But you are correct the lifespan can be increased.
And the capacitive sensors are like 3$, so it's not that bad
There are a lot of Arduino sketches out there where a digital pin is used to power the sensor only when needed.
WKD:
what you say is right but to be sure to stop the galvanic corrosion you should electrically disconnect the sensor when you do not take the measurement, this should be done using another Arduino channel and maybe a bipolar relay
why make things complicated, one should try to keep sketches small, so one can add usefull code when neeeded
To extend the lifespan of the cheap sensors, you can use 2 analog pins one as a digital output to power the sensor and one as analog input, you take the reading and then turn off the output pin. On the next measurement you just swap the pins. This way you are simulating an AC behavior. The copper will eventually corrode for chemical reactions over time, but it will not be accelerated by flowing current.
Good idea!
thesimbon - The copper (plus the other metal that's plated onto the copper, if you're lucky it's tin, if not, it's nickel and there's a much greater chance for the latter) will not only corrode, but also leach into the soil. Sounds like just the right thing to make your plants happy....
CoolKoon I only suggested how to extend the life of sensor, I am not a chemist or a biologists so I don't know what will happen to the plant 😁
thesimbon - Well, soil moisture sensors are usually used in order to be able to water plants properly. Which kinda presumes that the goal is to make the plants thrive and avoid poisoning them as much as possible, don't you think? I mean what else would you use a soil moisture sensor for?
Use AC-driven stainless steel probes. I´ve seen that used on a water tank level sensor, and it seems to work.
I always had doubts on which one of these sensors to use. Thanks for explaining so well and solving my dilemma.
Glad to help
After a heck of a lot of failed tests, I went to an AC drive detection scheme initially seen from National Semiconductor in the later '70s. My version drives a Ti electrode at around 100khz and 12v peak to peak capacitor coupled (a 555) - neither value is too critical - and senses via a voltage doubler (or a few of them for water level in a tank) consisting of two diodes and two .1uf caps loaded by 100k and directly driving an arduino or ESP logic input for water level, or with different loading to suit your electrodes, an a/d converter. Water has a dielectric constant around 80 - so here we are using the capacity change as water is more or less present between the electrodes. I'm using titanium wire for those (pure) as in most cases it wouldn't corrode even electrolytically, and have had one system (for cistern water level) in continuous use for around 10 years now with no maintenance required. Nothing else ever survived even a whole year - floats stick, optics cloud up, any DC stuff corrodes and so on.
Sadly, I didn't do a full documentation on this yet - it's so simple I just remember it, maybe I should and share it - or maybe Andreas can, he'd do a nicer job. Nice pics/plots of what I did do are here: www.coultersmithing.com/forums/viewtopic.php?f=59&t=904&p=5584&hilit=water+level#p5584
Sounds like an alternative concept. It would be good if you document it one to be used by others.
I will. Your skills in explaining would probably be superior re telling people how to tune the parameters for a given task...
Here you go, folks. Let's bug Andreas to do this up right!
www.coultersmithing.com/forums/viewtopic.php?f=7&t=1098&p=6438#p6438
@@DCFusor Great article - thanks for writing that up, and sharing it here. One point that I'm not clear on: You use alternating current (ac) to drive your "water tank capacitors", and you use titanium wire as the "conductive plates" of those capacitors. The ac will stop electrolysis - as long as the driving current has no dc component. Does the titanium stop some other from of corrosion that is unrelated to electrolysis?
@@seamusdemora5598 Yes, it's nearly immune to pretty much all corrosion from water based chemistry. It's widely used in things like salt water for that reason. FWIW, while mine grows a little fuzz (algae?) now and then, it's good as new after more than a decade. Nothing else ever came close to that level of reliable longevity.
Resistive measurement works perfectly fine. I use two Stainless steel rods that are sampled for 1ms every hour. Inbetween sampling there is no voltage. It is running for 5 years now without issue.
In analytical chemistry for cunductometry this whole issue is managed by the use of alternateing current (and platina electrodes but stainless steel, copper or graphite should be fine for this). I don't know a damn about eletronics but why don't they just use alternating current, it reverses every chemical changes it makes? Sorry for the spelling.
I to did the same thing. Using Stainless steel rods have worked in my soil for years now. I also did not want add more circuity (even though I like the capacitive approach) to my project design. I have my Microcontroller pulse for a few milliseconds make a ADC read then average these raw reads, off the rest of the time. No electrolysis effect.
I also use stainless steel rods, the only issue I have with resistive measure is the dependence from temperature, anyway I don't know if the capacitive have same issue
Electrolytic corrosion is the death of almost all electronics. That is the reason why it is important to block direct current. Those cheap moisture sensors are actually a nice learning tool and included in almost all arduino-kits. And the rapid electrolytic destruction is a feature, it shows beginners the importance to think about these problems and how to avoid them. :)
The naive approach is, to add a resistor to make a voltage divider and put them between Vcc and GND and measure the voltage drop with the built-in ADC. This makes them corrode away in no time. The next less naive approach is to put the voltage divider between a port-pin and GND and enable them only a few times to measure the value. This slows it down but doesn't solve the problem. Third approach is, putting it between two port-pins and to take measurements they are driven with alternating current ( alternate between high and low on those two port-pins, always one pin high and the other low and taking measurements in between). This remove almost all direct current, but some direct current might be still present if the program takes longer when one specific pin is high (i.e. when taking a sample only in one code path). Then you can fix the program, maybe add a capacitor in series with the voltage divider and so on. Then you might introduce the capacitive sensor. It is a learning tool. :)
And when all flowers are dried up, you can build electric neon flowers: ua-cam.com/video/rbrjkzMEpPU/v-deo.html www.bigclive.com/nixie.htm (and they don't need water)
Edit:
The other thing I wanted to mention is: Conformal coating helps a lot and it is extremely easy to retrofit, just get a spray bottle of kontaktchemie plastik 70 (or similar product), clean the PCB, and spray it (be careful with connectors). Conformal coating could be done in the factory, it is very cheap but it isn't done to increase the chance for water damage. Water damage means no warranty and the customer has to buy a new product and that is what some vendors of some products want (Especially the vendor of particularly hard to repair laptops that get turned into a PC when a corroded trace or pad is replaced with a wire).
The easy way to make your own, and more robust, moisture sensor is a screw terminal with two nails in it. I mean the screw terminals used to install light fixtures (They are called Lüsterklemme in German, this should give good results in google image search).
Thank you for summarizing all connection methods. Maybe I should have mentioned it.
Now I have mentioned it. Maybe it helps some readers. :)
I also edited the comment and mentioned conformal coating that can cheaply added. You mentioned it too, but isn't that plasti dip stuff really thick? That is why I mentioned a product that is especially made for conformal coating and it is old, very old, I know that I used the kontakt chemie stuff almost 20 years ago. ;)
My second choice „Tropenlack“ seems to be a conformal coating. But not easily available. Thanks for your proposal.
Wow. That big yellow/blue can with its big letters worked perfectly. It kept the better suited, but less prominently presented, product under the perception threshold...
Somebody should tell this to the marketing people from electrolube. ;)
making the learning curve steeper, while this is not needed ? i think these subjects are some of the basics of electronics, making a battery, galvanic properties, etc...
Well explained. I have made various moisture sensors, including resistive sensors and capacitive sensors. Both have their pro' s and cons.
You already mentioned most of the disadvantages of the resistive sensors. Those can be minimized by interrupting the power to the sensor and only switch it on for a few milisec when you measure and that can be done say 4-6 times/day. More than enough.
I also do not use copper, but Iron. This way sensors last several seasons
I found the capacitive sensors (made with 555 or HC14) a bit sensitive to surroundings, apparently their wires pick up stray capacitance.
I was surprised about your sensor working with a plastic bag around it, it will, but probably not well with so much airspac around it. I tried with heat shrink.... that didnt really work. Lacquer and plastidip (expensive) do.
One more thing about that various resistive models. If you use the analog output, the 'module' that comes with it is usually superfluous,as it connects directly to the sensor
I thought iron starts to rust. No problem with that? Or do you use stainless steel? Concerning the plastic bag: Plastidip arrived too late for the video:-( But as you saw, it worked with the bag.
Usually galvanized I use. Yes it builds up some corrosion, but I just wipe it down end of season, doesn't really influence the reading throughout the season. Yes I saw it worked. I used a plastic bag too during some tests, but I never expected it to still work with so much air in between :-) My bad
I've been using 316 SS threaded rod. No problem with corrosion that I can detect.
You got the same solution I found. Cool someone else thinks like me.
the quality of your content is unmatched!
a comprehensive walk through the circuit diagrams and a solution -- what more could you ask for
Glad you liked the video!
Hi Andreas! You can not imagine how valuable this video is for me! I know programming but almost nothing about electronics. I have started about a month ago and your videos are helping me a lot (I still don't understand a lot but it's a way to know what to study). I will try to reproduce your sensor and connect it in an esp32! Again thanks a lot!
Thank you for your feedback and good luck with your build!
Dear Andreas, your study is priceless. Saved me tons of work and some money (and I'm afraid a friend of mine is not going to receive any payment of a device he was going to build me...)
Thanks for this.
A Venezuelan exiled in Lima, looking to come back soon to my country, once freed. Cheers!
Glad to help! And sorry for your colleague.
Just bury an ESP8266, the water will change the signal strength. 😎
:o)
Make sure you add a LiPo battery so it's self drying. Bonus is that the plant will add to the "heating" effect (read: fire!)
😆😜😂
Interesting tangent opportunity here, doesn't the ESP32 offer onboard capacitance sensing intended for touch detection? I imagine it wouldn't be too much of a rework this for a buried soil probe along the lines of what Andreas came up with. I might give this a shot when mine arrives!
@Andrew Sanjanwala Yeah, that should be possible. I believe the working principle is the same, except that with a capacitative touch sensor, one of the plates of the capacitor is your finger (or whatever you're touching the sensor with), and with soil moisture sensors, you have to put another plate.
capacitive sensing is a good idea. Also: Don't forget to protect the whole sensor, including the electronic components with lacquer, not only the sensing part.
You are right!
That is if you stick the components in the ground, which you do not do :) Also don't water the components!
You could also just switch the power to the sensor on for just a splitsecond fir a measurement
You are right.
I didn’t know there was a non-rusting sensor solution. Thanks for sharing
You are welcome!
I know it's one of your old videos, but this is incredibly helpful. Thank you again Andreas!
Glad it was helpful! This video still gets lots of views.
Perfect timing... I couldn’t understand why my plants were being over watered. I’ve ordered the recommended sensor. Thanks again.
You are welcome!
Great video! Ive learnt new things. Anyway, instead of using capacitive sensors, what about using graphite as sensor probes? Graphite are used in many electrolytic cells as electrodes so they won't corrode away like copper does. Plus, i think graphite can be cheap too as it can be found in pencils.
Graphite was suggested also by other viewers. It is a good idea.
yes it is good... but electrolysis will still take place.
I did something like this a while ago. I only measured every 15 minutes, using the AC measuring method with an arduino. The sensor itself was very reliable and basic, just two stainless steel rods stuck into a pair of screwable wire connectors. The system was running for a year with no loss of accuracy and absolutely no damage to the rods. The rods were 4mm diameter and 10cm in length.
Thank you for sharing your experience!
What about using AC to measure the moisture? I would expect that the simple sensors should life much longer. Also a pulsed current, only measuring the moisture a few milliseconds every hour or so should help. It is not neccessary to measure all the time. What do you think?
AC is the best way to do it. It avoids a problem - electrode polarisation and allowes for even electrode aging
You are right. There is a comment summarizing the different possibilities with their advantages and disadvantages.
AC will not remove the corrosion which the metal electrodes will experience in the soil. The DC current only accelerates this degradation - even without DC current a copper trace in soil with or without tin plating will be gone after a very short while.
And copper salts - while an essential micronutricient - will kill your plants quickly.
Uwe: I was thinking the same thing. Copper in high concentrations is bad. And coming from a PCB, that is probably high enough concentration to weaken the plant. Especially if you replace the sensor every month.
Frank: Pulsed DC is exactly what Andreas showed in his example with the last sensor and the signal generator. It create a capacitance effect. Pretty neat in how that works considering there isn't any touching parts.
Actually copper is a fungicide won't hurt the plant.
To avoid corrosion I used two stainless screws for probing, and alternating current for measuring. That means instead of connecting them to VCC/GND they-re connected between two GPIO analogue pins, and switch polarity 10 times/second. That also allows keep both "legs" at same gnd voltage between measurements. It needs no circuitry, one gpio pin is configured input-pullup the other as output low so there is a measurable voltage on the input pin. In a few ms program swaps them and averages last 10 read values.
Thank you for your feedback!
One more minute to see the finished protected sensor with the material you mentioned would have been a nice touch. Overall it was a very interesting and informative video. Thank you.
Unfortunately I do not have the material at hand. But one of my trusted colleagues gave me the tip.
what about nail varnish?
I also thought about that. But I do not have it in my lab ;-) Maybe somebody tried?
Big Clive proposed Nail varnish. (Tip from a Patreon)
Another thing that should be considered is how long these suggested protective coatings will last. And if they will release toxic substances in the long run. I doubt this would matter for decorative plants but if used for edible plants/vegetables it might. Of course this applies for the stuff that would be released from the exposed PCB also.
I know this has been awhile. But I came up with a probe that works really well, is super cheap, and easy to make. I simple put three long pieces of coax cable snugly into a 1/2" pvc pipe. The probe is sealed with simple pipe caps. I found that putting a bolt through the bottom for grounding made it more stable. All this stuff is super cheap and easy to work with.
Interesting concept!
Just switch polarity every time you check moisture. Second thing - buy only gold plated sensors.
They ll corrode anyways but a little bit slower and switching wont help until you saturate the soil with copper salts. Additionally platinium would be a much better choive then gold.
Decreasing sampling frequency and reducing sampling time would improve cheap sensors lifespan considerably.
Totally unbiased analysis showing which of the sensors really work. Thanks for the improved content.
You are welcome!
I laugh when you said "this is not a channel about good looks and makeup" at 8:42 . Brilliant and informative video as always Andreas!
Thank you!
The green stuff is Copper.
I just took 2 big steel nails put them into an 2 wide luster terminal strip (Lüsterklemme).
The trick to avoid electrolysis is to not connect to DC but to an arduino output and just give it power while reading the sensor for a millisecond.
There are many discussions in the comments about this method.
@@AndreasSpiess don't want to read all comments since I'm building a circuit right now.
Were they positive about this method? For me it works perfectly.
Great job, Andreas. I love the detail you've gone into, even finding the schematics for these unknown models.
I wanted to understand how they work myself!
@@AndreasSpiess can you help me in my Arduino project
@@abdulrahmanismailali1064 i am a UA-camr and do not do consulting.
Great video! I've had this problem a few years ago with water level detectors. Even with small voltages the electrodes disappeared after a few days. I tried replacing them with stainless steel electrodes, it appeared it didn't corrode, at least not as fast, but I now realize it might create even more toxic waste as a result because of chromium. I wish I knew about the capacitive sensors back then.
Thank you for sharing your experience!
the green stuff is probably mostly oxidized copper.
You are right!
I don't really know plant biology. But I think some copper ions dissolved in the soil will be harmless or even necessary/beneficial.
Although too much coppper in the soil will change the pH or reach toxic levels. And some species may be more sensitive than others (for better or for worse).
I dont think so, because copperoxide(s) are not green. The copper somehow goes into some kind of copper-salts, maybe copperchloride/carbonate/hydroxide... they are all nice greenish colors
@@paulg.3067 tap water would have some chlorine so copper chloride, and hydroxide would be likely. the plating will probably be tin so you might get some stannous chloride as well (not sure if you can get tin hydroxides, not a chemist).
Hello Andreas, this is an excellent video. I am Electronic Engineer but never had the opportunity to practice it. I love how you explain the principle with the electronic schema. This video has been very useful for me since I was doing the same type of research as you by comparing different probes. I am typing to make a wifi watering system (possibly solar) and this was very helpful.
Now, I have heard that the consumption of this device was abnormally high and that better solutions should be found (unless you don't mind about consumption).
I do no more remember the consumption. But maybe a small solar panel can help. And you do not need it on the whole time. One or two measurements a day should be ok.
Thanks for the video. I ordered a capacitive sensor and will add it to my projects queue.
Dear Andreas, we make a fabric able to sense humidity. It's resistive sensing element is made of stainless steel. We think its main advantage is to be able to measure humidity right in between the plant roots and not only in the surface of the vase. Let me know in case you want to test it.
So far I have no plans for a additional video on this topic. Did you make scientific tests to prove that it works? Because so far, nobody was able to show a correlation between real and measured humidity of such sensors (resistive or capacitive)
The green stuff should be copper oxide, which is classified as a hazard to the environment. Considering though, that there are a lot of copper pipes out there that also oxidize, I guess it's not all to bad. Fun fact: the statue of liberty is made of copper and oxidized over the years, that's what gives it its distinctive green color
You are right.
@@AndreasSpiess
CuO = black
CuCO3 = green
Cu(OH)2 = bluish green
I have solved this problem years ago by using a capasitor in series with the sensor and using alternating current for measurement. The capasitor eliminates the DC component and prevents corrosion.
Using AC was mentioned several times in other comments. Some also mentioned it will not completely remove oxidation.
As expected, another superb exposition! Thank you Andreas.
An informative video that points out the short comings of the different types of commercial sensors that can be purchased. It would of course be easy enough to elongate the life of these but because they rely on conductivity, they do need to be exposed to the soil, whereas a capacitive sensor, does not so can be coated to protect it. 2 nails would suffice to replace the copper electrodes if you wanted longevity, or because of the price of these types you could just replace them every year.
Thanks for the video, it gives people insight into the different types to use
You are right. There are many other comments on the different solutions and suggestions...
Hi,
I really like your videos. But this time I am a little bit disappointed. I thought you will bring a "real" solution. I got the same problem like you and I found a way to solve the problem forever without any toxic stuff (plastics, softener, etc). And without having any materials that can corrode.
I took two graphite electrodes, printed a holder for them and connected them to a controller of the cheap china sensor. To prevent any way of electrolysis it changes the polarity of the electrodes every 24h. I take data once every 10minutes.
To get perfect values I did the following:
I took 500g soil and put it in a compartment dryer about 48h around 60°C that it is 100% dry.
In the next step I took 30g of the soil and put water in it. After it was saturated I took the values from the 100% wet and the 100% dry soil - each with 30g of soil. Then it was time to get some values between these measurements because it does not change linear.
Here are my resultes (6cm dipped electrodes, 5mm diameter) :
Moisture // Value
0% // 1024
20% // 634
40% // 339
60% // 321
80% // 307
100% // 260
It shows, that I need to repeat this measurement with moisture values between 0% and 50% in smaller intervals. But if we think about the resilience of nature it isn't so important.
Anyway: Thank you for your great videos and explainations.
Good work! Maybe you follow the interesting link in Craig’s comment (above). The studies there suggest it is hard to get reliable measurements from resistive and capacitive sensors. This is what I experienced and why I gave up to increase accuracy. I accepted the results because to keep home plants healthy it should be ok. But it seems you got pretty good results with your sensor.
Andreas Spiess I cannot find that comment, at least here from the smartphone. What's his username?
I have this setup in use for 3 months now for my peppermint. I have tested it with soil from it and the values are nearly the same (+/-1% - condition: same temperature, same water, etc.). The main reason for this is that the surface of the electrodes does not change. No corrosion etc...
In addition: the problem with metal electrodes is, that they solve in postitiv ions under electrolyse. This changes the conductivity of the soil and the result is: BAD measurements. So just use inert electrodes like graphite (quiet expensive, but for food, its a better choice)
What i understand of Adreas's test, is that the galvanic/resistive "way" may be not the correct "road" to travel on, (somebody already tried aluminium electrodes ?) due to corrosion, maybe one should use silver electrodes because silver oxide is a conductor :) (hence use on switch contacts) in theory copper oxide stops oxygen from further corrosion, but will be a isolator, doing it the capacitive way seems a better solution, otherwise ultrasone ? the sound travels faster through water, i can't think of a better way then Andeas found in this test. and doubt if there is.
Eric-Jan van den Bogaard what about platinum or gold plating the electrodes?
A channel named "Flaura - Smart Plant Pot" has a video titled "Capacitive Soil Moisture Sensors don't work correctly" that you might find interesting. He includes video clips directly from your tests, and mentions the need for a 3V regulator in-circuit to get reliable, repeatable readings. Some boards exclude that regulator (shunting that connection with a 0-ohm resistor, for example, if the regulator's footprint is actually on the board).
I think I once was contacted by the creator of this board. Stable voltages are important for most sensors, BTW.
Nice video Andreas.
Thank you!
Muchas gracias profe, muy educativo e interesante el video, para este tipo de sensores tan útiles. El sensor de patas delgadas y macizas es útil para una ecualización del riego en la fase de diseño, por su características físicas, permiten una fácil penetración a la tierra, pero no dejarlo expuesto por periodos prolongados, debido a lo que usted expone en el video, y el sensor recubierto si sera útil para dejarlo en la tierra, claro incluyendo la mejora que usted menciona, recubriendo el borde, para así garantizar un riego proporcional a la humedad del suelo en todo momento. Saludos.
Yes, you can use the simple sensors for a short time and for tests.
Your Swiss Guy intro convinced me!! 😅😁😁😁 Great video!!
Thank you!
An AC Bridge might reduce corrosion and can be used to reduce noise. So I used two optocouplers with the transistors configured as a half bridge to drive one electrode with a square wave. The LEDs of the couplers are connected anti parallel and connected on one side to a voltage divider, which also limits the LED current. Connecting the other side to GND or the supply voltage one or the other LED are switched on, but never both. This circuit also minimizes crosstalk and noise. The other electrode of the moisture sensor is connected to a second voltage divider and an analog input. For the measurement a digital output controls the LEDs and the analog input is measured with the values being reversed if the digital output is high. At the end I average over many cycles (e.g. 16) This way a very basic synchronous detection is implemented greatly reducing noise. Not bad for a circuit with 4 resistors and 2 couplers.
I use stainless steel wires for the sensor to further reduce corrosion and a gypsum cast around them to measure soil water tension which allows for different soil types, rather than moisture
If there is interest, I will create a github page with schematics etc. What do you think about this circuit?
There are quite a few comments about hat methods already.
I though this was a channel about beauty and make-up
Sorry for not declaring it in the „small print“ ;-)
Plants are beautiful for the make-up of a house :)
yes
It's just a simple comparable testing between contact(conductive) sensors and non contact(capacitive sensors). But contact sensors are still being used because it might comfortably to replace on ecah crop cycle or it's in needed for short critical growing period.
You are right.
10:32
I love like he talks to us like we are computers, and he is the software running us.
Finally someone who speaks my language 💜🤖
Relationship goals
Where is the else condition. Where is the ELSE
All the sensors I use for soil profile moisture sensing rely on frequency or time domain reflectometry. They last forever. However, I know there are also capacitive sensors on the market suitable for science or agricultural use...now I know how they work. Thanks very much.
It wold be interesting to compare these sensors with the TDM ones.
It is always a pleasure to learn something from you sir.
Keep it up :)
:-)
As a proponent of KISS, I simply don't use any of those sensors.
It's just an ESP that opens/closes a solenoid and starts/stops a pump according to a schedule. The schedule can be changed in a web interface hosted on the ESP. Look how much water you use with watering cans and the output of your pump. Then you know how to match your schedule.
I also write the schedule to the ESP and time gets synched. So if power loss happens, everything will keep working like nothing happened.
I think this will also work. You even could combine it with Google calendar as I did in one of my videos. Then the user interface is also quite simple and the ESP has no data stored.
of course i believe you master! and i proved it
You can solder some stiff copper wire onto the legs of the cheap sensors so the PCB tracks are not in the damp soil, but this is only a partial fix.
I noticed that when the temperature drops at night the conductivity of the soil changes and of course this makes it difficult to set accurate limits. Another problem is that when you add liquid fertilizer like "Miracle Gro" the conductivity of the soil increases as does the chemical reaction on the wires.
Basically then Andreas' suggestion with the capacitive sensors and waterproof dip is the only reliable way to go.
Thank you for sharing your experience!
Yea, just pulse the sensor every couple seconds
According to other commenters this works for some time.
The "chemistry" that happens when one leg of your humidity sensor dissolves, is the oxidation of your anode. To prevent this, you can combine the following two strategies: (1) use metals that form a stable anode (gold, platinum, titanium, nickel, carbon) which means that when using PCB technology, your limited to ENIG and more advanced plating technologies, and (2) apply as little as possible voltage between the legs of the sensor, which means use as little current as possible to measure the resistance and amplify the voltage with e.g. an instrumentation amplifier. I agree that the capacitive sensor is a much more elegant and robust approach though! The working principle reminds me of the good old Theremin :)
I used a relay to cut off the sensor when not in use. You only need to use the sensor once an hour or so for a second.
What if you use the first type but switch the polarity regularly?
You find many other comments about that principle.
Works well for me.
Dear sir, I exactly understood what you meant. No electrical current as it will do electrolysis function, within different metal, different electrolyte, or even different potential differences in a circuit. The capacitive way is I will always like. Thank you for this enlightment. Thought it was just that simple to measure soil moisture. Thanks again.
:-)
Straight to the point. Thank you for protecting us customers against this cheap China sensors! Thumbs up!
Thank you!
LetsBuildSomething - Actually the capacitive moisture sensor is also a Chinese product....
By maintaining the polarity of the legs and having a constant current running through them you are literally deplating the metals from the positive electrode (anode) and inefficiently plating on the negative electrode (cathode). There are at least 2 things you can do to greatly improve the sensor life. Only turn the power on to the sensor long enough to make your measurement, and change the polarity of the sensor each time. It is a little more complicated, but your sensors should last a very long time. Thanks for the video!
There were quite a few proposals in the comments to avoid a fast dead of the sensor. Changing polarity was one of them. But it dis not help everywhere...
@@AndreasSpiess
Well, of course, you should start out with good sensors. Perhaps 200 microinches of electroplated watts semi-bright nickel, plated after etching to ensure all exposed copper is covered. Any exposed copper at all is going to go away in fairly short order with or without electric current. :-)
Still, I suspect the capacitive sensing has the potential to last longer if you coat the entire assembly in a good thin conformal coating. Except for the connectors of course, to which I would apply a generous helping of silicone dielectric grease.
Have a great day!
Du darfst kein grünes Uranglas für Deine Experimente verwenden, dann löst sich auch das Kupfer nicht ab .. ;o)
Die Farbe habe ich zufällig genommen. Es hat am Schluss aber noch etwas „giftiger“ ausgesehen. So hat es mindestens den Effekt optisch verstärkt.
I have some humidity sensing electrodes that are gold-plated, I assume to minimize the electrolytic degradation processes. I'm curious how long I should expect them to last due to the more inert gold plating. Though obviously the capacitive circuit is the best way to go for long-term monitoring. Thanks for pointing out this solution.
I assume gold plated material lasts longer. But I do not know how gold interacts with other chemicals. Some commenters reported heavy corrosion with different materials.
If I try one of these I am just going to buy a couple stainless bolts and connect them to the sensor. Pot the rest. Bam
Should work.
Fetid Tuna ok Erin brockovich, I suppose I'll die as the massive current going through stainless bolts erodes them entirely. And leaches into my tomatoes 🍅. Cool
Thanks for the analysis. I am about to install moisture sensor in my home garden (30-40 of them) and waned to understand the difference between all types of moisture sensors available in the market before i place the bulk order. This 10 min video saved me from going through all of their datasheets. One info missing from this video is the resolution of these sensors.
I just saw a longtime study of the capacitive sensors. Pay attention your protect them with and additional layer. Especially the side which is completery unprotected
@@AndreasSpiess True. There are several concerns around directly inserting these sensors in soil. The best solution i could find is to put these sensors in plastic zip lock bags. This will not only protect the sensor but also prevent any toxic chemical from sensors eroding into the soil and then sucked in by the plant. It will probably reduce sensor's resolution but since its just a astable NE555, I should be able to fix it.
This is just what i needed. Now i can start my garden without flying blind. Thank you Andreas!
You are welcome!
Years back I built an analogue system to water my plants. I found that my mild steel nails used as sensors would just rust away. I then used graphite rods from a lab supply shop. They are more fragile than the nails, but they don't corrode and don't give off any toxic oxides.
Your observations are shared by a few other commentators
Dear Andreas,
Take a look at the Irrometer 200SS app note. It uses a pseudo AC current with muxes for multiple sensors. If you are only using one of this or even a leaf wetness sensor, you can connect it in series with a known resistor and connect both ends to two digital output pins. Of course you connect an analog input in between. By running a small sketch pulling the pins HIGH and LOW and then LOW and HIGH, you generate an AC from the sensors point of view. That way you do not have galvanic current corroding the plates. Cheers Namensvetter!
This procedure was described by a few other viewers and you are right, it seems to prolong the life of the electrodes.
I've just got the capacitive soil moisture sensors shown in the video. And I already thought that insulating sides and the exposed circuitry is needed. Does anyone know of a coating that would not poison the plants in pots? Are those two options ("Plastic Dip", TRV) suitable for gardens? Any of them have no chance of contaminating the soil? Thanks for the answers.
Very happy that you came to conclusion on the sensors i just bought, they were not that expensive on the "usual platforms". Will have to see how they work long term.
Would also be interested if somebody used these protections over a long time
I'm testing now DCA/SCC3 Conformal Coating from ELECTROLUBE.
It's a spray and you must hang the sensor in the air to let all spare dropping off. Avoid any contact at the bottom for 24hours.
One sensor is now in the soil for a month and looks quite good
I've tested nail polish for a week, and some of it came off on the sides. But I had a different problem that these sensors were staying in the same range, slightly increasing over the days. Might be my mistakes, but if i tested it not in earth, but putting in a glass of water it went from 0 - 100%, but as I said in the earth it didn't really decrease, but rather increase over time. How Are your readings? Are you using these capacative sensors ? Yeah, I'm on vacation and this project is now at a stop for a month.
Very good, yeah i remember that copper will oxidized if get amoerage and put in the water
Thank you.
The bare conductor sensors will not give the same reading without frequent calibration, even if you have a material that will not corrode. This is caused by change in fertilizer salt from spring to fall and different soil ion exchange capacity from location to location.
I use a conductivity meter to measure the concentration of hydroponic solutions because at low concentrations the conductivity has a linear response to dissolved solids. Though even this is only accurate in comparing 2 batches of the same formula, as different salt formula have different conductivity slopes.
I don't know how the capacitor sensor reacts to ion concentration.
You are right. These sensors are not at all precise. I have no data showing how the capacitive sensors react to fertilizers. I assume a little less.
I used the striped sensor as christmas tree water sensor, it corroded in only 2 weeks totally. Thanks for the video, really concise and clear information here!
Fortunately, Christmas was over till then ;-) You are welcome!
I have the same experiences with both sensor types. The capacitive sensor, however, still has a problem. If the soil changes from wet to dry, a permanent gap in the soil can develop there, which makes further measurements useless. Of course, it depends heavily on the soil conditions.
Maybe high-frequency radio waves are the solution. I did a first experiment with a Bluetooth tracker and measured the dBm. Looks promising. I have packed it waterproof and buried about 15cm in dry soil. Then I irrigated the soil bit by bit and found noticeable changes in the dBm.
You are right. Measuring moisture seems to be an art. These sensors are just ok for detecting the time to water plants. Not more. They are not very accurate, but also quite cheap.
Hi Andreas, I try to use a shrinkwrap with glue inside to seal the capacitive sensor. But I do not if it was issued by the head or by the shrink tube. The analog read was 370-714 without the shrink tube and now 680-714. Therefore the shrink tube is currently not a good idea, but It would make it very simple. I orderd some new sensors to do more testing. My other died like you described by water coming in from the side.
Maybe you can send me a message on Facebook or Twitter. I also do some tests for a next video.
I'm thinking about designing a sensor which fits into those petling (small Pet Tube), where do you think are the limits in wall thickness for this kind of measurements? I'm planning a whole package with an LiFePo Cell, ESP8266 and the sensor itself. Maybe i can heat and press the pet tube at the lower sensor part together to get a better smaller gap to the water. This package would be 100% waterproof :)
Super simplified explanation: Even without any "power" at all, "dissimilar" (different) metals give up their electronic charges at different rates, as metal gives up its electronic charge, it completely breaks down (corrodes). Even without any power, when you connect dissimilar metals with a conductor (e.g. - wire or water or humidity), the electronic charges move from the weaker metal (anode) to the stronger metal (cathode). When you add electricity, it increases the flow and causes the process to speed up rapidly. Even without electricity, even the tiniest bit of humidity in the air allows this process to happen naturally which is why you when you calibrate the device, you will never see a "zero" reading.
When you calibrate it, you're testing for *your* environment with *your* water (and your water's electrolytes, metals, etc.) to see how much voltage is conducted when "dry" versus "completely submerged in water" to estimate a range in between. That's why these must be calibrated on site with the same water that is used to water a yard.
Bonus info 1: Since boats sit in water and are full of humidity (both are conductors), we try very hard to make sure all metals are similar (e.g. - all the same steel with similar compositions). As a "fail safe", we attach a plate of zinc underneath the boat because zinc is an extremely weak metal and will usually give up its charges to other metals so that it rusts instead. Then we replace the zinc plate as needed.
Bonus info 2: This process is the entire basis for how a batter works - one cell is loaded with a cathodic (+) material and the other is loaded with an anodic (-) material.
pomametals.com/wp-content/uploads/2018/03/galvanic-series-chart-metals.png
Very interesting explanation for an non-chemist. Thank you! It created some memories from way back when I was in school.
Thank You! I went through EXACTLY the same problem. There is an ON-OFF trick how to slow down the unavoidable corosion, but all attepmts will lead "everyone" to capacitive sensors. Thank You again and more, more, more videos.
You are right, I should have mentioned this trick.
Great video! For those of you that wanna know more about the topic there's a good overview of various soil moisture sensors in elektor magazine that was just recently uploaded. It's called 'Moisture Sensors for Watering Systems' by Peter Tschulik and is pretty instructive
Thank you for the link. Unfortunately, he also does not provide data. So far, I never saw a study showing how good or bad the different sensors are.
@@AndreasSpiess There are a bunch of scientific papers comparing different soil moisture sensors, for example 'assessing the applicability of low-cost soil moisture sensors' from April 2020 by Abdulla Alshahri
Green stuff is copper carbonate which is caused by corosion and electrolysis speeds up the corrosion process on your electrodes. Same thing when people remove rust using electrolysis but the object that needs derusting is grounded.
The copper is not good for your plants, If the contacts would be stainless steel or maybe silver or gold it would last longer?
Even platinum plating?
There are many comments around the material selection.
In electromagnetic depth-sounding, especially in magnetotellurics, corrosion is not only a problem because it destroys the electrodes, but the reaction also affects the measurements. One solution is to use Ag-AgCl-electrodes, which are a bit on the pricy side. I think controlling the on and of time of the sensor, as a lot of people mentioned, is probably the most efficient solution for plant-watering, as you really dont need continous measurements.
Or go the route I propose with isolated "electrodes"
Andreas look up Ox/redox reactions. Basicly one side you are stripping copper ions and the other side you'll be disposing ions present in the water on the other electrode. This is a classic reaction and the bassis or battries and currosion. That blue green is most likely a mix of copper 2 ions and other ferrous complexs in the water.
Thank you for your explanations!
Hi Andreas, thank you for the video, very informative, do you think the plastidip would take away from the sensitivity much? what if the capacitance sensor was coated in several coats? would it loose it's ability to sense through the porous rubber like coating?
I bought some plastic spray and plastidip. I plan a followup Video to sum up all the good input given in these comments
Hello,very good explication about the sensor(most of the channels that made a video about the moisture sensors didn't said anything about the dangers of the cheap ones) but can we can we solder a the cooper exposed terminals with a layer of solder?What do you think?
You could just plasti-dip or varnish one of those cheap resistive sensors, and then build a small board using the design @7:24. It's on my project list, anyway.
Can work if it has enough capacity between the two legs.
@@AndreasSpiess Excellent point sir - those prongs are pretty far apart, so capacitance values will be lower than the design normal for this sort of sensor.
Grüessech Andreas! Merci vil mol für das Video!
I don't understand how your self-built capacitor still works inside of a plastic bag.
Is it detecting the humidity of the plastic?
Could you provide a quick explanation?
Through its electrical field it measures the properties of he material between its electrodes. But not only exactly between the electrodes. The field also hits other parts. Electrodes in capacitors always are completely insolated. ( en.wikipedia.org/wiki/Capacitor )
damm this channel is good. Might not have millions of views but honestly guys who are just starting electronic this is gold...👌👌👌👌
Thank you for your nice words!
I solved the problem with firt sensor you used- solder over electrodes. Works fine, lasts 5x more.
Maybe you read other comments. Lead in the solder seems to be „not ideal“ for plants. But for sure it takes longer till the electrodes are gone.
I know that this is an old video but another factor is overlooked.
The composition of the soil can affect the capacitance, So you must calibrate your sensor to your soil. I.E
Measure dry soil and then add an optimum amount of water. Also the chemical mask up of the water will be another viable. I.E. Tap water VRS rain water they will have different TDS that can affect the sensor.
You are right. Unfortunately I did not find any studies using such sensors where we could see how accurate they are and how they compare with other sensors :-(
Your connections to your simple circuit indicates that one of the blue wires is directly inline with the other, therefore both ends of your home-made capacitor would be receiving the positive pulse of the waveform simultaneously, as it is not connected to ground as it should be and therefore could affect better measurements.
You are right. I sometimes have to rebuild my circuits for filming and I did a mistake there.
I hook up the sensor power to a gpio output pin and turn it on once every 2 hours for one reading. On for about 3.5 seconds every 2 hours. Extends sensor life. Plant moisture levels drop very slowly, no need for an always on plaint moisture sensor.
Thank you for sharing your experience. You find many other comments about that topic. Not all went well over time...
And I just ordered the same sortiment of sensors from China, trying to find out exactly whether this would happen.
Measuring with AC instead of DC would make the effect much slower, as would reducing the times the humidity is actually measured.. but bare copper in moist soil will always oxidize, even without external voltage. That's why copper or brass flower pots turn green over time. Regarding "the green stuff" - it's just copper dioxide, "Grünspan". It's not poisonous, and the plants shouldn't worry about it in these small doses, but it's still not useful to the planned goal.
You are right. A few other comments confirm the same thing.
I didn't realize there were generics of the capacitive sensors now! From what I've heard they are a lot more accurate than the resistive ones.
Just so you know though, you can prevent the destruction of the resistive sensors by only applying power only for a few milliseconds at a time whenever you need to take a measurement. I used to just connect the +5v pin to an output pin on my MCU and turn that output on when I need to take a reading.
You are right. This was discussed in many other comments below.
I noticed that there is a picture of a cheap temperature & humidity sensor in the early part of the video, and had a thought: could you not put one in a buried upside-down cup (or w/e) and measure the soil temperature and humidity that way? An external one would monitor the ambient temperature and humidity to provide a control.
Moisture and humidity are measured completely differently. There are a few discussions on the internet about that topic, because of Sparkfun and some Chinese selling humidity sensors as moisture sensors.
I'm using one of the same principle of these sensor to measure water level. While working on initial prototype, I found that the rate of electrolysis is high and decided to measure the water level on demand (mostly for 2-3 second for 2 times a day) and it is more than a year I am able to preserve the sensor probes working.
Chemical produced is Copper(II) Hydroxide : en.wikipedia.org/wiki/Copper(II)_hydroxide
Good Idea. I should have mentioned it in the video.
Andreas Spiess maybe in next time in some video 😊
The DC on the legs of the sensor causes the metal to migrate from one leg to the other.
Feeding the bare metal sensor with AC (via a capacitor) instead of DC helps.
The AC will balance the voltage in the legs to avoid the metal migrating.
True!
How about using the graphite probes instead? Graphite anodes are commonly used for cleaning rusted steel pieces through electrolysis because they decay far slower than iron.
Some other viewers also suggested this solution. So it should work, I think.
Excellent video, Andreas! However - if I think about the dozens of plants in separate containers in my parents winter garden - I really hope for a follow up video where you will show a clever method how to collect the values from a large number of these sensors without rolling out a few hundred meters of wires. Is there a way to attach a cheap wireless data link to them that could for example operate on coin cell batteries and send the values a few times per day to a central receiver in the same room?
One viewer used cheap 433MHz senders and an ATtiny
Likely someone already explained the green foam in the water, but to keep it fresh, a brief explanation.
The green "gunk" is the de-plated copper from the sensor. Copper turns green when combined with oxygen, forming copper-oxide. (The Statue of Liberty was once copper colored, but exposure to the environment turned her "skin" green.)
Wow, that one was staring me right in the face and I should have realized these cheapo bare copper sensors simply won't work!
I know what's happening because I use a similar method to extract gold from computer electronics. The method I use eats away the copper holding the gold on the surface of a chip. The copper underneath the gold is dissolved by acid, leaving nothing for the gold to bond to. The gold then floats away for collection. The bath I use turns exactly the same color of what's floating in your glass.
And here is the silly thing staring me right in the face. You don't put copper in a moist environment that contains acids and salts and then run a current through it. (AKA soil.) That is an anode and a cathode. All that's needed is even the slightest bit of juice and some O2 in the environment and out goes the copper! Do that in reverse with a bit of acid and you can plate things to copper- that's how the gold gets deposited on electronics. The "teeth" in a stick of memory are copper underneath. Run that through an anode cathode setup and your memory comes out golden. (Fun fact- the ancient Egyptians figured this out! MANY of the "solid gold" trinkets dug up by archeologist are gold plated lead.)
As to toxicity...
Copper oxide is seriously poisonous. Best throw that cup away.
But it does exist in dirt. (Never eat dirt.) Plants need trace amounts of copper in the form of copper oxide. You actually consume copper when you eat plants- but it is bound up in no toxic forms. With the plant in the way to filter the copper, I would guess there is no real harm. You touch copper oxide all the time on coins.
But as to the what else is on those sensors? God himself knows.
The people who make these devices live in the single most polluted country in the world. If it were coming out of Europe or the US, the chemical purity of the copper would be assured. And the strata that the copper bonded to would be food grade- because this is going into gardens you might be eating from. But somehow money makes that go away. Maybe it is safe, but i would only use these as a demonstration sensor.
I hate to be mean, but this is the same place that "recycles" human hair from barber shops to make sure the dog food we buy meets certain levels of biotin and other biological tests. And let's not forget the "plastic baby milk" incident... Babies all over Europe came down with kidney stones and some may have died because the company located in in the same country where these sensors are made was putting melamine, the chemical that makes plastic flexible, into baby formula to fool the regulatory testing agencies in Europe. The people doing this made millions of course. (Melamine is not dangerous if it is in plastic. But in food? Gives you massive kidney stones...)
Point is, most things are worth what they cost. If it is a super good deal, you should ask wise.
Thank you for bringing this to my attention- before I bought any.
Thank you for your explanation. Indeed, in the many comments the copper-oxide was mentioned.
Thanks Andreas! If I'm studying to develop a lora connected watering system for my plants is only because of you. Thank you for inspiring and explaining things in a way that is both fascinating and simple!
Glad you like the content of the channel!
Hi Andreas, a series-capacitor with the 555 ckt would have ensured that absolutely no DC enters the electrodes - I'm surprised that the original circuit doesn't have this.. as for the corroded copper and tin (assuming that the PCBs are lead-free tinned) - the products (copper-hydroxide) are reasonably harmless for plants. The patina on the Statue of Liberty is partially copper hydroxide (and mostly carbonate).
I think a capacitor would not change a lot (because of the diode).
In the schematic at 7:37 , the upper sensor-electrode is GND. Pin3 of the 555-timer outputs a ~square-wave. The average voltage at pin-3 shall then typically be ~60% of Vcc. This goes directly to the lower electrode. At this point, the only insulator for the DC is the (thin) solder-mask on the PCB. In my experience, while the mask is an insulator against casual contact, it is not a long-term waterproof coating. To achieve that would need a specialist-grade epoxy. In my experience, the presence of DC shall also corrode the coated electrode, albeit starting a lot slower. An easy cure would be to add a series capacitor upstream of the electrode. This virtually guarantees that no DC is visible to water (due to the extremely high dielectric resistance of the capacitor), even after the water permeates the solder-mask. For a few cents, the life of the sensor would increase manyfold.
PS - I see a component labelled "C2" on the silkscreen - but not in your schematic. Could this be a series-capacitor?
Hi Andreas thanks for your time spent to show this for us. Could you do a test? Change the plated electrodes to Iron Galvanized Wire... maybe you have little bit more resistance but it will last.
You have plenty of comments about the different ways of measuring humility
Great video. I'm doing a lot with this sensors. At first i was using the crappy cheap ones. Now i replaced them all with the capacitive sensors.
Thanks for sharing your experience.
The xiaomi plant sensor seems to be a cost effective solution. It supposedly works with the capacitive method. Some sources refer that it is fulffilling "Soil Probe EC5 Standard." Googling that returns some capacitive sensors. The sensor also shows no clear traces. However the price bumped up bit a while ago
I am not sure it is capacitive. I think it is resistive. But I do not know
Thank you Andreas for your interesting videos! Why not to use stainless steel electrodes insted of standart wich modules come with? Seems it will work much longer? What do you think?
contentex Stainless works better but still will dissolve eventually. The trick is Titanium electrodes - 1mm titanium wire will work fine.
Thank you for the idea!
Stainless steel contains chromium... Which can react under electrolyse to a dichromate. BEWARE.
Thank you! What is wrong with what you said? Would you please explain. Thanks. What is your advice to make electrode from? As suggested by titanium?
contentex you can get cancer from dichromates. Take graphite! Easy to handle and not harmful. And it does not solve in any kind of way.
Thanks for the Video, Andreas.
In a proper industrial solution the driver for the sensor is always alternating current. This prevents unwanted electrolysis even if the sensor is capacitive and the isolation gets damaged. With leakage detection and indication you know there is a fault, distorting your measurement. A possible easy solution can be to couple a PWM signal out with a capacitor and feed back the sensor over an rectifier + capacitor/lowpass. Sounds complicated but are less components than a NE555 based oscillator and most of the components are used in the DC application anyway + Micro-controllers love to PWM.
At all you have to think about if a capacitance touch-less measuring method is the best for you: You get a phone call and your plant gets water ... this can happen;) Using the direct contact method with AC coupling is the stable (homebrew) method i think.
In addition what Eman Retzun(Nutzer Name?) said: there shouldn't be any component in the sensor path, including the amplifier if one is needed, that draws more current than an Arduino can switch, and on/off times for plant moisture measurements can be very sporadic.
Where's my copper gone?!?: From the one electrode to the other, negative electrode:) ... but other stuff can get in solution that was bound with or was under the copper. So don't use permanent electrolysis on your potatoes.
What happens in a fault situation?: Your house gets messy and the expenses are far more than a 3$ sensor. Ever thought about the magic of the capillary effect? -> You build a closed system, where only so much water physically can get in what's needed. High-End space material like terracotta does the rest. If you can't withstand, than you can put a moisture sensor outside of that all as secondary safety measure. And this one can always be dry, yelling an loud alarm if it gets wet:)
You are right. There were some already some discussions in the comments about that matter.