D1 Mini analog input voltage
Posted: Mon Mar 28, 2022 5:31 pm
The ESP8266 has an analog input pin, but it operates in the voltage range 0V-1V, not 0V-3.3V, and clearly not 0V-5V. The D1 Mini is a wrapper around the ESP-12E/F (although later versions of the D1 Mini completely deconstructed the ESP8266 and spread its individual components out on the D1 Mini's board directly). There appears to be a fairly good consensus that the D1 Mini incorporates the necessary 3.3V->1V voltage divider to enable the ESP8266 to receive 3.3V-range analog sensor inputs.
I was testing the corresponding voltages and found that when I put 1V into the D1 Mini's analog pin, I measure .30V on the corresponding ESP-12F's analog pin, and when I put 3.3V into the D1's analog pin I measure .46V at the ESP-12's analog pin. Obviously, I don't want to test putting 5V into the D1's analog pin, but I'm surprised that providing its apparent max (3.3V) produces less than half of the anticipated voltage range at the ESP (.46V instead of 1V).
The docs (https://www.wemos.cc/en/latest/d1/d1_mini.html) clearly indicate that the D1's pin ought to be operating in the 3.3V range (in fact, somewhat concerningly, that document says the max is 3.2V; does that imply that 3.3V would damage either the D1 o the ESP-12?), so why don't I get 1V at the ESP in these experiments?
I'll admit, the ADC appears to be pre-calibrated to this .46V range. When I read the digital value from the A0 pin, I get 349 for 1V and 1024 for 3.3V (curiously, getting 1024 suggests that the minimum value must be 1, not 0). So, on one hand, it could be argued that I'm still getting the full 10-bit range available from the sensor. But I'm curious if its more like getting 9-bits (since the voltage maxes out at about half its purported range, .46V, in fact .04V less than half). It might be internally calibrated to stretch the real .46V range up to 1024 digital values just before or after the ADC, but that still implies that in terms of analog sensitivity relative to some presumed noise floor, I'm only reading .46V of signal spread, not 1V. Merely doubling the value to get .46 up to 1V doesn't give me 1V of true sensor sensitivity since it multiplies the noise along with the signal.
So, what do you think? Does the D1 Mini really only provide .46V of analog sensor range, not 1V, even if that range is internally spread out to make use of the 10-bit ADC? Or alternatively, is it actually making use of the full 1V range despite my readings of .46V and I'm just misunderstanding how to interpret reading .46V on the ESP's pin?
Thoughts?
I was testing the corresponding voltages and found that when I put 1V into the D1 Mini's analog pin, I measure .30V on the corresponding ESP-12F's analog pin, and when I put 3.3V into the D1's analog pin I measure .46V at the ESP-12's analog pin. Obviously, I don't want to test putting 5V into the D1's analog pin, but I'm surprised that providing its apparent max (3.3V) produces less than half of the anticipated voltage range at the ESP (.46V instead of 1V).
The docs (https://www.wemos.cc/en/latest/d1/d1_mini.html) clearly indicate that the D1's pin ought to be operating in the 3.3V range (in fact, somewhat concerningly, that document says the max is 3.2V; does that imply that 3.3V would damage either the D1 o the ESP-12?), so why don't I get 1V at the ESP in these experiments?
I'll admit, the ADC appears to be pre-calibrated to this .46V range. When I read the digital value from the A0 pin, I get 349 for 1V and 1024 for 3.3V (curiously, getting 1024 suggests that the minimum value must be 1, not 0). So, on one hand, it could be argued that I'm still getting the full 10-bit range available from the sensor. But I'm curious if its more like getting 9-bits (since the voltage maxes out at about half its purported range, .46V, in fact .04V less than half). It might be internally calibrated to stretch the real .46V range up to 1024 digital values just before or after the ADC, but that still implies that in terms of analog sensitivity relative to some presumed noise floor, I'm only reading .46V of signal spread, not 1V. Merely doubling the value to get .46 up to 1V doesn't give me 1V of true sensor sensitivity since it multiplies the noise along with the signal.
So, what do you think? Does the D1 Mini really only provide .46V of analog sensor range, not 1V, even if that range is internally spread out to make use of the 10-bit ADC? Or alternatively, is it actually making use of the full 1V range despite my readings of .46V and I'm just misunderstanding how to interpret reading .46V on the ESP's pin?
Thoughts?