In-soil/Underground application of SHT1x & DS18B20

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

In-soil/Underground application of SHT1x & DS18B20

#1 Post by Ton_vN » 04 Oct 2021, 19:49

For meteo/agrotechnic it is also interesting to measure the temperature and humidity in-soil/underground.
Davis has very nice humidity sensor and temperature-sensor, but cost is reason to look for alternatives.

In my setups I apply SHT1x to measure Temperature &Humidity in/on the top-soil, and DS18B20s for measuring Temperature from top-soil to deeper levels.
SHT1x in 'protective' capsule, and DS18B20 is version in stainless steel holder.

Earlier experience with SHT11 already showed that humidity sensor of that device fails after prolonged exposure to water, even if housed in a 'protective' capsule.
Measurement by SHT11 of temperature continues undisturbed.
For segmented measurement in the garden have an array of 1*SHT15 + 4*DS18B20: measurement was no problem until last winter.
Problems then starting as description ending here.
Experience with SHT15 in the garden not different than with SHT11: end-of-life-signal is that humidity drops & stays at -2%.
Slower demise of the array of DS18B20s: first 3 from same supplier, then slightly slower 1 from other supplier.
Not expecting that the DS18B20s have suffered from testing experiments (because according to spec they can deal with PS in range 2.4VDC~5.5VDC), fearing that WEMOS_GPIO got 'fried' during testing, or for other reasons.
However, when connecting the array to VCC+GND+pinD5 of 'fresh' WEMOC_PCB, during setup for DS18B20s get response DeviceAdress - None -
:( Headscratching; last resort of digging the sensor-array is undesirable ..........
Subsequently doubting power supply and wiring, but after comparative testing another fresh WEMOS_PCB with unused DS18B20 (which run without problem), the conclusion might be that the application in continously very moist environment has affected and ultimately 'killed' the DS18B20s, while WEMOS remained unaffected.
Replacement of SHT1x + DS18B20 is not difficult, because just purchase & labour, but would prefer to prevent future breakdown, or at least to extend the life-cycle.

Questions now:
a) how to better protect the next SHT1x-in-capsule against intrusion of moist, while keeping the functionality for humidity?
b) how to better protect the next DS18B20-in-steel-holder against intrusion of moist?
Any best practises?

TD-er
Core team member
Posts: 6349
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#2 Post by TD-er » 05 Oct 2021, 09:16

I think the only way to keep the sensors from oxidation is to make sure there is no direct contact.
For temperature sensors this is relatively easy to achieve, but for humidity you might want to switch to "capacitive" sensors.
These are essentially a capacitor which experiences a change in capacity due to the presence of water. (distance and amount of water is key here)

Also I don't think the 'traditional' temp/hum sensor is usable for high humidity environments.
Those report a relative humidity, which is depending on the temperature.
But this relative humidity is related to air, not soil.
In the ground, you're essentially measuring the depth of water level, so a capacitive sensor makes more sense here. (pun intended :) )

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#3 Post by Ton_vN » 05 Oct 2021, 21:15

TDer,

Indeed life of the thermo-sensor will become much longer if their cover is really thick and very water-resisting:
have been thinking for next batch of DS18B20s-in-steel-holder to put each DS18B20 in an extra capsule and fill that capsule with silicon paste or similar emulsion.
The filling of the capsule may be thermal resistant, but processes underground are slow by nature: therefore some 'retarding' through the filling probably is not a big problem.

For underground measuring of moisture a capacitive method might be the better solution compared to resistive measurement, but realisation is a question mark.
Puzzles, because Davis as established company is not known to be ignorant, but their humidity sensors are measuring resistance.
:? DC as carrier will be 'eating' the outer side of the sensor (like happening with the well-known 'fork'-sensor), but applying an AC-signal as carrier for measurement, interesting aspect how to deal with multiple neighbouring sensors at 1 station ........
Last edited by Ton_vN on 05 Oct 2021, 22:45, edited 1 time in total.

