Rain Sensor

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Rain Sensor

#1 Post by Deennoo » 15 Oct 2015, 21:18

Hi

I just finish a rain sensor with ESPEasy, with the same kind of rain sensor we can find on ebay.

It's run R30 on a SP1 and update Domoticz via http


Set it as a reversed switch with pull up.

[attachment=0]rain sensor.JPG[/attachment]

Now waiting for real rain.
Attachments
rain sensor.JPG
rain sensor.JPG (36.69 KiB) Viewed 23053 times

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Rain Sensor

#2 Post by BertB » 16 Oct 2015, 09:08

Do you have a picture and a link to the type of rain sensor you used?

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: Rain Sensor

#3 Post by Deennoo » 16 Oct 2015, 14:19

For the moment i only use the Digital pin, who works like a switch (didn't try to pass without electronic for the moment)


looks like this :

http://www.ebay.fr/itm/Module-detecteur ... 1532414817

This the cheaps one solution but works for moment.

Need to find one with gold immersive for less corrosion.

Martinus

Re: Rain Sensor

#4 Post by Martinus » 16 Oct 2015, 15:06

I'm really not an expert on this, but i've read some things in the past about rain or moisture sensor probes being eaten away within a few weeks...

I think using gold plated sensors will help a bit. But if a sensor uses constant dc current to measure resistance, it will suffer from electrolysis and the sensor coating will disappear anyway... Gold has better protection against corrosion, but probably not against electrolysis.

If this is the cause: known solutions to minimize electrolysis are:

1) only power the sensor during actual measurement, maybe 1 second each 5 minutes.
2) use an alternate current source to the sensor probes.

Problem is that this kind of technical information is often not provided if you buy a sensor.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Rain Sensor

#5 Post by BertB » 16 Oct 2015, 15:14

This is correct. Best would be to use alternate currents. But that is also a difficult solution.

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: Rain Sensor

#6 Post by Deennoo » 19 Oct 2015, 22:25

as i read here : http://gardenbot.org/howTo/soilMoisture/

To reduce electrolise just power sensor when we need to read value, for a rain sensor, by using barometric pressur ?

adrianmihalko
Normal user
Posts: 51
Joined: 15 Sep 2016, 00:20

Re: Rain Sensor

#7 Post by adrianmihalko » 22 Apr 2017, 23:24

Guys, can you help me with a wiring diagram? I want to connect to an ESP-01, which has limited pins. It is possible?

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Rain Sensor

#8 Post by Shardan » 23 Apr 2017, 16:01

adrianmihalko wrote: 22 Apr 2017, 23:24 Guys, can you help me with a wiring diagram? I want to connect to an ESP-01, which has limited pins. It is possible?
Which type of rain sensor do you want to use?
Please give a link or a photo to make it possible to answer.

Regards
Shardan
Regards
Shardan

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Rain Sensor

#9 Post by Shardan » 23 Apr 2017, 16:09

BertB wrote: 16 Oct 2015, 15:14 This is correct. Best would be to use alternate currents. But that is also a difficult solution.
I've found a project that makes it possible. The solution isn't too difficult, parts are standard components.
That guy uses alternating current for a combined resitive/capacitive sensor.
Even a heating for winter time is integrated. It gives a digital and an analog value back so even an
analog metering is possible with the ESP.

That guy disassembled a commercial sensor which was not working well to get the printed sensor board itself.
It should be possible to make your own sensor board. It's likely you will have to adapt the oscillator frequency
to the selfmade sensor board to make it work.

https://homematic-forum.de/forum/viewtopic.php?t=14185

Regards
Shardan
Regards
Shardan

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

Re: Rain Sensor

#10 Post by Ton_vN » 27 Apr 2017, 15:45

Aliexpress delivers a very cheap package to be connected to the switch-input of Arduino, Raspberry or ESP8266, or (also) to the analogue-input of those devices.
No solution for corrosion on the electrodes, but a few DIY-pins can do that part of the job, like described earlier.
Last edited by Ton_vN on 27 Apr 2017, 22:05, edited 1 time in total.

