Testing Components: Soil Moisture Sensor.
These are the connections -
Vcc(Sensor) - 5V (probe),
Gnd(sensor) - Gnd (probe),
AO(sensor) to Pin02 (bluey)
And i used this code:
adc_val = simple_adc_get_value(SIMPLE_ADC_GAIN4, ANALOG_PIN_2);
tfp_printf("1. ADC output is %d \n", adc_val);
adc_check = & check_adc;
ms_timer_start(MS_TIMER0, MS_REPEATED_CALL, RTC_TICKS_MS(500), adc_check);
What i expected:
some reading (of some range) when the soil moisture sensor in water and like 0 when it is out of water
What i got:
the same reading when the moisture sensor is in water or out of water (4095) !!
Other trouble shooting:
1) I connected the AO (moisture sensor) to a different analog pin (PIN 03/ PIN 04). Interestingly i got the same value (4095) when i should not have got any value
2) I removed the connection from moisture sensor to the bluey board, I still get the same value (4095)
@prithvirajnarendra - what am i missing. I seem to have forgotten something from the ADC class Help !