PDA

View Full Version : Rain Sensor - HELP!



everest
10-21-2009, 10:02 AM
I could use some design help/ideas from some more experience builders. I'm having problems with the rain sensor portion of one of my projects. While my design WORKS it's not going to be very durable, because I've got electrolysis induced corrosion eating away my sensor. Here's what I've got running now:

1) I have a simple configuration that wires a "wet leaf" sensor, which is a simple PCB with a two grids of exposed wire traces. The intent is to just measure the resistance between the two to determine if moisture is present.

2) I connect on set of traces on the wet leaf to Vdd (+5) and the other to ground through two 1k and 10k resistors wired in series.

3) I use a 220ohm resistor to connect in between the two resistors (1k and 10k) to an input pin on my Stamp 2e. I then make the pin an input, and see who wins out. . .the ground, or the +5v from the wet leaf.

The results are quite good, I can see the first drop of rain on the wet leaf.

PROBLEM: While I selected a gold plated we leaf, I'm seeing an alarming amount of corrosion on my sensor, after just a few weeks outdoors, and only 2 rainfalls. Is anyone aware of a better way to detect rain and avoid the corrosion issues I'm seeing here? Any novel ideas? Thanks!

-Jeff

SRLM
10-21-2009, 01:16 PM
Have you tried to lower the current?

Mike Green
10-21-2009, 01:22 PM
If you can afford 3 I/O pins, instead of using +5V and ground, use 2 other I/O pins as your power source (and increase the resistances by at least 5x, maybe 10x). Make one I/O pin HIGH and the other LOW for enough time to make a reading, then switch polarity and make another reading. You can average the two readings if you want or throw one away. Either way you're providing AC to the sensor and reducing the corrosion. If it's going to be several milliseconds between readings, turn off the power to the sensor (make both I/O pins LOW) and that'll also reduce the corrosion.

everest
10-21-2009, 11:12 PM
SLRM, I'm experimenting with higher resistances yes, but the sensor becomes SUPER sensitive and is prone to erroneous readings. I tried a set of 1M ohm resistors last night, and if I even touch the sensor surface it shows up as rain. If I put water on it, and let it dry, the it never pops back as dry, it just stays in a "wet" reading.

Mike, I can't afford three pins :(

Someone has suggested using a sensor grid with the traces much closer together, sealing them, and measuring them as a capacitor. . .apparently the rain changes the charge/discharge time. . .so I could use RCTIME, but I can't figure out how that could possibly work.

-Jeff

Post Edited (everest) : 10/21/2009 3:19:25 PM GMT

Leon
10-22-2009, 02:22 AM
How about some piezo film to detect the impact of the rain drops? It'll make things much easier.

Leon

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle

Tracy Allen
10-22-2009, 03:09 AM
Another way to balance the +/- current flow is to put the wetness sensor as the feeback in a 555 oscillator.
http://www.emesys.com/OL2mhos.htm
http://www.emesystems.com/lwet_dat.htm
Also shown in the Applied Sensors Stamps-in-class. This circuit also works if the sensor is a capacitor instead of the resistor, but the traces do have to be very close together and insulated with something like soldermask, and the 555 run at a much higher frequency.

