DIY Touch Sensor/Switch ESP8266 | Node MCU

NodeMCU has a single ADC(Analog to Digital Converter) input which is not enough for big complex projects but is definitely enough for small projects which require a single analog sensor or even a simple switch. The in-built analog-to-digital converter of NodeMCU has 10 bit range i.e it gives value between 0 to 1024 and can take maximum input of 3.3v .So 0v input or GND returns value 0 at ADC pin and 3.3v returns 1024.

Now this analog-to-digital converter is very sensitive .It can sense close circuit between itself and the 3.3v pin of the NodeMCU and can return values according to the resistance between them. This can be used for a switching action or even brightness control of a LED. And such a switch can be made easily without any extra parts.”

Link