Hi,
I am using capacitive soil moisture sensors with the ratings as shown in the attachment in order to monitor my soil water levels.
When I hook up sensors identically to the attached circuit, the first three sensors give out correct readings, however the fourth sensor starts giving out random values. I would like to know if anyone has worked with a similar setup and experienced a similar problem and maybe a way around it.
I used the following code. I have tried doing multiple analogRead() values and giving a delay in order to allow the ADC of the arduino uno to comply, but this has not solved the issue.
void setup(){
// put your setup code here, to run once:
Serial.begin(9600); //com enable
int sensorValue1 = analogRead(A1);
int sensorValue2 = analogRead(A2);
int sensorValue3 = analogRead(A4);
int sensorValue4 = analogRead(A5); //assigning analog pins
int moist1;
int moist2;
int moist3;
int moist4; //variables for calculations
}
void loop(){
int moist1 = analogRead(A1);
delay(10);
moist1 = analogRead(A1); //take reading 1
Serial.print("sensor 1's reading: ");
Serial.println(moist1);
delay(500); //delay to allow ADC
int moist2 = analogRead(A2);
delay(10);
moist2 = analogRead(A2); //take reading 2
Serial.print("sensor 2's reading: ");
Serial.println(moist2);
delay(500);
int moist3 = analogRead(A4);
delay(10);
moist3 = analogRead(A4); //take reading 3
Serial.print("sensor 3's reading: ");
Serial.println(moist3);
delay(500);
int moist4 = analogRead(A5);
delay(10);
moist1 = analogRead(A1); //take reading 4
Serial.print("sensor 4's reading: ");
Serial.println(moist4);
delay(500);
}