TD-er
Core team member
Posts: 6349
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#4 Post by TD-er » 05 Oct 2021, 21:35

Measuring resistance can be tricky indeed, due to redox reactions (is that correct English? I only know it from chemistry class in high school)
Switching polarity may indeed help here, but not against "normal corrosion" of the material.

Switching is rather easy by the way, as you can use a simple "H-bridge", normally used for DC motors.
The resistance in the MOSFETs of such a H-bridge is negligable when compared to the resistance of the soil, so you can put a simple linear voltage regulator in front of it and measure the voltage over a series resistor in front of the regulator.

Not sure if you would also measure the values from a neighboring sensor. But I guess if you only send a current during the measurement you can prevent false readings by taking the lowest (or highest?) measured resistance of a few measurements in a row.
By using a random interval between measurements you can make sure you always have one measurement which cannot be influenced by another one.

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#5 Post by Ton_vN » 05 Oct 2021, 22:26

Found some more manufacturer's information describing the sensor including example How to read the sensor.
The example also discusses the aspect of 'mutual effects' between sensors.
Cannot (yet) find how the 'managing' Soil Moisture/Temperature Station functionally deals with multiple sensors, but obviously some time-planned measurement cycle would be a rather simple functional solution to prevent 'mutual interference' between the sensors.
This type of humidity measurement does not have % as result, but cb, as described in Davis' spec sheet for this sensor: just another type of calculation .....
The Soil Moisture/Temperature Station converts the electrical resistance reading
from the sensor into a calibrated reading of centibars of soil water suction with a range from 0 (wettest) to 200 (driest)
centibars.
October 06, 2021
Better hint to 'mutual effects: added line 2, edited line 3
Last edited by Ton_vN on 06 Oct 2021, 09:07, edited 3 times in total.

TD-er
Core team member
Posts: 6349
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#6 Post by TD-er » 05 Oct 2021, 22:34

Is this a linear scale?
And if so, linear to what? current or resistance?

If so, then calibration is rather simple.

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#7 Post by Ton_vN » 05 Oct 2021, 22:42

;-) The 'example' is very supportive for making a setup incl. software.
Like Arduino ESPEasy offers PWM as candidate to generate pseudo-AC.
Also describing setups for multiple sensors and how to calibrate.

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#8 Post by Ton_vN » 11 Oct 2021, 19:56

Learning by experience.
Testing is the start, to be followed by repair.
'Remote restauration' is not possible, and therefore dug the array with the 4 failing DS18B20, and possibly found the reason for their 'strike':
the 32mm PVC-pipe used for bringing the sensors&cable down to their levels was full of water from -50cm downwards.
The surrounding soil was not very wet till -100cm.

Possible explanation:
over time the fluctuating groundwater has filled the array-pipe (helped by some severe floods during thunderstorms), and apparently the sensors at -50cm and -100cm have been drowned, dragging along the other 2 sensors,
:-( In hindsight had forgotten to make drain-holes in the covers with the sensors and in the bottom segment of the pipe, disabling discharge of leaked water ......

Yet making drainholes possibly a quick&dirty solution, but not sure of future effects, and therefore have to re-engineer the holders for the array, perhaps according to this idea:
1) separately check the sensors whether still fit for recycling
2) keep the array for sensors at - 10cm, -20cm and -30cm, because they usually will be above groundwater, outside the dager area
3) not 1 common 32mm-pipe down to -100cm, but separate pipes for the sensors at -50cm and -100cm, with gaze at the bottom end to keep out soil, but allow free flow of water
4) for -50cm and -100cm the sensor&cable each fitted into a narrower pipe, which pipe to be sealed at the bottom end with the steel sensorholder protruding, with waterresistant closure [to ensure that sensor and cable remain dry].
This setup to be dropped into the wider pipe to make thermal contact at the bottom
5) for the sensors at -50cm and -100cm interface to junction box by connector, enabling quick & reliable (de)connection for check & replacement.

