We have moved at community.getvera.com

Author Topic: [Working] Z-wave soil moisture sensor based on Fibaro RGBW module  (Read 10303 times)

Offline kwieto

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +27/-15
[Working] Z-wave soil moisture sensor based on Fibaro RGBW module
« on: September 05, 2017, 05:20:34 pm »
I finally have some time to play with the idea of combining Fibaro RGBW-441 module with an Arduino soil moisture sensor to make it work together and I can say that initial results are very promising - it works!

If anyone interested in how-to, below is the receipt:

All you need is a Fibaro RGBW-441 module and 1 up to 4 Arduino compatible soil moisture sensors - I used the one like on this photo: http://img.dxcdn.com/productimages/sku_290154_5.jpg

According to the specification the inputs of RGBW-441 module can be configured and attached to various sensors, giving analog signal within 0-10V range. To do that, you need to define which of  inputs (you can configure all, if you want) should act as "Analog" 0-10V input. It is a bit unclear in the manual, so here s the detailed schema: you need to set parameter 14 (2byte dec) with a number reflecting setting for all 4 channels of the module. the number is calculated by converting binary values for each channel to the dec value - you can use online converter.
By default, each channel is set to RGBW - momentary switch, normal mode. The binary sequence for that setting is 0001, so four channels give 0001000100010001 which, converted to decimal system is 4369.
If you want to change i.e. channel 1 to analog input (1000) you have to modify sequence like here 1000000100010001 = 33041. For all four inputs it will be 1000100010001000 = 34952
Remember, that setting specific channel to receive analog input you lose possibility to turn on/off responding output. If you want to have possibility to steer some device (i.e water valve) directly by RGBW-441 module, you can't use sensor with that channel, at least not directly.
I configured CH 1 and 2 as analog inputs and CH 3 and 4 as "OUT - Toggle with memory (normal mode)". That gives bin 1000100011101110 = 35054 dec

One thing to remember - if input set to receive 0-10V signal it gives 100% when the circuit is open and 0% if it is closed. Don't be surprised that after you set specific channel like that, you'll see 100% (ON) reading when you didn't attached yet any device to it.

