Using analog input on NodeMCU ESP8266


hallo,

im not quite shure model of nodemcu esp8266 ive got, adruino ide works model esp-12e included in link.
its black esp chip on black breakout board.
im trying use analog input a0. many websites uses voltage of 1v analog reference. ive builded voltage divider 3.3v 1.1v. when connect 1.1v analog input pin a0 values of 321.
so connected 3.3v pin (messured 2.28v) a0 pin , still got values less 1000.

i used simple sketch testing:
code: [select]

void setup() {
  serial.begin(9600);
  delay(1000);
  serial.println(f("setup"));
}

void loop() {
  serial.println(analogread(a0));
  delay(1000);
}

any ideas im doing wrong?

thanks help!

ive tried same sketch mentioned before black esp8266 dev kit (ch340g wemos.cc lolin new nodemcu v3).
analogread(a0) returns value of 3 when a0 connected gnd. shouldnt 0???
original nodemcu dev kit returns values between 0 , 3 when a0 connected gnd.
when power on 1 of dev kits there new wlan network, sketch not start network. normal?
does wlan network interfere analog readings?

pin mapping:

original  |  lolin node mcu v3

a0                              |  a0
rsv                           |  g
rsv ->messured 0v    |  vu -> messured 4.97v
sd3                           |  s3
sd2                           |  s2
sd1                           |  s1

when connect vu pin of lolin dev kit a0 value of 1024. when connect vin pin of orig. nodemcu dev kit a0 value of 1024. analog reference has greater 3,3v.
how can change it???
analogreference(internal) not work.


Arduino Forum > Using Arduino > Microcontrollers > Using analog input on NodeMCU ESP8266


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor