Post links and attach files for documentation here, also chat about these docs freely

User avatar
By trackerj
#31572 As maximum voltage input is expected to be 1V only and because your desired input Voltage is 5V it's obviously that we need to find a way to "translate" the voltage domain between 0-5V to 0-1V.

They are many different techniques available for doing that but the easiest one to useis the Resistive Voltage Divider (RVD). Very crude but effective, with the right quality and precision resistors.

A RVD (also known as a potential divider) is a passive linear circuit that produces an output voltage (Vout) that is a fraction of its input voltage (Vin). Voltage division is the result of distributing the input voltage among the components of the divider.

Image

Let's find out what resistor values we will need for our RVD:

Vinmax = 5V
Voutmax = VADCin_max = 1V
Vout=Vin*R2/(R1+R2)

From the resistor ratio calculation values are: R1=40K and R2=10k. You can choose also other values as long as you keep accurate the ratio between, better go upper that that. 400k and 100k should give the same result for example but be careful with the input impedance! As a general practice a Op Amp Buffer will be a good add-on.

Related article : ESP8266 Internal ADC Explained

And an example of a buffered input ADC input Voltage Level Shifter and amplifier module
User avatar
By eriksl
#31578 A voltage divider as you describe, is actually a good choice in this case. The input impedance of the "TOUT" pin is quite large (somewhere between 100 kOhms and 10 MOhms), this means the load on the voltage divider is very light, so the resistors can be chosen quite large and so dissipation is minimal.
User avatar
By MikeWS
#34466 I connected a 10k pot to 3.3V and cranked both ways - no damage.
It would seem the Vref for the ADC is actually around 1V but I'm not sure of the precise number - I'm getting about 30% swing on my pot wiper before it starts clipping at 1023.
User avatar
By eriksl
#34544
MikeWS wrote:I connected a 10k pot to 3.3V and cranked both ways - no damage.
It would seem the Vref for the ADC is actually around 1V but I'm not sure of the precise number - I'm getting about 30% swing on my pot wiper before it starts clipping at 1023.


It's probably not exactly 1V, more like 0.98 V or 1.1 V, the band gap for the reference.