Same values whether I dip the moisture sensor in water or not
Posted: Wed May 29, 2019 1:36 pm
I am following example esp-idf/examples/peripherals/adc/ and copied exactly the code in adc1_example_main.c in my project. But somehow I am getting same values as below whether I dip the moisture sensor in water or not.
I am using ESP32 development board,esp-idf 3.2 (recent release), and connections are as below:
Moisture sensor ESP32 DevBoard
VCC ------------------> 3V3
GND ------------------> GND
A out ------------------> GPIO34 (as code is using ADC_CHANNEL_6)
If I use Arduino IDE for analog read, I get correct results (different values when moisture sensor is dipped and undipped in water) with same hardware configuration.
I spent lot of time, but couldn’t figure out what I am doing wrong.
Any guess please.
Code: Select all
eFuse Two Point: NOT supported
eFuse Vref: NOT supported
Characterized using Default Vref
Raw: 4095 Voltage: 1039mV
Raw: 4095 Voltage: 1039mV
Raw: 4095 Voltage: 1039mV
Raw: 4095 Voltage: 1039mV
Raw: 4095 Voltage: 1039mV
Raw: 4095 Voltage: 1039mV
Raw: 4095 Voltage: 1039mV
Raw: 4095 Voltage: 1039mV
.
.
.
Moisture sensor ESP32 DevBoard
VCC ------------------> 3V3
GND ------------------> GND
A out ------------------> GPIO34 (as code is using ADC_CHANNEL_6)
If I use Arduino IDE for analog read, I get correct results (different values when moisture sensor is dipped and undipped in water) with same hardware configuration.
I spent lot of time, but couldn’t figure out what I am doing wrong.
Any guess please.