Next thing: Arduino sensor. I've decided to try Arduino one because it is cheap (like 2 USD) and available without much effort (OK, you wait for the shipment from China if you want to get best price). The only problem with such sensor is that, according to the specification, it works with power only up to 5V DC.
I tried to find moisture detector with output up to 10V, but all I have found were professional, expensive ones (starting from c.a. 200 USD)
After some tries with powering sensor with 5V and attaching its analog output to RGBW-441 (didn't work) or considering some step-up/step-down converter to make the sensor working, I finally figured that it may probably work with voltage up to 30V and the information about 5V refers to Arduino compatibility only. I power this setup with 12V, so I decided to give it a try.

And it works!

Attaching the sensor is really simple, you attach + and ground to the same DC power source as RGBW-441 and then analog output (A0) to desired IN channel of RGBW-441 module, and it is done.
Remember, that as I wrote before, Fibaro reports 100% if circuit is open (soil dry) and 0% if it is closed (soil completely wet), so the readings are reversed.
But they seem to be accurate enough to figure out at which level you should set your sprinkles/waterline ON.
If someone have any idea how to reverse these readings, please give a hint.

Another topic is that RGBW-441 is presenting itself as a dimmer, so it goes under "lights on/off" shortcut. I've tried to change its category and subcategory to move it out from there, but I didn't find working combination (some obvious ones, like refrigerator switch, are not accepted by it). Any help here is appreciated as well.
« Last Edit: September 05, 2017, 05:24:19 pm by kwieto »

Offline kwieto

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +27/-15
Re: [Working] Z-wave soil moisture sensor based on Fibaro RGBW module
« Reply #1 on: September 07, 2017, 06:00:55 am »
OK, so I went into first sign of bump: it seems that arduino probe is very sensitive to corrosion. Since current goes through probe constantly, one pole act as anode and the other one as cathode.
As a result, one of them is corroding, like on the picture here: http://www.homautomation.org/wp-content/uploads/2014/06/photo1.jpg

This process is known and according to the internet sources the probe can be damaged within a month or even less. Not a very good idea, to replace sensor every couple of weeks :(

There are several approaches to that:

First is to make probe by yourself, using more thick and less corrosive material, i.e. stainless steel. For that solution you need a set where controller is on separate PCB and the probe on the other (typically YL-69 module). You replace the old probe by the one you made and it should work again. Remember, that this only delays the time where you probe should be replaced, the corrosion process is still destroying the probe slowly. There are solutions with graphite poles, which should be corrosion-free, the question is mechanical durability.
There are several DIY manuals how to do the probe, from sticking two metal poles directly to the ground, to more sophisticated solutions like encapsulating them in gypsum, but the general built is always the same.

Second, you can buy a set with "anti corrosion probe" on Aliexpress, like this: https://www.aliexpress.com/item/Soil-moisture-sensor-and-soil-module-soil-moisture-test-soil-humidity-test-corrosion-resistance-probe/32812568676.html
It is more expensive than the basic set, but if the probe will work for a couple of months instead of weeks, it is worth it. Still, I don't expect it to be corrosion proof, rather slower process of disintegration. You can buy the probe alone, if you already have arduino module

Third, you can try the capacitive probe made by DFRobot: https://www.dfrobot.com/product-1385.html
According to the producer, it is 100% corrosion proof as the metering method is slightly different than with other sensors. In this case, you need to make some step-down circuit as it probably won't work with 12V and for sure not with 24V (the main component works up to 15V). You also can expect that readings will not go to the full scale in Vera (it gives 0-3V on the output, so most probably it will show readings between 66% and 100% in Vera. If you can live with it, you can still use it to detect when you should water your plants.
It is also more expensive than the basic version, yet still affordable.

Fourth approach is to attach probe to AC current. As it switches polarity constantly, you will not experience corrosion on the probe. The question is how to make it work with the main module.

I will try approaches 1-2 and probably 3,

I've found also probe which will probably work with FRGB-441 directly (link: http://www.vegetronix.com/Products/VG400/ ) but it is still a bit pricey (c.a. 40 USD) compared to the rest of the components.
« Last Edit: September 07, 2017, 06:05:33 am by kwieto »

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: [Working] Z-wave soil moisture sensor based on Fibaro RGBW module
« Reply #2 on: September 07, 2017, 02:04:31 pm »
Have to applaud you for the hard work. There has been quite a few commercially available projects out there which have been working reasonably well, albeit not without some quirks. A friend of mine and myself have gone different ways and have found that sealing the electronic from humidity is probably the biggest challenge. I am using a zigbee solution with the plantlink. My friend went with http://spruceirrigation.com
Another one is http://www.sensoterra.com
After losing 2 of my plantlink to internal corrosion (out of 9) I started using silicone paste and silicate pouches to dehydrate and seal my sensors. After this, I immersed one of the sensors under 5" of water for an entire winter (accidentally)and... that sensor still works. I have not had any probe corrosion issues though.

The plantlink presents the advantage of having a plugin for the Vera which I improved recently...
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline kwieto

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +27/-15
Re: [Working] Z-wave soil moisture sensor based on Fibaro RGBW module
« Reply #3 on: September 08, 2017, 04:39:06 am »
I considered buying Plantlink for my setup. The main problem is that it is not available on sale anymore. There are single items on Amazon, which wouldn't be much of a problem if they would ship to Europe.
You can buy some of them on ebay with shipment to Europe, the shipment costs are not encouraging (like: 20-30USD).
And there are only base sets (main station + 1 sensor) available, I didn't find any additional sensors on sale.

I focused on custom solution for couple of reasons:
1. I need more "home" than "garden" appliance (watering plants on a balcony or pot plants inside the house)
2. I prefer z-wave solution over plugin solution, as my experience with devices operated via plugins (WeMo, Netatmo) shows me that it can be a bit tricky to make it work and needs more maintenance in the system than z-wave solution.
3. I don't need advanced statistical data (given i.e. by Spruce), nor weather predictions etc. My main target was to water plants when I'm outside the house, so simple logic "soil is dry - turn on the watering" is enough. Any weather prediction (like: "don't water plants on the balcony if it will rain today") can be added through existing plugins directly in Vera, so I don't have a need to buy sophisticated controller like Spruce.
4. For me it is more a "fun-project" than a need (I don't have a problem with excessive water bills or difficulty to keep large lawn watered properly) I focused on some low budget solution.

Speaking about prices, the setup I made is hard to beat by other solutions:
If you want to build a set similar to mine (2 sensors, 2 relays) you need to pay:

Plantlink - main unit with 1 sensor is priced about 60-70USD + additional sensor priced around 30USD = 100 USD for the set of two sensors. Plus z-wave relay (let say 1 x 2 relay swtich) which would be priced 50-60USD, you ned to pay c.a. 150USD for the whole setup.

Spruce is very interesting but also very pricey. For main unit and 2 sensors you need to pay 350USD, adding z-wave relay makes it 400 USD. Of course access to history and prediction plans are nice, but I'm not convinced if it is necessary for me. And for the in-house plants predicting the weather is useless anyway, since they are inside.

I don't know how Sensoterra is priced (they don't show pricing on their website), but seems to be a professional, farming system.

From the other hand Fibaro is very popular in my country and thus is also relatively cheap. FRGBW-441 is priced around 50-60USD, but if you have a bit of patience you can buy for outlet price (with full warranty) under 40 USD. 2 sensor with probes like those "anti-corrosion" from Aliexpress will cost c.a. 10-15 USD. Cost of the cable is negligible. And you don't need to buy any additional relay, since you have still 2 channels reserved for 12V output. So the whole cost is around 50-60 USD. Compared to Plantlink (the cheapest alternative). it is still almost 3 times less.
Another advantage over Plantlink or Spruce is that the probe doesn't contain any electronics, there are just two poles and a cable. You can put the main unit of the sensor together with the RGBW controller in a sealed box and attach probe on a long cable (I've tested up to 4m already). The drawback is that it is still on the cable, so if you have larger area to cover it would be difficult/less convenient than wireless solution.

So taking pros and cons together it would be like that:

+ low budget solution
+ full z-wave integration without any plugins and bridging via WiFi/internet
+ works even if the internet connection is down.
+ You can design custom probe by yourself, i.e. if you need to reach deeper parts of the soil, to check the soil moisture near the roots of specific plants.
+ you can hide all electronics inside the house and let only the cheap probe to be outside, which can be the point in remote locations (I plan to install one sensor in my herbs garden located at my country house, which I visit more or less every other week and in between it is completely empty, so I don't want to loose expensive device just because somebody will "like" it).

- readings are in % so you need to learn by yourself which percentage is the point when you should water your plants
- since probes are attached by cable to the main unit, it is recommended rather for small areas (balcony, pot plants, small herb/vegetable garden, etc.)
- no advanced statistics or predictions schemes available - you have to build some scheme by yourself if you need.
- the cheap probes are very poor, mine half-corroded within couple of days (probably because of soil type and using 12V instead of 5V). Durability of more expensive probes (5USD per item) are still to be tested. You can use cheap graphite sticks (i.e. made for pencils), but in this case attaching wires may require a bit of additional effort/manual skills. Possibility of using 7USD capacitive sensor is to be tested as well.

« Last Edit: September 08, 2017, 04:58:34 am by kwieto »

Offline kwieto

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +27/-15
Re: [Working] Z-wave soil moisture sensor based on Fibaro RGBW module
« Reply #4 on: October 15, 2017, 04:36:46 pm »
In addition, I have opportunity to test Plantlink solution, and, to be honest, I'm not very impressed.
My device is continuously reporting "link missing" (it helps for a while to unplug/plug again basestation) but this can be a faulty device.
But from my discussion with support I got knowledge about some features which limit the usage of this solution.
The main issue is that if device report too dry or too wet soil for some period of time, it disables communication (I didn't get an info how it is establishing it again). In this case, using the device outdoor, like on balcony or terrace, is questionable - one heavy rain and you will receive "link missing" for your sensors.
And you don't know if the problem is just rain, or your sensor was damaged. You don't have continuous readings from the sensor, either.

I wonder if Plantlink Lush will address these issues.

Offline Michaeldup

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
Working Z wave soil moisture sensor based on Fibaro RGBW module
« Reply #5 on: June 23, 2018, 04:12:25 pm »
The Fibaro RGBW module and most LED controllers use Pulse Width Modulation PWM to adjust the duty cycle of power deliverd to the LEDs. Computer fan controllers use the same technology and its designed to wrok at 12V so I dont see why it wouldnt work as long as you stay within the max load ratings for each channel.

Try it and see, its all low voltage anyway, so pretty safe

Offline kwieto

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +27/-15
Re: [Working] Z-wave soil moisture sensor based on Fibaro RGBW module
« Reply #6 on: July 01, 2018, 04:28:26 pm »
OK, so couple of updates here:

Now it is almost a year of use and everything works fine.
The biggest problem are probes, which are becoming damaged fast.
I've tried capacitative sensor but it had very limited range presented between "dry" and "wet" (like only 25% of the 0-100% scale), finally got damaged by water (all electronics is on the same board as a probe, I thought that if it is above ground then nothing bad should happen, but I was wrong).
I've tried "anti corrosion probe" it worked well for quite long time, then unfortunately one pole went out as well.
Now I'm testing carbon sticks, which are working well. One pole gets some dirt on it which makes the probe stop working, but regular cleaning solves the problem. The probe itself doesn't wear off, at least I don't see visible changes yet.

I did some changes to the system and during the process accidentially connected RGBW with reversed polarity. Everything survived, fortunately, but since that RGBW shows humidity changes in very narrow range (like: 2% if dry and 5% if wet) I'm not sure if the issue is with RGBW or the arduino modules, I'll check it when I try to configure the second RGBW which I ordered. For now I changed the configuration of proper channels from "sensor" to "bistable switch with memory" and attached Arduino module in the way that it works as on/off switch (desired humidity is then set via potentiometer on the Arduino module).

I build a two zone system for watering plants on my balcony, based on the humidity sensor, pump put into a watertank and 12V water valves opening or closing accodrdingly to the zone which is watered. 2 valves and a pump took 3 channels so for now I have humidity sensor only for one zone, second is watered according to time schedule.
When I'll get next RGBW I will set probably second sensor as well as similar (but one zone only) system for plants in the living room. Next step is to integrate water level sensors (already installed in the tanks) which will send notifications when water need to be refilled. Unfortunately There would be not enough channels for that (2 zones + 2 humidity sensors + pump + water level sensor on the balcony + pump + humidity sensor + water level sensor  inside = 9 channels, while 2 RGBW's give me 8 ), so I will probably need to add binary switch to handle water level sensors, or I'll integrate sensor with pump in a way that the pumt will not run if water level is too low - then I would need to make a logic based on power consumption reported by the main device, or on the humidity (if it won't change after watering, then assume that the pump didn't run because of too low water level).
« Last Edit: July 01, 2018, 05:24:17 pm by kwieto »

Offline JEAU

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: [Working] Z-wave soil moisture sensor based on Fibaro RGBW module
« Reply #7 on: November 04, 2018, 09:18:58 pm »
Does any Fibaro RGBW work or it has to be RGBW-441

Offline kwieto

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +27/-15
Re: [Working] Z-wave soil moisture sensor based on Fibaro RGBW module
« Reply #8 on: November 20, 2018, 10:12:59 am »
Fibaro has only one RGBW device in their offer, which is RGBW-441

Offline verabp

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: [Working] Z-wave soil moisture sensor based on Fibaro RGBW module
« Reply #9 on: December 03, 2018, 07:47:24 pm »
@kwieto thanks for all your observations. I'm ordering some sample Z-wave devices for yard control and your guidance is very useful to learn about new items to try out.

re: "One thing to remember - if input set to receive 0-10V signal it gives 100% when the circuit is open and 0% if it is closed. Don't be surprised that after you set specific channel like that, you'll see 100% (ON) reading when you didn't attached yet any device to it."
--> If this cause a problem, you could put a 10 to 100 kOhm resistor across the inputs to force the signal low when the circuit is open.

re: "I've tried capacitative sensor but it had very limited range presented between "dry" and "wet" (like only 25% of the 0-100% scale)"
--> For extended use outdoors, I think capacitive sensors are likely the way to go since they should not corrode nor be strongly dependent on salt concentration in the soil as the conductive sensors are. I ordered a couple from China to try. To scale up the voltage to 10V at saturated water conditions, a simple (single-chip and a couple resistors) linear amplifier can be made from an operational amplifier. The operational amplifier chip would draw essentially no current and could be powered from whatever voltage drives the Fibaro RGBW. When the parts arrive and I get this working I'll post a schematic.


Offline Warnerkew

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Working Z wave soil moisture sensor based on Fibaro RGBW module
« Reply #10 on: December 23, 2018, 07:53:09 am »
I have installed both Fibaro dimmer and the relay modules through out the house using clipsal saturn momentary switches . I am using a Vera lite.  One of the relay switches operates a transformer that is connected to strips of LED lights.  This module stopped responding a couple of weeks ago in that the lights stayed on both when operated by the z wave or manually.  I replaced the relay with a new one and it has operated for 4 to 5 weeks and is now staying on again.  I have removed it from the system and then re connected if I pole it it pings successfully.

One of my other Atom led controlled by a fibaro dimmer, that has been operating for weeks is now doing the same thing.

I also have a problem with the Atom LED downloghts flickering and the blue led in the switch flickering when the switch is off,

Can anyone help