TD-er
Core team member
Posts: 6349
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#9 Post by TD-er » 11 Oct 2021, 20:57

There are also Dallas sensors sold which are packaged in "waterproof" enclosures. (also at AliExpress etc.)
One problem still may be that those are often RVS and I'm not sure how well that may last in slightly acidic soil.

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#10 Post by Ton_vN » 11 Oct 2021, 22:54

TD-er,

All outdoor DS18B20s in my configuration have been delivered with steel holder.
Never seen that the holder has been affected by moisture, but fear that for the 'victim'-DS18B20s the moisture has been entering by way of the 'backdoor' along the cable.

Because liquid often follows gravity, one possible way of protection is fitting with the holder upright (as 'roof').
But that approach not very handy for the intended 'undersoil' setup.

For measuring temp at my solar panels, I curled a small sheet of aluminium around the holder and glued the alu-sheet to the backside of the solar panels.
Also for measurement in the bottom of my crawlspace curled an alu-sheet around the holder of a DS18B20 to act as a thermal probe stuck into the sandy bottom.
In both cases the alu-sheet acting as a thermal conductor towards the holder of the 'offset'-DS18B20: already > 5 years in operation without any problem.
;-) Headscratching how to translate this experience for these 'deep-soil' DS18B20s.

Temp_under_solar
Temp_under_solar
Paneel_temp2.jpg (15.12 KiB) Viewed 13282 times

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#11 Post by Ton_vN » 19 Oct 2021, 09:52

The DS18B20-sensors usually have a cable of max. 1m
=> in my array the deepest sensor at -100cm therefore needed an extension to reach the nearest junction box.
The 'drowned' array now above-soil for inspection & repair:
the connection between DS18B20 and Extension shows clear signs of muddy submersion and resulting rust.
Not good for the connection, operation and life-cycle ......
Related handicap that the cores of the sensor-cable are very thin:
:( certainly not improving survival in moist environment.
After drying, the sensor itself still shows signs of life:
perhaps can be reused .....

Short term solution: refit with watertight connector or watertight cover for the extension.
Longer term approach (while the 'repaired' setup bridges the gap till arrival of the replacing sensor):
buy DS18B20 with 3m-cable
Last edited by Ton_vN on 19 Oct 2021, 10:34, edited 2 times in total.

TD-er
Core team member
Posts: 6349
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#12 Post by TD-er » 19 Oct 2021, 10:01

What is the situation on how the sensors are mounted?
Is it a straight line down?
Would it be possible to use PVC tubes with the sensors glued to the wall of the tube and then the tube glued at the end?
Even if you need to extend it a bit, you could use pieces of PVC tube, so you can glue in the sensors at the end of each piece and use those extender parts.
I was thinking of some plastic cap to hold the sensor and glue in that cap so you have the best adhesion between plastics. Easy to 3D print, or make from parts of PVC tube.

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#13 Post by Ton_vN » 19 Oct 2021, 10:28

TD-er,

Original setup was with sensor at -100cm fitted in a cap solidly closing the end of the array-pipe, sensor-cable&extension free-hanging and (optimistically, because inside the common PVC-pipe) connector between sensor-cable and extension open to environment.
As indicated, my 'conceptual-error' seems the need for a drainage hole in that closing cap to get rid of intruding water and the need for waterresistance of the connection.

;) New setup is a combination of your idea and the original setup.
Basis is a straight 32mm PVC-pipe extending till -100cm, just for this 'bottom'-sensor.
The 32mm PVC-pipe is open-ended at the bottom, end covered by gause and/or by punctured cap, keeping out soil (but with good contact to soil) while enabling free flow of water.
90cm PVC-pipe of 5/8" with sensor glued at bottom end (with the glue also closing that bottom end), also closing the top end of the 5/8"-pipe (to keep out water from above) should protect the sensor and it's 'standard' cable at least for the lower 90cm.
Dropping that setup in the 32mm-pipe enables quick & easy install, test & repair.
If not fixing the package of extension cable and 5/8"-pipe+sensor, side-effect when groundwater or rain would enter, is that the whole package is a floater, and the extension-connector stays out of the water.
In practise the setup as floater hardly seems a functional handicap, because probably very little difference between the temperature at the bottom of the dry 32mm-pipe and the temperature of rising groundwater.

