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

Moderator: igrr

User avatar
By pickman
#44676 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
User avatar
By RinusW
#48616 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.