Page 1 of 1

How to use the built in 1V1 reference?

Posted: Thu Apr 18, 2019 12:40 pm
by Emygma
Hello,

I would like to take a voltage reading with one of the ADC pins via analogRead.
By default ESP32 uses whatever its current + rail voltage is as a reference,if I am not mistaken.
However, I need to use the built in 1V1 reference instead.

On arduino, this is very easy, I simply do this:

analogReference(INTERNAL);

And thats it. All analogReads now use the built in 1V1 as reference.
This code however, will not compile on the ESP32. So how do I set the ADC on the esp32 to use the built in 1V1 reference instead?

thank you

Re: How to use the built in 1V1 reference?

Posted: Fri Apr 19, 2019 2:41 am
by ESP_Sprite
You indeed are mistaken; it's the other way around. The ESP32 always uses the 1.1V reference, but you can switch in some attenuators to enlarge the available range.