Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By mojESP8266
#39035 Hi,

so i have decided to try moisture sensor(YL-69) with my ESP-12. Let me just say that i have already tried it with arduino and it works.

But with ESP i have problem with analog pin.

My MS(moisture sensor) is using 3.3V and i know that ESP analog pin needs around 1.1V?

if i connect it directly without any dropdown voltage manipulation than i get always data 1024.
if insert between MS(analog pin) and ESP-ACD pin dropdown voltage(to around 1.1v) than i see in serial monitor numbers around 100-140points. If i put MS in water i get around 80points.
Not sure if this is ok or not but it should be on scale from 0 -1023?

what am i doing wrong here ...
User avatar
By mojESP8266
#39042
WereCatf wrote:How, exactly, do you drop the voltage? A simple voltage-divider should be the way to go.


YL-69:
1st pin (VCC): 3.3V
2nd pin (Gnd)
3rd pin (D0): /
4th pin (A0): voltage divider. I added 1k R1 and 510 R2 (output around 1.115V); is this ok?

results are the same... i got values around 70-120 range and not 0-1023.
User avatar
By WereCatf
#39046 It's 1.0V, not 1.1V, but yeah, it sounds like your setup is fine and the issue lies with your code instead. I don't have one of these moisture-sensors, but when connecting to a "real" Arduino-board you're getting values in the range of 0-1023? Mind showing your sketch?