How do I add the soil-moisture sensor to domoticz?
-
I have tried adding the soil moisture sensor in domoticz and the log sees the sensor. But in devices I only see a security-switch-sensor with no values. How do I add it the right way?
-
What do you present it with? I think standard sketch is presented as 1/0 switch (moist or dry)
-
Sundberg is correct, the standard sketch only reports wet or dry, which is presented as a security switch that is either on or off.
I've made a sketch that reports battery and moisture:
codebender
You can just remove the battery parts if you're not interested in those values.
-
As mfalkvidd says: the "normal" digital value only shows up as a switch. You can add the analog pin of the sensor as a counter in domoticz (and add a water symbol). Take a look at my code here.
-
@mfalkvidd Just a little thing. Domoticz does not interpret S_CUSTOM you can use S_MULTIMETER in combination with V_VOLTAGE. No issue in your case because sending V_VOLTAGE on it's ownn creates the Sensor in Domoticz. You could use
gw.present(CHILD_ID_BATTERY, S_MULTIMETER, "Moisture battery")
to present the sensor name and let Domoticz default it to "Moisture battery".
-
AWI: yes, you are correct. I think I'm using a version of Domoticz that's too old so it doesn't support S_MULTIMETER. I should get around to upgrading.
-
By the way, here is how I connect the sensor to the Arduino:
-
Basic information are also on the project page. I was using the same kind of sensor (cheap one from ebay). I seemed to work very well for about one week but then suddenly it started to send back only one value.... when I took the sensor out of the soil I saw that the sensor (at least one leg) had mold on it. Has anyone seen such a problem? Any ideas how to prevent that?
-
@epierre did an update on the sketch which reverses polarity to help avoiding corrosion.
-
@hek Where is the question to your answer hek? Can't see it here.
But corrosion do to the current in the sensor might be the reason for my dead sensor. Any ideas how to avoid that on that kind of cheap Soil Moisture Sensors from the project page?PS I guess powering the sensor over a pin of the arduino (or some kind of transistor) would make it possible to disable the sensor when not measuring. That might help?!
-
Tried to answer this...
@LastSamurai said:
I seemed to work very well for about one week but then suddenly it started to send back only one value
-
Great idea hek, I think that is the problem. But the sketch you posted uses a different sensor, doesn't it? There is something about:
* Connection: * D6, D7: alternative powering to avoid sensor degradation * A0, A1: alternative resistance mesuring
And a link to different sensor. The cheap kind that I am using only has two connections for power and an analog and digital pin. I don't see how you could be alternating power here...
But perhaps it helps if the sensor isn't constantly powered on but only for measurements.
Does anyone else have a solution for this?
-
Yes, @epierre should clarify what sensors used and how it should be connected in the sketch.
If a new sensors type is used we should probably keep the old example and create a new one for this.
-
Maybe a bit late. But the soil moisture sketch was the first one I brought into production by soldering it on a PCB. I added it to Domoticz as a motion sensor, not as a switch. And it's working great. If the motion sensor is telling that there's motion, it means the plants aren't thirsty. If there's no motion than the plants need some water. I even let Domoticz send a message to my mobile phone when the plants are thirsty ;-). I keep forgetting to give my plants water on a regular basis, so this sensor is really helpful.
-
Hi @TheoL
Motion sensor and Switch (and also the soil moisture sensor) work the same way in Domoticz. Its either 1 (ON/Motion/Wet) or 0 (Off/No motion/dry).
-
@hek said:
Yes, @epierre should clarify what sensors used and how it should be connected in the sketch.
If a new sensors type is used we should probably keep the old example and create a new one for this.
Well it is here in the sketch: " Required to interface the sensor: 2 * 4.7kOhm + 2 * 1N414"
but it was better in the post: http://forum.mysensors.org/topic/514/soil-humidity-and-temperature-sensor-watermark-davis-granular-matrix-sensor/2
and yes it works with two connectors this way !
@hek I'm not in the list https://github.com/mysensors/Arduino/graphs/contributors
-
-
@hek said:
@epierre said:
@hek I'm not in the list
I can see you in the list
visibly I searched myself at the bottom, but I had many bugs as it seems
-
Well it is here in the sketch: " Required to interface the sensor: 2 * 4.7kOhm + 2 * 1N414"
but it was better in the post: http://forum.mysensors.org/topic/514/soil-humidity-and-temperature-sensor-watermark-davis-granular-matrix-sensor/2
and yes it works with two connectors this way !So this works with the sensor I linked above (= the one in the picture above)? I though changing the voltage way would destroy the sensor..
My goal is to have the sensor in soil for years though. Even if I turn it off while not measuring it might break I guess.
-
Anyone? Because I really want to use the sensor but I don't really get the posts her
-
And this sketch is supposed to be connected as this?
Edit: correct link is http://vanderleevineyard.com/1/post/2012/08/-the-vinduino-project-3-make-a-low-cost-soil-moisture-sensor-reader.html
-
Not quite. There are no diodes and no resistors in the solution I use.