Shop OBEX P1 Docs P2 Docs Learn Events
Rain Sensor - HELP! — Parallax Forums

Rain Sensor - HELP!

everesteverest Posts: 141
edited 2009-11-01 20:56 in BASIC Stamp
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
678 x 484 - 51K

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-10-21 05:16
    Have you tried to lower the current?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-21 05:22
    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.
  • everesteverest Posts: 141
    edited 2009-10-21 15:12
    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 [noparse]:([/noparse]

    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
  • LeonLeon Posts: 7,620
    edited 2009-10-21 18:22
    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 AllenTracy Allen Posts: 6,662
    edited 2009-10-21 19:09
    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 integrated weather module.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • everesteverest Posts: 141
    edited 2009-10-21 20:58
    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
  • LeonLeon Posts: 7,620
    edited 2009-10-21 22:21
    Yes. You'd be better off with a Propeller.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • everesteverest Posts: 141
    edited 2009-10-21 23:31
    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
  • everesteverest Posts: 141
    edited 2009-10-22 05:19
    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 SchwabeBeau Schwabe Posts: 6,560
    edited 2009-10-22 06:54
    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

    IC Layout Engineer
    Parallax, Inc.
    773 x 887 - 175K
  • everesteverest Posts: 141
    edited 2009-10-22 17:43
    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 [noparse]:)[/noparse] 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
  • everesteverest Posts: 141
    edited 2009-10-22 17:52
    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! [noparse]:)[/noparse]

    -Jeff
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2009-10-22 19:13
    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/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 10/22/2009 7:18:56 PM GMT
  • everesteverest Posts: 141
    edited 2009-10-22 19:36
    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 SchwabeBeau Schwabe Posts: 6,560
    edited 2009-10-22 19:50
    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

    IC Layout Engineer
    Parallax, Inc.
  • everesteverest Posts: 141
    edited 2009-10-22 20:15
    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 AllenTracy Allen Posts: 6,662
    edited 2009-10-22 23:21
    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
  • everesteverest Posts: 141
    edited 2009-10-23 00:42
    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
  • steambcsteambc Posts: 11
    edited 2009-11-01 20:56
    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? 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
Sign In or Register to comment.