1
\$\begingroup\$

I recently bought a moisture sensor off eBay (one of those Chinese YL-69 like can be seen here) and my original plan was to use it with an Arduino board. However, after much experimenting I realize there is a chance my sensor was broken, so before I go back to eBay to complain, I would very much appreciate expert advice.

Because the readouts were so wonky, I decided to perform the simplest test: plug the YL-69 to the also included YL-38 (as can be seen here), power the YL-38 (it has on one side VCC, GND, D0 and A0 and on the other side two input pins to plug to the YL-69) and this YL-38 lights up a blue LED just by having current flowing through it. Additionally, depending on the resistance applied on the two IN pins and depending on the potentiometer's adjustment, it will light up a red LED once the resistance to the IN pins crosses the threshold defined by the potentiometer.

From what I was able to read online, normally, by sticking the YL-69 on water, it should cause the resistance at the IN pins to be almost nil and thus the red LED would stay lit for as long as this is happening. However, what happens is that as soon as I stick the YL-69 in water (not completely obviously), the red LED comes up for a while (indicating that the water had an effect in lowering resistance) but after just 2 or 3 seconds it turns back off.

This is consistent to when I was reading the A0 values with the Arduino. I was getting what I sometimes thought was the right reading but it would always level out back to 300-ish.

My question is: is my YL-69 sensor broken? Thanks in advance!

\$\endgroup\$
  • 1
    \$\begingroup\$ This looks a lot like a duplicate of electronics.stackexchange.com/questions/90725/… . Basically, long story short, those kinds of sensors are crap, don't work very well, and there are all sorts of fun galvanic issues due to the fact that the metal on the tines are subject to lots of fun electrochemical issues. \$\endgroup\$ – Connor Wolf Apr 6 '14 at 6:24
1
\$\begingroup\$

I think the device that you purchase is a “dew sensor” (ON-OFF), and not a humidity measurement device. Then you have to specify what humidity you want to measure: the absolute, the relative or the specific humidity? See here

The most common used is the relative humidity (%RH). In this case, temperature should be considered. A typical sensor for this measurement you can see bellow

enter image description here

For specific application please see Si7005 from Silicon Labs

\$\endgroup\$
  • \$\begingroup\$ It's not a dew sensor or a humidity sensor. It's a soil moisture sensor. It's got tines you stick in the dirt. \$\endgroup\$ – Connor Wolf Apr 6 '14 at 7:27
  • \$\begingroup\$ Indeed, @ConnorWolf is right. As far as I understand it's basically two conductive pieces of metal and the more humid the soil is, the easier it is for the current to flow from one tine to the other. What baffles me is that such a device can "break" but from reading it seems it can be caused by corrosion... \$\endgroup\$ – Tiago Espinha Apr 6 '14 at 8:44
  • \$\begingroup\$ @Tiago Espinha Right. As far as the current that is applied to the electrodes is DC, corrosion layer established soon after switch ON. Or is an AC current? \$\endgroup\$ – GR Tech Apr 6 '14 at 10:23
  • \$\begingroup\$ @GRTech I'm applying 5V DC to the YL-38 which then connects to the moisture sensor... I suppose it's all DC. Do you think this could be the problem? Would electrolysis set in just seconds after I plug it in? \$\endgroup\$ – Tiago Espinha Apr 7 '14 at 7:08
  • \$\begingroup\$ @Tiago Espinha As far as I remember, 2V it is adequate to start electrolysis of the water + salts (for pure water is about 1.2V). The time needed to formate a layer Xmm of oxidation, related with the applied current, the solution etc, and it is a subject of electrochemistry and stoichiometry. \$\endgroup\$ – GR Tech Apr 7 '14 at 8:16
1
\$\begingroup\$

water+metal causes rust (iorn oxide) or oxidation in general happens when metal is subjected to moisture or air. Electricity is a catalyst in that equation. Meaning, electricity will speed up the oxidation reaction between the metal and water. A quick rub with sand paper or even scraping the sensor with another metal to make it "shiney" again would "fix" That sensor. One thing I might do is use a digital out pin from your controller to the power pin of the yl-38. That way you don't keep electricity going through the circuit all the time. Just make sure to put in a time delay after turning on the yl-38 before reading the analog out from the yl-38 to an analog input on the MCU.

A separate possible solution is that the water is a poor conductor. Water is not always conductive if it does not have minerals (free electrons via minerals). Try salt water compared to distilled and there will be a difference.

Lastly you are wrong that the value should be nil. In the other guides online people saw 300 for a wet cloth, 500 for a damp cloth 900 for a finger and 1040 for air. You will only see 0 (almost zero) if metal is the conductor. Water has a little more resistance and is less of a conductor then metal so 300 sounds like the correct value for this sensor.

Lastly from the IC that is on the yl-38, what you have is an op-amp IC (rated for 2-30volts) where one op amp is set up as a comparator and the other is an amp configuration (i didn't trace the circuit I made an assumption here). At 5Volts your not going to hurt that op amp.

Did you check the voltage going out of the yl-38 at the DO and AO pin? Were they 5V or less? Are your connections good? Are you using more that a foot of wire(that will act as an antenna and pick up noise from the air)? Are the grounds from your MCU and Yl-38 connected?

oh well this is a dead post but I thought I would post for the lurkers

\$\endgroup\$
0
\$\begingroup\$

From what I an tell, this is intended to test your house plants to see if you are giving the proper watering shedual. It is readable by an arduino and can display the readout on the arduino software on your PC using the serial monitor built into the software.

void setup(){
  Serial.begin(9800);
}

void loop(){

  Serial.print("Moisture Sensor Value:");
  Serial.println(analogRead(5));
  delay(1000);
} 

is a sketch that should get you going.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.