Time to gather experience till the sensor-with-long-cable arrives, to see whether correct thinking (and 5/8"-pipe application to be repeated for long cable setup), or not required with long cable.
Must pay attention that sufficient extension cable to allow vertical movement of the package:
;-) ;-) if fitting a thin, lightweight, marked vertical bar to the 5/8"-pipe, at the same time would have a very coarse visual indicator for groundwater level rising from -100mm upwards .......

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#14 Post by Ton_vN » 19 Oct 2021, 22:11

Just an observation for info as example results:
nothing else intended ....

Results for the 4 'drowned' DS18B20s, from functional testing with ESPEasy, singly and in combination:
sensor-010 => device detected, but Port-ID has changed (to different DA-string of 8*2characters) and no report of temperature => useless
sensor-020 => device detected, but Port-ID has changed (to different DA-string of 8*2characters) and no report of temperature => useless
sensor-050 => device 'dead' and (when connected to array) 'killing' the interface for the other sensors => DA = None => useless
sensor-100 => device seems OK [reports with original Port-ID/DA, reports temperature] => recycling possible
Bottom sensor is from another supplier than the top 3 devices: difference in quality of manufacturing?

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#15 Post by Ton_vN » 30 Oct 2021, 22:59

Realisation of alternative layout was quicker possible than expected.
Setup with 3 PVC-pipes:
# Pipe1 (diam=32mm) having all thermo-sensors for -10cm, -20cm, -30cm and -50cm at fixed 'branches'
- The red (punctured) covers hold the sensors.
# Pipe2 (diam=32mm) for access to -100cm, with lower end closed/covered by fabric
# Pipe3 (diam=5/8") as sensorprobe, at the lower end holds the thermosensor for -100cm
- drops into Pipe2; thin stick as extension is also guidance/holder for the cable ( ;-) no pulling at the cable)
# The Junction Box joins the wiring for the sensors of Pipe1, and has connectors for:
- the ESP8266-interface, on top of JB,
- the -100cm-sensorprobe, at bottom of JB,
- an extra sensor, at righthand-side of JB
(that sensor now applied for measurement of temperature of toplevel soil)
# All sensors well covered with isolation-tape, fabric and glue, to have some more waterresistance.
[Heat shrinking tubing ( = 'krimpkous') as outer cover perhaps better, but not in stock in required size]
# Plant-bucket as overall cover against precipitation.

Installed and operational with 6*DS18B20:
just some more work needed on the fitting of the extension cable for the sensorprobe for better fitting into the 32mm-Pipe2.
Curious how long this configuration will survive ........
Left-to-right: 1m-probe 1m-Pipe2 50cm-Pipe1<br />plus cables
Left-to-right: 1m-probe 1m-Pipe2 50cm-Pipe1
plus cables
ThermoArray2021A.jpg (69.97 KiB) Viewed 12530 times
Installed at location: visible parts, without cover
Installed at location: visible parts, without cover
ThermoArray2021B.jpg (72.93 KiB) Viewed 12530 times
Last edited by Ton_vN on 31 Oct 2021, 15:43, edited 1 time in total.

TD-er
Core team member
Posts: 6349
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#16 Post by TD-er » 31 Oct 2021, 11:16

Why are the red covers punctured?
I'm not sure if shrinking tube would be the best suitable for keeping it water tight.
Maybe with teflon tape between it, but just shrinking tube isn't that water tight.