adrianmihalko
Normal user
Posts: 51
Joined: 15 Sep 2016, 00:20

Re: Rain Sensor

#11 Post by adrianmihalko » 27 Apr 2017, 17:24

Ton_vN wrote: 27 Apr 2017, 15:45 Aliexpress delivers a very cheap package to be connected to switch-input of Arduino, Raspberry or ESP8266, or (also) to the analogue-input of those devices.
No solution for corrosion on the electrodes, but a few DIY-pins can do the job, like described here
Thank you guys, I bought similar rain module:

http://www.ebay.com/itm/301924610031

It supports analog input and digital (1-0) output too. I can use the digital pin on the available GPIO pins. Analog measurement would be better (more precise), but I have no analog pin on the ESP-01.

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

Re: Rain Sensor

#12 Post by Ton_vN » 27 Apr 2017, 21:48

Did not yet install & connect my rain-sensor, but have some experience with the comparable 'fork'-sensor for soil-moisture.
The 'fork' is even more susceptible to corrosion, because it continuously is in the moist soil.
After 2 months of 'exposure' it looks as shown below and does not function anymore ...........
Corroded soil-fork-sensor
Corroded soil-fork-sensor
Corrosie0.jpg (12.08 KiB) Viewed 21903 times
Have meanwhile replaced the corroded fork by a dirt-cheap home-made version using 2 steel nails:
below a comparison right-to-left of corroded fork, new/original fork, "DIY-Model0".
Curious how long this DIY-Model0 will last .......
Comparison of sensors
Comparison of sensors
IMG_20170501_133438 [640x480]crop.jpg (46.91 KiB) Viewed 21761 times
The interface-PCB seems to be the same for the soil-sensor and for the rain-sensor, in both cases measuring the resistance/conductance between 2 metal sondes.
With the soil-sensor attached, the analogue interface of that PCB outputs a very noisy signal, and only by Kalman-filtering I got reasonably stable data.
Expect that same will be applicable for the rain-meter, although for the rain-meter you might experience more time of nearly 100% dry.

Wondering what happens to functionality and to corrosion if you cover the plate of the rain-sensor with a light water-repelling coating and install the plate in slant position (allowing quicker run-off of rain/moist) ......
Last edited by Ton_vN on 03 May 2017, 09:12, edited 7 times in total.

krikk
Normal user
Posts: 118
Joined: 28 Feb 2017, 07:57
Location: Austria
Contact:

Re: Rain Sensor

#13 Post by krikk » 28 Apr 2017, 17:21

just for you info, a picture of my "rain" sensor, which i installed about 1 year ago, exposed to normal austrian weather :)

the side of the sensor and the bh1750 sensor was coated with epoxy resin (which was completely transparent)...
20170428_151626807_iOS.jpg
20170428_151626807_iOS.jpg (1.6 MiB) Viewed 21906 times

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Rain Sensor

#14 Post by Shardan » 28 Apr 2017, 17:56

The picture from krikk shows very impressively what DC current does.

It's easy to see that the left side is the "anode" size, loosing metal ions to the other side.

DC driven rain sensors are nice for experimenting. They are not made for permanent use.


Regards
Shardan
Regards
Shardan

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Rain Sensor

#15 Post by BertB » 28 Apr 2017, 19:17

This is probably a good way to avoid corosion.
Shardan wrote: 23 Apr 2017, 16:09
BertB wrote: 16 Oct 2015, 15:14 This is correct. Best would be to use alternate currents. But that is also a difficult solution.
I've found a project that makes it possible. The solution isn't too difficult, parts are standard components.
That guy uses alternating current for a combined resitive/capacitive sensor.
Even a heating for winter time is integrated. It gives a digital and an analog value back so even an
analog metering is possible with the ESP.

That guy disassembled a commercial sensor which was not working well to get the printed sensor board itself.
It should be possible to make your own sensor board. It's likely you will have to adapt the oscillator frequency
to the selfmade sensor board to make it work.

https://homematic-forum.de/forum/viewtopic.php?t=14185

Regards
Shardan

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

Re: Rain Sensor

