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

User avatar
By John Heath
#36027
pvvx wrote:
hreintke wrote:ADC uses 14 bits. The maximum sampling frequency 45..50us (20..22kHz).


Hi pvvx,

Are you using an external ADC or one on the ESP8266?

Thank you, J.
User avatar
By DaniloFix
#40978 Hi guys

Are you sure about the 1V range of the ESP8266? I have a NodeMCU with a SHARP IR sensor connected. The IR sensor has a range from about 0V - 3.2V - In my test using this simple code:

Code: Select allint           sensor = A0;
int           sensor_value = 0;


in my loop:

Code: Select allsensor_value = analogRead(sensor);
Serial.println(sensor_value);
delay(1000);


What I found was, that I hit around the 1024 mark, when I was close to 3.2V. If 1023 should be equal to around 1.0V then I should expect to hit that mark when the sensor outputs that voltage, but that's not the case. This leads me to believe, that at least some versions of ESP8266 uses a ADC of 0 - 3.3V.

What do you think?
User avatar
By martinayotte
#40981 ESP8266 itself is really 0-1V for 0-1023 data.
For example, on Wemos D1 Mini, there is already a voltage divider, so it is already handling 0-3V and lower it to 0-1V accordingly, so maybe NodeMCU is actually doing the same.
User avatar
By bgowland
#40990
martinayotte wrote:ESP8266 itself is really 0-1V for 0-1023 data.
For example, on Wemos D1 Mini, there is already a voltage divider, so it is already handling 0-3V and lower it to 0-1V accordingly, so maybe NodeMCU is actually doing the same.
I have a Gizwits ESF12 module re-flashed with NodeMCU.

Tests with the ADC and the on-board LDR show readings over 4000 (decimal) with a very bright light shining on the LDR. That indicates 14-bit as mentioned by others.

I haven't experimented with metered voltages directly on the ADC pin yet (a job for tomorrow).