The rain impact idea that Leon brought up is used in the Vaisala WXT520 (http://www.vaisala.com/weather/products/weathermultisensor.html) integrated weather module.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com (http://www.emesystems.com)

everest
10-22-2009, 04:58 AM
Thanks Tracy, I'll check out that approach, I'm hearing a lot about that style and I've seen links to those pages, time to do some more reading!

Leon, wouldn't I have to continuously monitor the film? One issue is that my application does a LOT of different things, so it only checks in with the environmental equipment every few seconds.

-Jeff

Leon
10-22-2009, 06:21 AM
Yes. You'd be better off with a Propeller.

Leon

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle

everest
10-22-2009, 07:31 AM
I've just ordered three of the moisture detection circuits from EME systems. . .I think those are going to work out perfectly, and at $22 each, and given the small packaging, they will literally just drop right in to the existing project enclosures. . .I think they will do the trick!

Since they provide a frequency based representation of the amount of rain present, I can do some additional neat things, like distinguish between active rain and rain just sitting on the sensor. . .it should be pretty easy to see what's going on by watching the frequency stability and/or changes.

-Jeff

everest
10-22-2009, 01:19 PM
Hey guys,

I just did an experiment, and here's what I've discovered. . .if I cover a wet leaf sensor with a single light coat of Krylon paint designed for outdoor use on plastics and metal. . .and swap out the resistors with MUCH higher values. . .I still get very reliable rain detection with just ridiculously low current flowing. I'm not sure how much a Stamp2 pin will sink when it's in INPUT mode, but we're talking about microamps of current here. . .

Is there any way to determine how quickly this sensor might be affected by electrolysis in this configuration? I've been googling and I can't figure out a way to calculate this.

-Jeff

Beau Schwabe
10-22-2009, 02:54 PM
everest,

Here is something else you might want to try that will exercise the polarity on the wet leaf ... not quite microcamps though about 1.5mA

The frequency will vary from about 4.2kHz to 15.4kHz depending on how saturated the wet leaf is.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

everest
10-23-2009, 01:43 AM
Thanks Beau,

I think I have most of these parts on hand, so I'll give this a try! Does reversing the polarity rapidly further reduce the corrosion due to electrolysis? I need to find myself a chemical engineer or something :) This looks fundamentally similar to the LMC555 oscillator approach that the EME systems devices I've ordered use, but I love that I can build this one with parts on hand!!

-Jeff

everest
10-23-2009, 01:52 AM
Incidentally, does anyone know how to build a capacitance based sensor like this? My understanding is that two series of traces, spaced very close together, with a coating of an insulator can also act as a rain sensor since the presence of water on the surface changes the capacitance. . .somehow. . .I just don't have the slightest idea how to build something like this, and Google has been of no help! :)

-Jeff

Tracy Allen
10-23-2009, 03:13 AM
Anything that switches the polarity of the current will help, the goal being a time average of zero, Ions migrate in the electric field, but first one direction and then the other, and less so when the time intervals are short and the driving voltage is low. Best if the waveform is symmetrical. There may still be a random walk of ions, but over a much longer time scale than is the case when there is a DC bias. Even a few millivolts of DC bias applied day in and day out will hasten corrosion. I balance the current by means of capacitors in series with the grid. If possible, turn power on infrequently to take a sample.

There are electrochemical effects between dissimilar metals, even without external applied currents. Little batteries, with erosion of one of the metals at a rate roughly proportional to the electrode potential:
-- Gold against copper, -440 mV, copper erodes,
-- Tin against copper, 220 mV, tin erodes.
nickel is intermediate between gold and copper, very close to copper.

When a conductive grid is exposed outside, it collects dust and aerosols that increase the conductivity and response to high humidity and to light dew. Heavy rainfall will wash much of that off and reset the response to the clean level. It makes it hard to distinguish a light rain from high humidity, but if you are also measuring dew point, you can sort that out, but take care for the sky exposure, you know, cold sky. Crud on the sensor may exacerbate corrosion, particularly if the crud contains stuff like sulfur, as is common in agricultural settings.

Painting with flat latex paint is a usual practice for this type of sensor. It keeps surface contaminants away from direct contact with the bare metals and evens out the response. I add a small amount of gypsum to the paint in order to act as a chemical buffer, to counteract the effects of the external crud. I'm not sure what the effect of the paint is on the corrosion. It might slow it down by constraining the movement of ions, or not, an unresolved question.

A capacitance sensor to respond to the dielectric constant of water would be just like your existing grid, maybe with finer 8 mil traces. Add a 100% solder mask to insulate the traces. Even green to mimic a leaf. Paint it? The artificial leaf is then a capacitor of ~100pF, increasing dramatically when wet. Decagon makes a leaf wetness sensor based on the dielectric principle: www.decagon.com/canopy/leaf_wetness/ (http://www.decagon.com/canopy/leaf_wetness/)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com (http://www.emesystems.com)

Post Edited (Tracy Allen) : 10/22/2009 7:18:56 PM GMT

everest
10-23-2009, 03:36 AM
Thanks Tracy,

I wonder if I couldn't create a capacitance sensor with the existing wet leaf sensors I have have. . .? Are there any restrictions on the type of pain I need to use that you can think of? I'm going to pick up some solder mask today. I want to try many different approached to this problem to make sure I have the best and most durable possible solution moving forward.

-Jeff

Beau Schwabe
10-23-2009, 03:50 AM
everest,

The capacitor method would be the best approach in terms of longevity. Designing a optimal circuit will depend of what the capacitance range is of the sensor itself.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

everest
10-23-2009, 04:15 AM
Yea, building the actual capacitor/sensor is the tricky part. . .I'm still pretty much in the dark on how exactly to do that, although it sounds like painting my existing wet leaf sensor with solder mask and some kind of paint might actually create a small capacitor that would work. . .I have a few spares, so I guess I'll just test it out and see!

-Jeff

Tracy Allen
10-23-2009, 07:21 AM
Solder mask is a crosslinked polymer, UV or heat cured, a specialty item for PC board manufacturing, and it is tough stuff. I don't know quite where you might pick some up locally. A conformal coating might work, or lacquer or epoxy enamal. Maybe bond on a thin layer of plastic like Saran wrap.

I just took one of my grids, and coated it with a thin layer of GC silicone resin, and while still tacky laid on generic 0..5 mil polyethylene plastic wrap. Dry capacitance 50 pF, wet capacitance 200-500 pF. However, after a few minutes it quit and started reading 20kOhms DC resistance. Maybe there was a pinhole in the plastic. I guess the lesson is that the coating has to be good and stable.

Latex paint is permeable to water and cannot be used as insulation. On leaf wetness sensors it is used to spread out the response and to hold the water instead of allowing it to bead up. I think there would still be a place for flat exterior latex paint on top of the insulating layer, also to protect the soldermask from UV, and to isolate it from dust and other crud.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com (http://www.emesystems.com)

everest
10-23-2009, 08:42 AM
I'm testing my painted sensor, and honestly. . .measuring the resistance leveraging 5 volts, through 5 million ohms of resistors (and don't forget the painted sensor). . .honestly I can't see corrosion being a problem for this thing in anyone's lifetime. I can't find any formula for calculating corrosion rates at a given current/voltage/material but this current is so small I can't even pick it up with my volt meter. Apparently the Stamp2 can see the voltage though, so it's working

I'm going to leave this up on the roof running 24x7 for a few weeks and see what happens. Then I'll start trying some more elaborate solutions an boards. I've got 3 EME units on the way (Thanks Tracy!!) so I'm all set with those if necessary.

-Jeff

steambc
11-02-2009, 04:56 AM
Wow, this thread is bringing back memories.

When I was a kid, I made a super high-tech rain sensor and it worked great.

I took a wooden clothes pin and wrapped some bare wire around the ends that normally touch together because of the spring pressure. I hooked the wires up to a buzzer, and then placed an aspirin between the contacts. When it rained, the aspirin would quickly dissolve, the contacts would close, and the buzzer would sound.

How's that for an elegant solution? http://forums.parallax.com/images/smilies/wink.gif

It actually worked very well. I tried to sell the idea to NASA for their recent bombing run on the moon (where they crashed a rocket into the moon and then sent a device through the dust that was kicked up in order to find moisture), but they foolishly declined. Have you ever read of a clothes pin failing in outer space? I thought not.

Brian