#16 Post by Ton_vN » 29 Apr 2017, 10:34

Alternating current would be the solution, but how to find a very simple configuration .....
Has somebody 'dissected' the circuit of the PCB usually supplied with the rain/soil-sensor?
Probably working with a DC-current coming from pole1 and measuring the current through pole2.

Just brainstorming, could a simple, makeshift solution be to insert a small/basic square-wave oscillator between the PCB and pole1 and a rectifier from pole2 to the PCB? That setup would at least reduce the duty-cycle of the current at the poles.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Rain Sensor

#17 Post by Shardan » 29 Apr 2017, 14:02

Ton_vN wrote: 29 Apr 2017, 10:34 Alternating current would be the solution, but how to find a very simple configuration .....
Has somebody 'dissected' the circuit of the PCB usually supplied with the rain/soil-sensor?
Probably working with a DC-current coming from pole1 and measuring the current through pole2.

Just brainstorming, could a simple, makeshift solution be to insert a small/basic square-wave oscillator between the PCB and pole1 and a rectifier from pole2 to the PCB? That setup would at least reduce the duty-cycle of the current at the poles.
Hello,

in theory yes - practically it's not that easy.
I've already designed such a circuit on paper. To make it work it needs a lot of parts and effort.

The usual "simple" square wave oscillators do not give real AC output. They don't switch between + and - but
between + and 0. So it is just an on/off switched DC and gives the same problems.
It is possible to work around this problem with a symmetric power supply or a capacitor of course.
With that you will run into the next issue. a usual rectifier won't do the job. Diodes have a
forward voltage of around 0,7V. So a voltage less then 0,7V simply won't get through the rectifier.
You may use a "precision rectifier" circuit for that, which again needs a lot of additional parts.

When I added the parts in my draft i saw that it was even more then the solution described in https://homematic-forum.de/forum/viewtopic.php?t=14185.

Now I'm wondering if i should make a desing with a BME280 + DS18B20 + maybe a
luminosity sensor and the rain sensor circuit on a PCB together with a ESP-07S or similiar.

Damn, i need a day of 48 hours..... :)

Regards
Shardan
Regards
Shardan

Martinus

Re: Rain Sensor

#18 Post by Martinus » 29 Apr 2017, 15:03

Instead of real AC current, maybe use something simple like this approach:
soilMoisture.png
soilMoisture.png (30.92 KiB) Viewed 21846 times
Taken from
http://gardenbot.org/howTo/soilMoisture/
Does not protect sensors against corrosion but could reduce electrolysis effects.

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

Re: Rain Sensor

#19 Post by Ton_vN » 29 Apr 2017, 21:24

@shardan,

0.7V is the forward voltage applicable for Si-diodes. Ge-diodes go as low as 0.2V
But you are right, still (additional) power amplification needed to get over that threshold.

The manufacturer of the 'Conrad-sensor' as mentioned in the first message in the other forum suggests a very simple circuit with an oscillator feeding the grid-sensor, followed by a detector (see below):
  • Max. attenuation by grid-sensor = no signal to detector
  • Min. attenuation by grid-sensor = signal to detector
Kam-sensor_interfacecircuit
Kam-sensor_interfacecircuit
leakagesensor-b-b-schema.jpg (10.87 KiB) Viewed 21780 times

Operation also based on impedance in the sensor varying with moisture level, but an AC-carrierfrequency is at least one step better solution than application of DC-current.
Just the question how that circuit matches to the desired simple rain-sensor/moist-sensor as discussed in this thread, and whether/how we can predictably apply the analogue output-signal from the detector to determine level of moisture at the sensor.
Last edited by Ton_vN on 01 May 2017, 16:57, edited 10 times in total.

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

Re: Rain Sensor

#20 Post by Ton_vN » 29 Apr 2017, 21:56

Perhaps we have to look in different direction than measuring impedance/resistance between 2 poles.

An ESP8266 (and also Arduino and Raspberry) has capability as pulse-counter which could be applied as frequency-measuring, by counting incoming pulses per fixed interval.
For this application to be fed by an oscillator of which frequency is dependent on impedance or on capacity as presented by the trajectory between 2 measuring poles.
Is a simple oscillator-circuit known having that function (best with an AC-circuit over the poles)?

