XIAO ESP32S3 Plus: ADC_BAT on GPIO10?

I’ve got 20 of the new XIAO ESP32S3 Plus boards, and I’m trying to learn about the ADC_BAT label connected to GPIO10 on the board schematic. I was hopeful that this would allow battery voltage measurements, but I’m not seeing any connection to the battery circuit, or a voltage divider.

Am I missing anything here? I’m curious about the nature of this label in the schematic.

Thanks all!

Hi there,

So this is a Great question!

On the XIAO ESP32S3 Plus, the label ADC_BAT typically refers to the battery voltage sense line, and on this board it’s connected to GPIO10, which is an analog-capable pin.

:battery: What is ADC_BAT?

  • ADC_BAT is used to measure the voltage level of the battery.
  • It connects to an analog input (GPIO10) that lets the ESP32S3 read the battery voltage via its internal ADC (Analog to Digital Converter).
  • Often, there’s a resistor voltage divider between the battery and this pin to ensure the voltage stays within safe ADC levels (typically under 3.3V).

:white_check_mark: Why is this useful?

  • It allows your code to monitor battery level.
  • You can shut down peripherals or enter deep sleep when the battery gets low.
  • You can display battery % on-screen or transmit it wirelessly.

:clipboard: Example: Read battery voltage from ADC_BAT

Here’s a simple Arduino sketch to read the voltage on GPIO10 (ADC_BAT):

const int BAT_ADC_PIN = 10;  // GPIO10 = ADC_BAT
const float ADC_REF_VOLTAGE = 3.3;  // Reference voltage
const int ADC_RESOLUTION = 4095;    // 12-bit ADC
const float VOLTAGE_DIVIDER_RATIO = 2.0;  // e.g., 100K/100K divider

void setup() {
  Serial.begin(115200);
  analogReadResolution(12);
}

void loop() {
  int adcValue = analogRead(BAT_ADC_PIN);
  float voltage = (adcValue / float(ADC_RESOLUTION)) * ADC_REF_VOLTAGE * VOLTAGE_DIVIDER_RATIO;

  Serial.print("Battery Voltage: ");
  Serial.print(voltage);
  Serial.println(" V");

  delay(1000);
}

:warning: Check the schematic for your exact resistor divider ratio if you’re unsure — some boards use 100K/100K, others may differ.

I don’t see any info on the WiKi maybe they will add some?

HTH
GL :slight_smile: PJ :v:

I don’t see mention of it in the Tech refrence guide , So i’m Sus. :crossed_fingers:

Thanks PJ! This is what I had expected (and hoped for), but I don’t see any evidence that this pin is actually connected to the battery circuit or a voltage divider for measurement. Maybe something is hiding that I don’t see, but it appears to be a false advertisement in the schematic—maybe something planned initially but was never implemented?

I’m curious if there’s a way to consult the engineers or devs that designed the Plus model of the XAIO ESP32S3. Do those folks frequent these discussions?

Thanks everyone!

Hi there,

Sure thing, We all want to know. So I have a couple in route so I’ll be able to put hands on and test. I couldn’t find anything even in the technical reference guide. Unlike them to :lying_face: to stretch that far i’m thinking…

Stay tuned
HTH
GL :slight_smile: PJ :v:

Thanks!

It seems more likely that the ADC_BAT label is a mistake in the schematic (or the label is correct but further details are missing in the schematic, which seems less likely).

DJ

Hi there,

Well, if you have been around Seeed Studio devices, you know.
It’s a 50/50 proposition. Odd it’s in a few Places so , the pins spreadsheet for example? Let’s see if more info comes.

GL :slight_smile: PJ :v:

Fair enough. Yeah, I did notice the label in the pinout spreadsheet. In some instances, I know there is a requirement to write a certain pin high to enable an ADC, which may be the case here. There’s also this in the wiki for the non-Plus XIAO ESP32S3, which suggests this may have been a planned improvement for the Plus board:

Hi there,
Agree it would be a smart move , or some would say " a BOLD choice" :grin:
:v:

Quick update: since the voltage divider circuit is not present on the board, I tested a quick battery measurement using GPIO10 and my own voltage divider with 2x220K resistors, and it works great that way.

1 Like