User avatar
ManS-H
Normal user
Posts: 262
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: In-soil/Underground application of SHT1x & DS18B20

#17 Post by ManS-H » 31 Oct 2021, 12:32

TD-er wrote: 31 Oct 2021, 11:16 Why are the red covers punctured?
I'm not sure if shrinking tube would be the best suitable for keeping it water tight.
Maybe with teflon tape between it, but just shrinking tube isn't that water tight.
Look here: https://www.allekabels.nl/kabel_accesso ... -lijm.html

TD-er
Core team member
Posts: 6349
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#18 Post by TD-er » 31 Oct 2021, 13:49

Ah, didn't know about the shrinking tube with glue.
Good to know :)

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#19 Post by Ton_vN » 31 Oct 2021, 15:29

@TD-er,

'Lessons-learned/ Past experience'

1) Design-choices for the pipe&branches in combination with the red covers
Have a drill available which can reach -1m, which ;) sets a practical limit to the depth of the hole for the deepest sensor.
If you point the branches upward, no water intruding in the branches from the main pipe, and any water entering along the sensors will flow down to the main pipe,
but that layout proved to be more sensitive for disarray during initial assembly, also with sharp bends in cables.
The red cover at the lower end of the array always must be punctured around the sensor-fitting to drain any water collected in that pipe.
Therefore went for the other configuration with downward-aimed branches.
Pointing the branches downward is easier for assembly (with natural flow of cables), and it is easier to fill the soil around the array and easier for extraction, but any incoming water may collect in the branches, unless you puncture the red covers below the sensor-fitting for draining.
In hindsight such 'collected water' probably killed the sensors in my first setup not having punctured red covers ......
Also proven not to be sufficient to glue the branch-segments to the pipe, but in addition fixing screws are advised:
otherwise pulling out is in pieces with strained cables ..........
2) If in this soil-environment the heat shrink tubing is not well-fitted, it has no/limited added value, because unavoidably leaking water at some time.

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#20 Post by Ton_vN » 12 Nov 2021, 18:30

'fixing screws'= short 'parker's, or equivalent,
fixing the junction between the fixtures and the pipe,
but not penetrating to the inside of the pipe, to prevent damage to wiring etc.

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#21 Post by Ton_vN » 17 Nov 2021, 12:15

In this climate good protection against rain etc. is essential, while maintaining good ventilation to get rid of excessive moist.
Homemade/makeshift-solution, using 'available components / left-overs', now covering the new setup as shown in the picture:
- at left 2 stacked, black plantpots with plenty space cover the 'head' of the array with DS18B20s, with the bottom-holes of the pots allowing air flow for ventilation.
[ ;) kind of 'micro-management', but on purpose the round pot over the square pot, to improve draft to suck air from the square pot, latter being very close above top soil]
- on top of the stack a transparant plant-'dish' supported on 3 corks to protect the bottom-holes of the plantpots against rain
- at right a ventilation-pipe, painted silver, previously used as housing for a meteo-sensor,
- as base has a compatible, inverted, black plantpot.
That plantpot in it's sides has extra holes all around allowing air to enter under the ventilation pipe,
with idea that airflow over the topsoil is entering the ventilation pipe at the base through the holes in the plantpot,
then sucked by natural draft upwards through the ventilation pipe.
The SHT15-sensor is installed in the bottom of the inverted plantpot at the bottom of the ventilation-pipe and in that way hanging in the airflow at approx. +5cm from top soil.
The extra DS18B20 is put in the top soil under the plantpot, measuring temperature in the top soil.
Forksensor to be mounted besides this DS18B20 to measure moist in the top soil.
All sensors now reasonably protected: not without without reason as you can see from the mud spatters, due to present rain at the top soil.
Covers for ESP8266D1-sensors
Covers for ESP8266D1-sensors
IMG_20211117_ESP8266D1 [640x480].jpg (83.64 KiB) Viewed 11811 times

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#22 Post by Ton_vN » 22 Nov 2021, 19:13