Looking around, is a theremin-oscillator suitable as basic design?
Pole 1 = the antenna of the theremin-oscillator.
Pole 2 = ground of theremin-oscillator
Intermediate = space between the 2 poles = air, water, soil.
With this design the 2 poles can be completely sealed against water/moist, because intermediate capacitance is the critical characteristic variable, not resistance.

Feasible approach? Or did I miss a practical aspect?

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Rain Sensor

#21 Post by Shardan » 30 Apr 2017, 00:42

Ton_vN wrote: 29 Apr 2017, 21:56 Perhaps we have to look in different direction than measuring impedance/resistance between 2 poles.

An ESP8266 (and also Arduino and Raspberry) has capability as pulse-counter which could be applied as frequency-measuring, by counting incoming pulses per fixed interval.
For this application to be fed by an oscillator of which frequency is dependent on impedance or on capacity as presented by the trajectory between 2 measuring poles.
Is a simple oscillator-circuit known having that function (best with an AC-circuit over the poles)?

Looking around, is a theremin-oscillator suitable as basic design?
Pole 1 = the antenna of the theremin-oscillator.
Pole 2 = ground of theremin-oscillator
Intermediate = space between the 2 poles = air, water, soil.
With this design the 2 poles can be completely sealed against water/moist, because intermediate capacitance is the critical characteristic variable, not resistance.

Feasible approach? Or did I miss a practical aspect?
Hello,

that's one part of what the guy from the homematic-forum did (See link in the postings above).
He coupled the sensor as capacitor with a coil into a oscillating circuit. An oscillator tuned to the frequency of the circuit is connected via a capacitor.
Rain on the sensor does two things: It moves the frequency of the circuit away from the oscillators frequency and the resitive component attenuates the circuit.
So if the sensor gets raindrops the measured voltage of the circuit lowers.

I'm not sure if the capacitive component alone would be sufficient if you insulate the surface.
A lot of factors come into the game practically. The material of the cover is a big factor.
The material has a dielectric constant, the resulting capacity difference between dry and wet
depends heavily on this constant and the thickness of the cover.
Another point: With capacity alone as a sensor the form of the sensor gets more important.
If you try this, use fine leads or just wires as an electrode with 3..5 mm distance. This results
in a bigger change of the capacity when raindrops hit the sensor.

Regards
Shardan

Addendum:
I just calculated the Theramin circuit you mentioned - be carefull.
It runs on a frequency around 4 Mhz as a sqare wave oscillator.
Square waves consist of harmonics up to somewhat high frequencies and may interfere with radio and TV.
Regards
Shardan

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

Re: Rain Sensor

#22 Post by Ton_vN » 30 Apr 2017, 09:11

;-) My question at the end of the message was not without reason.

A theremin musical instrument reacts to any change in its vicinity:
that is an aspect we generally do not like for a measuring device.
For a practical realisation for our purpose, it opens a can of worms ..........

As you indicate, measuring of water sheets or measuring of trajectories in the soil has it's own 'challenges', especially related to the antenna-configuration and -setup.

Every theremin-setup will also need it's own way of tuning (if any).
Many realisations exist, but in this case looking for something simple & cheap to build, sturdy and with good characteristics for tuning & for reproduction.
Perhaps this design?
The Harrison-setup operates as a device known in 'radio-land' as a BeatFrequencyOscillator (~BFO):
- the bottom-part (U2A+U2B) acts as fixed frequency reference-oscillator
- the upper part (U1A+U1B) has a variable frequency due to the antenna and it's environment
- at the 'combiner'-section (U1F) a difference-signal appears, which is buffered through the following sections (U1D+U1E) as signal in audio-range.
To avoid unwanted theremin-effects, the PCB in its enclosure should be positioned close to the soil-poles or close to the rain-grid acting as antenna+ground, and both the circuit and the interface-cable should be well -shielded/-grounded.
In our intended application the PCB should also be well-protected against moisture.
For the receiving processor to act as low-frequency-measuring device, the output signal has to be converted to squarewave:
schmitt-trigger or optocoupler could do that job, with opto-coupler having the benefit of galvanic separation.
Information then available as relative indication, because calibration may be a too challenging aspect, except for the limits of 0% and 100%.

