New (better) Soil Moisture Sensors and RS485 Modbus on ESP32 Arduino
Soil moisture sensors are essential for successful working with plants. In video #207, I showed some of the most common sensors. Some of them were bad, and some were ok. In the meantime, I discovered a new sensor type that promises accuracy and more data. These sensors are also waterproof and can be buried. So, let’s check them out. We will also learn about the RS485 and Modbus interface and how to connect such sensors to MQTT and Home Assistant.
My second channel:
Links:
RS485 to TTL adapters: or
5V to 3.3V converters:
ComWinTop soil sensors:
Halisense soil sensors:
NPK soil sensor: or
Additional data about these sensors:
Patreon supporter companies:
The links above are usually affiliate links that support the channel (at no additional cost to you).
Supporting Material and Blog Page:
GitHub:
My Patreon Page:
Discord:
If you want to support the channel, please use the links below to start your shopping. No additional charges for you, but I get a commission on your purchases to buy new stuff for the channel
My Amazon.com shop:
For Banggood
For AliExpress: For AliExpress: bit.ly/3MtXUY8 (just go on from here to your product)
For Amazon US:
For Amazon.de:
For Amazon UK:
For ebay.com:
I am no longer on X
As an Amazon Associate, I earn from qualifying purchases
#no#midroll#ads
source
I just wanted to mention the EC on the THC-S is really pretty accurate. If you understand the feed that you are providing to your plants, say for automated gardening/crop steering. You can have a much better indicator that is accurate and affordable by tracking the EC of the soil/media, against the EC of your feed. You don't really need an NPK for that. Tracking the EC is also a much more affordable way to know you have hot soil, and the need for a legitimate wet sensor for NPK or other discover. Honestly though if your soils that hot your probaby going to send a sample out to a legit lab anyway. THC-S is hand down the best soil sensor out right now FOR THE PRICE.
The Lilygo T-RS S3 board would be nice to use with these sensors.
I suggest you to look into bparasite, it's an open source hard and software soil moisture sensor like the miFlora. It's actually cheaper if you order just 10 from our favourite PCB manfacturer
I worked in waste water management as a maintenance engineer for years .. can't see how they measure pH with a metal probe… I have a feeling it's all 'software' guess work from conductivity measurements.
I'm genuinely surprised you got ChatGPT to produce usable Arduino code so easily, I feel I have to debug its code and help it learn over 5 or 6 iterations, so kudos to you. I'll look at your instructions for hints how to make better requests.
Prior moisture sensors were prone to corrosion but were so inexpensive they can be replaced annually. These new sensors probably need mfg to stabilize and develop better calibration algorithms building in an understanding of their limitations.
Sad to see this sensor here ! The sensor isn't new, I have see the same more than 3 years ago … And It's fake measurement.
use gypsum with embed wires in it as a soil moisture sensor guys ;)
Great update! I'm curious if these sensors will suffer the same corrosive death that the capacitive moisture sensors fail from.
Long term experience considering the longevity would be of interest here. If these sensors don't use the capacitive method the old problems with corrosion and electrolysis would still apply.
👏🙌👍😀
Greetings Andreas. Thank you for this information. They look to be usable in some situations. Would you consider looking at sensors for hydroponics?
Wonderful RS485 Modbus ,MQTT, ChatGPT, Arduino project. Modicon PLCs days used lots of Modbus communication. 🎉 Best wishes.
Could you make a video showing how you give commands to GPT Chat to generate the code? Thank you very much for your exceptional work. Greetings from Spain
Never use its NPK, its EC based and in most soil, the accuracy is nearly 0% and in rare case you might get 70% accurate if and only if your soil is similar to the manufacturer's soil calibrated for.
For EC, Soil moisture, it's quite accurate. but the soil need to be wet in order to measure EC because it's based on conductivity.
If you buy the 5-pin one which include 7 parameters, the PH will be very wrong because of interference with other pins(i guess) but if you buy the PH alone, then the result is reasonable. And for the PH, you can't stick in soil for days because the Agcl will erode.
They claim that their moisture sensor is FDR, but i am not sure if it's truely FDR or not based on the price(around 8$ if you buy from China platform).
@Andreas thanks for your quite elaborate test and neutral review. Unlike many videos which just get it to works and claim that this is a great tool or magic wand to measure NPK.
Thank you Andreas, very interesting video
I recently setup Home Assistant and used the esp32 builder to setup a few temp sensors around the house. It was pretty easy. Im not hopping on the AI. I will learn the nitty gritty, I'm not in a hurry and the tinkering with microcontrollers is mostly about learning.
There is a ZigBee version of a similar sensor that reports Temperature and Moisture. Tuya model TS0601_soil. It connects to Home Assistant via zigbee2mqtt without problems. Uses 2 AA batteries for about a year.
Obviously the chemical content of an aqueous solution would already be a challenge (requireing expensive ion selective electrodes, that are conditioned in a buffer solution when not doing measurement, still not being too accurate). I have seen, that in hydroponic farming that pH is a very important factor (the nutirents do not deplete that fast). In a soil a continous monitoring of nutrients, K(+), PO4(3-), NO3(-) is probably by far not that critical as humidity and temperature. (The pH is also probably well buffered with organic and inorganic salts of weak acids and bases). What could be a good experiment though is to monitor the long term stability of these sensors, with some kind of reference (digital scale?) including temperature. Measuring temperature in the soil could be also of interest especially in Swiss weather.
I like the Chirp! capacitive waterproof moisture ones – some new ones have LoRA for TheThingsNetwork indoor gateway and were out all last Summer and spent Winter indoors in pots. Basic wetness altho readings can get weird – I calibrated for dry air = 0, fully immersed in water = 100; then in soil they'll report 110 or so when wet but definitely reports low when getting dry.
Thanks, interesting test and comparison!
(I think someone who is really in the gardening does not need such device ;) )
Can you do an episode on 4diac for ESP32??
AI spam is bad.
how do these things measure water content? you mentioned a capacitive measurement, how does that work? in my own tests, the simple voltage and current measuring devices all fail over time because they work like batteries, charging the electrolytes in the soil, and electroplating the pins, which destroys the units. at the moment, in my own experiments, i am passing an alternating current into the soil, and measuring the average current drawn. these last longer, but they are still not reliable. so, please would you explain, how is soil moisture correctly sensed? as far as i can work out, there is no reliable electrical method, and all of these devices are bullsh*t.
So, these sensors are more expensive and probably function about as well as standard capacitive sensors (NPK measurement obviously does not work to a useable level).
Hi Andreas, can make a video on how you 'talk' to the AI services?
I really do like including the data sheet. I didn't know you could do that. I have included requirements but the AI don't seem to deal with that very well (bad requirements?).
Thanks
Interesting for both sensors and AI. I use Claude AI and have not asked to have a program generated. I use it a lot for 3D printing parameters for materials, etc. Sounds like a project to me. I hope to ask exactly what you did with the same reference material. As time allows, I will do this (maybe not real soon, but soon LOL). You can expect to see my results someday. I am retired, but I formerly wrote s/w for vehicle power-train controls. My job would have been very different with AI generated code and more efficient for sure. They would still need me for specifications and testing, at least, for a few more years. Times they are ahh changing.
Wow!
The Sensor just arrieved and a Video is posted!
Perfect:)
Maybe chatpgt can write usable code, but can I trust my prompts to create that result. 😅
I've also been told that wood 'contaminants' in those soil bags tend to sequester available nitrogen.
NPK and PH readings are just a scam, use distilled water and salt (NaCl) and you'll still get NPK readings
We use RIKA sensors from china, and they don't have npk because It is not easy to measure these parameters with good precision.
Hi Andreas, i love plantas and gardering, sooo, i love this video , thanks
Would you do a video on how the NPK is actually measured?
We will soon have ChatGPT with a Swiss accent…
Great info, Anreas. However, for the price range of this sensor plus other required modules, you may just buy a readily available wireless soil moisture sensor like Ecowittweather. The price is a big NO for me.
14:11 "the NPK values are just indicative" == "we don't know how to measure, but here are some random numbers."
There is a github repo for this sensor that has been calibrated using a teros 12 (very expensive TDR meter). It is by kromadg. I suggest looking at their arduino sketch
I spent $200 on my EC/PH meter (replacement probes are $100) calibrated every few months. Frankly I don't expect new/cheap solutions will ever replace it since lots of toy meters already exist and they're all terrible.
I used an ESP to read RS232 with a custom compiled Tasmota image which made MQTT and import into Home Assistant trivial. That should also work with RS485. Compiling the customized Tasmota firmware was a bit of work up front though.
These are almost certainly FDR sensors, probably a rip-off from the rather old Delta-T WET2 sensor.
They aren't capable of NPK or pH measurements – that's just a scam – but are pretty good for moisture and conductivity from which various other parameters can be derived. Some calibration required.
I've owned some of these for a few years – they work OK and the FDR method is the most accurate for soil moisture measurement other than neutron probes and direct sample measurement (by drying and weighing).
That's a great comparison