Now testing for some days with the renovated setup.
Graph includes readings by 3 'real' meteo-sensors: Nexus at +20cm, WS7000P +10cm and WS7000 at -10cm (by means of thermoprobe)
The probe of the WS7000-setup is running down through the yellowish pipe visible at right in background in the picture of the previous message.
SHT15 in housing as described in that same message.
All other sensors are DS18B20.
.
Bottom&amp;Soil temperatures
Bottom&Soil temperatures
pibodem1_211121 [50%].png (50.85 KiB) Viewed 11637 times
.
Recycled SHT15 clearly not recovered from his drowning:
now under dry roof and at some distance from soil, but shows erratic behaviour.
ESP8266 rebooting (by hand) then going into sync again for some time,
but otherwise with unpredictable time of measurement, and values often 'flatline' (light green).
Or could it be that ESP8266 running 12 Tasks is 'bit too much'? Then question why only SHT15-reading would suffer.
Last edited by Ton_vN on 22 Nov 2021, 21:52, edited 1 time in total.

TD-er
Core team member
Posts: 6349
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#23 Post by TD-er » 22 Nov 2021, 19:32

When in doubt about the sensor, you could try it on a separate ESP.

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#24 Post by Ton_vN » 22 Nov 2021, 21:52

'Neighbouring' ESP8266 already in planning, but not yet present at location:
therefore time for uncritical experimentation with this 'survival'-SHT15.
Also alternative setup upcoming with DS18B20 for soil-temperature and PWM-sourced forksensor for soil-humidity.

Reading SHT15 is Task2 at the ESP8266:
uploading data from the SHT15 originally through Task Settings 'Send to Controller' with Ctr(IDX).
Have also tried a Rule performing alternative upload of SHT15-data to the same Controller&IDX.
But (as more or less could be expected) no difference:
read-out of the SHT15 seems the problem, not the communication from ESP8266 to Domoticz.
Present very variable moist environment might also again have effects on the SHT15:
:( clearly end-of-life is near ......

;) Next experiment, in category 'what-if':
could read-out of the SHT15 be 'forced' by means of a Rule?

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#25 Post by Ton_vN » 28 Nov 2021, 15:35

Reading of SHT15 is still being performed, but with rather erratic timing.

In that perspective perhaps clearer formulation of the question in previous message:
is it possible to force a controlled reading of SHT15 by means of a Rule (or other type of 'kicking')?
Rebooting of ESP8266 has effect, but that is really rude & uncontrolled .........
Last edited by Ton_vN on 28 Nov 2021, 21:00, edited 1 time in total.

User avatar
Ath
Normal user
Posts: 1809
Joined: 10 Jun 2018, 12:06
Location: NL

Re: In-soil/Underground application of SHT1x & DS18B20

#26 Post by Ath » 28 Nov 2021, 16:48

Any task can be executed using the "TaskRun,<taskName|taskNumber>" command. Usually, that will force fetching data from the sensor.
/Ton

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#27 Post by Ton_vN » 30 Nov 2021, 11:33

;) Clear that still a lot of learning curve required .......
Following simple script should do read-out/ 5 minutes, but see time-gaps longer than 5 minutes.
Who might be 'guilty': script-error or SHT15-failure?

Code: Select all

On System#Boot do    //When the ESP boots, do
   timerSet,1,10     //Set Timer1 for the inital event in 10 seconds
endon

On Rules#Timer=1 do  //When Timer1 expires, do
   TaskRun,2         //Read SHT15
   timerSet,1,300    //Set Timer1 for the next event in 300 second
endon

