-->
Page 1 of 1

Analog read - NodeMCU vs ESP-12E

PostPosted: Mon Aug 29, 2016 1:21 am
by rherrmann
Hello together,

I'm using a NoceMCU and want to read a sensor via analog pin (ADC). Since my sensor runs on 5V I knew I had to lower the voltage. While me research I read that the ESP-12E ADC runs at 1.0V. But when settings 1V to the NodeMCU I only get values of ~335. So it seems the NodeMCU needs 3.3V.

So is the 1V info obsolete/wrong or does the NodeMCU bring a voltage divider with it?

Re: Analog read - NodeMCU vs ESP-12E

PostPosted: Mon Aug 29, 2016 4:34 am
by schufti
the esp8266 adc in general has 1V range.
The NodeMCU boards have a voltage divider 220k/100k as can be seen on their schematics.

Re: Analog read - NodeMCU vs ESP-12E

PostPosted: Mon Aug 29, 2016 5:49 am
by rherrmann
Hey schufti,

thanks for your help. Nevertheless that makes me said. I thought I could use NodeMCU as dev board and if I'm fine with hardware, I could flash the code to a bare ESP-12E and solder it direct to the circuit (to save space) without any changes in the circuit. So I have to take care of the ADC if using a bare ESP-12E.

Are the more things which I have to add to the circuit, when going from NodeMCU to bare ESP? (Besides the power source, which I already have on my list.)

Re: Analog read - NodeMCU vs ESP-12E

PostPosted: Sun Jan 01, 2017 9:46 am
by Mattias
I am doing some tests on the A0 pin to determine the voltage needed for range 0-1023 and I am experiencing some strange differences.

Doing this in Arduino IDE and not LUA.

When I try the range with a 1k potentiometer connected to 3,3V output pin on the NodeMCU I get the proper range between 0-3,3V and a serial printout of the values on A0 give me steps 0-1023

When I do the the same test with a soil moisture sensor from Arduino and measure the output before I connect it to the A0 it gives me the voltage of 0-3,3V (dry -> wet).
As soon as I connect the output to the A0 the voltage drops to ca 1V ie the voltage divider kicks in and the serial printout gives me values from 12-360.

What I am having a hard time understanding is why the potentiometer gives me the correct range?

In theory, I dont have a problem with working in the range 0-1V but since the range doesnt include all 1024 steps it becomes a headache to manually translate the range. Is there a way to adjust the A0 so 0-1V = 0-1023?

Cheers! (and a happy new year!)