How to use the built in 1V1 reference?

Emygma
Posts: 4
Joined: Thu Apr 18, 2019 12:30 pm

How to use the built in 1V1 reference?

Postby Emygma » Thu Apr 18, 2019 12:40 pm

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

ESP_Sprite
Posts: 8999
Joined: Thu Nov 26, 2015 4:08 am

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

Postby ESP_Sprite » Fri Apr 19, 2019 2:41 am

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.

Who is online

Users browsing this forum: No registered users and 43 guests