Remarks:
1) Very positive (for 'us' as experimenters) is that Harrison's website provides details how to build the described theremin circuits, for some circuits including some background info.
2) 'Cheap' is very relative in this case, because the price-list in Harrison's webshop mentions a price, but unfortunately without the additionally required P&P which is "rather high" for eBay-orders.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Rain Sensor

#23 Post by Shardan » 17 May 2017, 19:38

Hello all,

meanwhile i did some breadboard testing based on the schematic from https://homematic-forum.de/forum/viewtopic.php?t=14185

I've built a simple oscillator and tuned it to the frequency of the LC resonator.
Looks promising. Even slightest touch or one drop of water brings up the circuit.

I've designed a complete circuit with an ESP-07S and ordered a pcb.
I'll report back when the prototype is up.

Regards
Shardan
Regards
Shardan

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Rain Sensor

#24 Post by LisaM » 25 May 2017, 01:14

Those fork rainsensors are all total crap, there is only one good solution: http://rainsensors.com/
The same technology is being used on car rainsensors, the sensor glued to your front car window...

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Rain Sensor

#25 Post by Shardan » 25 May 2017, 13:34

Interesting.
The sensor in my car is capacitive, not optical.
Regards
Shardan

Justblair
Normal user
Posts: 63
Joined: 08 Aug 2016, 23:42

Re: Rain Sensor

#26 Post by Justblair » 25 May 2017, 14:19

I am assuming the units you find in cars are communicating on the can bus. I can pick them up on e-bay for about £6. Thinking about hacking one into a rain sensor.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Rain Sensor

#27 Post by Shardan » 11 Jun 2017, 20:55

Hello all,
as promised I revamped the schematic from that other guy, changing some things and improving stability.
I've made a prototype of a rain sensor where the sensor itself is AC driven.

The circuit gives an analog value back that very roughly says how much water is on the sensor surface.
The sensor plate is heated so it can melt snow and frost away and dry of quick.
Heating can be switched automatically if the sensor gets rain, sensivity is adjustable.
It can be switched on via a rule or from homecontroller too, for example if temperature goes below zero.
Heating on/off is reported to the home controller.

Additionally there are I²C connectors for a BMP180 and a luminosity sensor (BH1750 or TLS2561).
As it is I²C it can be used for other devices too.

Measuring temperature in the case is not possible as the voltage regulators heat up the case inside.
This influences humidity metering, so this won't work inside the case too.
To get this values if needed there are connectors for external DS18B20 and / or DHT1x.
These connectors can be used for other GPIO purposes too.

The sensor PCB itself is a bought one. It's a gold plated sensor with the leads for heating
at the backside. As it comes around 12€ it's cheaper to buy then DIY.

It showed the sensor is sensitive enough to work even through a 4mm thick plastic case,
just it isn't very sensitive then... I'll try that with a very thin glass plate if i can get one.

Now i'll put it into a case and place it outside. We'll see.
.
Rainsensor-1.jpg
Rainsensor-1.jpg (726.16 KiB) Viewed 21527 times
PCB and sensor - front side
.
Rainsensor-2.jpg
Rainsensor-2.jpg (374.93 KiB) Viewed 21527 times
PCB and Sensor - back side
.
PCB_Annotated.jpg
PCB_Annotated.jpg (323.67 KiB) Viewed 21527 times
More descriptive front view.
Of course the luminosity sensor should be placed at the case front side, not deep inside
the case - it's just plugged in here to show it.
.
The ESP is an ESP-07s (4 MB) allowing an external antenna or a PBC antenna inside the case,
giving better connectivity on long distance.

It should be mentioned: This device is not suitable for beginners in electronics.
It needs more knowledge (and measuring instruments) then just knowing what a soldering iron is :)

Regards
Shardan
Regards
Shardan

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests