VMA303 calibration issues

Hi all,

I just bought package of water level sensor and a soil moisture sensor. But when connected directly to arduino nano and running some basic code to check whether the data makes sense, I ran in the following issues:

  • humidity sensor: when dry returns a value of 0, but when fully in water returns a value of 627. Not sure what units are those, but I was expecting that it would be 100% humidity level. Is there any constant we need to use to make sure that it reads the data correctly?
  • same thing with water level, the sensor itself is only 4cm long, but gives a value of 505 when in water.

Anyone had similar issues. Pls let me know if and how you have resolved it.

Thanks
Sasha

Dear,

This is normal. the readout is a value of the ADC converter.
You need to remap it to a percentage.

So in normal way the Soil moisture sensor gives us a value from 0 to 1023. The moisture is measured in percentages, So we will map these values from 0 to 100, and then show them on the serial monitor.

This is also the same for water level sensor. see this: https://lastminuteengineers.com/water-level-sensor-arduino-tutorial/ & this for percentage: https://scidle.com/how-to-use-a-water-level-sensor-module-with-arduino

For Soil moisture sensor:

in arduino code:

output_value= analogRead(sensor_pin);
output_value = map(output_value,550,0,0,100);

Complete code:

int sensor_pin = A0; 
int output_value ;

void setup() {
  Serial.begin(9600);
  Serial.println("Reading From the Sensor ...");
  delay(2000);
  }

void loop() {

  output_value= analogRead(sensor_pin);
  output_value = map(output_value,550,0,0,100);
  Serial.print("Mositure : ");
  Serial.print(output_value);
  Serial.println("%");
  delay(1000);
  }

Water Level sensor:

 sensorValue = analogRead(analogInPin); 
 
 Serial.print("Sensor = " ); 
 Serial.print(sensorValue*100/1024); 
 Serial.println("%");

Complete code:

const int analogInPin = A0; 
 
int sensorValue = 0;
 
void setup() {
 Serial.begin(9600); 
}
 
void loop() {
 sensorValue = analogRead(analogInPin); 
 
 Serial.print("Sensor = " ); 
 Serial.print(sensorValue*100/1024); 
 Serial.println("%");
 
 delay(1000); 
}

I hope to have informed you sufficiently.

Best regards,
Velleman Support

Thank you for your answer, very helpful. May I clarify a couple of points?

  1. Soil Sensor: Are you saying that the maximum value this particular soil sensor can return is 1024? If yes, why when in water it shows value of 627 only? Does it mean that the sensor is not working properly?

  2. Soil Sensor code:
    Given the above, shouldn’t the code be rather then

output_value= analogRead(sensor_pin);
output_value = map(output_value,0,627,0,100);

Thank you
Sasha