Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By rherrmann
#54037 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?
User avatar
By rherrmann
#54051 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.)
User avatar
By Mattias
#60232 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!)