Capacitive soil moisture sensor interfaced via I2C. Additionaly provides ambient light and temperature readings. Open Source Hardware.Designed by Catnip electronics in Lithuania
This is a "sensor mode only" version of my plant watering alarm Chirp. If you are interested in long cable runs, lower power and improved stability, you should check my RS485 soil moisture sensor -...Read More…
This is a "sensor mode only" version of my plant watering alarm Chirp. If you are interested in long cable runs, lower power and improved stability, you should check my RS485 soil moisture sensor -- also it's the easiest way to get your soil moisture readings into Raspberry Pi. If you are interested in connecting your sensors to LoRa WAN network (like TheThingNetwork) check out my I2C/RS485 LoRa Node
The sensor can be read via I2C protocol and provides these features:
Please checkout FAQ below before asking questions, if you still need help, please don't hesitate to contact me.
The easiest way to get the sensor working on Arduino compatible environment is to use the library by Ingo Fischer it is available thru Arduino environment, make sure to use version 1.1.4 or later as it contains some fixes for address change and bus hang bugs fixed in the firmware version 2.6.
Both light and moisture sensors give relative values. Meaning, more moisture will give you higher reading, more light, lower reading.
Moisture is somewhat linear. I test all sensors before shipping and they give about 290 - 310 in free air at 5V supply.
I didn't measure linearity of the light sensor, it gives 65535 in a dark room away form desk lamp. When it's dark, it takes longer to measure light, reading the light register while measurement is in progress will return the previous reading. Be aware, light sensor is pretty noisy.
Temperature is measured by the thermistor on the body of the sensor. Calculated absolute measurement accuracy is better than 2%. The returned value is in tenths of degrees Celsius. I.e. value 252 would mean 25.2°C.
Note Upon reading the moisture or temperature value, a value form the previous read command is returned and the new measurement is started. If you do rare measurements and want to act instantly, do two consecutive readings to get the most up to date data. Also you can read GET_BUSY register via i2c - it will indicate when the measurement is done. Basically the process goes like this: read from GET_CAPACITANCE, discard results, then read from GET_BUSY until you get '0' as an answer, then read form GET_CAPACITANCE again - the returned value is the soil moisture NOW.
The sensor works fine with Arduino and RaspberryPi. Examples are available on github page.
Thanks guys for writing this software, open source yay!
In some cases the default ESP8266 Arduino I2C library has the clock stretching timeout set too low. If you experience intermittent communication, add this to your code:
The sensor comes coated with PRF202 - a moisture resistant varnish for electronics. It's ok for play around in a flower pot but not enough for outdoor use. You must add an additional protection to the whole sensor after soldering cable to it! Some suggestions on making the sensor more robust after attaching the cable:
Be sure to coat the whole thing - the sensor part, the electronics and the cable connection itself so no bare copper or solder is accessible to the water.
Pre-coated version is available since December 2016. The sensor is coated in epoxy resin, cured and additionally protected by adhesive-lined heat shrink. The 1m (3 feet) long cable is pre-soldered. Light sensor is covered by heatshrink, so the light reading will always report total darkness.
The pinout of the rugged version (with white cable):
Shield is not grounded on the sensor end and must be grounded on the master end.
To get absolute readings you have to calibrate the sensor to particular soil type as sensors are sensitive to saline content of the soil. More salinity makes readings non-linear. A great calibration guide can be downloaded here
Drop me a message if you want your project listed here.
Do you have the exact dimensions, or even better a CAD drawing of the sensor in 3D?
Sensors are 18mm x 149mm. Zipped step file is available in github repository.
How to set up multiple sensors connected to one Arduino Uno?
You can connect several sensors to a single I2C bus. Exact maximum amount depends on many factors, mostly on the wiring length. To have several sensors working on a bus, you have to assing an individual address to each sensor. To do that, connect each sensor one by one and run an address change routine. Code is available as an example of Arduino library. Raspberry Pi example is also available.
Can I use a X meter long cable without affecting the sensor measurements?
It depends. Note that I2C bus is not ment to run on cables, so it's a hack already. Nevertheless, a lot of products do this. I suggest reading online resources about running I2C on long cables to get some background information, but generally, to support long cables and ensure robust communication you can do the following:
How to solder wire to the sensor?
Do not solder wires to the 6 pad connector - this is a programming header. Solder to 4 pads marked VCC, SCL, SDA, GND at the edge of the board. I suggest using a shielded 4 wire cable designed for security signalization installations. Do not solder the shield to the sensor, but ground it at the controller board side. Fix cable to the board using zip tie. Cover the wire connection and SMD parts with glue-lined heatshrink. Do not use a simple heatshrink as it will eventually let water in and will not allow it to evaporate resulting in short sensor lifetime.
Do you offer the source code from the i2c chrip project? Can I reflash firmware of the sensor?
Yes, sure, the sensor is open source hardware, all the code and hardware files are available on the github page. You can use 6 pad header to program it using any AVR programming hardware like TinyISP, UsbAsp and similar. Also, you can use your Arduino board as an AVR ISP programmer.
Communication with ESP8266-based systems is unreliable, sensor sends data then stops working.
In depth technical analysis is available here.
Add this call after you initialize I2C bus:
How durable are non-rugged sensors?
Standard solder mask seems to last about 3 months before flaking off. It really depends on the type of your soil and how often do you remove and insert the sensor as scratches will damage the surface and shorten the lifespan. I have had sensors working flawlessly for over a year in the flower pot at home when not disturbed. Note that you must protect sensor electronics with glue-lined heatshrink if you are going to install it outdoors. I use this heatshrink but you can use any similar one.
Can you set different address for each sensor before shipping?
Yes I can for orders of 50pcs or more, please drop me an email - mic at wemakethings net
How do I connect the sensor to my board?
Wire colors go like this:
You can leave the metal sheet and metal wire unconnected for a quick test, but connect it to GND for proper installation.
Please check if your controller board has onboard pullup resistors for I2C. You need to add pull up resistors to both SCL and SDA lines if they are not there. Raspberry Pi has pullups onboard, Arduino UNO does not.
What is the expected life of the rugged sensor for continuous use outdoor?
I still don't have enough data to answer this question. Rugged sensors should be in practice indestructable, but failures sometimes happen. If you are using rugged sensor please let me know about the failures you experience.
Light sensor of rugged variant?
Light sensing does not work for rugged sensors as light sensor is covered by heatshrink.
I would like to have sensors with a cable up to X meters
Sometimes I can provide customization for orders over 50 pcs, please drop me an email - mic at wemakethings net.
Can you provide a formal EU invoice?
Yes, I can, please contact me directly via email - mic at wemakethings net
No country selected, please select your country to see shipping options.
No rates are available for shipping to .
Enter your email address if you'd like to be notified when I2C Soil moisture sensor can be shipped to you:
Thanks! We'll let you know when the seller adds shipping rates for your country.
|Shipping Rate||Tracked||Ships From||First Item||Additional Items|
Vladimir | Oct. 11, 2021
Christian | April 16, 2021
Roman | Jan. 15, 2021
Bernhard | Jan. 7, 2021
Edward | Aug. 2, 2020
Pierre | July 24, 2020
Jerome | July 20, 2020
Jose | June 16, 2020
Sergey | Feb. 25, 2020
Bernd | Dec. 10, 2019
Jens | Oct. 28, 2019
Tim | June 4, 2019
Alberto | April 19, 2019
Thomas | March 11, 2019
Milan | March 5, 2019
Vladimir | Feb. 25, 2019
Joachim | Feb. 12, 2019
Alexandr | Feb. 10, 2019
Pavol | Nov. 2, 2018
Markus | Aug. 3, 2018
Christian | June 17, 2018
Gurhan | June 11, 2018
Alexander | May 22, 2018
David | April 26, 2018
Eric | April 1, 2018
Olivier | Feb. 28, 2018
Robert | Jan. 23, 2018
Charles | Nov. 10, 2017
Manlio | Nov. 8, 2017
Henry | Nov. 8, 2017
Pierre | Sept. 21, 2017
Michel | Sept. 13, 2017
Charles | Aug. 6, 2017
Namik | Aug. 2, 2017
Wen-Jong | June 25, 2017
Petit | June 17, 2017
Nilesh | June 9, 2017
Patrick | May 6, 2017
Norman | April 29, 2017
Varun | April 18, 2017
Rob | April 11, 2017
Harro | April 10, 2017
Flavio | April 10, 2017
Hrvoje | Feb. 28, 2017
Gabor | Sept. 19, 2016
Tzu-Chiang | Sept. 14, 2016
Ioannis | Aug. 23, 2016
Rodrigo | Aug. 17, 2016
Jay | July 1, 2016
Francois | June 18, 2016
Marc | June 17, 2016
Jan | June 15, 2016
Rickard | June 15, 2016
Jeremy | June 15, 2016
Victor | May 25, 2016
Ashish | May 23, 2016
Carl | May 16, 2016
Craig | May 9, 2016
Sebastian | May 2, 2016
Sebastian | April 19, 2016
Rene | April 7, 2016
Tony | April 5, 2016
Robin | Feb. 29, 2016
Dietmar | Feb. 29, 2016
Jean-Philippe | Jan. 6, 2016
Gilles | Dec. 28, 2015
Mihai | Nov. 28, 2015
Geoff | Oct. 31, 2015
Justin | Oct. 27, 2015
Justin | Oct. 26, 2015
Klavs | Oct. 26, 2015
Gerald | Oct. 22, 2015
David | Aug. 23, 2015
Claus | June 28, 2015
Heiner | June 24, 2015
Ralf | May 11, 2015
Charles | April 29, 2015
Christopher | April 10, 2015
Leigh | April 10, 2015
Attila | April 2, 2015
Florian | March 24, 2015
Stefan | Dec. 12, 2014
Michael | Oct. 31, 2014
Stephen | Aug. 28, 2014
Jeremy | Aug. 23, 2014
Chris | June 27, 2014
Anthony | June 14, 2014
Jasper | June 10, 2014
We recognize our top users by making them a Tindarian. Tindarians have access to secret & unreleased features.
We look for the most active & best members of the Tindie community, and invite them to join. There isn't a selection process or form to fill out. The only way to become a Tindarian is by being a nice & active member of the Tindie community!