on SHT15_Bodem_TH005#Temperature do  //If Temperature valid, transmit to Domoticz
   SendToHTTP,192.168.0.185,8080,/json.htm?param=udevice&type=command&idx=4065&nvalue=0&svalue=[SHT15_Bodem_TH005#Temperature];[SHT15_Bodem_TH005#Humidity];3
endon

TD-er
Core team member
Posts: 6349
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#28 Post by TD-er » 30 Nov 2021, 12:27

Better use a looptimer, it is easier ;)
A loop timer is also a bit more exact with its intervals, but I doubt that's the issue here as your interval is quite long.
If the task does not yield a new value, it often means there is no new value present on the sensor, or the sensor was not responding.

You can set a second timer, as a timeout to trigger a new taskrun and as soon as you received an event from that task you can disable that second timer (set timer to 0)

Thus:
- use looptimer for the 5 minutes loop
- set 2nd timer (looptimer?) as a timeout to trigger an additional taskrun
- clear 2nd timer when an event is received from that task

N.B. the looptimer (for the 2nd timer) can also be scheduled to run a number of loops.
See: https://espeasy.readthedocs.io/en/lates ... oop-timers

But that's not fixing the real issue you're having where a sensor may not respond well.

Another "fix" can be to call taskdisable and taskenable when the first taskrun doesn't work.
At PLUGIN_INIT (taskenable) there is often more interaction with the sensor than with a simple PLUGIN_READ (taskrun) call

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#29 Post by Ton_vN » 30 Nov 2021, 17:47

Step-by-step check/elimination/correction of possibly problematic aspects.

To see whether and how fast a readout could be done with related transmission to Domoticz, ran this test-script
(not useful for any other purpose, because of bad design for the loop: just a very rude experiment, nothing else!!!!!)

Code: Select all

