Jump to content

Interfacing a Soil Moisture Sensor

Recommended Posts



I'm starting the development of a wireless sensor network using the ez430-rf2500 kit. My goal is to measure soil humidity with a soil moisture sensor in each device of the network. The soil moisture sensor i'm using is the following: http://www.dfrobot.com/index.php?route=product/product&filter_name=soil%20moisture&product_id=599 . 


I'm having trouble integrating this sensor with the ez430-rf2500. I'm using the Temperature Sensor Monitor Demos as a basis for my project. But i don't understand this formula: degC = (((temp - 673) * 4230) / 1024); which converts the value read by the sensor! Is there any formula i could apply to my case?


So far I've done the C code, except the formula above. What more do i have to do?


Thanks in advance!

Best regards!

Link to post
Share on other sites
  • 3 weeks later...

 I've tested it but the read values are not in the range which is given in the moisture sensor wiki. 

It is suppose to be something like this:

Value range:

  1. 0 ~300 : dry soil
  2. 300~700 : humid soil
  3. 700~950 : in water
But in my case i get the value of 78 when the sensor is OUT of the water and a value of 113 when the sensor is IN the water! What am i doing wrong?
My code is the following:
ADC10CTL0 = ADC10IE + ADC10ON + ADC10SHT_2 + SREF_0;
for( degC = 240; degC > 0; degC-- ); // delay to allow reference to settle
ADC10CTL0 |= ENC + ADC10SC; // Sampling and conversion start
__bis_SR_register(CPUOFF + GIE); // LPM0 with interrupts enabled
results[2] = ADC10MEM;
I do not use any conversion formula! It is suppose to?
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...