-->
Page 1 of 1

Analog pin on node mcu 1.0 (esp 12F) in range 0-3.5V??

PostPosted: Sat Jun 24, 2017 4:12 am
by Bilz
Hi,
I read on the esp 12F datasheet that the ADC pin reads between 0 - 1V. Also, anything I've found online referring to the nodemcu or the esp states that it has a 0-1V range and a 10 bit resolution. However, I'm having some curious problems....

I recently bought the module and I've been flashing it with the arduino IDE. Here is my test code:

Code: Select allconst byte ADC = A0;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  int reading = analogRead(ADC);
  Serial.println(reading);
  delay(3000);
}

The problem: For some reason, I'm struggling to get a reading of 1024. I've unplugged everything and then connected the A0 pin to the GND and I get a reading of about 8. I'll say that's okay. However, when I connect 3.3V GND to A0, I get around 996. When I connected to 5V I get 1024. I then put a potentiometer between 5V and A0 and changed the voltage until I found the approximate voltage at which the analog reading changes from 1023 to 1024 and I found it to be ~ 3.5V. It seems that the analog pin range is between 0-3.5V rather than 0-1V. So, what's going on and how do I change it?

P.S. My exact purchase is this: https://www.aliexpress.com/item/5pcs-Wi ... 0.0.WA7IpN

Thanks in advance for any help!

Re: Analog pin on node mcu 1.0 (esp 12F) in range 0-3.5V??

PostPosted: Sat Jun 24, 2017 3:05 pm
by schufti
you mix up definitions of ESP-12 and nodemcu.
If you look closely at the board, you'll see that there are lots of components not necessarily needed for basic purpose of combining USB/serial and ESP-12. If you look at the schematic of nodemcu you will find a voltage divider connected to A0 of esp-12. Usually it's configured for 3.3V (seldom 5V, depends on the version of clone).

Re: Analog pin on node mcu 1.0 (esp 12F) in range 0-3.5V??

PostPosted: Sat Jun 24, 2017 10:17 pm
by trackerj
I would suggest you to read the 2 Articles below: