Page 1 of 1

[HELP] ADC not stable.

Posted: Tue Jan 26, 2021 11:15 am
by fahad_ali_sarwar
I have a humidity analog sensor that I am trying to read. The sensor outputs a 4-20 mA signal. I converted it into a 0 - 3.3V potential with a 165 Ohm resistor. When I measure the voltage across the resistors with a multimeter, I get the correct values. I get a voltage of around 2.9V which corresponds to about 87 % humidity which seems to be correct. However the values of ADC are haywire. I get values between 2500 to 4095, which correspond to between 61 % and 100 % humidity. The sensor is quite accurate so its not a problem with the sensor. I am using ADC on pin 25.
My circuit is shown as an attachment..
I have also attached the values of ADC measured/

Re: [HELP] ADC not stable.

Posted: Tue Jan 26, 2021 8:11 pm
by Michalpu
What is the refresh rate of your sensr and what regresh rate you have in code

Re: [HELP] ADC not stable.

Posted: Wed Jan 27, 2021 12:29 am
by ESP_Sprite
Also you probably want to parallel a small capacitor to that resistor, to get rid of any noise.

Re: [HELP] ADC not stable.

Posted: Sun Jan 31, 2021 5:57 am
by becorey
1) use RC low pass filter after your 165 Ohm resistor, filter out frequencies higher than the rate you expect the humidity to change.
2) use averaging in code, i.e. average 20 samples to get one "good" sample value
3) the adc value to voltage conversion is not 2500/4095*3.3, it needs to use the adc vref calibration value which is slightly different for each esp32. It turns out to be near 3.6 instead of 3.3.

Read https://docs.espressif.com/projects/esp ... 5%20-%2027).