-->
Page 6 of 6

Re: Reading a soil moisture sensor using a ESP-12-F

PostPosted: Thu Mar 03, 2016 12:10 pm
by martinayotte
Slower baudrate in both sketches, but upload firmware will still be at 115200.

Re: Reading a soil moisture sensor using a ESP-12-F

PostPosted: Sat Apr 02, 2016 8:55 am
by pickman
I'm trying ro read a analog sensor value in esp12 with Lua 5.1.4 on SDK 1.4.0, but I have two problems:

1. The command adc.read(0) always return 65535 ¿? (I put 0v or 1v in the pin ADC and return the same value)

2. When I use a voltage divider with R:470 / R:220 with the soil moisture sensor (YL-69) It returns 0,22 v in the water and out of water

Somebody can help ?

Thanks !
Rodrigo

Re: Reading a soil moisture sensor using a ESP-12-F

PostPosted: Sun Jun 05, 2016 8:51 am
by RinusW
If the adc.read(0) command always returns 65535, this means the ESP is in readvdd33() mode. You need to put the adc in the other mode. See http://nodemcu.readthedocs.io/en/dev/en/modules/adc/ for the adc.force_init_mode() function. Especially look at the example given.

Re: Reading a soil moisture sensor using a ESP-12-F

PostPosted: Mon Apr 27, 2020 7:51 am
by masoud8152
Please consider that if you are using the module the input of A0 is 0-1 volt, if you are using Devkit it is 0-3.3v.