- Sun Jan 01, 2017 9:46 am
#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!)