on SHT15_Bodem_TH005#Temperature do  //If Temperature valid, Next Read SHT15 & transmit to Domoticz
   TaskRun,2         
   SendToHTTP,192.168.0.185,8080,/json.htm?param=udevice&type=command&idx=4065&nvalue=0&svalue=[SHT15_Bodem_TH005#Temperature];[SHT15_Bodem_TH005#Humidity];3
endon
Result: quickly changing values at the related virtual device at Domoticz, with 'Condition' flipping between Wet and Dry.
After some time the flipping completely stops (probably due to other 'system-effects').
Conclusion: :| 'kicking' the SHT15 works, but how fast to sustain the read-out?

Attention shifted to a good loop for 'kicking'.

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#30 Post by Ton_vN » 01 Dec 2021, 18:20

Some exercise with Taskrun and timers, resulting in some simple code doing a job .......

Timer1 is doing that job.
Timer2 included to force a delay after reading the SHT15.
Transmission to Domoticz probably redundant relative to setting under 'Devices', but in this way the read-out has a directly related upload.
Needed some 'fidlling' with timer-values before 'reasonabling' running, and output of T-values from SHT15 not very stable.
Leading to conclusion that SHT15 needs replacement ......
Below 'Rule'-script is considered part of learning curve.
.

Code: Select all

On System#Boot do    //When the ESP boots, do
  loopTimerSet,1,300 //Start loopTimer1, 150sec interval, for loop
  TimerSet_ms,2,2000  // Start Timer2, 2000msec, for default & startdelay
endon

On Rules#Timer=1 do  //When Timer1 expires, do
  TaskRun,2          //Read SHT15
  TimerSet_ms,2,2000 // Start Timer2, 2000msec, for delay till transmission
endon

On Rules#Timer=2 do  //When Timer2 expires, do
  SendToHTTP,192.168.0.185,8080,/json.htm?param=udevice&type=command&idx=4065&nvalue=0&svalue=[SHT15_Bodem_TH005#Temperature];[SHT15_Bodem_TH005#Humidity];3
endon

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#31 Post by Ton_vN » 14 Dec 2021, 14:56

Not an urgent matter, but just for an easy 'repair':
SHT11 and SHT15 having passed end-of-life, is a pin-compatible, modern replacement available?

[Otherwise have to find howto fit to ESPEasy a readily-available I2C-variant like SHT31]

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#32 Post by Ton_vN » 16 Mar 2022, 17:15

More experience.

After recent downpours the DS18B20 at -50cm went haywire, but during subsequent dry weatherintermittently returned'.
Reason to pull/raise the whole array once more for inspection.
Observations:
- the 3 drains physically tight below each DS18B20 at -10cm , -20cm and -30cm did their job and those sensors seem OK/unharmed.
- DS18B20 at -50cm is vertically in bottom-end of pipe, and apparently the drain-holes not open enough
=> that DS18B20 drowned, and visibly badly corroded [ ;-( quality of 'stainless steel' hood apparently related to price]
- DS18B20 at -100cm is 'loose&well-covered' within it's separate pipe with bottom-end closed with gaze
=> sensor looks OK and behaves OK, apparently pipe well drained

Remedy:
- installed separate 1"-PVC-pipe for the sensor at -50cm with bottom-end closed with gaze, similar to setup for -100cm
- DS18B20 as extra protection housed in a narrow, metal pipe, sealed by cork&glue at bottom and filled with glue from top
=> DS18B20 for -50cm now 'loose&well-covered' in that separate pipe, but sensing is erratic = replacement planned.

Recommendation:
- when installing sensors underground, make sure that you can pull, inspect&replace with ease
=> in future possibly also separate, vertical 1"-pipes to be installed for the DS18B20s at -10cm, -20cm and -30cm
=> in appearance the array will become similar to a pan-flute

Side-effect:
- used the opportunity to put a fork-sensor at the position formerly occupied by the DS18B20 at -50cm
- to be applied as PWM-moisture sensor.
Being of same construction and close to top-soil PWM-moisture-sensor, it should enable comparison.
- having no electronics and only comprising 2 steel nails of 5cm*2mm, should last some time ......

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#33 Post by Ton_vN » 21 Jun 2022, 16:45

Today the DS18B20s at -50cm and -100cm again failed.
For deepsoil-sensing have to find a thermo-sensortype which is better waterresistant, because raising/replacing every 3 months is not an acceptable way of life.

User avatar
Ath
Normal user
Posts: 1809
Joined: 10 Jun 2018, 12:06
Location: NL

Re: In-soil/Underground application of SHT1x & DS18B20

#34 Post by Ath » 21 Jun 2022, 17:08

At what end of the sensor did it fail? And why are only these failing, and not the ones positioned deeper? Or are the deeper ones only SHT1x sensors? Could it have to do with the quality of the DS18b20 sensors?
/Ton

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#35 Post by Ton_vN » 21 Jun 2022, 19:55

For correct understanding, the present configuration is:
- above soil is 1*SHT15, which has end-of-life, because humidity element totally failing, and thermo-sensor erratic (but no 100% replacement available anymore)
- the 6 other thermosensors located from surface to -100cm downwards are DS18B20 in stainless steel capsule.
The lower 2 DS18B20s at -50cm and -100cm presently behave erratically: sometimes looking/reporting normal, but other times the ESP8266 cannot find them.

Quality in relation to price certainly will be applicable, but difficult to find 'favourable' replacements.

TD-er
Core team member
Posts: 6349
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#36 Post by TD-er » 21 Jun 2022, 21:25

Maybe there is a "X-type" thermocouple element available which has good enough resolution at the temperatures you're interested in? (X as in one of the letters for various types of thermocouple elements, which each has its own combination of different metals welded together)
Perhaps those can be laminated with some liquid plastic to make them water proof?

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: In-soil/Underground application of SHT1x & DS18B20

#37 Post by Ton_vN » 15 Jul 2022, 11:46

Would car paint be a longer-lasting, DIY, water-resistant cover?
To be tested with next batch of replacement-DS18B20s.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest