Smartthings & Moisture Sensors

Hi all,

I’m embarking on a little project to create a system that would allow me to add several moisture sensors (like the capacitive v1.2 3-wire sensor / 0-3VDC). I plan to put this out on my vegetable patch and monitor the moisture at key positions in the bed to alert me if they are going dry. I may later decide to add a valve as I have a water butt which is elevated above the bed which could act as a dripper.

Anyway, I am an electrical designer / control panel builder so the designing and wiring of this system doesn’t scare me. But I was wondering what the best way would be to get several 0-3V sensors all reporting to Smartthings?

I was looking at the Z-Wave route originally, but unlike my industry there seems to be a lack of extra low voltage I/O units that are dedicated to a specific I/O such as analogues.

Maybe someone can steer me down the correct route, maybe it would need some sort of Arduino or RPI interface?

I don’t want to do much ST code if I can help it. I find it extremely hard to get my head around it, even though I can code complex projects in IEC61131-3.

Many thanks in advance for looking and any advice you can share.

The person you need to speak to is @iharyadi he makes this possible.
I have them controlling the watering of indoor and outdoor plants. Zigbee repeater modules with external contacts, he’s even built dth’s, very easy to set up, they have been rock solid for over a year, much better than anything commercially available. They’re also environment sensors, powered by USB.

3 Likes

Thank you, Alwas!

Will check this out for sure. I haven’t had much experience with Zigbee as all my home devices are Z-Wave so will be good to look at something new.

The other option I was looking at was the Z-Wave Z-Uno Shield, but trying to get one seems hard.

I personally am veering away from Z-Wave regarding SmartThings and generally, Zigbee is more reliable.

1 Like

Its an interesting area - so many companies have failed to take this space and I believe it’s because they are trying to survive and make too much capital on it. It costs so much money to develop, launch and maintain products in this space. Gardening needs human interaction to succeed, but we live very different lives these days so my hope is that I can have a system that gives me peace of mind that my vegetables are not thirsty! :joy:

They should design and release the product on that basis for people to make themselves. Like sell a housing design that can be 3D printed, a PCB design that can be sent to a PCB manufacturer for making etc.

1 Like

By the way @Alwas , how do I go about approaching @iharyadi on here to discuss the product you mentioned?

Thanks.

Totally agree, never come across a commercially available option that’s viable, so many horror stories of soil sensors losing connection to their hubs, batteries not lasting a month etc and reliability is kinda important when it comes to plants! Just write on his thread, he’s over on Hubitat now with a lot of clever developers, but still maintains ST code thankfully.

2 Likes

Hi Chris,

It is my hobby to design stuff for my home automation. The sensor that Alwas use is the foundation of what I am making today.

Currently, I am making Arduino shield connected to my sensors. Here is some example of what I am making. It is an Arduino UNO shield.

Google Photos

I also have Arduino Mega 2560 and Arduino Due shield.

Google Photos

Now, what Alwas need is much simpler. He need to connect simple Analog, Digital sensor. The shield require an Arduino. Adding Arduino is to handle much more complex sensor. Or, Arduino is sometime a good choice if you want to connect a lot of sensors.

Here are some of the demo video what the shield can do. I apologize the demo is using different hub but it is very similar to Smartthings. I maintain DTH for both hubs. I am trying. Sometime, the availability of the demo or feature lag on one hub compared to the others. But, the video should illustrate what the idea is.

If you need more information, just PM me.

Thanks
Iman

1 Like

You have that setup positioned outdoors in a garden?

@jlv yes, here’s the sensor I showed in situ…

You just have to be creative to protect it from the elements. The good thing about the Environment Sensor also having temp,lux,humidity and pressure sensors on-board, the dth allows you to receive reports as often or as little as you like, say every 3 degree Celsius change, or 0.1 degree Celsius change to the second! All this for half the price of an Aeon Multi Sensor 6! I also added a 3 dollar PIR sensor to the module, that with the plastic cone I added, gives zero false negatives even during the day.

1 Like

@Alwas thanks for sharing the picture. Curious what sensor you are using in the ground to detect moisture. I bought a few environmental sensors from @iharyadi last year and they are great! I have a spare and would love to better control my irrigation system because while it is smart and runs based on weather, I find we live in an area that doesn’t always match up to the weather predictions and actual measurements would be best.

The black one in the photo above, basically this one, the capacitive v1.2


Don’t get the smaller cheaper ones for arduino, they corrode within a week. Yes this way is better than following the weather, when it rains I know from the module within 5 minutes. Within the dth you can decide when it changes to wet/dry, at 1.5v 1.6 volts etc

Awesome thank you. Please pardon my ignorance but how deep are these in the ground? Assume that the electronics at the top must be above ground and protected. Or am I over thinking this?

I elected to completely submerge mine, to protect it from the elements, the white piece of tubing you see in the photo isn’t the sensor, that’s just protection against some freewheelin’ lawnmower operator, first I painted the whole sensor with clear nail varnish, then I covered the electronic part and connections with Sugru and it’s been fine.
For comparison, the indoor one I only put in part way obviously.

2 Likes

I hope you guys do not mind I document the moisture sensor and what It takes to get up to the point that @Alwas is running.

First, the wiring.

The sensor will have pads marked and the Moisture Sensor V1.2 also marked. I recommend to follow the marking just to be on the save side.

  1. Connect Ground To ground
  2. Connect 5V on my sensor to the VDD on the 1.2 Moisture sensor.
  3. Connect AI (analog input) on my sensor to Aout on 1.2 Mositure sensor.

Drivers:

Download the following driver to your IDE.

And

Once you do this, you can use your phone to pair the Environment Sensor.

  1. Go to you phone and add device as usual steps of adding device.
  2. Once the sensor is found. Name the sensor to any name you like.
  3. You will have a new device with the given name on step 2. Please go into the device page. You will find the following screen.
  4. Click on the preference button on top right. You will get the following screen.

    Enable the Analog Input and Enter Water Sensor in Analog Input Handler.
  5. Once you are done click save on the top right side of the screen. You will see a new device in your things.
  6. Enter into the new device and click on the preference page.
  7. In the preference page, you will find screen like below.

    You can give the device a name. The threshold is used to determine when you consider it is a dry condition. You should play around with this value. Please note that the drier it is, the higher the voltage. The voltage should be between 1.2 for wet and 2.7 for dry in ideal water dip and dried sensor.

I will be happy to improve the display to show percentage rather than voltage if there is any demand on it. I am not an expert in gardening where these sensors are used. I suppose some of us interested on Wet/Dry only. Some will be interested on the percentage for historical and prediction. I am open to suggestions.

BTW, if you are interested on my Environment Sensor, it is on sale in Ebay check out this thread.

Thanks
Iman

2 Likes

I suspect that some of us will use the sensor outdoor. Please consider coating the board with exception the read circle area. Please coat as last process. With coats, you will loose conductivity to the the pads. If you make a mistake, it will be a hassle to scrape the coat to get access to the pads. As note, please do the coating until last steps after all has been tested.

Some of us have access to what is called “conformal coating”. This is the proper way to go.

But, if you cannot get access to this coating, you can use nail polish as a Youtuber found something interesting property about the nail polish.

1 Like

I just update the water sensor DTH to report moisture measurement in %.

Based on my experiment, a dried sensor reading would report ~2.7V. A wet sensor reading is ~1.5V. These are the default value that I will using to translate from volt to %.

These numbers can be different from sensor to sensor. Therefore, I make this configurable in the device preference page. You should be able to see a couple fields that you can make adjustment for the voltage to moisture %.

I personally calibrate my sensor by recording the voltage value when the moisture is dried. Then, I dip the moisture sensor in a bowl of water. These are my voltage for 0% moisture and voltage for 100% moisture. If you like to use your soil as calibration it is ok too. But, I am not sure that is the voltage reading will be from soil to soil. But as note, start with dry condition first. Then get the wet condition. Doing it the other way around obviously will take some time to wait until the soild dried.

You will typically buy moisture sensor from the same batch. You may not have to calibrate all of them. You can use calibration from one sensor for the others on the same batch.

Thanks
Iman