Potential Problem Reading VCC on NodeMCU



  • Hi All,
    On a NodeMCU Ver1, I was having problems with analogRead(A0) returning 65535 no matter what voltage I applied to the ADC pin?

    In researching the cause, I discovered that having MY_DEBUG and/or MY_SPECIAL_DEBUG defined causes the ADC_MODE to be configured by MySensors to read the CPU VCC and thus AnalogRead(A0) returns 65535 as a 'reminder' that the ADC port is not available, Fair enough....

    However, in my reading I noted that for the ESP8266 to read VCC correctly, the ADC pin must remain unconnected (floating). Here is where I see a potential MySensors problem, all the latest NodeMCU Ver 1 boards that I have been receiving have a resistor divider, making the ADC input range 0 to 3.3 Volts, therefore the MySensors VCC reading will not be reliable on these boards and there is no config setting etc that can resolve this.

    I've made this post to draw attention to this as I've not seen it addressed anywhere before (despite a full day's researching the issue (see references below).

    Perhaps one of the ArduinoESP8266 core developers can shed more light on this.

    Regards,

    Paul

    Background Reading:

    Bug Issues: #338 #575 #695 #696 #2672 #3168 #4009

    https://forum.mysensors.org/topic/5547/wemos-d1-mini-esp8266-mysensors-and-analog-a0/6


 

387
Online

7.6k
Users

8.5k
Topics

91.3k
Posts