What can I do to get consistent readings from moisture sensor?

Zeni241
Posts: 86
Joined: Tue Nov 20, 2018 4:28 am

What can I do to get consistent readings from moisture sensor?

Postby Zeni241 » Wed Mar 06, 2019 12:23 pm

I am using example of adc in asp idf 3.2, as given here https://github.com/espressif/esp-idf/tr ... erals/adc .
I am using Esp32 devkit v1 and my moisture sensor is identical to this https://www.aliexpress.com/item/Free-Sh ... st=ae803_4

The output is very anticlimax. :o :shock: :o :(
Question is what can I do to get consistent readings? :roll: :roll:

Below readings are when sensor is in the air.

eFuse Two Point: NOT supported
eFuse Vref: Supported
Characterized using eFuse Vref
Raw: 0 Voltage: 75mV
Raw: 0 Voltage: 75mV
Raw: 420 Voltage: 172mV
Raw: 4072 Voltage: 1015mV
Raw: 1219 Voltage: 356mV
Raw: 0 Voltage: 75mV
Raw: 3768 Voltage: 945mV
Raw: 1646 Voltage: 455mV
Raw: 3 Voltage: 76mV
Raw: 4082 Voltage: 1017mV
Raw: 0 Voltage: 75mV
Raw: 1667 Voltage: 460mV
Raw: 1620 Voltage: 449mV
Raw: 150 Voltage: 110mV
Raw: 2850 Voltage: 733mV
Raw: 0 Voltage: 75mV
Raw: 3744 Voltage: 939mV
Raw: 0 Voltage: 75mV
Raw: 4095 Voltage: 1020mV
Raw: 0 Voltage: 75mV
Raw: 4095 Voltage: 1020mV
Raw: 0 Voltage: 75mV
Raw: 3343 Voltage: 847mV
Raw: 256 Voltage: 134mV
Raw: 2029 Voltage: 543mV
Raw: 932 Voltage: 290mV
Raw: 1153 Voltage: 341mV
Raw: 1490 Voltage: 419mV
Raw: 514 Voltage: 194mV
Raw: 2028 Voltage: 543mV
Raw: 139 Voltage: 107mV
Raw: 2544 Voltage: 662mV
Raw: 15 Voltage: 78mV
Raw: 2984 Voltage: 764mV
Raw: 0 Voltage: 75mV
Raw: 3425 Voltage: 866mV
Raw: 0 Voltage: 75mV
Raw: 3975 Voltage: 993mV
Raw: 0 Voltage: 75mV
Raw: 4095 Voltage: 1020mV
Raw: 0 Voltage: 75mV
Raw: 4095 Voltage: 1020mV
Raw: 0 Voltage: 75mV
Raw: 3739 Voltage: 938mV
Raw: 30 Voltage: 82mV
Raw: 3005 Voltage: 769mV
Raw: 277 Voltage: 139mV
Raw: 2379 Voltage: 624mV
Raw: 557 Voltage: 204mV
Raw: 1988 Voltage: 534mV
Raw: 755 Voltage: 249mV
Raw: 1727 Voltage: 474mV
Raw: 966 Voltage: 298mV
Raw: 1469 Voltage: 414mV
Raw: 1122 Voltage: 334mV
Raw: 1271 Voltage: 368mV
Raw: 1255 Voltage: 365mV
Raw: 1145 Voltage: 339mV
Raw: 1344 Voltage: 385mV
.
.
.
.
.
.
.
.
.

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: What can I do to get consistent readings from moisture sensor?

Postby fly135 » Wed Mar 06, 2019 7:21 pm

Looks like the voltage maps to ADC values pretty consistently. Are you asking why the voltage is changing so much?

John A

Zeni241
Posts: 86
Joined: Tue Nov 20, 2018 4:28 am

Re: What can I do to get consistent readings from moisture sensor?

Postby Zeni241 » Thu Mar 07, 2019 3:28 am

Thanks for reply. Yes, I want to know why it is changing so wildly when the condition of moisture sensor is static.
Shouldn't it give same value ideally?

Zeni241
Posts: 86
Joined: Tue Nov 20, 2018 4:28 am

Re: What can I do to get consistent readings from moisture sensor?

Postby Zeni241 » Thu Mar 07, 2019 9:27 am

Attaching a 0.1 micro farad non polar capacitor between GPIO and sensor made a lot of difference.

Can someone please lead me to industrial moisture sensor circuit resources?

Reading while moisture sensor in air:

eFuse Two Point: NOT supported
eFuse Vref: Supported
Characterized using eFuse Vref
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw: 4095 Voltage: 1020mV
Delay 3000
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw: 4095 Voltage: 1020mV
Delay 3000
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw value=4095
Raw: 4095 Voltage: 1020mV
Delay 3000
Raw value=4095
Raw value=4095

And when dipped in water:

Raw: 351 Voltage: 156mV
Raw: 376 Voltage: 162mV
Raw: 337 Voltage: 153mV
Raw: 328 Voltage: 151mV
Raw: 316 Voltage: 148mV
Raw: 345 Voltage: 155mV
Raw: 337 Voltage: 153mV
Raw: 339 Voltage: 153mV
Raw: 350 Voltage: 156mV
Raw: 355 Voltage: 157mV
Raw: 342 Voltage: 154mV
Raw: 329 Voltage: 151mV
Raw: 320 Voltage: 149mV
Raw: 335 Voltage: 152mV
Raw: 338 Voltage: 153mV
Raw: 336 Voltage: 153mV
Raw: 337 Voltage: 153mV
Raw: 359 Voltage: 158mV
Raw: 370 Voltage: 160mV
Raw: 360 Voltage: 158mV
Raw: 366 Voltage: 159mV
Raw: 369 Voltage: 160mV
Raw: 361 Voltage: 158mV
Raw: 349 Voltage: 156mV
Raw: 355 Voltage: 157mV
Raw: 334 Voltage: 152mV
Raw: 339 Voltage: 153mV
Raw: 328 Voltage: 151mV
Raw: 336 Voltage: 153mV
Raw: 352 Voltage: 156mV
Raw: 363 Voltage: 159mV
Raw: 355 Voltage: 157mV
Raw: 352 Voltage: 156mV
Raw: 352 Voltage: 156mV
Raw: 361 Voltage: 158mV
Raw: 352 Voltage: 156mV
Raw: 351 Voltage: 156mV
Raw: 363 Voltage: 159mV
Raw: 369 Voltage: 160mV
Raw: 368 Voltage: 160mV
Raw: 370 Voltage: 160mV
Raw: 403 Voltage: 168mV
Raw: 377 Voltage: 162mV
Raw: 352 Voltage: 156mV
Raw: 361 Voltage: 158mV
Raw: 366 Voltage: 159mV
Raw: 374 Voltage: 161mV
Raw: 374 Voltage: 161mV
Raw: 352 Voltage: 156mV
Raw: 362 Voltage: 159mV
Raw: 387 Voltage: 164mV
Raw: 378 Voltage: 162mV
Raw: 396 Voltage: 166mV
Raw: 402 Voltage: 168mV
Raw: 403 Voltage: 168mV
Raw: 395 Voltage: 166mV
Raw: 408 Voltage: 169mV
Raw: 429 Voltage: 174mV
Raw: 385 Voltage: 164mV
Raw: 375 Voltage: 162mV
Raw: 385 Voltage: 164mV
Raw: 388 Voltage: 165mV
Raw: 381 Voltage: 163mV
Raw: 365 Voltage: 159mV
Raw: 365 Voltage: 159mV
Raw: 364 Voltage: 159mV
Raw: 369 Voltage: 160mV
Raw: 376 Voltage: 162mV
Raw: 374 Voltage: 161mV
Raw: 357 Voltage: 157mV
Raw: 371 Voltage: 161mV
Raw: 369 Voltage: 160mV
Raw: 344 Voltage: 154mV
Raw: 345 Voltage: 155mV
Raw: 350 Voltage: 156mV
Raw: 326 Voltage: 150mV
Raw: 317 Voltage: 148mV
Raw: 336 Voltage: 153mV
Raw: 361 Voltage: 158mV
Raw: 324 Voltage: 150mV
Raw: 362 Voltage: 159mV
Raw: 350 Voltage: 156mV
Raw: 339 Voltage: 153mV
Raw: 369 Voltage: 160mV
Raw: 345 Voltage: 155mV
Raw: 360 Voltage: 158mV
Raw: 373 Voltage: 161mV
Raw: 352 Voltage: 156mV
Raw: 365 Voltage: 159mV
Raw: 375 Voltage: 162mV
Raw: 365 Voltage: 159mV
Raw: 340 Voltage: 153mV
Raw: 372 Voltage: 161mV
Raw: 362 Voltage: 159mV
Raw: 361 Voltage: 158mV
Raw: 373 Voltage: 161mV
Raw: 367 Voltage: 160mV
Raw: 376 Voltage: 162mV
Raw: 392 Voltage: 165mV
Raw: 371 Voltage: 161mV
Raw: 382 Voltage: 163mV
Raw: 407 Voltage: 169mV
Raw: 372 Voltage: 161mV
Raw: 387 Voltage: 164mV
Raw: 404 Voltage: 168mV
Raw: 382 Voltage: 163mV
Raw: 387 Voltage: 164mV
Raw: 397 Voltage: 167mV
Raw: 381 Voltage: 163mV
Raw: 397 Voltage: 167mV
Raw: 368 Voltage: 160mV
Raw: 369 Voltage: 160mV
Raw: 369 Voltage: 160mV
Raw: 353 Voltage: 156mV
Raw: 353 Voltage: 156mV
Raw: 356 Voltage: 157mV
Raw: 357 Voltage: 157mV
Raw: 386 Voltage: 164mV
Raw: 380 Voltage: 163mV
Raw: 389 Voltage: 165mV
Raw: 390 Voltage: 165mV
Raw: 373 Voltage: 161mV
Raw: 385 Voltage: 164mV
Raw: 366 Voltage: 159mV
Raw: 375 Voltage: 162mV

Who is online

Users browsing this forum: MicroController and 156 guests